GameServer - Debuging GameLogic

This commit is contained in:
dean11 2014-02-19 16:22:14 +01:00
parent 13755c0aeb
commit b656ce448d
2 changed files with 24 additions and 5 deletions

View File

@ -61,6 +61,8 @@ using namespace DanBias;
switch (e.args.type) switch (e.args.type)
{ {
case NetworkClient::ClientEventArgs::EventType_Disconnect: case NetworkClient::ClientEventArgs::EventType_Disconnect:
this->gClients[temp]->GetClient()->Disconnect();
this->gClients[temp] = 0;
break; break;
case NetworkClient::ClientEventArgs::EventType_ProtocolFailedToRecieve: case NetworkClient::ClientEventArgs::EventType_ProtocolFailedToRecieve:
break; break;
@ -128,6 +130,12 @@ using namespace DanBias;
int id = movedObject->GetID(); int id = movedObject->GetID();
//Protocol_ObjectPosition p(movedObject->GetPosition(), id); //Protocol_ObjectPosition p(movedObject->GetPosition(), id);
Protocol_ObjectPositionRotation p(movedObject->GetPosition(), movedObject->GetRotation(), id); Protocol_ObjectPositionRotation p(movedObject->GetPosition(), movedObject->GetRotation(), id);
Oyster::Math::Float3 temp = movedObject->GetPosition();
if(temp.x < -300)
id = 0;
GameSession::gameSession->Send(p.GetProtocol()); GameSession::gameSession->Send(p.GetProtocol());
//} //}
} }

View File

@ -104,6 +104,16 @@ struct NetworkClient::PrivateData : public IThreadObject
errorCode = this->connection.Send(temp); errorCode = this->connection.Send(temp);
if(errorCode != 0 && errorCode != WSAEWOULDBLOCK) if(errorCode != 0 && errorCode != WSAEWOULDBLOCK)
{
if( errorCode == WSAECONNABORTED || errorCode == WSAENOTCONN)
{
CEA parg;
parg.type = CEA::EventType_Disconnect;
parg.data.protocol = p;
NetEvent<NetworkClient*, CEA> e = { this->parent, parg };
this->recieveQueue.Push(e);
}
else
{ {
CEA parg; CEA parg;
parg.type = CEA::EventType_ProtocolFailedToSend; parg.type = CEA::EventType_ProtocolFailedToSend;
@ -112,6 +122,7 @@ struct NetworkClient::PrivateData : public IThreadObject
this->recieveQueue.Push(e); this->recieveQueue.Push(e);
} }
} }
}
return errorCode; return errorCode;
} }