Added a player name to the PlayerSpawned event. When a player has spawned the server sends the name to the client which publishes the event.

This commit is contained in:
stiffly
2016-01-24 22:00:38 +01:00
parent 0c56a05144
commit 06f64f8fbf
3 changed files with 4 additions and 0 deletions
+2
View File
@@ -405,6 +405,8 @@ bool Server::OnPlayerSpawned(const Events::PlayerSpawned & e)
Packet packet = Packet(MessageType::OnPlayerSpawned);
packet.WritePrimitive<EntityID>(e.Player.ID);
packet.WritePrimitive<EntityID>(e.Spawner.ID);
// We don't send PlayerID here because it will always be set to -1
packet.WriteString(m_ConnectedPlayers[e.PlayerID].Name);
send(e.PlayerID, packet);
return false;
}