pkg_fwd fixed again, i send now only needed packets and filter server only packets out. So the joingame is no send to everyone.

origin
stpohle 22 years ago
parent f726b7033f
commit 4cb6c047a9

@ -1,4 +1,4 @@
$Id: ChangeLog,v 1.64 2004/02/01 23:51:10 stpohle Exp $ $Id: ChangeLog,v 1.65 2004/02/02 00:01:42 stpohle Exp $
- Fixed: forgot to put the Message F4 to start the game - Fixed: forgot to put the Message F4 to start the game
into the playerselection screen. I put this only into the into the playerselection screen. I put this only into the
@ -7,6 +7,10 @@ $Id: ChangeLog,v 1.64 2004/02/01 23:51:10 stpohle Exp $
- Fixed: DropItems haven't been resetted on dropping items. - Fixed: DropItems haven't been resetted on dropping items.
- fixed: Firewall Flag wasn't set right on all clients for the
players. The same with the pkg_fwd routine i not only needed
packets to the other clients. I send even some Serveronly
packets.
Version 0.11.1 Version 0.11.1

@ -4,27 +4,27 @@
enum _network_data { enum _network_data {
PKG_error = 0, PKG_error = 0,
PKG_pingreq, PKG_joingame,
PKG_pingack,
PKG_playerid, PKG_playerid,
PKG_servermode, PKG_servermode,
PKG_joingame, PKG_pingreq,
PKG_field, PKG_pingack,
PKG_playerdata,
PKG_bombdata,
PKG_getfield, PKG_getfield,
PKG_getplayerdata, PKG_getplayerdata,
PKG_fieldline, PKG_fieldline,
PKG_playerstatus,
PKG_pkgack, PKG_pkgack,
PKG_playermove,
PKG_chat,
PKG_ill,
PKG_special,
PKG_mapinfo, PKG_mapinfo,
PKG_tunneldata, PKG_tunneldata,
PKG_dropitem, PKG_field, // forward - always be the first field
PKG_respawn, PKG_playerdata, // forward
PKG_bombdata, // forward
PKG_playerstatus, // forward
PKG_playermove, // forward
PKG_chat, // forward
PKG_ill, // forward
PKG_special, // forward
PKG_dropitem, // forward
PKG_respawn, // forward
PKG_quit // always the last known type PKG_quit // always the last known type
}; };

@ -1444,7 +1444,7 @@ fwd_pkg (struct pkg *packet, _net_addr * addr)
if (GT_MP_PTPS) /* clients don't forward anything */ if (GT_MP_PTPS) /* clients don't forward anything */
return; return;
if (packet->h.typ <= PKG_quit) { if (packet->h.typ >= PKG_field && packet->h.typ < PKG_quit) {
for (pl = 0; pl < MAX_PLAYERS; pl++) for (pl = 0; pl < MAX_PLAYERS; pl++)
if ((!PS_IS_aiplayer (players[pl].state)) && PS_IS_netplayer (players[pl].state) if ((!PS_IS_aiplayer (players[pl].state)) && PS_IS_netplayer (players[pl].state)
&& ((players[addr->pl_nr].net.flags & NETF_firewall) == NETF_firewall && ((players[addr->pl_nr].net.flags & NETF_firewall) == NETF_firewall
@ -1452,7 +1452,7 @@ fwd_pkg (struct pkg *packet, _net_addr * addr)
&& pl != addr->pl_nr) && pl != addr->pl_nr)
send_pkg (packet, &players[pl].net.addr); send_pkg (packet, &players[pl].net.addr);
} }
else else if (packet->h.typ > PKG_quit)
d_fatal ("fwd_pkg: not forwarding unknown packet From Player:%d (%s) Typ:%d Len:%d\n", d_fatal ("fwd_pkg: not forwarding unknown packet From Player:%d (%s) Typ:%d Len:%d\n",
addr->pl_nr, players[addr->pl_nr].name, packet->h.typ, NTOH16 (packet->h.len)); addr->pl_nr, players[addr->pl_nr].name, packet->h.typ, NTOH16 (packet->h.len));
}; };

Loading…
Cancel
Save