From 4cb6c047a93e2d44b240842cae0954dca90a8722 Mon Sep 17 00:00:00 2001 From: stpohle Date: Mon, 2 Feb 2004 00:01:42 +0000 Subject: [PATCH] pkg_fwd fixed again, i send now only needed packets and filter server only packets out. So the joingame is no send to everyone. --- ChangeLog | 6 +++++- include/packets.h | 26 +++++++++++++------------- src/packets.c | 4 ++-- 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9b3953a..8972f5b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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 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: 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 diff --git a/include/packets.h b/include/packets.h index 9378631..fb3f9b9 100644 --- a/include/packets.h +++ b/include/packets.h @@ -4,27 +4,27 @@ enum _network_data { PKG_error = 0, - PKG_pingreq, - PKG_pingack, + PKG_joingame, PKG_playerid, PKG_servermode, - PKG_joingame, - PKG_field, - PKG_playerdata, - PKG_bombdata, + PKG_pingreq, + PKG_pingack, PKG_getfield, PKG_getplayerdata, PKG_fieldline, - PKG_playerstatus, PKG_pkgack, - PKG_playermove, - PKG_chat, - PKG_ill, - PKG_special, PKG_mapinfo, PKG_tunneldata, - PKG_dropitem, - PKG_respawn, + PKG_field, // forward - always be the first field + 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 }; diff --git a/src/packets.c b/src/packets.c index 2c84b80..8b2dacf 100644 --- a/src/packets.c +++ b/src/packets.c @@ -1444,7 +1444,7 @@ fwd_pkg (struct pkg *packet, _net_addr * addr) if (GT_MP_PTPS) /* clients don't forward anything */ 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++) if ((!PS_IS_aiplayer (players[pl].state)) && PS_IS_netplayer (players[pl].state) && ((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) 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", addr->pl_nr, players[addr->pl_nr].name, packet->h.typ, NTOH16 (packet->h.len)); };