forked from 0ad/0ad
olsner
7bcc12373b
- Changed player colour JS interface: setColour(...) instead of a colour property - Introduced a network log and replaced most network LOG() calls with NET_LOG() - Moved to a slot-based system for Pre-Game and extended a lot of the JS APIs to networking stuff - A bit of cleanup in the low-level network code (Unix parts) - Clients now keep track of all other connected clients on the server (And exposes this info to JS) - Split out GameAttributes to its own file - Removed unused class AttributeMap - Changed CJSObject to use T* pointers in JS_SetPrivate (needed to make ToScript work with multiple inheritance) This was SVN commit r1929.
32 lines
561 B
C++
Executable File
32 lines
561 B
C++
Executable File
#include "precompiled.h"
|
|
|
|
#include "Network.h"
|
|
#include "NetLog.h"
|
|
|
|
CServerSocket::~CServerSocket()
|
|
{
|
|
}
|
|
|
|
void CServerSocket::OnRead()
|
|
{
|
|
CSocketAddress remoteAddr;
|
|
|
|
PS_RESULT res=PreAccept(remoteAddr);
|
|
if (res==PS_OK)
|
|
{
|
|
OnAccept(remoteAddr);
|
|
}
|
|
else
|
|
{
|
|
// All errors are non-critical, so no need to do anything special besides
|
|
// not calling OnAccept [ shouldn't be, that is ;-) ]
|
|
NET_LOG("CServerSocket::OnRead(): PreAccept returned an error: %s", res);
|
|
}
|
|
}
|
|
|
|
void CServerSocket::OnWrite()
|
|
{}
|
|
|
|
void CServerSocket::OnClose(PS_RESULT errorCode)
|
|
{}
|