Beispiel #1
0
		private static void OnRoomCreate(Client client, PacketReader reader){
			//房间创建
			int port = reader.ReadInt32();
			bool needauth = reader.ReadBoolean();
			string room = reader.ReadUnicode(20);
			string banlist = reader.ReadUnicode(20);
			string info = reader.ReadUnicode(40);
			GameConfig2 config = new GameConfig2();
			config.Parse(info);
			config.Name = room;
			config.NeedAuth = needauth;
			config.DeulPort = port;
			config.BanList = banlist;
            config.RoomString = info;
            client.ServerRoomCreate(config);
		}
Beispiel #2
0
		private static void OnRoomList(Client client, PacketReader reader){
			int count = reader.ReadInt32();
			List<GameConfig2> configs=new List<GameConfig2>();
			for(int i=0;i<count;i++){
                int port = reader.ReadInt32();
                bool needauth = reader.ReadBoolean();
                string name = reader.ReadUnicode(20);
				string banlist = reader.ReadUnicode(20);
				string info = reader.ReadUnicode(20);
                bool start = reader.ReadBoolean();
                GameConfig2 config =new GameConfig2();
				config.Parse(info);
				config.Name = name;
				config.BanList = banlist;
				config.DeulPort = port;
				config.NeedAuth = needauth;
                config.IsStart = start;
                config.RoomString = info;
				configs.Add(config);
			}
			client.ServerRoomList(configs);
		}