private void OnClientReceiveMessage(DeathMessage message) { var playerName = PlayerJoin.PlayerNames.TryGetValue(message.SenderId, out var n) ? n : message.PlayerName; var deathMessage = Necronomicon.GetPhrase(message.DeathType); DebugLog.All(string.Format(deathMessage, playerName)); }
private void OnClientReceiveMessage(LeaveMessage message) { DebugLog.All(message.PlayerName, "left"); PlayerJoin.PlayerNames.Remove(message.SenderId); foreach (var objectId in message.ObjectIds) { DestroyObject(objectId); } }
private void OnClientReceiveMessage(JoinMessage message) { PlayerNames[message.SenderId] = message.PlayerName; DebugLog.All(message.PlayerName, "joined!"); }