private void SpawnPlayerOnOtherClients() { foreach (Client client in Server.clients.Values) { if (client.player != null) { ServerSend.SpawnPlayer(client.id, player); } } }
public void SendIntoGame(string _playerName) { player = new Player(id, _playerName, new Vector3(0, 0, 0)); foreach (Client _client in MainServer.clients.Values) { if (_client.player != null) { if (_client.id != id) { ServerSend.SpawnPlayer(id, _client.player); } } } foreach (Client _client in MainServer.clients.Values) { if (_client.player != null) { ServerSend.SpawnPlayer(_client.id, player); } } }
public void SendIntoGame(string playerName) { clientPlayer = new Player(id, playerName, Vector3.Zero); foreach (Client client in Server.clients.Values) { if (client.clientPlayer != null && client.id != id) { // Send every spawned player information to the newly connected client ServerSend.SpawnPlayer(id, client.clientPlayer); } } foreach (Client client in Server.clients.Values) { if (client.clientPlayer != null) { // Send the newly connected clients data to every connected client, including the newly connected client too so that it can receive its own spawn information! ServerSend.SpawnPlayer(client.id, clientPlayer); } } }
public void SendIntoGame(string playerName) { player = new Player(ID, playerName, Vector3.Zero); foreach (Client client in Server.Clients.Values) { if (client.player != null && client.ID != ID) { ServerSend.SpawnPlayer(ID, client.player); if (client.Cube != null) { ServerSend.CreateCube(ID, client.Cube); } } } foreach (Client client in Server.Clients.Values) { if (client.player != null) { ServerSend.SpawnPlayer(client.ID, player); } } }