Esempio n. 1
0
		public async Task ProcessPackage(User user, RoomInfoPackage package)
		{
			var result = new RoomInfoPackage();
			if (!mServer.Rooms.ContainsKey(package.ID))
			{
				result.ID = Guid.Empty;
				await mServer.ClientListener.Send(user, result);
				return;
			}
			var info = mServer.Rooms[package.ID];
			result.ID = info.ID;
			result.Name = info.Name;
			result.UserCount = mServer.Lobby.Values.Count(u => u.Room != null && u.Room.ID == package.ID);
			await mServer.ClientListener.Send(user, result);
		}
Esempio n. 2
0
		private void RoomInfoRecived(RoomInfoPackage roomInfoPackage)
		{
			mRoomNameLabel.Text = roomInfoPackage.Name;
		}
Esempio n. 3
0
		private void RoomInfoRecived(RoomInfoPackage info)
		{
			mRoomsListBox.Items.Add(new ListBoxItem { ID = info.ID, Name = info.Name, UserCount = info.UserCount });
		}