Update of /cvsroot/opentnl/tnl/masterclient
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24496/masterclient
Modified Files:
main.cpp
Removed Files:
masterclient.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: main.cpp
===================================================================
RCS file: /cvsroot/opentnl/tnl/masterclient/main.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** main.cpp 20 May 2004 04:30:31 -0000 1.3
--- main.cpp 21 Feb 2005 07:48:13 -0000 1.4
***************
*** 190,194 ****
}
! TNL_DECLARE_RPC_OVERRIDE(m2cQueryGameTypesResponse, (U32 queryId, const Vector<StringTableEntry> &gameTypes, const Vector<StringTableEntry> &missionTypes))
{
// Ignore old queries...
--- 190,194 ----
}
! TNL_DECLARE_RPC_OVERRIDE(m2cQueryGameTypesResponse, (U32 queryId, Vector<StringTableEntry> gameTypes, Vector<StringTableEntry> missionTypes))
{
// Ignore old queries...
***************
*** 217,221 ****
}
! TNL_DECLARE_RPC_OVERRIDE(m2cQueryServersResponse, (U32 queryId, const Vector<IPAddress> &ipList))
{
// Only process results from current query...
--- 217,221 ----
}
! TNL_DECLARE_RPC_OVERRIDE(m2cQueryServersResponse, (U32 queryId, Vector<IPAddress> ipList))
{
// Only process results from current query...
***************
*** 248,252 ****
c2mRequestArrangedConnection(mCurrentQueryId, mIPList[index],
getInterface()->getFirstBoundInterfaceAddress().toIPAddress(),
! ByteBuffer((U8 *) "Hello World!", 13));
logprintf("Requesting arranged connection with %s", Address(mIPList[index]).toString());
--- 248,252 ----
c2mRequestArrangedConnection(mCurrentQueryId, mIPList[index],
getInterface()->getFirstBoundInterfaceAddress().toIPAddress(),
! new ByteBuffer((U8 *) "Hello World!", 13));
logprintf("Requesting arranged connection with %s", Address(mIPList[index]).toString());
***************
*** 260,265 ****
}
! TNL_DECLARE_RPC_OVERRIDE(m2cClientRequestedArrangedConnection, (U32 requestId, const Vector<IPAddress> &possibleAddresses,
! ByteBufferRef connectionParameters))
{
if(!gIsServer || Random::readF() > 0.75)
--- 260,265 ----
}
! TNL_DECLARE_RPC_OVERRIDE(m2cClientRequestedArrangedConnection, (U32 requestId, Vector<IPAddress> possibleAddresses,
! ByteBufferPtr connectionParameters))
{
if(!gIsServer || Random::readF() > 0.75)
***************
*** 275,282 ****
U8 data[Nonce::NonceSize * 2 + SymmetricCipher::KeySize * 2];
- ByteBuffer b(data, sizeof(data));
Random::read(data, sizeof(data));
IPAddress localAddress = getInterface()->getFirstBoundInterfaceAddress().toIPAddress();
c2mAcceptArrangedConnection(requestId, localAddress, b);
GameConnection *conn = new GameConnection();
--- 275,283 ----
U8 data[Nonce::NonceSize * 2 + SymmetricCipher::KeySize * 2];
Random::read(data, sizeof(data));
IPAddress localAddress = getInterface()->getFirstBoundInterfaceAddress().toIPAddress();
+ ByteBufferPtr b = new ByteBuffer(data, sizeof(data));
+ b->takeOwnership();
c2mAcceptArrangedConnection(requestId, localAddress, b);
GameConnection *conn = new GameConnection();
***************
*** 287,293 ****
logprintf("Accepting arranged connection from %s", Address(fullPossibleAddresses[0]).toString());
! logprintf(" Generated shared secret data: %s", b.encodeBase64()->getBuffer());
ByteBufferPtr theSharedData = new ByteBuffer(data + 2 * Nonce::NonceSize, sizeof(data) - 2 * Nonce::NonceSize);
Nonce nonce(data);
Nonce serverNonce(data + Nonce::NonceSize);
--- 288,296 ----
logprintf("Accepting arranged connection from %s", Address(fullPossibleAddresses[0]).toString());
!
! logprintf(" Generated shared secret data: %s", b->encodeBase64()->getBuffer());
ByteBufferPtr theSharedData = new ByteBuffer(data + 2 * Nonce::NonceSize, sizeof(data) - 2 * Nonce::NonceSize);
+ theSharedData->takeOwnership();
Nonce nonce(data);
Nonce serverNonce(data + Nonce::NonceSize);
***************
*** 298,307 ****
}
! TNL_DECLARE_RPC_OVERRIDE(m2cArrangedConnectionAccepted, (U32 requestId, const Vector<IPAddress> &possibleAddresses, ByteBufferRef connectionData))
{
! if(!gIsServer && requestId == mCurrentQueryId && connectionData.getBufferSize() >= Nonce::NonceSize * 2 + SymmetricCipher::KeySize * 2)
{
logprintf("Remote host accepted arranged connection.");
! logprintf(" Shared secret data: %s", connectionData.encodeBase64()->getBuffer());
GameConnection *conn = new GameConnection();
--- 301,310 ----
}
! TNL_DECLARE_RPC_OVERRIDE(m2cArrangedConnectionAccepted, (U32 requestId, Vector<IPAddress> possibleAddresses, ByteBufferPtr connectionData))
{
! if(!gIsServer && requestId == mCurrentQueryId && connectionData->getBufferSize() >= Nonce::NonceSize * 2 + SymmetricCipher::KeySize * 2)
{
logprintf("Remote host accepted arranged connection.");
! logprintf(" Shared secret data: %s", connectionData->encodeBase64()->getBuffer());
GameConnection *conn = new GameConnection();
***************
*** 312,321 ****
ByteBufferPtr theSharedData =
new ByteBuffer(
! (U8 *) connectionData.getBuffer() + Nonce::NonceSize * 2,
! connectionData.getBufferSize() - Nonce::NonceSize * 2
);
! Nonce nonce(connectionData.getBuffer());
! Nonce serverNonce(connectionData.getBuffer() + Nonce::NonceSize);
conn->connectArranged(getInterface(), fullPossibleAddresses,
--- 315,325 ----
ByteBufferPtr theSharedData =
new ByteBuffer(
! (U8 *) connectionData->getBuffer() + Nonce::NonceSize * 2,
! connectionData->getBufferSize() - Nonce::NonceSize * 2
);
+ theSharedData->takeOwnership();
! Nonce nonce(connectionData->getBuffer());
! Nonce serverNonce(connectionData->getBuffer() + Nonce::NonceSize);
conn->connectArranged(getInterface(), fullPossibleAddresses,
***************
*** 324,328 ****
}
! TNL_DECLARE_RPC_OVERRIDE(m2cArrangedConnectionRejected, (U32 requestId, ByteBufferRef rejectData))
{
if(!gIsServer && requestId == mCurrentQueryId)
--- 328,332 ----
}
! TNL_DECLARE_RPC_OVERRIDE(m2cArrangedConnectionRejected, (U32 requestId, ByteBufferPtr rejectData))
{
if(!gIsServer && requestId == mCurrentQueryId)
--- masterclient.dsp DELETED ---
|