public TMClientInfoInRoom(TMClient client) { Client = client; User = client.User; ClientStatus = ClientStatusForRoom.Init; ScreenName = client.User.Username; }
public TMClientInfoInRoom DisconnectRoom(TMClient client) { var info = FindClientInfo(client); ClientInfos.Remove(info); this.RpcAllAsync("OnClientDisconnect", info); return(info); }
public void ClientDisconnectLobby(TMClient client) { var room = FindRoomByClient(client); if (room != null) { room.DisconnectRoom(client); if (room.ClientInfos.Count == 0) { ClearRoom(room); } } }
public async Task WorldTextMessage(TMClient client, string message, TMContext context) { var clients = this.Connections.Select(c => c.Client as TMClient); await this.RpcAsync(clients, "WorldMessage", client.User, message); }
public TMRoom FindRoomByClient(TMClient client) { return(Rooms.FirstOrDefault(room => room.ClientInfos.Any(info => info.Client == client))); }
public static TMClient UseLobby(this TMClient client, string lobbyWebSocketUrl) { return(client.ConnnectLobby(lobbyWebSocketUrl)); }
public TMClientInfoInRoom FindClientInfo(TMClient client) { var info = ClientInfos.FirstOrDefault(ci => ci.Client == client); return(info); }