GameServer - Debuging GameLogic
This commit is contained in:
parent
13755c0aeb
commit
b656ce448d
|
@ -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());
|
||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
|
|
|
@ -105,11 +105,22 @@ struct NetworkClient::PrivateData : public IThreadObject
|
||||||
|
|
||||||
if(errorCode != 0 && errorCode != WSAEWOULDBLOCK)
|
if(errorCode != 0 && errorCode != WSAEWOULDBLOCK)
|
||||||
{
|
{
|
||||||
CEA parg;
|
if( errorCode == WSAECONNABORTED || errorCode == WSAENOTCONN)
|
||||||
parg.type = CEA::EventType_ProtocolFailedToSend;
|
{
|
||||||
parg.data.protocol = p;
|
CEA parg;
|
||||||
NetEvent<NetworkClient*, CEA> e = { this->parent, parg };
|
parg.type = CEA::EventType_Disconnect;
|
||||||
this->recieveQueue.Push(e);
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue