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)
{
case NetworkClient::ClientEventArgs::EventType_Disconnect:
this->gClients[temp]->GetClient()->Disconnect();
this->gClients[temp] = 0;
break;
case NetworkClient::ClientEventArgs::EventType_ProtocolFailedToRecieve:
break;
@ -128,6 +130,12 @@ using namespace DanBias;
int id = movedObject->GetID();
//Protocol_ObjectPosition p(movedObject->GetPosition(), 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());
//}
}

View File

@ -105,11 +105,22 @@ struct NetworkClient::PrivateData : public IThreadObject
if(errorCode != 0 && errorCode != WSAEWOULDBLOCK)
{
CEA parg;
parg.type = CEA::EventType_ProtocolFailedToSend;
parg.data.protocol = p;
NetEvent<NetworkClient*, CEA> e = { this->parent, parg };
this->recieveQueue.Push(e);
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;
parg.type = CEA::EventType_ProtocolFailedToSend;
parg.data.protocol = p;
NetEvent<NetworkClient*, CEA> e = { this->parent, parg };
this->recieveQueue.Push(e);
}
}
}