private void OnClientConnected(ClientData client, string name, string team) { Console.WriteLine("OnClientConnected: {0} {1} {2}", client == null ? Guid.Empty : client.Id, name, team); DisplayClientList(); }
private void OnClientGameCreated(ClientData client, GameData game) { Console.WriteLine("OnClientGameCreated: {0} {1} {2} {3}", client == null ? Guid.Empty : client.Id, game.Id, game.Name, game.Rule); if (game.Clients != null) { Console.WriteLine("\tClients: {0}", game.Clients.Count); foreach (ClientData gameClient in game.Clients) Console.WriteLine("\tClient: {0} {1} {2} {3} {4} {5}", gameClient.Id, gameClient.Name, gameClient.GameId, gameClient.IsGameMaster, gameClient.IsPlayer, gameClient.IsSpectator); } DisplayGameList(); }
private void OnClientDisconnected(ClientData client, LeaveReasons reason) { Console.WriteLine("OnClientDisconnected: {0} {1}", client == null ? Guid.Empty : client.Id, reason); DisplayClientList(); }
private void OnTeamChanged(ClientData client, string team) { Console.WriteLine("OnTeamChanged: {0} {1}", client == null ? Guid.Empty : client.Id, team); }
private void OnBroadcastMessageReceived(ClientData client, string message) { Console.WriteLine("OnBroadcastMessageReceived: {0} {1}", client == null ? Guid.Empty : client.Id, message); }
private void OnGridModified(ClientData client, byte[] grid) { Console.WriteLine("OnGridModified: {0}", client == null ? Guid.Empty : client.Id); }
public void OnClientConnected(Guid clientId, string name, string team) { Log.Default.WriteLine(LogLevels.Info, "Client connected {0} {1} {2}", clientId, name, team); ResetTimeout(); ClientData client = _clients.FirstOrDefault(x => x.Id == clientId); if (client == null) client = new ClientData { Id = clientId, Name = name, Team = team }; else { client.Id = clientId; client.Name = name; client.Team = team; } ClientConnected.Do(x => x(client, name, team)); }
private void OnVoteKickAsked(ClientData sourceClient, ClientData targetClient, string reason) { Console.WriteLine("OnVoteKickAsked: {0} {1} {2}", sourceClient == null ? Guid.Empty : sourceClient.Id, targetClient == null ? Guid.Empty : targetClient.Id, reason); }
private void OnGameMasterModified(ClientData client) { Console.WriteLine("OnGameMasterModified: {0}", client == null ? Guid.Empty : client.Id); }
private void OnPlayerWon(ClientData client) { Console.WriteLine("OnPlayerWon: {0}", client == null ? Guid.Empty : client.Id); }
private void OnAchievementEarned(ClientData client, int achievementId, string achievementTitle) { Console.WriteLine("OnAchievementEarned: {0} {1} {2}", client == null ? Guid.Empty : client.Id, achievementId, achievementTitle); }
private void OnPlayerLinesAdded(ClientData client, int specialId, int count) { Console.WriteLine("OnPlayerLinesAdded: {0} {1} {2}", client == null ? Guid.Empty : client.Id, specialId, count); }
public bool VoteKick(ClientData target, string reason) { if (target == null || _clients.All(x => x != target)) return false; _proxy.Do(x => x.ClientVoteKick(target.Id, reason)); return true; }
public bool SendPrivateMessage(ClientData target, string message) { if (target == null || _clients.All(x => x != target)) return false; _proxy.Do(x => x.ClientSendPrivateMessage(target.Id, message)); return true; }
private void OnConnected(ConnectResults result, Versioning serverVersion, ClientData client, List<GameData> games) { Console.WriteLine("OnConnected: {0} {1}.{2} {3}", result, serverVersion == null ? -1 : serverVersion.Major, serverVersion == null ? -1 : serverVersion.Minor, client.Id); Console.WriteLine("Game list: {0}", games == null ? 0 : games.Count); if (games != null) foreach (GameData game in games) { Console.WriteLine("Game: {0} {1} {2}", game.Id, game.Name, game.Rule); Console.WriteLine("\tClients: {0}", game.Clients == null ? 0 : game.Clients.Count); if (game.Clients != null) foreach (ClientData gameClient in game.Clients) Console.WriteLine("\tClient: {0} {1} {2} {3} {4} {5}", gameClient.Id, gameClient.Name, gameClient.GameId, gameClient.IsGameMaster, gameClient.IsPlayer, gameClient.IsSpectator); } }
private void OnClientGameLeft(ClientData client) { Console.WriteLine("OnClientGameLeft: {0}", client == null ? Guid.Empty : client.Id); }
private void OnContinuousSpecialFinished(ClientData client, Specials special) { Console.WriteLine("OnContinuousSpecialFinished: {0} {1}", client == null ? Guid.Empty : client.Id, special); }
private void OnClientGameJoined(ClientData client, bool asSpectator) { Console.WriteLine("OnClientGameJoined: {0} {1}", client == null ? Guid.Empty : client.Id, asSpectator); }
private void OnSpecialUsed(ClientData client, ClientData target, int specialId, Specials special) { Console.WriteLine("OnSpecialUsed: {0} {1} {2} {3}", client == null ? Guid.Empty : client.Id, target == null ? Guid.Empty : target.Id, specialId, special); }
public void OnConnected(ConnectResults result, Versioning serverVersion, Guid clientId, List<GameData> games) { ClientData client = null; if (result == ConnectResults.Successfull) { Log.Default.WriteLine(LogLevels.Info, "Connected as player {0}", clientId); _clients.Clear(); _gameClients.Clear(); _games.Clear(); _games.AddRange(games); _clientId = clientId; client = new ClientData { Id = clientId, Name = Name, Team = Team, }; _clients.Add(client); _state = States.Connected; } else { Log.Default.WriteLine(LogLevels.Warning, "Wrong id {0}", clientId); _state = States.Created; } Connected.Do(x => x(result, serverVersion, client, games)); }