[Opentnl-cvs] tnl/test testGame.cpp,1.6,1.7 testGame.h,1.3,1.4
Brought to you by:
mark_frohnmayer,
s_alanet
From: Mark F. <mar...@us...> - 2004-08-19 20:25:03
|
Update of /cvsroot/opentnl/tnl/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15513/test Modified Files: testGame.cpp testGame.h Log Message: Fixed TNL netConnection ping/encryption issues Index: testGame.h =================================================================== RCS file: /cvsroot/opentnl/tnl/test/testGame.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** testGame.h 16 May 2004 02:29:40 -0000 1.3 --- testGame.h 19 Aug 2004 20:24:51 -0000 1.4 *************** *** 248,251 **** --- 248,256 ---- void onConnectionEstablished(); + /// isDataToTransmit is called each time the connection is ready to send a packet. If + /// the NetConnection subclass has data to send it should return true. In the case of a simulation, + /// this should always return true. + bool isDataToTransmit(); + /// Remote function that client calls to set the position of the player on the server. TNL_DECLARE_RPC(rpcSetPlayerPos, (F32 x, F32 y)); Index: testGame.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/test/testGame.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** testGame.cpp 2 Jun 2004 21:01:57 -0000 1.6 --- testGame.cpp 19 Aug 2004 20:24:51 -0000 1.7 *************** *** 102,108 **** { // find all the objects that are "in scope" - for the purposes ! // of this test program, that is all objects in a circle of radius // 0.25 around the scope object, or a radius squared of 0.0625 for(S32 i = 0; i < game->players.size(); i++) { --- 102,112 ---- { // find all the objects that are "in scope" - for the purposes ! // of this test program, all buildings are considered to be in ! // scope always, as well as all "players" in a circle of radius // 0.25 around the scope object, or a radius squared of 0.0625 + for(S32 i = 0; i < game->buildings.size(); i++) + connection->objectInScope(game->buildings[i]); + for(S32 i = 0; i < game->players.size(); i++) { *************** *** 389,392 **** --- 393,402 ---- } + bool TestConnection::isDataToTransmit() + { + // we always want packets to be sent. + return true; + } + void TestConnection::onConnectTerminated(NetConnection::TerminationReason reason, const char *string) { *************** *** 408,412 **** // call the parent's onConnectionEstablished. // by default this will set the initiator to be a connection ! // to "server" and the non-initiator to be a connnection to "client" Parent::onConnectionEstablished(); --- 418,422 ---- // call the parent's onConnectionEstablished. // by default this will set the initiator to be a connection ! // to "server" and the non-initiator to be a connection to "client" Parent::onConnectionEstablished(); |