From 5d5d66e3cc47274f33e5814d5a91fb639d1ba759 Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Mon, 3 Nov 2008 00:27:51 +0000 Subject: [PATCH] don't broadcast packets to unauthed clients git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@3385 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/server.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/src/server.cpp b/source/src/server.cpp index 120487ac..f9099efc 100644 --- a/source/src/server.cpp +++ b/source/src/server.cpp @@ -312,7 +312,7 @@ void sendpacket(int n, int chan, ENetPacket *packet, int exclude = -1) if(n<0) { recordpacket(chan, packet->data, (int)packet->dataLength); - loopv(clients) if(i!=exclude) sendpacket(i, chan, packet); + loopv(clients) if(i!=exclude && (clients[n]->type!=ST_TCPIP || clients[n]->isauthed)) sendpacket(i, chan, packet); return; } switch(clients[n]->type) @@ -339,7 +339,7 @@ bool buildworldstate() loopv(clients) { client &c = *clients[i]; - if(c.type!=ST_TCPIP) continue; + if(c.type!=ST_TCPIP || !c.isauthed) continue; if(c.position.empty()) pkt[i].posoff = -1; else { @@ -368,7 +368,7 @@ bool buildworldstate() loopv(clients) { client &c = *clients[i]; - if(c.type!=ST_TCPIP) continue; + if(c.type!=ST_TCPIP || !c.isauthed) continue; ENetPacket *packet; if(psize && (pkt[i].posoff<0 || psize-c.position.length()>0)) {