EPlayerSpawned special logic added to server and client.
This commit is contained in:
@@ -92,6 +92,9 @@ void Client::parseMessageType(Packet& packet)
|
||||
case MessageType::Kick:
|
||||
parseKick();
|
||||
break;
|
||||
case MessageType::OnPlayerSpawned:
|
||||
parsePlayersSpawned();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -129,6 +132,15 @@ void Client::parseKick()
|
||||
m_IsConnected = false;
|
||||
}
|
||||
|
||||
void Client::parsePlayersSpawned(Packet& packet)
|
||||
{
|
||||
Events::PlayerSpawned e;
|
||||
e.Player = EntityWrapper(m_World, m_ServerIDToClientID[packet.ReadPrimitive<EntityID>()]);
|
||||
e.Spawner = EntityWrapper(m_World, m_ServerIDToClientID[packet.ReadPrimitive<EntityID>()]);
|
||||
e.PlayerID = -1;
|
||||
m_EventBroker->Publish(e);
|
||||
}
|
||||
|
||||
// Fields with strings will not work right now
|
||||
void Client::InterpolateFields(Packet& packet, const ComponentInfo& componentInfo, const EntityID& entityID, const std::string& componentType)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user