forked from teamnwah/openmw-tes3coop
Add placeholder ProcessWorldPacket method to server's Networking
This commit is contained in:
parent
2602c1f71a
commit
d0328f2553
2 changed files with 35 additions and 1 deletions
|
@ -355,11 +355,38 @@ void Networking::ProcessPlayerPacket(RakNet::Packet *packet)
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
printf("Message with identifier %i has arrived.\n", packet->data[0]);
|
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Unhandled PlayerPacket with identifier %i has arrived",
|
||||||
|
packet->data[0]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Networking::ProcessWorldPacket(RakNet::Packet *packet)
|
||||||
|
{
|
||||||
|
Player *player = Players::GetPlayer(packet->guid);
|
||||||
|
|
||||||
|
if (!player->isHandshaked() || player->LoadedState() != Player::POSTLOADED)
|
||||||
|
return;
|
||||||
|
|
||||||
|
switch (packet->data[0])
|
||||||
|
{
|
||||||
|
|
||||||
|
case ID_WORLD_OBJECT_REMOVAL:
|
||||||
|
{
|
||||||
|
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_WORLD_OBJECT_REMOVAL from %s",
|
||||||
|
player->Npc()->mName.c_str());
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
default:
|
||||||
|
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Unhandled WorldPacket with identifier %i has arrived",
|
||||||
|
packet->data[0]);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void Networking::Update(RakNet::Packet *packet)
|
void Networking::Update(RakNet::Packet *packet)
|
||||||
{
|
{
|
||||||
Player *player = Players::GetPlayer(packet->guid);
|
Player *player = Players::GetPlayer(packet->guid);
|
||||||
|
@ -390,6 +417,12 @@ void Networking::Update(RakNet::Packet *packet)
|
||||||
else if (worldController->ContainsPacket(packet->data[0]))
|
else if (worldController->ContainsPacket(packet->data[0]))
|
||||||
{
|
{
|
||||||
worldController->SetStream(&bsIn, 0);
|
worldController->SetStream(&bsIn, 0);
|
||||||
|
ProcessWorldPacket(packet);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Unhandled Raknet packet with identifier %i has arrived",
|
||||||
|
packet->data[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,7 @@ namespace mwmp
|
||||||
void KickPlayer(RakNet::RakNetGUID guid);
|
void KickPlayer(RakNet::RakNetGUID guid);
|
||||||
|
|
||||||
void ProcessPlayerPacket(RakNet::Packet *packet);
|
void ProcessPlayerPacket(RakNet::Packet *packet);
|
||||||
|
void ProcessWorldPacket(RakNet::Packet *packet);
|
||||||
void Update(RakNet::Packet *packet);
|
void Update(RakNet::Packet *packet);
|
||||||
|
|
||||||
unsigned short NumberOfConnections() const;
|
unsigned short NumberOfConnections() const;
|
||||||
|
|
Loading…
Reference in a new issue