public void JoinRoom(GameConfig2 config) { if (OnJoinRoom != null) { OnJoinRoom(config); } }
public void ServerRoomCreate(GameConfig2 config) { if (OnRoomCreate != null) { OnRoomCreate(config); } }
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); }
public void OnCreate(GameConfig2 config) { lock (Rooms){ Rooms[config.Tag] = config; } BeginInvoke(new Action( () => { lock (_lock) AddRoom(config); }) ); }
void Tbn_tagClick(object sender, EventArgs e) { GameConfig2 cfg = panel_rooms.FindRoom(2); if (cfg != null) { JoinRoom(cfg.Name, cfg.DeulPort, cfg.NeedAuth); } else { JoinRoom("T#", Program.Config.DuelPort, Program.Config.NeedAuth); } }
private static void OnRoomCreate(Client client, PacketReader reader) { //Rooms creating 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); }
private void AddRoom(GameConfig2 config) { RoomBlock b = new RoomBlock(this, config); Controls.Add(b); }
public RoomBlock(RoomGrid parent, GameConfig2 config) { this.parent = parent; this.config = config; Init(); }
private void PreJoinRoom(GameConfig2 config) { PreJoinRoom(config.Name, config.RoomString, config.DeulPort, config.NeedAuth); }