コード例 #1
0
 public TMClientInfoInRoom(TMClient client)
 {
     Client       = client;
     User         = client.User;
     ClientStatus = ClientStatusForRoom.Init;
     ScreenName   = client.User.Username;
 }
コード例 #2
0
        public TMClientInfoInRoom DisconnectRoom(TMClient client)
        {
            var info = FindClientInfo(client);

            ClientInfos.Remove(info);
            this.RpcAllAsync("OnClientDisconnect", info);
            return(info);
        }
コード例 #3
0
ファイル: TMRoomContainer.cs プロジェクト: wujun4code/Slark
        public void ClientDisconnectLobby(TMClient client)
        {
            var room = FindRoomByClient(client);

            if (room != null)
            {
                room.DisconnectRoom(client);
                if (room.ClientInfos.Count == 0)
                {
                    ClearRoom(room);
                }
            }
        }
コード例 #4
0
        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);
        }
コード例 #5
0
ファイル: TMRoomContainer.cs プロジェクト: wujun4code/Slark
 public TMRoom FindRoomByClient(TMClient client)
 {
     return(Rooms.FirstOrDefault(room => room.ClientInfos.Any(info => info.Client == client)));
 }
コード例 #6
0
 public static TMClient UseLobby(this TMClient client, string lobbyWebSocketUrl)
 {
     return(client.ConnnectLobby(lobbyWebSocketUrl));
 }
コード例 #7
0
        public TMClientInfoInRoom FindClientInfo(TMClient client)
        {
            var info = ClientInfos.FirstOrDefault(ci => ci.Client == client);

            return(info);
        }