GameServer - Misc

This commit is contained in:
dean11 2014-02-20 09:14:42 +01:00
parent 9e26095dd0
commit d93d900d40
4 changed files with 7 additions and 5 deletions

View File

@ -22,10 +22,12 @@ using namespace GameLogic;
//Physics::ICustomBody::SubscriptMessage //Physics::ICustomBody::SubscriptMessage
void Player::PlayerCollision(Oyster::Physics::ICustomBody *rigidBodyPlayer, Oyster::Physics::ICustomBody *obj, Oyster::Math::Float kineticEnergyLoss) void Player::PlayerCollision(Oyster::Physics::ICustomBody *rigidBodyPlayer, Oyster::Physics::ICustomBody *obj, Oyster::Math::Float kineticEnergyLoss)
{ {
Player *player = ((Player*)(rigidBodyPlayer->GetCustomTag())); Player *player = ((Player*)(rigidBodyPlayer->GetCustomTag()));
Object *realObj = (Object*)obj->GetCustomTag(); //needs to be changed? Object *realObj = (Object*)obj->GetCustomTag(); //needs to be changed?
if(!realObj) return;
if(!player) return;
switch (realObj->GetObjectType()) switch (realObj->GetObjectType())
{ {
case ObjectSpecialType::ObjectSpecialType_Generic: case ObjectSpecialType::ObjectSpecialType_Generic:

View File

@ -61,18 +61,16 @@ using namespace DanBias;
switch (e.args.type) switch (e.args.type)
{ {
case NetworkClient::ClientEventArgs::EventType_Disconnect: case NetworkClient::ClientEventArgs::EventType_Disconnect:
//printf("\t(%i : %s) - EventType_Disconnect\n", cl->GetClient()->GetID(), e.sender->GetIpAddress().c_str()); printf("\t(%i : %s) - EventType_Disconnect\n", cl->GetClient()->GetID(), e.sender->GetIpAddress().c_str());
this->gClients[temp]->Invalidate(); this->gClients[temp]->Invalidate();
break; break;
case NetworkClient::ClientEventArgs::EventType_ProtocolFailedToRecieve: case NetworkClient::ClientEventArgs::EventType_ProtocolFailedToRecieve:
break; break;
case NetworkClient::ClientEventArgs::EventType_ProtocolFailedToSend: case NetworkClient::ClientEventArgs::EventType_ProtocolFailedToSend:
//printf("\t(%i : %s) - EventType_ProtocolFailedToSend\n", cl->GetClient()->GetID(), e.sender->GetIpAddress().c_str());
if(this->gClients[temp]->IncrementFailedProtocol() >= 5/*client->threshold*/) if(this->gClients[temp]->IncrementFailedProtocol() >= 5/*client->threshold*/)
this->gClients[temp]->Invalidate(); this->gClients[temp]->Invalidate();
break; break;
case NetworkClient::ClientEventArgs::EventType_ProtocolRecieved: case NetworkClient::ClientEventArgs::EventType_ProtocolRecieved:
//printf("\t(%i : %s) - EventType_ProtocolRecieved\n", cl->GetClient()->GetID(), e.sender->GetIpAddress().c_str());
this->ParseProtocol(e.args.data.protocol, cl); this->ParseProtocol(e.args.data.protocol, cl);
break; break;
} }

View File

@ -10,6 +10,8 @@
using namespace DanBias; using namespace DanBias;
int WINAPI WinMain( HINSTANCE hinst, HINSTANCE prevInst, PSTR cmdLine, int cmdShow) int WINAPI WinMain( HINSTANCE hinst, HINSTANCE prevInst, PSTR cmdLine, int cmdShow)
{ {
if(SetDllDirectory(L"..\\DLL") == FALSE) if(SetDllDirectory(L"..\\DLL") == FALSE)

View File

@ -64,7 +64,7 @@ struct NetworkClient::PrivateData : public IThreadObject
: ID(currID++) : ID(currID++)
, parent(0) , parent(0)
, owner(0) , owner(0)
, outputEvent(1) , outputEvent(0)
{ {
InitWinSock(); InitWinSock();
this->thread.Create(this, false); this->thread.Create(this, false);