|
|
@ -42,6 +42,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com |
|
|
|
|
|
|
|
|
|
|
|
//#define NO_ENCRYPTION
|
|
|
|
//#define NO_ENCRYPTION
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef PLASMA_EXTERNAL_RELEASE |
|
|
|
|
|
|
|
|
|
|
|
struct NetLogMessage_Header |
|
|
|
struct NetLogMessage_Header |
|
|
|
{ |
|
|
|
{ |
|
|
|
unsigned m_protocol; |
|
|
|
unsigned m_protocol; |
|
|
@ -67,6 +69,8 @@ static unsigned GetAdjustedTimer() |
|
|
|
return maths.LowPart % 864000000; |
|
|
|
return maths.LowPart % 864000000; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif // PLASMA_EXTERNAL_RELEASE
|
|
|
|
|
|
|
|
|
|
|
|
namespace pnNetCli { |
|
|
|
namespace pnNetCli { |
|
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************
|
|
|
|
/*****************************************************************************
|
|
|
@ -153,6 +157,7 @@ static void PutBufferOnWire (NetCli * cli, void * data, unsigned bytes) { |
|
|
|
|
|
|
|
|
|
|
|
byte * temp, * heap = NULL; |
|
|
|
byte * temp, * heap = NULL; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef PLASMA_EXTERNAL_RELEASE |
|
|
|
// Write to the netlog
|
|
|
|
// Write to the netlog
|
|
|
|
if (s_netlog) { |
|
|
|
if (s_netlog) { |
|
|
|
NetLogMessage_Header header; |
|
|
|
NetLogMessage_Header header; |
|
|
@ -167,6 +172,7 @@ static void PutBufferOnWire (NetCli * cli, void * data, unsigned bytes) { |
|
|
|
WriteFile(s_netlog, data, bytes, &bytesWritten, NULL); |
|
|
|
WriteFile(s_netlog, data, bytes, &bytesWritten, NULL); |
|
|
|
LeaveCriticalSection(&s_pipeCritical); |
|
|
|
LeaveCriticalSection(&s_pipeCritical); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
#endif // PLASMA_EXTERNAL_RELEASE
|
|
|
|
|
|
|
|
|
|
|
|
if (cli->mode == kNetCliModeEncrypted) { |
|
|
|
if (cli->mode == kNetCliModeEncrypted) { |
|
|
|
// Encrypt data...
|
|
|
|
// Encrypt data...
|
|
|
@ -862,6 +868,7 @@ static NetCli * ConnCreate ( |
|
|
|
cli->mode = mode; |
|
|
|
cli->mode = mode; |
|
|
|
cli->SetValue(kNilGuid); |
|
|
|
cli->SetValue(kNilGuid); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef PLASMA_EXTERNAL_RELEASE |
|
|
|
// Network debug pipe
|
|
|
|
// Network debug pipe
|
|
|
|
if (!s_netlog) { |
|
|
|
if (!s_netlog) { |
|
|
|
InitializeCriticalSection(&s_pipeCritical); |
|
|
|
InitializeCriticalSection(&s_pipeCritical); |
|
|
@ -882,6 +889,7 @@ static NetCli * ConnCreate ( |
|
|
|
s_timeOffset.HighPart = timeBase.dwHighDateTime; |
|
|
|
s_timeOffset.HighPart = timeBase.dwHighDateTime; |
|
|
|
s_timeOffset.LowPart = timeBase.dwLowDateTime; |
|
|
|
s_timeOffset.LowPart = timeBase.dwLowDateTime; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
#endif // PLASMA_EXTERNAL_RELEASE
|
|
|
|
|
|
|
|
|
|
|
|
ResetSendRecv(cli); |
|
|
|
ResetSendRecv(cli); |
|
|
|
|
|
|
|
|
|
|
@ -1070,6 +1078,7 @@ bool NetCliDispatch ( |
|
|
|
cli->input.Add(bytes, data); |
|
|
|
cli->input.Add(bytes, data); |
|
|
|
bool result = DispatchData(cli, param); |
|
|
|
bool result = DispatchData(cli, param); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef PLASMA_EXTERNAL_RELEASE |
|
|
|
// Write to the netlog
|
|
|
|
// Write to the netlog
|
|
|
|
if (s_netlog) { |
|
|
|
if (s_netlog) { |
|
|
|
NetLogMessage_Header header; |
|
|
|
NetLogMessage_Header header; |
|
|
@ -1084,6 +1093,7 @@ bool NetCliDispatch ( |
|
|
|
WriteFile(s_netlog, data, bytes, &bytesWritten, NULL); |
|
|
|
WriteFile(s_netlog, data, bytes, &bytesWritten, NULL); |
|
|
|
LeaveCriticalSection(&s_pipeCritical); |
|
|
|
LeaveCriticalSection(&s_pipeCritical); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
#endif // PLASMA_EXTERNAL_RELEASE
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef SERVER |
|
|
|
#ifdef SERVER |
|
|
|
cli->recvDispatch = result; |
|
|
|
cli->recvDispatch = result; |
|
|
|