public static GameConfig Build(GameClientPacket packet) { GameConfig config = new GameConfig(); config.LfList = BanlistManager.GetIndex(packet.ReadUInt32()); config.BanList = BanlistManager.GetName(config.LfList); config.Rule = packet.ReadByte(); config.Mode = packet.ReadByte(); config.EnablePriority = Convert.ToBoolean(packet.ReadByte()); config.NoCheckDeck = Convert.ToBoolean(packet.ReadByte()); config.NoShuffleDeck = Convert.ToBoolean(packet.ReadByte()); //C++ padding: 5 bytes + 3 bytes = 8 bytes for (int i = 0; i < 3; i++) { packet.ReadByte(); } config.StartLp = packet.ReadInt32(); config.StartHand = packet.ReadByte(); config.DrawCount = packet.ReadByte(); config.GameTimer = packet.ReadInt16(); packet.ReadUnicode(20); config.Name = packet.ReadUnicode(30); if (string.IsNullOrEmpty(config.Name)) { config.Name = RoomManager.NewRandomRoomName(); } config.RoomString = config.Name; return(config); }
public static GameConfig Build(GameClientPacket packet) { GameConfig config = new GameConfig(); config.LfList = BanlistManager.GetIndex(packet.ReadUInt32()); config.BanList = BanlistManager.GetName(config.LfList); config.Rule = packet.ReadByte(); config.Mode = packet.ReadByte(); config.EnablePriority = Convert.ToBoolean(packet.ReadByte()); config.NoCheckDeck = Convert.ToBoolean(packet.ReadByte()); config.NoShuffleDeck = Convert.ToBoolean(packet.ReadByte()); //C++ padding: 5 bytes + 3 bytes = 8 bytes for (int i = 0; i < 3; i++) packet.ReadByte(); config.StartLp = packet.ReadInt32(); config.StartHand = packet.ReadByte(); config.DrawCount = packet.ReadByte(); config.GameTimer = packet.ReadInt16(); packet.ReadUnicode(20); config.Name = packet.ReadUnicode(30); if (string.IsNullOrEmpty(config.Name)) config.Name = RoomManager.NewRandomRoomName(); config.RoomString = config.Name; return config; }
public GameConfig(GameClientPacket packet) { LfList = BanlistManager.GetIndex(packet.ReadUInt32()); Rule = packet.ReadByte(); Mode = packet.ReadByte(); EnablePriority = Convert.ToBoolean(packet.ReadByte()); NoCheckDeck = Convert.ToBoolean(packet.ReadByte()); NoShuffleDeck = Convert.ToBoolean(packet.ReadByte()); //C++ padding: 5 bytes + 3 bytes = 8 bytes for (int i = 0; i < 3; i++) packet.ReadByte(); StartLp = packet.ReadInt32(); StartHand = packet.ReadByte(); DrawCount = packet.ReadByte(); GameTimer = packet.ReadInt16(); packet.ReadUnicode(20); Name = packet.ReadUnicode(30); if (string.IsNullOrEmpty(Name)) Name = GameManager.RandomRoomName(); }
public GameConfig(GameClientPacket packet) { LfList = BanlistManager.GetIndex(packet.ReadUInt32()); Rule = packet.ReadByte(); Mode = packet.ReadByte(); EnablePriority = Convert.ToBoolean(packet.ReadByte()); NoCheckDeck = Convert.ToBoolean(packet.ReadByte()); NoShuffleDeck = Convert.ToBoolean(packet.ReadByte()); //C++ padding: 5 bytes + 3 bytes = 8 bytes for (int i = 0; i < 3; i++) { packet.ReadByte(); } StartLp = packet.ReadInt32(); StartHand = packet.ReadByte(); DrawCount = packet.ReadByte(); GameTimer = packet.ReadInt16(); packet.ReadUnicode(20); Name = packet.ReadUnicode(30); if (string.IsNullOrEmpty(Name)) { Name = GameManager.RandomRoomName(); } }