GameServer - Debuging GameLogic
This commit is contained in:
parent
13755c0aeb
commit
b656ce448d
|
@ -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());
|
||||
//}
|
||||
}
|
||||
|
|
|
@ -104,6 +104,16 @@ struct NetworkClient::PrivateData : public IThreadObject
|
|||
errorCode = this->connection.Send(temp);
|
||||
|
||||
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;
|
||||
parg.type = CEA::EventType_ProtocolFailedToSend;
|
||||
|
@ -112,6 +122,7 @@ struct NetworkClient::PrivateData : public IThreadObject
|
|||
this->recieveQueue.Push(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return errorCode;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue