public async Task ProcessPackage(User user, JoinRoom package) { var result = new JoinRoom(); result.ID = package.ID; if (!mServer.Rooms.ContainsKey(package.ID)) { result.Result = false; await mServer.ClientListener.Send(user, result); return; } user.Room = mServer.Rooms[package.ID]; result.Result = true; await mServer.ClientListener.Send(user, result); }
private void JoinRoomRecived(JoinRoom joinRoom) { if (!joinRoom.Result) return; mMainForm.ControlStack.Push(new RoomControl(mMainForm)); }