GameServer - Pontus found idiot bug that dennis made

This commit is contained in:
dean11 2014-02-19 12:46:05 +01:00
parent 65163447bb
commit 8a3cd796ca
4 changed files with 15 additions and 14 deletions

View File

@ -123,6 +123,7 @@ bool Game::NewFrame()
for (unsigned int i = 0; i < this->players.Size(); i++)
{
this->onMoveFnc(this->players[i]);
if(this->players[i] && this->players[i]->player) this->players[i]->player->EndFrame();
}

View File

@ -160,7 +160,6 @@ void Player::EndFrame()
this->rigidBody->SetUp(this->rigidBody->GetState().centerPos.GetNormalized());
Object::EndFrame();
}

View File

@ -561,11 +561,11 @@ namespace GameLogic
this->protocol[0].type = Oyster::Network::NetAttributeType_Short;
//PLAYER_ID
this->protocol[1].type = Oyster::Network::NetAttributeType_Int;
this->protocol[1].type = Oyster::Network::NetAttributeType_Bool;
//TEAM_ID
this->protocol[2].type = Oyster::Network::NetAttributeType_Int;
//OWNER
this->protocol[3].type = Oyster::Network::NetAttributeType_Bool;
this->protocol[3].type = Oyster::Network::NetAttributeType_Int;
//PLAYER-NAME
this->protocol[4].type = Oyster::Network::NetAttributeType_CharArray;
//MESH-NAME
@ -585,9 +585,10 @@ namespace GameLogic
}
Protocol_ObjectCreatePlayer(Oyster::Network::CustomNetProtocol& p)
{
this->object_ID = p[1].value.netInt;
this->teamId = this->protocol[2].value.netInt;
this->owner = this->protocol[3].value.netBool;
this->owner = p[1].value.netBool;
this->object_ID = p[2].value.netInt;
this->teamId = p[3].value.netInt;
this->name.assign(p[4].value.netCharPtr);
this->meshName.assign(p[5].value.netCharPtr);
@ -610,11 +611,11 @@ namespace GameLogic
this->protocol[0].type = Oyster::Network::NetAttributeType_Short;
//PLAYER_ID
this->protocol[1].type = Oyster::Network::NetAttributeType_Int;
this->protocol[1].type = Oyster::Network::NetAttributeType_Bool;
//TEAM_ID
this->protocol[2].type = Oyster::Network::NetAttributeType_Int;
//OWNER
this->protocol[3].type = Oyster::Network::NetAttributeType_Bool;
this->protocol[3].type = Oyster::Network::NetAttributeType_Int;
//PLAYER-NAME
this->protocol[4].type = Oyster::Network::NetAttributeType_CharArray;
//MESH-NAME
@ -644,10 +645,10 @@ namespace GameLogic
}
Oyster::Network::CustomNetProtocol GetProtocol() override
{
this->protocol[1].value = this->object_ID;
this->protocol[2].value = this->teamId;
this->protocol[3].value = this->owner;
this->protocol[1].value = this->owner;
this->protocol[2].value = this->object_ID;
this->protocol[3].value = this->teamId;
this->protocol.Set(4, this->name);
this->protocol.Set(5, this->meshName);

View File

@ -66,10 +66,10 @@ using namespace DanBias;
break;
case NetworkClient::ClientEventArgs::EventType_ProtocolFailedToSend:
printf("\t(%i : %s) - EventType_ProtocolFailedToSend\n", cl->GetClient()->GetID(), e.sender->GetIpAddress().c_str());
this->Detach(e.sender);
//this->Detach(e.sender);
break;
case NetworkClient::ClientEventArgs::EventType_ProtocolRecieved:
printf("\t(%i : %s) - EventType_ProtocolRecieved\n", cl->GetClient()->GetID(), e.sender->GetIpAddress().c_str());
//printf("\t(%i : %s) - EventType_ProtocolRecieved\n", cl->GetClient()->GetID(), e.sender->GetIpAddress().c_str());
this->ParseProtocol(e.args.data.protocol, cl);
break;
}