public int HandlePacket(GameClient client, GSPacketIn packet) { packet.ClearContext(); packet.WriteDateTime(DateTime.Now); client.Out.SendTCP(packet); return 0; }
public int HandlePacket(GameClient client, GSPacketIn packet) { //Lay Danh Sach tat ca cac phong GSPacketIn pkg = new GSPacketIn((byte)ePackageType.HOTSPRING_ROOM_LIST_GET); pkg.WriteInt(10); for (int i = 0; i < 10; i++) { //loc_2.roomNumber = _loc_3.readInt(); pkg.WriteInt(i); //_loc_2.roomID = _loc_3.readInt(); pkg.WriteInt(i); //_loc_2.roomName = _loc_3.readUTF(); pkg.WriteString("Room" + i); //_loc_2.roomPassword = _loc_3.readUTF(); pkg.WriteString(""); //_loc_2.effectiveTime = _loc_3.readInt(); pkg.WriteInt(1); //_loc_2.curCount = _loc_3.readInt(); pkg.WriteInt(1); //_loc_2.playerID = _loc_3.readInt(); pkg.WriteInt(client.Player.PlayerCharacter.ID); //_loc_2.playerName = _loc_3.readUTF(); pkg.WriteString("abc"); //_loc_2.startTime = _loc_3.readDate(); pkg.WriteDateTime(DateTime.Now.AddDays(-50)); //_loc_2.roomIntroduction = _loc_3.readUTF(); pkg.WriteString("Room Intro"); //_loc_2.roomType = _loc_3.readInt(); pkg.WriteInt(1); //_loc_2.maxCount = _loc_3.readInt(); pkg.WriteInt(10); } client.SendTCP(pkg); return 0; }
public int HandlePacket(GameClient client, GSPacketIn packet) { var roomId = packet.ReadInt(); var passString = packet.ReadString(); GSPacketIn pkg = new GSPacketIn((byte)ePackageType.HOTSPRING_ROOM_ENTER); pkg.WriteInt(roomId); pkg.WriteInt(roomId); //_loc_3.roomID = _loc_2.readInt(); //_loc_3.roomNumber = _loc_2.readInt(); //_loc_3.roomName = _loc_2.readUTF(); pkg.WriteString("RoomName"); //_loc_3.roomPassword = _loc_2.readUTF(); pkg.WriteString(""); //_loc_2.effectiveTime = _loc_3.readInt(); pkg.WriteInt(1); //_loc_2.curCount = _loc_3.readInt(); pkg.WriteInt(1); //_loc_2.playerID = _loc_3.readInt(); pkg.WriteInt(client.Player.PlayerCharacter.ID); //_loc_2.playerName = _loc_3.readUTF(); pkg.WriteString("abc"); //_loc_2.startTime = _loc_3.readDate(); pkg.WriteDateTime(DateTime.Now.AddDays(-50)); //_loc_2.roomIntroduction = _loc_3.readUTF(); pkg.WriteString("Room Intro"); //_loc_2.roomType = _loc_3.readInt(); pkg.WriteInt(1); //_loc_2.maxCount = _loc_3.readInt(); pkg.WriteInt(10); //this._playerEnterRoomTime = _loc_2.readDate(); //this._playerEffectiveTime = _loc_2.readInt(); pkg.WriteDateTime(DateTime.Now); pkg.WriteDateTime(DateTime.Now.AddDays(1)); client.SendTCP(pkg); return 0; }
public int HandlePacket(GameClient client, GSPacketIn packet) { int num = packet.ReadInt(); try { TankHotSpringLogicProcessor processor = new TankHotSpringLogicProcessor(); HotSpringRoomInfo info = new HotSpringRoomInfo { RoomID = num }; client.Player.CurrentHotSpringRoom = new HotSpringRoom(info, processor); } catch { Console.WriteLine("System Error!"); } HotSpringRoom room = client.Player.CurrentHotSpringRoom; using (PlayerBussiness db = new PlayerBussiness()) { db.UpdateHotSpringRoomInfo(room.Info); } string str = packet.ReadString(); GSPacketIn pkg = new GSPacketIn(0xca); pkg.WriteInt(num); pkg.WriteInt(num); pkg.WriteString(room.Info.RoomName); pkg.WriteString(room.Info.Pwd); pkg.WriteInt(1); pkg.WriteInt(1); pkg.WriteInt(client.Player.PlayerCharacter.ID); pkg.WriteString(client.Player.PlayerCharacter.NickName); pkg.WriteDateTime(room.Info.BeginTime); pkg.WriteString(room.Info.RoomIntroduction); pkg.WriteInt(1); pkg.WriteInt(10); pkg.WriteDateTime(DateTime.Now); pkg.WriteInt(10); client.SendTCP(pkg); return 0; }
public static GSPacketIn SendBufferList(Player player, List<BufferInfo> infos) { GSPacketIn pkg = new GSPacketIn((byte)ePackageType.BUFF_OBTAIN, player.Id); pkg.WriteInt(infos.Count); foreach (BufferInfo info in infos) { pkg.WriteInt(info.Type); pkg.WriteBoolean(info.IsExist); pkg.WriteDateTime(info.BeginDate); pkg.WriteInt(info.ValidDate); pkg.WriteInt(info.Value); } return pkg; }
public GSPacketIn SendAuctionRefresh(AuctionInfo info, int auctionID, bool isExist, ItemInfo item) { GSPacketIn pkg = new GSPacketIn((byte)ePackageType.AUCTION_REFRESH); pkg.WriteInt(auctionID); pkg.WriteBoolean(isExist); if (isExist) { pkg.WriteInt(info.AuctioneerID); pkg.WriteString(info.AuctioneerName); pkg.WriteDateTime(info.BeginDate); pkg.WriteInt(info.BuyerID); pkg.WriteString(info.BuyerName); pkg.WriteInt(info.ItemID); pkg.WriteInt(info.Mouthful); pkg.WriteInt(info.PayType); pkg.WriteInt(info.Price); pkg.WriteInt(info.Rise); pkg.WriteInt(info.ValidDate); pkg.WriteBoolean(item != null); if (item != null) { pkg.WriteInt(item.Count); pkg.WriteInt(item.TemplateID); pkg.WriteInt(item.AttackCompose); pkg.WriteInt(item.DefendCompose); pkg.WriteInt(item.AgilityCompose); pkg.WriteInt(item.LuckCompose); pkg.WriteInt(item.StrengthenLevel); pkg.WriteBoolean(item.IsBinds); pkg.WriteBoolean(item.IsJudge); pkg.WriteDateTime(item.BeginDate); pkg.WriteInt(item.ValidDate); pkg.WriteString(item.Color); pkg.WriteString(item.Skin); pkg.WriteBoolean(item.IsUsed); } } pkg.Compress(); SendTCP(pkg); return pkg; }
public GSPacketIn SendBufferList(GamePlayer player, List<AbstractBuffer> infos) { GSPacketIn pkg = new GSPacketIn((byte)ePackageType.BUFF_OBTAIN, player.PlayerId); pkg.WriteInt(infos.Count); foreach (AbstractBuffer bufferInfo in infos) { BufferInfo info = bufferInfo.Info; pkg.WriteInt(info.Type); pkg.WriteBoolean(info.IsExist); pkg.WriteDateTime(info.BeginDate); pkg.WriteInt(info.ValidDate); pkg.WriteInt(info.Value); } SendTCP(pkg); return pkg; }
public GSPacketIn SendUpdateBuffer(GamePlayer player, BufferInfo[] infos) { GSPacketIn pkg = new GSPacketIn((byte)ePackageType.BUFF_UPDATE, player.PlayerId); pkg.WriteInt(infos.Length); foreach (BufferInfo info in infos) { pkg.WriteInt(info.Type); pkg.WriteBoolean(info.IsExist); pkg.WriteDateTime(info.BeginDate); pkg.WriteInt(info.ValidDate); pkg.WriteInt(info.Value); } SendTCP(pkg); return pkg; }
/// <summary> /// 发送当前用户的任务数据 /// </summary> /// <param name="player"></param> /// <param name="infos"></param> /// <returns></returns> public GSPacketIn SendUpdateQuests(GamePlayer player, byte[] states, BaseQuest[] infos) { //TODO:完成任务列表的同步 if (m_gameClient.Player == null) return null; try { var length = 0; var numSend = infos.Length; var j = 0; do { GSPacketIn pkg = new GSPacketIn((byte)ePackageType.QUEST_UPDATE, m_gameClient.Player.PlayerCharacter.ID); length = (numSend > 7) ? 7 : numSend; pkg.WriteInt(length); for (int i = 0; i < length; i++, j++) { var info = infos[j]; if (info.Data.IsExist) { pkg.WriteInt(info.Data.QuestID); //任务编号 pkg.WriteBoolean(info.Data.IsComplete); //是否完成 pkg.WriteInt(info.Data.Condition1); //用户条件一 pkg.WriteInt(info.Data.Condition2); //用户条件二 pkg.WriteInt(info.Data.Condition3); //用户条件三 pkg.WriteInt(info.Data.Condition4); //用户条件四 pkg.WriteDateTime(info.Data.CompletedDate);//用户条件完成日期 pkg.WriteInt(info.Data.RepeatFinish); //该任务剩余接受次数。 pkg.WriteInt(info.Data.RandDobule); //用户接受任务机会 pkg.WriteBoolean(info.Data.IsExist); //是否为新任务 } } //输出所有的任务 for (int i = 0; i < states.Length; i++) { pkg.WriteByte(states[i]); } numSend -= length; SendTCP(pkg); } while (j < infos.Length); } catch (Exception e) { Console.WriteLine(e.InnerException); } return new GSPacketIn((byte)ePackageType.QUEST_UPDATE, m_gameClient.Player.PlayerCharacter.ID); }
public GSPacketIn SendUserEquip(PlayerInfo player, List<ItemInfo> items) { GSPacketIn pkg = new GSPacketIn((byte)ePackageType.ITEM_EQUIP, player.ID, 10240); pkg.WriteInt(player.ID); pkg.WriteString(player.NickName); pkg.WriteInt(player.Agility); pkg.WriteInt(player.Attack); pkg.WriteString(player.Colors); pkg.WriteString(player.Skin); pkg.WriteInt(player.Defence); pkg.WriteInt(player.GP); pkg.WriteInt(player.Grade); pkg.WriteInt(player.Luck); pkg.WriteInt(player.hp);//_loc_5.hp = _loc_2.readInt(); pkg.WriteInt(player.Hide); pkg.WriteInt(player.Repute); pkg.WriteBoolean(player.Sex); pkg.WriteString(player.Style); pkg.WriteInt(player.Offer); pkg.WriteByte(player.typeVIP); pkg.WriteInt(player.VIPLevel); pkg.WriteInt(player.Win); pkg.WriteInt(player.Total); pkg.WriteInt(player.Escape); pkg.WriteInt(player.ConsortiaID); pkg.WriteString(player.ConsortiaName); pkg.WriteInt(0);//_loc_5.badgeID = _loc_2.readInt(); pkg.WriteInt(player.RichesOffer); pkg.WriteInt(player.RichesRob); pkg.WriteBoolean(player.IsMarried); pkg.WriteInt(player.SpouseID); pkg.WriteString(player.SpouseName); pkg.WriteString(player.DutyName); pkg.WriteInt(player.Nimbus); pkg.WriteInt(player.FightPower); pkg.WriteInt(5);//apprenticeshipState = _loc_2.readInt(); pkg.WriteInt(-1);//masterID = _loc_2.readInt(); pkg.WriteString("Master");//setMasterOrApprentices(_loc_2.readUTF()); pkg.WriteInt(0);//graduatesCount = _loc_2.readInt(); pkg.WriteString("HoNorMaster");//honourOfMaster = _loc_2.readUTF(); pkg.WriteInt(player.AchievementPoint);// pkg.WriteString("Tân Binh");//honor = _loc_2.readUTF(); pkg.WriteDateTime(DateTime.Now.AddDays(-2)); pkg.WriteInt(player.Offer); //_loc_5.spdTexpExp = _loc_2.readInt(); pkg.WriteInt(player.Offer); //_loc_5.attTexpExp = _loc_2.readInt(); pkg.WriteInt(player.Offer); //_loc_5.defTexpExp = _loc_2.readInt(); pkg.WriteInt(player.Offer); //_loc_5.hpTexpExp = _loc_2.readInt(); pkg.WriteInt(player.Offer); //_loc_5.lukTexpExp = _loc_2.readInt(); pkg.WriteBoolean(false); //_loc_5.DailyLeagueFirst = _loc_2.readBoolean(); pkg.WriteInt(player.Offer); //_loc_5.DailyLeagueLastScore = _loc_2.readInt(); pkg.WriteInt(items.Count); foreach (ItemInfo info in items) { pkg.WriteByte((byte)info.BagType); pkg.WriteInt(info.UserID); pkg.WriteInt(info.ItemID); pkg.WriteInt(info.Count); pkg.WriteInt(info.Place); pkg.WriteInt(info.TemplateID); pkg.WriteInt(info.AttackCompose); pkg.WriteInt(info.DefendCompose); pkg.WriteInt(info.AgilityCompose); pkg.WriteInt(info.LuckCompose); pkg.WriteInt(info.StrengthenLevel); pkg.WriteBoolean(info.IsBinds); pkg.WriteBoolean(info.IsJudge); pkg.WriteDateTime(info.BeginDate); pkg.WriteInt(info.ValidDate); pkg.WriteString(info.Color); pkg.WriteString(info.Skin); pkg.WriteBoolean(info.IsUsed); pkg.WriteInt(info.Hole1); pkg.WriteInt(info.Hole2); pkg.WriteInt(info.Hole3); pkg.WriteInt(info.Hole4); pkg.WriteInt(info.Hole5); pkg.WriteInt(info.Hole6); pkg.WriteString(info.Template.Pic); pkg.WriteInt(info.Template.RefineryLevel); pkg.WriteDateTime(DateTime.Now); pkg.WriteByte((byte)info.Hole5Level); pkg.WriteInt(info.Hole5Exp); pkg.WriteByte((byte)info.Hole6Level); pkg.WriteInt(info.Hole6Exp); if (info.IsGold) { pkg.WriteBoolean(info.IsGold);//_loc_8.isGold = _loc_2.readBoolean(); pkg.WriteInt(365);//_loc_8.goldValidDate = _loc_2.readInt(); pkg.WriteDateTime(DateTime.Now);//_loc_8.goldBeginTime = _loc_2.readDateString(); } else { pkg.WriteBoolean(false); } } pkg.Compress(); SendTCP(pkg); return pkg; }
public GSPacketIn SendUserEquip(PlayerInfo player, List<ItemInfo> items) { GSPacketIn pkg = new GSPacketIn((byte)ePackageType.ITEM_EQUIP, player.ID, 10240); pkg.WriteInt(player.ID); pkg.WriteInt(player.Agility); pkg.WriteInt(player.Attack); pkg.WriteString(player.Colors); pkg.WriteString(player.Skin); pkg.WriteInt(player.Defence); pkg.WriteInt(player.GP); pkg.WriteInt(player.Grade); pkg.WriteInt(player.Luck); pkg.WriteInt(player.Hide); pkg.WriteInt(player.Repute); pkg.WriteBoolean(player.Sex); pkg.WriteString(player.Style); pkg.WriteInt(player.Offer); pkg.WriteString(player.NickName); pkg.WriteBoolean(true); pkg.WriteInt(5); pkg.WriteInt(player.Win); pkg.WriteInt(player.Total); pkg.WriteInt(player.Escape); pkg.WriteInt(player.ConsortiaID); pkg.WriteString(player.ConsortiaName); pkg.WriteInt(player.RichesOffer); pkg.WriteInt(player.RichesRob); pkg.WriteBoolean(player.IsMarried); pkg.WriteInt(player.SpouseID); pkg.WriteString(player.SpouseName); pkg.WriteString(player.DutyName); pkg.WriteInt(player.Nimbus); pkg.WriteInt(player.FightPower); pkg.WriteInt(5); pkg.WriteInt(-1); pkg.WriteString("Master"); pkg.WriteInt(5); pkg.WriteString("HoNorMaster"); //AchievementPoint pkg.WriteInt(9999); pkg.WriteString("Honor"); pkg.WriteDateTime(DateTime.Now.AddDays(-2)); pkg.WriteInt(items.Count); foreach (ItemInfo info in items) { pkg.WriteByte((byte)info.BagType); pkg.WriteInt(info.UserID); pkg.WriteInt(info.ItemID); pkg.WriteInt(info.Count); pkg.WriteInt(info.Place); pkg.WriteInt(info.TemplateID); pkg.WriteInt(info.AttackCompose); pkg.WriteInt(info.DefendCompose); pkg.WriteInt(info.AgilityCompose); pkg.WriteInt(info.LuckCompose); pkg.WriteInt(info.StrengthenLevel); pkg.WriteBoolean(info.IsBinds); pkg.WriteBoolean(info.IsJudge); pkg.WriteDateTime(info.BeginDate); pkg.WriteInt(info.ValidDate); pkg.WriteString(info.Color); pkg.WriteString(info.Skin); pkg.WriteBoolean(info.IsUsed); pkg.WriteInt(info.Hole1); pkg.WriteInt(info.Hole2); pkg.WriteInt(info.Hole3); pkg.WriteInt(info.Hole4); pkg.WriteInt(info.Hole5); pkg.WriteInt(info.Hole6); pkg.WriteString(info.Template.Pic); pkg.WriteInt(info.Template.RefineryLevel); pkg.WriteDateTime(DateTime.Now); pkg.WriteByte(5); pkg.WriteInt(5); pkg.WriteByte(5); pkg.WriteInt(5); //item.Hole5Level = pkg.readByte(); //item.Hole5Exp = pkg.readInt(); //item.Hole6Level = pkg.readByte(); //item.Hole6Exp = pkg.readInt(); } pkg.Compress(); SendTCP(pkg); return pkg; }
public GSPacketIn SendMarryRoomInfoToPlayer(GamePlayer player, bool state, MarryRoomInfo info) { GSPacketIn pkg = new GSPacketIn((byte)ePackageType.MARRY_ROOM_STATE, player.PlayerCharacter.ID); pkg.WriteBoolean(state); if (state) { pkg.WriteInt(info.ID); pkg.WriteString(info.Name); pkg.WriteInt(info.MapIndex); pkg.WriteInt(info.AvailTime); //pkg.WriteInt(info.Count); //pkg.WriteInt(room.Player.PlayerCharacter.ID); //pkg.WriteInt(room.Groom.PlayerCharacter.ID); //pkg.WriteInt(room.Bride.PlayerCharacter.ID); pkg.WriteInt(info.PlayerID); pkg.WriteInt(info.GroomID); pkg.WriteInt(info.BrideID); pkg.WriteDateTime(info.BeginTime); //pkg.WriteBoolean(info.IsHymeneal); pkg.WriteBoolean(info.IsGunsaluteUsed); } SendTCP(pkg); return pkg; }
internal void SendCreateGame() { GSPacketIn pkg = new GSPacketIn((byte)ePackageType.GAME_CMD); pkg.WriteByte((byte)eTankCmdType.GAME_CREATE); //pkg.WriteInt(m_map.Info.ID); pkg.WriteInt((byte)m_roomType); pkg.WriteInt((byte)m_gameType); pkg.WriteInt(m_timeType); List<Player> players = GetAllFightPlayers(); pkg.WriteInt(players.Count); foreach (Player p in players) { IGamePlayer gp = p.PlayerDetail; pkg.WriteInt(4); pkg.WriteString("zonename"); pkg.WriteInt(gp.PlayerCharacter.ID); pkg.WriteString(gp.PlayerCharacter.NickName); //isvip pkg.WriteBoolean(true); //viplevel pkg.WriteInt(5); pkg.WriteBoolean(gp.PlayerCharacter.Sex); pkg.WriteInt(gp.PlayerCharacter.Hide); pkg.WriteString(gp.PlayerCharacter.Style); pkg.WriteString(gp.PlayerCharacter.Colors); pkg.WriteString(gp.PlayerCharacter.Skin); pkg.WriteInt(gp.PlayerCharacter.Grade); pkg.WriteInt(gp.PlayerCharacter.Repute); if (gp.MainWeapon == null) { pkg.WriteInt(0); } else { pkg.WriteInt(gp.MainWeapon.TemplateID); } pkg.WriteInt(12); pkg.WriteString(" "); pkg.WriteDateTime(DateTime.Now); pkg.WriteInt(0); pkg.WriteInt(gp.PlayerCharacter.Nimbus); pkg.WriteInt(gp.PlayerCharacter.ConsortiaID);// pkg.WriteInt(0); pkg.WriteString(gp.PlayerCharacter.ConsortiaName); pkg.WriteInt(gp.PlayerCharacter.ConsortiaLevel); pkg.WriteInt(gp.PlayerCharacter.ConsortiaRepute); pkg.WriteInt(gp.PlayerCharacter.Win); pkg.WriteInt(gp.PlayerCharacter.Total); pkg.WriteInt(gp.PlayerCharacter.FightPower); pkg.WriteInt(5); pkg.WriteInt(0); pkg.WriteString("Master"); //pkg.WriteInt(5); pkg.WriteInt(5); pkg.WriteString("honor"); pkg.WriteBoolean(gp.PlayerCharacter.IsMarried); if (gp.PlayerCharacter.IsMarried) { pkg.WriteInt(gp.PlayerCharacter.SpouseID); pkg.WriteString(gp.PlayerCharacter.SpouseName); } pkg.WriteInt(5); pkg.WriteInt(5); pkg.WriteInt(5); pkg.WriteInt(5); pkg.WriteInt(5); pkg.WriteInt(5); pkg.WriteInt(p.Team); pkg.WriteInt(p.Id); pkg.WriteInt(p.MaxBlood); } SendToAll(pkg); }
private void SendCreateGameToSingle(PVEGame game, IGamePlayer gamePlayer) { GSPacketIn pkg = new GSPacketIn((byte)ePackageType.GAME_CMD); pkg.WriteByte((byte)eTankCmdType.GAME_ROOM_INFO); pkg.WriteInt(game.Map.Info.ID); pkg.WriteInt((byte)game.RoomType); pkg.WriteInt((byte)game.GameType); pkg.WriteInt(game.TimeType); List<Player> players = game.GetAllFightPlayers(); pkg.WriteInt(players.Count); foreach (Player p in players) { IGamePlayer gp = p.PlayerDetail; pkg.WriteInt(gp.PlayerCharacter.ID); //zoneid //pkg.WriteInt(4); pkg.WriteString(gp.PlayerCharacter.NickName); //isvip pkg.WriteBoolean(true); pkg.WriteInt(5); pkg.WriteBoolean(gp.PlayerCharacter.Sex); pkg.WriteInt(gp.PlayerCharacter.Hide); pkg.WriteString(gp.PlayerCharacter.Style); pkg.WriteString(gp.PlayerCharacter.Colors); pkg.WriteString(gp.PlayerCharacter.Skin); pkg.WriteInt(gp.PlayerCharacter.Grade); pkg.WriteInt(gp.PlayerCharacter.Repute); if (gp.MainWeapon == null) { pkg.WriteInt(0); } else { pkg.WriteInt(gp.MainWeapon.TemplateID); pkg.WriteInt(0); pkg.WriteString(""); pkg.WriteDateTime(DateTime.MinValue); } pkg.WriteInt(0); pkg.WriteInt(gp.PlayerCharacter.ConsortiaID); pkg.WriteString(gp.PlayerCharacter.ConsortiaName); pkg.WriteInt(gp.PlayerCharacter.ConsortiaLevel); pkg.WriteInt(gp.PlayerCharacter.ConsortiaRepute); pkg.WriteInt(p.Team); pkg.WriteInt(p.Id); pkg.WriteInt(p.MaxBlood); pkg.WriteBoolean(p.Ready); } MissionInfo missionInfo = game.Misssions[game.SessionId - 1]; pkg.WriteString(missionInfo.Name); pkg.WriteString(missionInfo.Name); pkg.WriteString(missionInfo.Success); pkg.WriteString(missionInfo.Failure); pkg.WriteString(missionInfo.Description); pkg.WriteInt(game.TotalMissionCount); pkg.WriteInt(game.SessionId - 1); gamePlayer.SendTCP(pkg); }
public void SendOpenWorldBoss() { GSPacketIn packet = new GSPacketIn((byte)ePackageType.WORLDBOSS_CMD); packet.WriteByte((byte)WorldBossPackageType.OPEN); packet.WriteInt(1243);//_currentPVE_ID = event.pkg.readInt(); packet.WriteString("World Boss1");//event.pkg.readUTF(); packet.WriteString("Cuồng Long");//_bossInfo.name = event.pkg.readUTF(); packet.WriteLong(8000);//_bossInfo.total_Blood = event.pkg.readLong(); packet.WriteInt(0);//var _loc_2:* = event.pkg.readInt(); packet.WriteInt(0);//var _loc_3:* = event.pkg.readInt(); packet.WriteString("World Boss2");//event.pkg.readUTF(); packet.WriteInt(800); packet.WriteInt(560);//_bossInfo.playerDefaultPos = new Point(event.pkg.readInt(), event.pkg.readInt()); packet.WriteDateTime(DateTime.Now);//_bossInfo.begin_time = event.pkg.readDate(); packet.WriteDateTime(DateTime.Now.AddDays(1));//_bossInfo.end_time = event.pkg.readDate(); packet.WriteInt(45);//_bossInfo.fight_time = event.pkg.readInt(); packet.WriteBoolean(false);//_bossInfo.fightOver = event.pkg.readBoolean(); packet.WriteBoolean(false);//_bossInfo.roomClose = event.pkg.readBoolean(); packet.WriteInt(1);//_bossInfo.ticketID = event.pkg.readInt(); packet.WriteInt(1);//_bossInfo.need_ticket_count = event.pkg.readInt(); packet.WriteInt(33);//_bossInfo.timeCD = event.pkg.readInt(); packet.WriteInt(0);//_bossInfo.reviveMoney = event.pkg.readInt(); packet.WriteInt(0);//var _loc_4:* = event.pkg.readInt(); //while (_loc_5 < _loc_4) //{ packet.WriteInt(0); //_loc_6.ID = event.pkg.readInt(); packet.WriteString("Tăng dame"); //_loc_6.name = event.pkg.readUTF(); packet.WriteInt(30); //_loc_6.price = event.pkg.readInt(); packet.WriteString("Tăng dame gấp 10000 lần"); //_loc_6.decription = event.pkg.readUTF(); //} SendTCP(packet); //return packet; }
public GSPacketIn SendOpenVIP(GamePlayer Player) { GSPacketIn packet = new GSPacketIn((byte)ePackageType.VIP_RENEWAL, Player.PlayerCharacter.ID); packet.WriteByte(Player.PlayerCharacter.typeVIP); packet.WriteInt(Player.PlayerCharacter.VIPLevel); packet.WriteInt(Player.PlayerCharacter.VIPExp); packet.WriteDateTime(Player.PlayerCharacter.VIPExpireDay); packet.WriteDateTime(Player.PlayerCharacter.VIPLastDate); packet.WriteInt(Player.PlayerCharacter.VIPNextLevelDaysNeeded); packet.WriteBoolean(Player.PlayerCharacter.CanTakeVipReward); SendTCP(packet); return packet; }
public void SendLoginSuccess() { if (m_gameClient.Player == null) return; GSPacketIn pkg = new GSPacketIn((byte)ePackageType.LOGIN, m_gameClient.Player.PlayerCharacter.ID); pkg.WriteByte(0); pkg.WriteInt(4);//_loc_3.ZoneID = _loc_2.readInt(); pkg.WriteInt(m_gameClient.Player.PlayerCharacter.Attack);//_loc_3.Attack = _loc_2.readInt(); pkg.WriteInt(m_gameClient.Player.PlayerCharacter.Defence);//_loc_3.Defence = _loc_2.readInt(); pkg.WriteInt(m_gameClient.Player.PlayerCharacter.Agility); //_loc_3.Agility = _loc_2.readInt(); pkg.WriteInt(m_gameClient.Player.PlayerCharacter.Luck);//_loc_3.Luck = _loc_2.readInt(); pkg.WriteInt(m_gameClient.Player.PlayerCharacter.GP);//_loc_3.GP = _loc_2.readInt(); pkg.WriteInt(m_gameClient.Player.PlayerCharacter.Repute);//_loc_3.Repute = _loc_2.readInt(); pkg.WriteInt(m_gameClient.Player.PlayerCharacter.Gold);//_loc_3.Gold = _loc_2.readInt(); pkg.WriteInt(m_gameClient.Player.PlayerCharacter.Money);//_loc_3.Money = _loc_2.readInt(); pkg.WriteInt(m_gameClient.Player.PlayerCharacter.GiftToken);//_loc_3.DDTMoney = _loc_2.readInt(); pkg.WriteInt(1);//_loc_3.Score = _loc_2.readInt(); pkg.WriteInt(m_gameClient.Player.PlayerCharacter.Hide);//_loc_3.Hide = _loc_2.readInt(); pkg.WriteInt(m_gameClient.Player.PlayerCharacter.FightPower);//_loc_3.FightPower = _loc_2.readInt(); pkg.WriteInt(5);//_loc_3.apprenticeshipState pkg.WriteInt(-1);//_loc_3.masterID pkg.WriteString("Master");// _loc_3.setMasterOrApprentices pkg.WriteInt(0);//_loc_3.graduatesCount pkg.WriteString("HoNorMaster");//_loc_3.honourOfMaster pkg.WriteDateTime(DateTime.Now.AddDays(50));//_loc_3.freezesDate = _loc_2.readDate(); pkg.WriteByte(m_gameClient.Player.PlayerCharacter.typeVIP); //_loc_3.typeVIP = _loc_2.readByte(); pkg.WriteInt(m_gameClient.Player.PlayerCharacter.VIPLevel); pkg.WriteInt(m_gameClient.Player.PlayerCharacter.VIPExp); pkg.WriteDateTime(m_gameClient.Player.PlayerCharacter.VIPExpireDay); pkg.WriteDateTime(m_gameClient.Player.PlayerCharacter.LastDate); pkg.WriteInt(m_gameClient.Player.PlayerCharacter.VIPOnlineDays); pkg.WriteDateTime(DateTime.Now); pkg.WriteBoolean(m_gameClient.Player.PlayerCharacter.CanTakeVipReward); pkg.WriteInt(0); pkg.WriteInt(m_gameClient.Player.PlayerCharacter.AchievementPoint); pkg.WriteString("Tân binh Gunny"); pkg.WriteInt(m_gameClient.Player.PlayerCharacter.OnlineTime); pkg.WriteBoolean(m_gameClient.Player.PlayerCharacter.Sex); pkg.WriteString(m_gameClient.Player.PlayerCharacter.Style + "&" + m_gameClient.Player.PlayerCharacter.Colors); pkg.WriteString(m_gameClient.Player.PlayerCharacter.Skin); pkg.WriteInt(m_gameClient.Player.PlayerCharacter.ConsortiaID); pkg.WriteString(m_gameClient.Player.PlayerCharacter.ConsortiaName); pkg.WriteInt(0);//_loc_3.badgeID = _loc_2.readInt(); pkg.WriteInt(m_gameClient.Player.PlayerCharacter.DutyLevel); pkg.WriteString(m_gameClient.Player.PlayerCharacter.DutyName); pkg.WriteInt(m_gameClient.Player.PlayerCharacter.Right); pkg.WriteString(m_gameClient.Player.PlayerCharacter.ChairmanName); pkg.WriteInt(m_gameClient.Player.PlayerCharacter.ConsortiaHonor); pkg.WriteInt(m_gameClient.Player.PlayerCharacter.ConsortiaRiches); pkg.WriteBoolean(m_gameClient.Player.PlayerCharacter.HasBagPassword); pkg.WriteString(m_gameClient.Player.PlayerCharacter.PasswordQuest1); pkg.WriteString(m_gameClient.Player.PlayerCharacter.PasswordQuest2); pkg.WriteInt(m_gameClient.Player.PlayerCharacter.FailedPasswordAttemptCount); pkg.WriteString(m_gameClient.Player.PlayerCharacter.UserName); pkg.WriteInt(m_gameClient.Player.PlayerCharacter.Nimbus); pkg.WriteString(m_gameClient.Player.PlayerCharacter.PvePermission); pkg.WriteString(m_gameClient.Player.PlayerCharacter.FightLabPermission); pkg.WriteInt(m_gameClient.Player.PlayerCharacter.AnswerSite); pkg.WriteInt(1);//receiebox = _loc_2.readInt(); pkg.WriteInt(6);//receieGrade = _loc_2.readInt(); pkg.WriteInt(30);//needGetBoxTime = _loc_2.readInt(); pkg.WriteDateTime(m_gameClient.Player.PlayerCharacter.LastSpaDate); pkg.WriteDateTime(DateTime.Now.AddDays(-5)); pkg.WriteInt(m_gameClient.Player.PlayerCharacter.Offer);//_loc_3.UseOffer = _loc_2.readInt(); pkg.WriteInt(m_gameClient.Player.PlayerCharacter.Offer);//_loc_3.matchInfo.dailyScore = _loc_2.readInt(); pkg.WriteInt(m_gameClient.Player.PlayerCharacter.Offer);//_loc_3.matchInfo.dailyWinCount = _loc_2.readInt(); pkg.WriteInt(m_gameClient.Player.PlayerCharacter.Offer);//_loc_3.matchInfo.dailyGameCount = _loc_2.readInt(); pkg.WriteBoolean(m_gameClient.Player.PlayerCharacter.Sex);//_loc_3.DailyLeagueFirst = _loc_2.readBoolean(); pkg.WriteInt(m_gameClient.Player.PlayerCharacter.Offer);//_loc_3.DailyLeagueLastScore = _loc_2.readInt(); pkg.WriteInt(m_gameClient.Player.PlayerCharacter.Offer);//_loc_3.matchInfo.weeklyScore = _loc_2.readInt(); pkg.WriteInt(m_gameClient.Player.PlayerCharacter.Offer);//_loc_3.matchInfo.weeklyGameCount = _loc_2.readInt(); pkg.WriteInt(m_gameClient.Player.PlayerCharacter.Offer);//_loc_3.matchInfo.weeklyRanking = _loc_2.readInt(); pkg.WriteInt(m_gameClient.Player.PlayerCharacter.Offer);//_loc_3.spdTexpExp = _loc_2.readInt(); pkg.WriteInt(m_gameClient.Player.PlayerCharacter.Offer);//_loc_3.attTexpExp = _loc_2.readInt(); pkg.WriteInt(m_gameClient.Player.PlayerCharacter.Offer);//_loc_3.defTexpExp = _loc_2.readInt(); pkg.WriteInt(m_gameClient.Player.PlayerCharacter.Offer);//_loc_3.hpTexpExp = _loc_2.readInt(); pkg.WriteInt(m_gameClient.Player.PlayerCharacter.Offer);//_loc_3.lukTexpExp = _loc_2.readInt(); pkg.WriteInt(m_gameClient.Player.PlayerCharacter.Offer);//_loc_3.texpTaskCount = _loc_2.readInt(); pkg.WriteInt(m_gameClient.Player.PlayerCharacter.Offer);//_loc_3.texpCount = _loc_2.readInt(); pkg.WriteDateTime(DateTime.Now.AddDays(-5));//_loc_3.texpTaskDate = _loc_2.readDate(); pkg.WriteBoolean(false);//_loc_3.isOldPlayerHasValidEquitAtLogin = _loc_2.readBoolean(); pkg.WriteInt(1);//_loc_3.badLuckNumber = _loc_2.readInt(); pkg.WriteInt(m_gameClient.Player.PlayerCharacter.Offer);//_loc_3.luckyNum = _loc_2.readInt(); pkg.WriteDateTime(DateTime.Now.AddDays(-5));//_loc_3.lastLuckyNumDate = _loc_2.readDate(); pkg.WriteInt(m_gameClient.Player.PlayerCharacter.Offer);//_loc_3.lastLuckNum = _loc_2.readInt(); pkg.WriteBoolean(m_gameClient.Player.PlayerCharacter.IsOldPlayer);//_loc_3.isOld = _loc_2.readBoolean(); pkg.WriteInt(10000);//_loc_3.CardSoul = _loc_2.readInt(); pkg.WriteInt(0);//_loc_3.uesedFinishTime = _loc_2.readInt(); SendTCP(pkg); }
public GSPacketIn SendHotSpringRoomInfo(GamePlayer player, HotSpringRoom[] allHotRoom) { GSPacketIn packet = new GSPacketIn((byte)ePackageType.HOTSPRING_ROOM_LIST_GET, player.PlayerCharacter.ID); packet.WriteInt(allHotRoom.Length); foreach (HotSpringRoom room in allHotRoom) { packet.WriteInt(room.Info.RoomNumber); packet.WriteInt(room.Info.RoomID); packet.WriteString(room.Info.RoomName); packet.WriteString(room.Info.Pwd); packet.WriteInt(room.Info.AvailTime); packet.WriteInt(room.Count); packet.WriteInt(player.PlayerCharacter.ID); packet.WriteString(player.PlayerCharacter.UserName); packet.WriteDateTime(room.Info.BeginTime); packet.WriteString(room.Info.RoomIntroduction); packet.WriteInt(room.Info.RoomType); packet.WriteInt(room.Info.MaxCount); } SendTCP(packet); return packet; }
public GSPacketIn SendEnterFarm(GamePlayer Player) { GSPacketIn packet = new GSPacketIn((byte)ePackageType.FARM); packet.WriteByte((byte)FarmPackageType.ENTER_FARM); packet.WriteInt(Player.PlayerCharacter.ID);//_model.currentFarmerId = _loc_2.readInt(); packet.WriteBoolean(false);// _loc_3:* = _loc_2.readBoolean();//isAutomatic packet.WriteInt(332112);// _loc_4:* = _loc_2.readInt();//autoSeedID packet.WriteDateTime(DateTime.Now);// _loc_5:* = _loc_2.readDate();//startdate packet.WriteInt(12);// _loc_6:* = _loc_2.readInt();//_autoTime packet.WriteInt(8);// _loc_7:* = _loc_2.readInt();//_needSeed packet.WriteInt(80);// _loc_8:* = _loc_2.readInt();//_getSeed packet.WriteInt(8);// _loc_9:* = _loc_2.readInt();//field count for (int i = 0; i < 8; i++) { packet.WriteInt(i);//_loc_11 = _loc_2.readInt();//fieldID packet.WriteInt(332112);//_loc_12 = _loc_2.readInt();//seedID :332112 packet.WriteDateTime(DateTime.Now);//_loc_13 = _loc_2.readDate();//payTime packet.WriteDateTime(DateTime.Now);//_loc_14 = _loc_2.readDate();//plantTime packet.WriteInt(10);//_loc_15 = _loc_2.readInt();//gainCount packet.WriteInt(0);//_loc_16 = _loc_2.readInt();//fieldValidDate packet.WriteInt(30);//_loc_17 = _loc_2.readInt();//AccelerateTime } packet.WriteString("300,1000|1000,2000");//_model.payFieldMoney = _loc_2.readUTF(); packet.WriteString("300,1000|1000,2000");//_model.payAutoMoney = _loc_2.readUTF(); packet.WriteDateTime(DateTime.Now.AddDays(-1));//_model.autoPayTime = _loc_2.readDate(); packet.WriteInt(0);//_model.autoValidDate = _loc_2.readInt(); packet.WriteInt(Player.PlayerCharacter.VIPLevel);//_model.vipLimitLevel = _loc_2.readInt(); of player SendTCP(packet); return packet; }
public GSPacketIn SendMarryRoomInfo(GamePlayer player, MarryRoom room) { GSPacketIn pkg = new GSPacketIn((byte)ePackageType.MARRY_ROOM_CREATE, player.PlayerCharacter.ID); bool result = room != null; pkg.WriteBoolean(result); if (result) { pkg.WriteInt(room.Info.ID); pkg.WriteBoolean(room.Info.IsHymeneal); pkg.WriteString(room.Info.Name); pkg.WriteBoolean(room.Info.Pwd == "" ? false : true); pkg.WriteInt(room.Info.MapIndex); pkg.WriteInt(room.Info.AvailTime); pkg.WriteInt(room.Count); pkg.WriteInt(room.Info.PlayerID); pkg.WriteString(room.Info.PlayerName); pkg.WriteInt(room.Info.GroomID); pkg.WriteString(room.Info.GroomName); pkg.WriteInt(room.Info.BrideID); pkg.WriteString(room.Info.BrideName); pkg.WriteDateTime(room.Info.BeginTime); pkg.WriteByte((byte)room.RoomState); pkg.WriteString(room.Info.RoomIntroduction); } SendTCP(pkg); return pkg; }
public GSPacketIn SendMarryRoomLogin(GamePlayer player, bool result) { GSPacketIn pkg = new GSPacketIn((byte)ePackageType.MARRY_ROOM_LOGIN, player.PlayerCharacter.ID); pkg.WriteBoolean(result); if (result) { pkg.WriteInt(player.CurrentMarryRoom.Info.ID); pkg.WriteString(player.CurrentMarryRoom.Info.Name); pkg.WriteInt(player.CurrentMarryRoom.Info.MapIndex); pkg.WriteInt(player.CurrentMarryRoom.Info.AvailTime); pkg.WriteInt(player.CurrentMarryRoom.Count); //pkg.WriteInt(room.Player.PlayerCharacter.ID); //pkg.WriteInt(room.Groom.PlayerCharacter.ID); //pkg.WriteInt(room.Bride.PlayerCharacter.ID); pkg.WriteInt(player.CurrentMarryRoom.Info.PlayerID); pkg.WriteString(player.CurrentMarryRoom.Info.PlayerName); pkg.WriteInt(player.CurrentMarryRoom.Info.GroomID); pkg.WriteString(player.CurrentMarryRoom.Info.GroomName); pkg.WriteInt(player.CurrentMarryRoom.Info.BrideID); pkg.WriteString(player.CurrentMarryRoom.Info.BrideName); pkg.WriteDateTime(player.CurrentMarryRoom.Info.BeginTime); pkg.WriteBoolean(player.CurrentMarryRoom.Info.IsHymeneal); pkg.WriteByte((byte)player.CurrentMarryRoom.RoomState); pkg.WriteString(player.CurrentMarryRoom.Info.RoomIntroduction); pkg.WriteBoolean(player.CurrentMarryRoom.Info.GuestInvite); pkg.WriteInt(player.MarryMap); pkg.WriteBoolean(player.CurrentMarryRoom.Info.IsGunsaluteUsed); } SendTCP(pkg); return pkg; }
public void SendConsortiaUserPass(int playerid, string playerName, ConsortiaUserInfo info, bool isInvite, int consortiaRepute, string loginName,int fightpower) { GSPacketIn pkg = new GSPacketIn((byte)eChatServerPacket.CONSORTIA_RESPONSE, playerid); pkg.WriteByte(1); pkg.WriteInt(info.ID); pkg.WriteBoolean(isInvite); pkg.WriteInt(info.ConsortiaID); pkg.WriteString(info.ConsortiaName); pkg.WriteInt(info.UserID); pkg.WriteString(info.UserName); pkg.WriteInt(playerid); pkg.WriteString(playerName); pkg.WriteInt(info.DutyID); pkg.WriteString(info.DutyName); pkg.WriteInt(info.Offer); pkg.WriteInt(info.RichesOffer); pkg.WriteInt(info.RichesRob); pkg.WriteDateTime(info.LastDate); pkg.WriteInt(info.Grade); pkg.WriteInt(info.Level); pkg.WriteInt(info.State); pkg.WriteBoolean(info.Sex); pkg.WriteInt(info.Right); pkg.WriteInt(info.Win); pkg.WriteInt(info.Total); pkg.WriteInt(info.Escape); pkg.WriteInt(consortiaRepute); pkg.WriteString(loginName); pkg.WriteInt(fightpower); pkg.WriteInt(500); //New pkg.WriteString("Honor"); SendTCP(pkg); }
public GSPacketIn SendUpdatePublicPlayer(PlayerInfo info) { GSPacketIn pkg = new GSPacketIn((byte)ePackageType.UPDATE_PlAYER_INFO, info.ID); pkg.WriteInt(info.GP); pkg.WriteInt(info.Offer); pkg.WriteInt(info.RichesOffer); pkg.WriteInt(info.RichesRob); pkg.WriteInt(info.Win); pkg.WriteInt(info.Total); pkg.WriteInt(info.Escape); pkg.WriteInt(info.Attack); pkg.WriteInt(info.Defence); pkg.WriteInt(info.Agility); pkg.WriteInt(info.Luck); pkg.WriteInt(info.Hide); //pkg.WriteInt(info.Grade); pkg.WriteString(info.Style); pkg.WriteString(info.Colors); pkg.WriteString(info.Skin); pkg.WriteInt(info.ConsortiaID); pkg.WriteString(info.ConsortiaName); pkg.WriteInt(info.ConsortiaLevel); pkg.WriteInt(info.ConsortiaRepute); pkg.WriteInt(info.Nimbus); //PVE难度等级测试 pkg.WriteString(info.PvePermission); //fightPermission //pkg.WriteString(info.PvePermission); pkg.WriteString("1"); pkg.WriteInt(info.FightPower); //info.apprenticeshipState = pkg.readInt(); //info.masterID = pkg.readInt(); //info.setMasterOrApprentices(pkg.readUTF()); //info.graduatesCount = pkg.readInt(); //info.honourOfMaster = pkg.readUTF(); pkg.WriteInt(1); pkg.WriteInt(-1); pkg.WriteString("ss"); pkg.WriteInt(1); pkg.WriteString("ss"); ////AchievementPoint pkg.WriteInt(0); ////honor pkg.WriteString("honor"); //LastSpaDate if (info.ExpendDate != null) pkg.WriteDateTime((DateTime)info.ExpendDate); else { pkg.WriteDateTime(DateTime.MinValue); } //charmgp pkg.WriteInt(100); //consortiaCharmGP pkg.WriteInt(100); pkg.WriteDateTime(DateTime.MinValue); ////DeputyWeaponID pkg.WriteInt(10001); pkg.WriteInt(0); // box gi ko biet pkg.WriteInt(info.AnswerSite); // pkg.WriteInt(0); SendTCP(pkg); return pkg; }
internal void SendCreateGame() { GSPacketIn pkg = new GSPacketIn((byte)ePackageType.GAME_CMD); pkg.WriteByte((byte)eTankCmdType.GAME_CREATE); pkg.WriteInt((byte)m_roomType); pkg.WriteInt((byte)m_gameType); pkg.WriteInt(m_timeType); List<Player> players = GetAllFightPlayers(); pkg.WriteInt(players.Count); foreach (Player p in players) { IGamePlayer gp = p.PlayerDetail; pkg.WriteInt(4); pkg.WriteString("zonename"); pkg.WriteInt(gp.PlayerCharacter.ID); pkg.WriteString(gp.PlayerCharacter.NickName); pkg.WriteBoolean(false);//_loc_12 = _loc_2.readBoolean(); pkg.WriteByte(gp.PlayerCharacter.typeVIP); pkg.WriteInt(gp.PlayerCharacter.VIPLevel); pkg.WriteBoolean(gp.PlayerCharacter.Sex); pkg.WriteInt(gp.PlayerCharacter.Hide); pkg.WriteString(gp.PlayerCharacter.Style); pkg.WriteString(gp.PlayerCharacter.Colors); pkg.WriteString(gp.PlayerCharacter.Skin); pkg.WriteInt(gp.PlayerCharacter.Grade); pkg.WriteInt(gp.PlayerCharacter.Repute); pkg.WriteInt(gp.MainWeapon.TemplateID); pkg.WriteInt(gp.MainWeapon.RefineryLevel); pkg.WriteString(gp.MainWeapon.Name); pkg.WriteDateTime(DateTime.Now); if (gp.SecondWeapon == null) { pkg.WriteInt(0); } else { pkg.WriteInt(gp.SecondWeapon.TemplateID); } pkg.WriteInt(gp.PlayerCharacter.Nimbus); pkg.WriteInt(gp.PlayerCharacter.ConsortiaID); pkg.WriteString(gp.PlayerCharacter.ConsortiaName); pkg.WriteInt(0);//_loc_9.badgeID = _loc_2.readInt(); pkg.WriteInt(0);//_loc_13 = _loc_2.readInt(); pkg.WriteInt(0);//_loc_14 = _loc_2.readInt(); pkg.WriteInt(gp.PlayerCharacter.Win); pkg.WriteInt(gp.PlayerCharacter.Total); pkg.WriteInt(gp.PlayerCharacter.FightPower); pkg.WriteInt(5);//apprenticeshipState = _loc_2.readInt(); pkg.WriteInt(0);//masterID = _loc_2.readInt(); pkg.WriteString("Master");//setMasterOrApprentices(_loc_2.readUTF()); pkg.WriteInt(gp.PlayerCharacter.AchievementPoint);//AchievementPoint = _loc_2.readInt(); pkg.WriteString("honor");//honor = _loc_2.readUTF(); pkg.WriteInt(gp.PlayerCharacter.Offer);//_loc_9.Offer = _loc_2.readInt(); pkg.WriteBoolean(false);//_loc_9.DailyLeagueFirst = _loc_2.readBoolean(); pkg.WriteInt(0);//_loc_9.DailyLeagueLastScore = _loc_2.readInt(); pkg.WriteBoolean(gp.PlayerCharacter.IsMarried); if (gp.PlayerCharacter.IsMarried) { pkg.WriteInt(gp.PlayerCharacter.SpouseID); pkg.WriteString(gp.PlayerCharacter.SpouseName); } pkg.WriteInt(5); //GMExperienceAddition pkg.WriteInt(5); //AuncherExperienceAddition pkg.WriteInt(5); //GMOfferAddition pkg.WriteInt(5); //AuncherOfferAddition pkg.WriteInt(5); //GMRichesAddition pkg.WriteInt(5); //AuncherRichesAddition pkg.WriteInt(p.Team); pkg.WriteInt(p.Id); pkg.WriteInt(p.MaxBlood); pkg.WriteInt(1);//_loc_18 = _loc_2.readInt(); for (int i = 0; i < 1; i++) { pkg.WriteInt(i);//_loc_20 = _loc_2.readInt();Place pkg.WriteInt(140403);//_loc_22 = _loc_2.readInt();TemplateID pkg.WriteInt(1);//_loc_21.ID = _loc_2.readInt(); pkg.WriteString("远古魔龙");//_loc_21.Name = _loc_2.readUTF(); pkg.WriteInt(gp.PlayerCharacter.ID);//_loc_21.UserID = _loc_2.readInt(); pkg.WriteInt(60);//_loc_21.Level = _loc_2.readInt(); pkg.WriteInt(3);//_loc_23 = _loc_2.readInt(); for (int ii = 0; ii < 3; ii++) { pkg.WriteInt(ii);//_loc_25 = _loc_2.readInt(); pkg.WriteInt(ii + 110);//_loc_26 = _loc_2.readInt(); } } } SendToAll(pkg); }
public void SendDateTime() { GSPacketIn pkg = new GSPacketIn((byte)ePackageType.SYS_DATE); pkg.WriteDateTime(DateTime.Now); SendTCP(pkg); }
public GSPacketIn SendUpdatePublicPlayer(PlayerInfo info) { GSPacketIn pkg = new GSPacketIn((byte)ePackageType.UPDATE_PLAYER_INFO, info.ID); pkg.WriteInt(info.GP); pkg.WriteInt(info.Offer); pkg.WriteInt(info.RichesOffer); pkg.WriteInt(info.RichesRob); pkg.WriteInt(info.Win); pkg.WriteInt(info.Total); pkg.WriteInt(info.Escape); pkg.WriteInt(info.Attack); pkg.WriteInt(info.Defence); pkg.WriteInt(info.Agility); pkg.WriteInt(info.Luck); pkg.WriteInt(info.hp);//info.hp = pkg.readInt(); pkg.WriteInt(info.Hide); pkg.WriteString(info.Style); pkg.WriteString(info.Colors); pkg.WriteString(info.Skin); pkg.WriteBoolean(false);//info.IsShowConsortia = pkg.readBoolean(); pkg.WriteInt(info.ConsortiaID); pkg.WriteString(info.ConsortiaName); pkg.WriteInt(0);//info.badgeID = pkg.readInt(); pkg.WriteInt(info.ConsortiaLevel);//unknown1 = pkg.readInt(); pkg.WriteInt(info.ConsortiaRepute);//unknown2 = pkg.readInt(); pkg.WriteInt(info.Nimbus); pkg.WriteString(info.PvePermission); pkg.WriteString(info.FightLabPermission); pkg.WriteInt(info.FightPower); pkg.WriteInt(5);//apprenticeshipState = pkg.readInt(); pkg.WriteInt(-1);//masterID = pkg.readInt(); pkg.WriteString("Master");//setMasterOrApprentices(pkg.readUTF()); pkg.WriteInt(0);//graduatesCount = pkg.readInt(); pkg.WriteString("HoNorMaster");//honourOfMaster = pkg.readUTF(); pkg.WriteInt(info.AchievementPoint); pkg.WriteString("Danh hiệu Gunny"); //honor = pkg.readUTF(); pkg.WriteDateTime((DateTime)info.LastSpaDate); pkg.WriteInt(100);//charmgp pkg.WriteInt(100); //unknown3 = pkg.readInt(); pkg.WriteDateTime(DateTime.MinValue); //info.shopFinallyGottenTime pkg.WriteInt(info.Offer);//info.UseOffer = pkg.readInt(); pkg.WriteInt(info.Offer);//info.matchInfo.dailyScore = pkg.readInt(); pkg.WriteInt(info.Offer);//info.matchInfo.dailyWinCount = pkg.readInt(); pkg.WriteInt(info.Offer);//info.matchInfo.dailyGameCount = pkg.readInt(); pkg.WriteInt(info.Offer);//info.matchInfo.weeklyScore = pkg.readInt(); pkg.WriteInt(info.Offer);//info.matchInfo.weeklyGameCount = pkg.readInt(); pkg.WriteInt(info.Offer);//info.spdTexpExp = pkg.readInt(); pkg.WriteInt(info.Offer);//info.attTexpExp = pkg.readInt(); pkg.WriteInt(info.Offer);//info.defTexpExp = pkg.readInt(); pkg.WriteInt(info.Offer);//info.hpTexpExp = pkg.readInt(); pkg.WriteInt(info.Offer);//info.lukTexpExp = pkg.readInt(); pkg.WriteInt(info.Offer);//info.texpTaskCount = pkg.readInt(); pkg.WriteInt(info.Offer);//info.texpCount = pkg.readInt(); pkg.WriteDateTime(DateTime.Now.AddDays(-5));//info.texpTaskDate = pkg.readDate(); pkg.WriteInt(1);//len = pkg.readInt(); for (int i = 0; i < 1; i++) { pkg.WriteInt(1);//mapId = pkg.readInt(); pkg.WriteByte(1);//flag = pkg.readByte(); } SendTCP(pkg); return pkg; }
public void SendMarryRoomInfoToPlayer(int playerId, bool state, MarryRoomInfo info) { GSPacketIn pkg = new GSPacketIn((byte)eChatServerPacket.MARRY_ROOM_INFO_TO_PLAYER); pkg.WriteInt(playerId); pkg.WriteBoolean(state); if (state) { pkg.WriteInt(info.ID); pkg.WriteString(info.Name); pkg.WriteInt(info.MapIndex); pkg.WriteInt(info.AvailTime); pkg.WriteInt(info.PlayerID); pkg.WriteInt(info.GroomID); pkg.WriteInt(info.BrideID); pkg.WriteDateTime(info.BeginTime); pkg.WriteBoolean(info.IsGunsaluteUsed); } SendTCP(pkg); }
//public void SendUpdateInventorySlot(PlayerInventory bag, int[] updatedSlots) //{ // if (m_gameClient.Player == null) // return; // var numSend = updatedSlots.Length; // var j = 0; // do // { // GSPacketIn pkg = new GSPacketIn((byte)ePackageType.GRID_GOODS, m_gameClient.Player.PlayerCharacter.ID); // pkg.WriteInt(bag.BagType); // var length = (numSend > 10) ? 10 : numSend; // pkg.WriteInt(length); // for (int i = 0; i < length; i++, j++) // { // pkg.WriteInt(updatedSlots[i]); // ItemInfo item = bag.GetItemAt(updatedSlots[i]); // if (item == null) // { // pkg.WriteBoolean(false); // } // else // { // pkg.WriteBoolean(true); // pkg.WriteInt(item.UserID); // pkg.WriteInt(item.ItemID); // pkg.WriteInt(item.Count); // pkg.WriteInt(item.Place); // pkg.WriteInt(item.TemplateID); // pkg.WriteInt(item.AttackCompose); // pkg.WriteInt(item.DefendCompose); // pkg.WriteInt(item.AgilityCompose); // pkg.WriteInt(item.LuckCompose); // pkg.WriteInt(item.StrengthenLevel); // pkg.WriteBoolean(item.IsBinds); // pkg.WriteBoolean(item.IsJudge); // pkg.WriteDateTime(item.BeginDate); // pkg.WriteInt(item.ValidDate); // pkg.WriteString(item.Color == null ? "" : item.Color); // pkg.WriteString(item.Skin == null ? "" : item.Skin); // pkg.WriteBoolean(item.IsUsed); // pkg.WriteInt(item.Hole1); // pkg.WriteInt(item.Hole2); // pkg.WriteInt(item.Hole3); // pkg.WriteInt(item.Hole4); // pkg.WriteInt(item.Hole5); // pkg.WriteInt(item.Hole6); // //DDTank // pkg.WriteString(item.Template.Pic); // pkg.WriteInt(5); // pkg.WriteDateTime(DateTime.Now.AddDays(5)); // pkg.WriteInt(5); // pkg.WriteByte(5); // pkg.WriteInt(5); // pkg.WriteByte(5); // pkg.WriteInt(5); // //item.RefineryLevel = pkg.readInt(); // //item.DiscolorValidDate = pkg.readDateString(); // //item.StrengthenTimes = pkg.readInt(); // //item.Hole5Level = pkg.readByte(); // //item.Hole5Exp = pkg.readInt(); // //item.Hole6Level = pkg.readByte(); // //item.Hole6Exp = pkg.readInt(); // } // } // numSend -= length; // SendTCP(pkg); // } while (j < updatedSlots.Length); //} public void SendUpdateInventorySlot(PlayerInventory bag, int[] updatedSlots) { if (m_gameClient.Player == null) return; if (bag.BagType == (int)eBageType.Card) { SendUpdateCardData(bag); return; } GSPacketIn pkg; pkg = new GSPacketIn((byte)ePackageType.GRID_GOODS, m_gameClient.Player.PlayerCharacter.ID, 10240); pkg.WriteInt(bag.BagType); pkg.WriteInt(updatedSlots.Length); foreach (int i in updatedSlots) { pkg.WriteInt(i); ItemInfo item = bag.GetItemAt(i); if (item == null) { pkg.WriteBoolean(false); } else { pkg.WriteBoolean(true); pkg.WriteInt(item.UserID); pkg.WriteInt(item.ItemID); pkg.WriteInt(item.Count); pkg.WriteInt(item.Place); pkg.WriteInt(item.TemplateID); pkg.WriteInt(item.AttackCompose); pkg.WriteInt(item.DefendCompose); pkg.WriteInt(item.AgilityCompose); pkg.WriteInt(item.LuckCompose); pkg.WriteInt(item.StrengthenLevel); pkg.WriteBoolean(item.IsBinds); pkg.WriteBoolean(item.IsJudge); pkg.WriteDateTime(item.BeginDate); pkg.WriteInt(item.ValidDate); pkg.WriteString(item.Color == null ? "" : item.Color); pkg.WriteString(item.Skin == null ? "" : item.Skin); pkg.WriteBoolean(item.IsUsed); pkg.WriteInt(item.Hole1); pkg.WriteInt(item.Hole2); pkg.WriteInt(item.Hole3); pkg.WriteInt(item.Hole4); pkg.WriteInt(item.Hole5); pkg.WriteInt(item.Hole6); //DDTank pkg.WriteString(item.Template.Pic); pkg.WriteInt(5); pkg.WriteDateTime(DateTime.Now.AddDays(5)); pkg.WriteInt(0); pkg.WriteByte(0); pkg.WriteInt(0); pkg.WriteByte(0); pkg.WriteInt(0); //item.RefineryLevel = pkg.readInt(); //item.DiscolorValidDate = pkg.readDateString(); //item.StrengthenTimes = pkg.readInt(); //item.Hole5Level = pkg.readByte(); //item.Hole5Exp = pkg.readInt(); //item.Hole6Level = pkg.readByte(); //item.Hole6Exp = pkg.readInt(); } } SendTCP(pkg); }
public void SendAddRoom(Game.Server.Rooms.BaseRoom room) { GSPacketIn pkg = new GSPacketIn((int)eFightPackageType.ROOM_CREATE); pkg.WriteInt(room.RoomId); pkg.WriteInt((int)room.GameType); pkg.WriteInt(room.GuildId); List<GamePlayer> players = room.GetPlayers(); pkg.WriteInt(players.Count); foreach (GamePlayer p in players) { pkg.WriteInt(p.PlayerCharacter.ID);//改为唯一ID pkg.WriteString(p.PlayerCharacter.NickName); pkg.WriteBoolean(p.PlayerCharacter.Sex); pkg.WriteInt(p.PlayerCharacter.Hide); pkg.WriteString(p.PlayerCharacter.Style); pkg.WriteString(p.PlayerCharacter.Colors); pkg.WriteString(p.PlayerCharacter.Skin); pkg.WriteInt(p.PlayerCharacter.Offer); pkg.WriteInt(p.PlayerCharacter.GP); pkg.WriteInt(p.PlayerCharacter.Grade); pkg.WriteInt(p.PlayerCharacter.Repute); pkg.WriteInt(p.PlayerCharacter.ConsortiaID); pkg.WriteString(p.PlayerCharacter.ConsortiaName); pkg.WriteInt(p.PlayerCharacter.ConsortiaLevel); pkg.WriteInt(p.PlayerCharacter.ConsortiaRepute); pkg.WriteInt(p.PlayerCharacter.Attack); pkg.WriteInt(p.PlayerCharacter.Defence); pkg.WriteInt(p.PlayerCharacter.Agility); pkg.WriteInt(p.PlayerCharacter.Luck); pkg.WriteDouble(p.GetBaseAttack()); pkg.WriteDouble(p.GetBaseDefence()); pkg.WriteDouble(p.GetBaseAgility()); pkg.WriteDouble(p.GetBaseBlood()); pkg.WriteInt(p.MainWeapon.TemplateID); pkg.WriteBoolean(p.CanUseProp); if (p.SecondWeapon != null) { pkg.WriteInt(p.SecondWeapon.TemplateID); pkg.WriteInt(p.SecondWeapon.StrengthenLevel); } else { pkg.WriteInt(0); pkg.WriteInt(0); } pkg.WriteDouble(RateMgr.GetRate(eRateType.Experience_Rate) * AntiAddictionMgr.GetAntiAddictionCoefficient(p.PlayerCharacter.AntiAddiction) * (p.GPAddPlus == 0 ? 1 : p.GPAddPlus)); pkg.WriteDouble(AntiAddictionMgr.GetAntiAddictionCoefficient(p.PlayerCharacter.AntiAddiction) * (p.OfferAddPlus == 0 ? 1 : p.OfferAddPlus)); pkg.WriteDouble(RateMgr.GetRate(eRateType.Experience_Rate)); pkg.WriteInt(GameServer.Instance.Configuration.ServerID); List<AbstractBuffer> infos = p.BufferList.GetAllBuffer(); pkg.WriteInt(infos.Count); foreach (AbstractBuffer bufferInfo in infos) { BufferInfo info = bufferInfo.Info; pkg.WriteInt(info.Type); pkg.WriteBoolean(info.IsExist); pkg.WriteDateTime(info.BeginDate); pkg.WriteInt(info.ValidDate); pkg.WriteInt(info.Value); pkg.WriteInt(info.ValidCount); } pkg.WriteInt(p.EquipEffect.Count); foreach (int i in p.EquipEffect) { pkg.WriteInt(i); } } SendTCP(pkg); }
//public void SendLoginSuccess() //{ // if (m_gameClient.Player == null) // return; // GSPacketIn pkg = new GSPacketIn((byte)ePackageType.LOGIN, m_gameClient.Player.PlayerCharacter.ID); // pkg.WriteByte(0); // pkg.WriteInt(m_gameClient.Player.PlayerCharacter.Attack); // pkg.WriteInt(m_gameClient.Player.PlayerCharacter.Defence); // pkg.WriteInt(m_gameClient.Player.PlayerCharacter.Agility); // pkg.WriteInt(m_gameClient.Player.PlayerCharacter.Luck); // pkg.WriteInt(m_gameClient.Player.PlayerCharacter.GP); // pkg.WriteInt(m_gameClient.Player.PlayerCharacter.Repute); // pkg.WriteInt(m_gameClient.Player.PlayerCharacter.Gold); // pkg.WriteInt(m_gameClient.Player.PlayerCharacter.Money); // pkg.WriteInt(m_gameClient.Player.PlayerCharacter.Hide); // pkg.WriteInt(m_gameClient.Player.PlayerCharacter.AntiAddiction); // pkg.WriteBoolean(m_gameClient.Player.PlayerCharacter.Sex); // pkg.WriteString(m_gameClient.Player.PlayerCharacter.Style + "&" + m_gameClient.Player.PlayerCharacter.Colors); // pkg.WriteString(m_gameClient.Player.PlayerCharacter.Skin); // pkg.WriteInt(m_gameClient.Player.PlayerCharacter.ConsortiaID); // pkg.WriteString(m_gameClient.Player.PlayerCharacter.ConsortiaName); // pkg.WriteInt(m_gameClient.Player.PlayerCharacter.DutyLevel); // pkg.WriteString(m_gameClient.Player.PlayerCharacter.DutyName); // pkg.WriteInt(m_gameClient.Player.PlayerCharacter.Right); // pkg.WriteString(m_gameClient.Player.PlayerCharacter.ChairmanName); // pkg.WriteInt(m_gameClient.Player.PlayerCharacter.ConsortiaHonor); // pkg.WriteInt(m_gameClient.Player.PlayerCharacter.ConsortiaRiches); // pkg.WriteBoolean(m_gameClient.Player.PlayerCharacter.HasBagPassword); // pkg.WriteString(m_gameClient.Player.PlayerCharacter.PasswordQuest1); // pkg.WriteString(m_gameClient.Player.PlayerCharacter.PasswordQuest2); // pkg.WriteInt(m_gameClient.Player.PlayerCharacter.FailedPasswordAttemptCount); // pkg.WriteString(m_gameClient.Player.PlayerCharacter.UserName); // pkg.WriteInt(m_gameClient.Player.PlayerCharacter.Nimbus); // pkg.WriteString(System.Convert.ToBase64String(m_gameClient.Player.PlayerCharacter.QuestSite)); // pkg.WriteString(m_gameClient.Player.PlayerCharacter.PvePermission); // pkg.WriteInt(m_gameClient.Player.PlayerCharacter.FightPower); // pkg.WriteInt(m_gameClient.Player.PlayerCharacter.AnswerSite); // SendTCP(pkg); //} //DDTank2.6 //DDTank2.6 public void SendLoginSuccess() { if (m_gameClient.Player == null) return; GSPacketIn pkg = new GSPacketIn((byte)ePackageType.LOGIN, m_gameClient.Player.PlayerCharacter.ID); pkg.WriteByte(0); //zoneid //_loc_3.ZoneID = _loc_2.readInt(); pkg.WriteInt(4); //TaskManager.requestCanAcceptTask(); //_loc_3.Defence = _loc_2.readInt(); //_loc_3.Agility = _loc_2.readInt(); //_loc_3.Luck = _loc_2.readInt(); //_loc_3.GP = _loc_2.readInt(); //_loc_3.Repute = _loc_2.readInt(); //_loc_3.Gold = _loc_2.readInt(); //_loc_3.Money = _loc_2.readInt(); pkg.WriteInt(m_gameClient.Player.PlayerCharacter.Attack); pkg.WriteInt(m_gameClient.Player.PlayerCharacter.Defence); pkg.WriteInt(m_gameClient.Player.PlayerCharacter.Agility); pkg.WriteInt(m_gameClient.Player.PlayerCharacter.Luck); pkg.WriteInt(m_gameClient.Player.PlayerCharacter.GP); pkg.WriteInt(m_gameClient.Player.PlayerCharacter.Repute); pkg.WriteInt(m_gameClient.Player.PlayerCharacter.Gold); pkg.WriteInt(m_gameClient.Player.PlayerCharacter.Money); //_loc_3.medal = _loc_2.readInt(); //_loc_3.Hide = _loc_2.readInt(); //_loc_3.FightPower = _loc_2.readInt(); //_loc_3.apprenticeshipState = _loc_2.readInt(); //_loc_3.masterID = _loc_2.readInt(); pkg.WriteInt(m_gameClient.Player.PropBag.GetItemCount(7001)); pkg.WriteInt(m_gameClient.Player.PlayerCharacter.Hide); pkg.WriteInt(m_gameClient.Player.PlayerCharacter.FightPower); pkg.WriteInt(5); pkg.WriteInt(-1); //_loc_3.setMasterOrApprentices(_loc_2.readUTF()); //_loc_3.graduatesCount = _loc_2.readInt(); //_loc_3.honourOfMaster = _loc_2.readUTF(); //_loc_3.freezesDate = _loc_2.readDate(); //_loc_3.IsVIP = _loc_2.readBoolean(); //_loc_3.VIPLevel = _loc_2.readInt(); //_loc_3.VIPExp = _loc_2.readInt(); //_loc_3.VIPExpireDay = _loc_2.readDate(); pkg.WriteString("Master"); pkg.WriteInt(5); pkg.WriteString("HoNorMaster"); pkg.WriteDateTime(DateTime.Now.AddDays(50)); pkg.WriteBoolean(true); pkg.WriteInt(5); pkg.WriteInt(50000); pkg.WriteDateTime(DateTime.Now.AddDays(50)); //_loc_3.LastDate = _loc_2.readDate(); //_loc_3.VIPNextLevelDaysNeeded = _loc_2.readInt(); //_loc_3.systemDate = _loc_2.readDate(); //_loc_3.canTakeVipReward = _loc_2.readBoolean(); //_loc_3.OptionOnOff = _loc_2.readInt(); //_loc_3.AchievementPoint = _loc_2.readInt(); //_loc_3.honor = _loc_2.readUTF(); pkg.WriteDateTime(DateTime.Now.AddDays(50)); pkg.WriteInt(50); pkg.WriteDateTime(DateTime.Now); pkg.WriteBoolean(false); pkg.WriteInt(1599); pkg.WriteInt(1599); pkg.WriteString("honor"); //TimeManager.Instance.totalGameTime = _loc_2.readInt(); //_loc_3.Sex = _loc_2.readBoolean(); //_loc_4 = _loc_2.readUTF(); //_loc_5 = _loc_4.split("&"); //_loc_3.Style = _loc_5[0]; //_loc_3.Colors = _loc_5[1]; //_loc_3.Skin = _loc_2.readUTF(); pkg.WriteInt(0); pkg.WriteBoolean(m_gameClient.Player.PlayerCharacter.Sex); pkg.WriteString(m_gameClient.Player.PlayerCharacter.Style + "&" + m_gameClient.Player.PlayerCharacter.Colors); pkg.WriteString(m_gameClient.Player.PlayerCharacter.Skin); //_loc_3.ConsortiaID = _loc_2.readInt(); //_loc_3.ConsortiaName = _loc_2.readUTF(); //_loc_3.DutyLevel = _loc_2.readInt(); //_loc_3.DutyName = _loc_2.readUTF(); //_loc_3.Right = _loc_2.readInt(); //_loc_3.CharManName = _loc_2.readUTF(); pkg.WriteInt(m_gameClient.Player.PlayerCharacter.ConsortiaID); pkg.WriteString(m_gameClient.Player.PlayerCharacter.ConsortiaName); pkg.WriteInt(m_gameClient.Player.PlayerCharacter.DutyLevel); pkg.WriteString(m_gameClient.Player.PlayerCharacter.DutyName); pkg.WriteInt(m_gameClient.Player.PlayerCharacter.Right); pkg.WriteString(m_gameClient.Player.PlayerCharacter.ChairmanName); //_loc_3.ConsortiaHonor = _loc_2.readInt(); //_loc_3.ConsortiaRiches = _loc_2.readInt(); //_loc_6 = _loc_2.readBoolean(); //_loc_3.bagPwdState = _loc_6; //_loc_3.bagLocked = _loc_6; pkg.WriteInt(m_gameClient.Player.PlayerCharacter.ConsortiaHonor); pkg.WriteInt(m_gameClient.Player.PlayerCharacter.ConsortiaRiches); pkg.WriteBoolean(m_gameClient.Player.PlayerCharacter.HasBagPassword); //_loc_3.questionOne = _loc_2.readUTF(); //_loc_3.questionTwo = _loc_2.readUTF(); //_loc_3.leftTimes = _loc_2.readInt(); //_loc_3.LoginName = _loc_2.readUTF(); //_loc_3.Nimbus = _loc_2.readInt(); pkg.WriteString(m_gameClient.Player.PlayerCharacter.PasswordQuest1); pkg.WriteString(m_gameClient.Player.PlayerCharacter.PasswordQuest2); pkg.WriteInt(m_gameClient.Player.PlayerCharacter.FailedPasswordAttemptCount); pkg.WriteString(m_gameClient.Player.PlayerCharacter.UserName); pkg.WriteInt(m_gameClient.Player.PlayerCharacter.Nimbus); // pkg.WriteString("1"); //_loc_3.PvePermission = _loc_2.readUTF(); //_loc_3.fightLibMission = _loc_2.readUTF(); //_loc_3.userGuildProgress = _loc_2.readInt(); pkg.WriteString(m_gameClient.Player.PlayerCharacter.PvePermission); pkg.WriteString("1111111"); //userguid answersite pkg.WriteInt(99999); //BossBoxManager.instance.receiebox = _loc_2.readInt(); //BossBoxManager.instance.receieGrade = _loc_2.readInt(); //BossBoxManager.instance.needGetBoxTime = _loc_2.readInt(); //_loc_3.LastSpaDate = _loc_2.readDate(); //_loc_3.shopFinallyGottenTime = _loc_2.readDate(); pkg.WriteInt(1000); pkg.WriteInt(2000); pkg.WriteInt(3000); pkg.WriteDateTime(DateTime.Now.AddDays(-5)); pkg.WriteDateTime(DateTime.Now.AddDays(-5)); SendTCP(pkg); }