[Opentnl-cvs] tnl/master main.cpp,1.6,1.7 masterInterface.cpp,1.3,1.4 masterInterface.h,1.3,1.4 mast
Brought to you by:
mark_frohnmayer,
s_alanet
From: Mark F. <mar...@us...> - 2005-02-21 07:48:22
|
Update of /cvsroot/opentnl/tnl/master In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24496/master Modified Files: main.cpp masterInterface.cpp masterInterface.h Removed Files: master.dsp Log Message: Added template-based RPC marshalling Updated master, masterclient and test projects to use new RPC format Removed VC6 projects due to template incompatibility Index: masterInterface.h =================================================================== RCS file: /cvsroot/opentnl/tnl/master/masterInterface.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** masterInterface.h 3 Jul 2004 20:01:46 -0000 1.3 --- masterInterface.h 21 Feb 2005 07:48:12 -0000 1.4 *************** *** 77,81 **** /// m2cQueryGameTypesResponse with Vectors of size 0 to indicate that no more game or mission /// types are to be added. ! TNL_DECLARE_RPC(m2cQueryGameTypesResponse, (U32 queryId, const Vector<StringTableEntry> &gameTypes, const Vector<StringTableEntry> &missionTypes)); /// c2mQueryServers is sent by the client to the master server to request a list of --- 77,81 ---- /// m2cQueryGameTypesResponse with Vectors of size 0 to indicate that no more game or mission /// types are to be added. ! TNL_DECLARE_RPC(m2cQueryGameTypesResponse, (U32 queryId, Vector<StringTableEntry> gameTypes, Vector<StringTableEntry> missionTypes)); /// c2mQueryServers is sent by the client to the master server to request a list of *************** *** 85,89 **** TNL_DECLARE_RPC(c2mQueryServers, (U32 queryId, U32 regionMask, U32 minPlayers, U32 maxPlayers, U32 infoFlags, ! U32 maxBots, U32 minCPUSpeed, StringTableEntryRef gameType, StringTableEntryRef missionType)); /// m2cQueryServersResponse is sent by the master server in response to a c2mQueryServers RPC, to --- 85,89 ---- TNL_DECLARE_RPC(c2mQueryServers, (U32 queryId, U32 regionMask, U32 minPlayers, U32 maxPlayers, U32 infoFlags, ! U32 maxBots, U32 minCPUSpeed, StringTableEntry gameType, StringTableEntry missionType)); /// m2cQueryServersResponse is sent by the master server in response to a c2mQueryServers RPC, to *************** *** 92,96 **** /// per message. The Master Server will always send a final, empty m2cQueryServersResponse to signify that the list /// is complete. ! TNL_DECLARE_RPC(m2cQueryServersResponse, (U32 queryId, const Vector<IPAddress> &ipList)); /// c2mRequestArrangedConnection is an RPC sent from the client to the master to request an arranged --- 92,96 ---- /// per message. The Master Server will always send a final, empty m2cQueryServersResponse to signify that the list /// is complete. ! TNL_DECLARE_RPC(m2cQueryServersResponse, (U32 queryId, Vector<IPAddress> ipList)); /// c2mRequestArrangedConnection is an RPC sent from the client to the master to request an arranged *************** *** 99,119 **** /// server. TNL_DECLARE_RPC(c2mRequestArrangedConnection, (U32 requestId, ! IPAddressRef remoteAddress, IPAddressRef internalAddress, ! ByteBufferRef connectionParameters)); /// m2cClientRequestedArranged connection is sent from the master to a server to notify it that /// a client has requested a connection. The possibleAddresses vector is a list of possible IP addresses /// that the server should attempt to connect to for that client if it accepts the connection request. ! TNL_DECLARE_RPC(m2cClientRequestedArrangedConnection, (U32 requestId, const Vector<IPAddress> &possibleAddresses, ! ByteBufferRef connectionParameters)); /// c2mAcceptArrangedConnection is sent by a server to notify the master that it will accept the connection /// request from a client. The requestId parameter sent by the MasterServer in m2cClientRequestedArrangedConnection /// should be sent back as the requestId field. The internalAddress is the server's self-determined IP address. ! TNL_DECLARE_RPC(c2mAcceptArrangedConnection, (U32 requestId, IPAddressRef internalAddress, ByteBufferRef connectionData)); /// c2mRejectArrangedConnection notifies the Master Server that the server is rejecting the arranged connection /// request specified by the requestId. The rejectData will be passed along to the requesting client. ! TNL_DECLARE_RPC(c2mRejectArrangedConnection, (U32 requestId, ByteBufferRef rejectData)); /// m2cArrangedConnectionAccepted is sent to a client that has previously requested a connection to a listed server --- 99,119 ---- /// server. TNL_DECLARE_RPC(c2mRequestArrangedConnection, (U32 requestId, ! IPAddress remoteAddress, IPAddress internalAddress, ! ByteBufferPtr connectionParameters)); /// m2cClientRequestedArranged connection is sent from the master to a server to notify it that /// a client has requested a connection. The possibleAddresses vector is a list of possible IP addresses /// that the server should attempt to connect to for that client if it accepts the connection request. ! TNL_DECLARE_RPC(m2cClientRequestedArrangedConnection, (U32 requestId, Vector<IPAddress> possibleAddresses, ! ByteBufferPtr connectionParameters)); /// c2mAcceptArrangedConnection is sent by a server to notify the master that it will accept the connection /// request from a client. The requestId parameter sent by the MasterServer in m2cClientRequestedArrangedConnection /// should be sent back as the requestId field. The internalAddress is the server's self-determined IP address. ! TNL_DECLARE_RPC(c2mAcceptArrangedConnection, (U32 requestId, IPAddress internalAddress, ByteBufferPtr connectionData)); /// c2mRejectArrangedConnection notifies the Master Server that the server is rejecting the arranged connection /// request specified by the requestId. The rejectData will be passed along to the requesting client. ! TNL_DECLARE_RPC(c2mRejectArrangedConnection, (U32 requestId, ByteBufferPtr rejectData)); /// m2cArrangedConnectionAccepted is sent to a client that has previously requested a connection to a listed server *************** *** 121,134 **** /// of IP addresses the client should attempt to connect to, and the connectionData buffer is the buffer sent by the /// server upon accepting the connection. ! TNL_DECLARE_RPC(m2cArrangedConnectionAccepted, (U32 requestId, const Vector<IPAddress> &possibleAddresses, ByteBufferRef connectionData)); /// m2cArrangedConnectionRejected is sent to a client when an arranged connection request is rejected by the /// server, or when the request times out because the server never responded. ! TNL_DECLARE_RPC(m2cArrangedConnectionRejected, (U32 requestId, ByteBufferRef rejectData)); /// c2mUpdateServerStatus updates the status of a server to the Master Server, specifying the current game /// and mission types, any player counts and the current info flags. TNL_DECLARE_RPC(c2mUpdateServerStatus, ( ! StringTableEntryRef gameType, StringTableEntryRef missionType, U32 botCount, U32 playerCount, U32 maxPlayers, U32 infoFlags)); --- 121,134 ---- /// of IP addresses the client should attempt to connect to, and the connectionData buffer is the buffer sent by the /// server upon accepting the connection. ! TNL_DECLARE_RPC(m2cArrangedConnectionAccepted, (U32 requestId, Vector<IPAddress> possibleAddresses, ByteBufferPtr connectionData)); /// m2cArrangedConnectionRejected is sent to a client when an arranged connection request is rejected by the /// server, or when the request times out because the server never responded. ! TNL_DECLARE_RPC(m2cArrangedConnectionRejected, (U32 requestId, ByteBufferPtr rejectData)); /// c2mUpdateServerStatus updates the status of a server to the Master Server, specifying the current game /// and mission types, any player counts and the current info flags. TNL_DECLARE_RPC(c2mUpdateServerStatus, ( ! StringTableEntry gameType, StringTableEntry missionType, U32 botCount, U32 playerCount, U32 maxPlayers, U32 infoFlags)); *************** *** 137,141 **** /// m2cSetMOTD is sent to a client when the connection is established. The /// client's game string is used to pick which MOTD will be sent. ! TNL_DECLARE_RPC(m2cSetMOTD, (const char *motdString)); }; --- 137,141 ---- /// m2cSetMOTD is sent to a client when the connection is established. The /// client's game string is used to pick which MOTD will be sent. ! TNL_DECLARE_RPC(m2cSetMOTD, (StringPtr motdString)); }; Index: masterInterface.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/master/masterInterface.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** masterInterface.cpp 3 Jul 2004 20:01:46 -0000 1.3 --- masterInterface.cpp 21 Feb 2005 07:48:12 -0000 1.4 *************** *** 30,76 **** // Since this is an interface, we implement a bunch of stubs. ! TNL_IMPLEMENT_RPC(MasterServerInterface, c2mQueryGameTypes, (U32 queryId), NetClassGroupMasterMask, RPCGuaranteedOrdered, RPCDirClientToServer, 0) {} ! TNL_IMPLEMENT_RPC(MasterServerInterface, m2cQueryGameTypesResponse, (U32 queryId, const Vector<StringTableEntry> &gameTypes, const Vector<StringTableEntry> &missionTypes), NetClassGroupMasterMask, RPCGuaranteedOrdered, RPCDirServerToClient, 0) {} ! TNL_IMPLEMENT_RPC(MasterServerInterface, c2mQueryServers, (U32 queryId, U32 regionMask, ! U32 minPlayers, U32 maxPlayers, U32 infoFlags, ! U32 maxBots, U32 minCPUSpeed, StringTableEntryRef gameType, StringTableEntryRef missionType), NetClassGroupMasterMask, RPCGuaranteedOrdered, RPCDirClientToServer, 0) {} ! TNL_IMPLEMENT_RPC(MasterServerInterface, m2cQueryServersResponse, (U32 queryId, ! const Vector<IPAddress> &ipList), NetClassGroupMasterMask, RPCGuaranteedOrdered, RPCDirServerToClient, 0) {} TNL_IMPLEMENT_RPC(MasterServerInterface, c2mRequestArrangedConnection, (U32 requestId, ! IPAddressRef remoteAddress, IPAddressRef internalAddress, ! ByteBufferRef connectionParameters), NetClassGroupMasterMask, RPCGuaranteedOrdered, RPCDirClientToServer, 0) {} ! TNL_IMPLEMENT_RPC(MasterServerInterface, m2cClientRequestedArrangedConnection, (U32 requestId, const Vector<IPAddress> &possibleAddresses, ! ByteBufferRef connectionParameters), NetClassGroupMasterMask, RPCGuaranteedOrdered, RPCDirServerToClient, 0) {} ! TNL_IMPLEMENT_RPC(MasterServerInterface, c2mAcceptArrangedConnection, (U32 requestId, IPAddressRef internalAddress, ByteBufferRef connectionData), NetClassGroupMasterMask, RPCGuaranteedOrdered, RPCDirClientToServer, 0) {} ! TNL_IMPLEMENT_RPC(MasterServerInterface, c2mRejectArrangedConnection, (U32 requestId, ByteBufferRef rejectData), NetClassGroupMasterMask, RPCGuaranteedOrdered, RPCDirClientToServer, 0) {} ! TNL_IMPLEMENT_RPC(MasterServerInterface, m2cArrangedConnectionAccepted, (U32 requestId, const Vector<IPAddress> &possibleAddresses, ByteBufferRef connectionData), NetClassGroupMasterMask, RPCGuaranteedOrdered, RPCDirServerToClient, 0) {} ! TNL_IMPLEMENT_RPC(MasterServerInterface, m2cArrangedConnectionRejected, (U32 requestId, ByteBufferRef rejectData), NetClassGroupMasterMask, RPCGuaranteedOrdered, RPCDirServerToClient, 0) {} TNL_IMPLEMENT_RPC(MasterServerInterface, c2mUpdateServerStatus, ( ! StringTableEntryRef gameType, StringTableEntryRef missionType, U32 botCount, U32 playerCount, U32 maxPlayers, U32 infoFlags), NetClassGroupMasterMask, RPCGuaranteedOrdered, RPCDirClientToServer, 0) {} ! // version 1 protocol messages ! ! TNL_IMPLEMENT_RPC(MasterServerInterface, m2cSetMOTD, (const char *motdString), ! NetClassGroupMasterMask, RPCGuaranteedOrdered, RPCDirServerToClient, 1) {} \ No newline at end of file --- 30,86 ---- // Since this is an interface, we implement a bunch of stubs. ! TNL_IMPLEMENT_RPC(MasterServerInterface, c2mQueryGameTypes, (U32 queryId), (queryId), NetClassGroupMasterMask, RPCGuaranteedOrdered, RPCDirClientToServer, 0) {} ! TNL_IMPLEMENT_RPC(MasterServerInterface, m2cQueryGameTypesResponse, ! (U32 queryId, Vector<StringTableEntry> gameTypes, Vector<StringTableEntry> missionTypes), (queryId, gameTypes, missionTypes), NetClassGroupMasterMask, RPCGuaranteedOrdered, RPCDirServerToClient, 0) {} ! TNL_IMPLEMENT_RPC(MasterServerInterface, c2mQueryServers, ! (U32 queryId, U32 regionMask, U32 minPlayers, U32 maxPlayers, U32 infoFlags, ! U32 maxBots, U32 minCPUSpeed, StringTableEntry gameType, StringTableEntry missionType), ! (queryId, regionMask, minPlayers, maxPlayers, infoFlags, maxBots, minCPUSpeed, gameType, missionType), NetClassGroupMasterMask, RPCGuaranteedOrdered, RPCDirClientToServer, 0) {} ! TNL_IMPLEMENT_RPC(MasterServerInterface, m2cQueryServersResponse, ! (U32 queryId, Vector<IPAddress> ipList), (queryId, ipList), NetClassGroupMasterMask, RPCGuaranteedOrdered, RPCDirServerToClient, 0) {} TNL_IMPLEMENT_RPC(MasterServerInterface, c2mRequestArrangedConnection, (U32 requestId, ! IPAddress remoteAddress, IPAddress internalAddress, ByteBufferPtr connectionParameters), ! (requestId, remoteAddress, internalAddress, connectionParameters), NetClassGroupMasterMask, RPCGuaranteedOrdered, RPCDirClientToServer, 0) {} ! TNL_IMPLEMENT_RPC(MasterServerInterface, m2cClientRequestedArrangedConnection, ! (U32 requestId, Vector<IPAddress> possibleAddresses, ByteBufferPtr connectionParameters), ! (requestId, possibleAddresses, connectionParameters), NetClassGroupMasterMask, RPCGuaranteedOrdered, RPCDirServerToClient, 0) {} ! TNL_IMPLEMENT_RPC(MasterServerInterface, c2mAcceptArrangedConnection, ! (U32 requestId, IPAddress internalAddress, ByteBufferPtr connectionData), ! (requestId, internalAddress, connectionData), NetClassGroupMasterMask, RPCGuaranteedOrdered, RPCDirClientToServer, 0) {} ! TNL_IMPLEMENT_RPC(MasterServerInterface, c2mRejectArrangedConnection, ! (U32 requestId, ByteBufferPtr rejectData), ! (requestId, rejectData), NetClassGroupMasterMask, RPCGuaranteedOrdered, RPCDirClientToServer, 0) {} ! TNL_IMPLEMENT_RPC(MasterServerInterface, m2cArrangedConnectionAccepted, ! (U32 requestId, Vector<IPAddress> possibleAddresses, ByteBufferPtr connectionData), ! (requestId, possibleAddresses, connectionData), NetClassGroupMasterMask, RPCGuaranteedOrdered, RPCDirServerToClient, 0) {} ! TNL_IMPLEMENT_RPC(MasterServerInterface, m2cArrangedConnectionRejected, ! (U32 requestId, ByteBufferPtr rejectData), ! (requestId, rejectData), NetClassGroupMasterMask, RPCGuaranteedOrdered, RPCDirServerToClient, 0) {} TNL_IMPLEMENT_RPC(MasterServerInterface, c2mUpdateServerStatus, ( ! StringTableEntry gameType, StringTableEntry missionType, U32 botCount, U32 playerCount, U32 maxPlayers, U32 infoFlags), + (gameType, missionType, botCount, playerCount, maxPlayers, infoFlags), NetClassGroupMasterMask, RPCGuaranteedOrdered, RPCDirClientToServer, 0) {} ! TNL_IMPLEMENT_RPC(MasterServerInterface, m2cSetMOTD, (StringPtr motdString), (motdString), ! NetClassGroupMasterMask, RPCGuaranteedOrdered, RPCDirServerToClient, 0) {} \ No newline at end of file Index: main.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/master/main.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** main.cpp 14 Jul 2004 19:19:33 -0000 1.6 --- main.cpp 21 Feb 2005 07:48:12 -0000 1.7 *************** *** 260,264 **** (U32 queryId, U32 regionMask, U32 minPlayers, U32 maxPlayers, U32 infoFlags, U32 maxBots, U32 minCPUSpeed, ! StringTableEntryRef gameType, StringTableEntryRef missionType) ) { --- 260,264 ---- (U32 queryId, U32 regionMask, U32 minPlayers, U32 maxPlayers, U32 infoFlags, U32 maxBots, U32 minCPUSpeed, ! StringTableEntry gameType, StringTableEntry missionType) ) { *************** *** 367,372 **** // server. TNL_DECLARE_RPC_OVERRIDE(c2mRequestArrangedConnection, (U32 requestId, ! IPAddressRef remoteAddress, IPAddressRef internalAddress, ! ByteBufferRef connectionParameters)) { // First, make sure that we're connected with the server that they're requesting a connection with. --- 367,372 ---- // server. TNL_DECLARE_RPC_OVERRIDE(c2mRequestArrangedConnection, (U32 requestId, ! IPAddress remoteAddress, IPAddress internalAddress, ! ByteBufferPtr connectionParameters)) { // First, make sure that we're connected with the server that they're requesting a connection with. *************** *** 374,378 **** if(!conn) { ! c2mRejectArrangedConnection(requestId, ByteBuffer((U8 *) MasterNoSuchHost, strlen(MasterNoSuchHost) + 1)); return; } --- 374,379 ---- if(!conn) { ! ByteBufferPtr ptr = new ByteBuffer((U8 *) MasterNoSuchHost, strlen(MasterNoSuchHost) + 1); ! c2mRejectArrangedConnection(requestId, ptr); return; } *************** *** 427,431 **** // Called to indicate a connect request is being accepted. ! TNL_DECLARE_RPC_OVERRIDE(c2mAcceptArrangedConnection, (U32 requestId, IPAddressRef internalAddress, ByteBufferRef connectionData)) { GameConnectRequest *req = findAndRemoveRequest(requestId); --- 428,432 ---- // Called to indicate a connect request is being accepted. ! TNL_DECLARE_RPC_OVERRIDE(c2mAcceptArrangedConnection, (U32 requestId, IPAddress internalAddress, ByteBufferPtr connectionData)) { GameConnectRequest *req = findAndRemoveRequest(requestId); *************** *** 460,464 **** // Called to indicate a connect request is being rejected. ! TNL_DECLARE_RPC_OVERRIDE(c2mRejectArrangedConnection, (U32 requestId, ByteBufferRef rejectData)) { GameConnectRequest *req = findAndRemoveRequest(requestId); --- 461,465 ---- // Called to indicate a connect request is being rejected. ! TNL_DECLARE_RPC_OVERRIDE(c2mRejectArrangedConnection, (U32 requestId, ByteBufferPtr rejectData)) { GameConnectRequest *req = findAndRemoveRequest(requestId); *************** *** 478,482 **** // Called to update the status of a game server. TNL_DECLARE_RPC_OVERRIDE(c2mUpdateServerStatus, ( ! StringTableEntryRef gameType, StringTableEntryRef missionType, U32 botCount, U32 playerCount, U32 maxPlayers, U32 infoFlags)) { --- 479,483 ---- // Called to update the status of a game server. TNL_DECLARE_RPC_OVERRIDE(c2mUpdateServerStatus, ( ! StringTableEntry gameType, StringTableEntry missionType, U32 botCount, U32 playerCount, U32 maxPlayers, U32 infoFlags)) { *************** *** 561,565 **** { gcr->initiator->removeConnectRequest(gcr); ! gcr->initiator->c2mRejectArrangedConnection(gcr->initiatorQueryId, ByteBuffer((U8 *) MasterRequestTimedOut, strlen(MasterRequestTimedOut) + 1)); } --- 562,567 ---- { gcr->initiator->removeConnectRequest(gcr); ! ByteBufferPtr reqTimeoutBuffer = new ByteBuffer((U8 *) MasterRequestTimedOut, strlen(MasterRequestTimedOut) + 1); ! gcr->initiator->c2mRejectArrangedConnection(gcr->initiatorQueryId, reqTimeoutBuffer); } --- master.dsp DELETED --- |