public int HandlePacket(GameClient client, GSPacketIn packet)
        {
            GSPacketIn gSPacketIn = new GSPacketIn(165, client.Player.PlayerCharacter.ID);

            gSPacketIn.WriteDateTime(DateTime.Now);
            gSPacketIn.WriteDateTime(DateTime.Now.AddDays(7.0));
            gSPacketIn.WriteBoolean(true);
            client.Out.SendTCP(gSPacketIn);
            return(0);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        public void SendConsortiaUserPass(int playerid, string playerName, ConsortiaUserInfo info, bool isInvite, int consortiaRepute, string loginName, int fightpower, int achievementpoint, string honor)
        {
            GSPacketIn pkg = new GSPacketIn(128, 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(achievementpoint);
            pkg.WriteString(honor);

            this.SendTCP(pkg);
        }
Esempio n. 4
0
        public GSPacketIn SendMarryRoomInfoUpdateToScenePlayers(MarryRoom room)
        {
            GSPacketIn pkg    = new GSPacketIn((short)ePackageType.MARRY_ROOM_UPDATE);
            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);
            }

            SendToScenePlayer(pkg);
            return(pkg);
        }
Esempio n. 5
0
        public GSPacketIn SendMarryRoomInfoUpdateToScenePlayers(MarryRoom room)
        {
            GSPacketIn gSPacketIn = new GSPacketIn(255);
            bool       flag       = room != null;

            gSPacketIn.WriteBoolean(flag);
            if (flag)
            {
                gSPacketIn.WriteInt(room.Info.ID);
                gSPacketIn.WriteBoolean(room.Info.IsHymeneal);
                gSPacketIn.WriteString(room.Info.Name);
                gSPacketIn.WriteBoolean(!(room.Info.Pwd == ""));
                gSPacketIn.WriteInt(room.Info.MapIndex);
                gSPacketIn.WriteInt(room.Info.AvailTime);
                gSPacketIn.WriteInt(room.Count);
                gSPacketIn.WriteInt(room.Info.PlayerID);
                gSPacketIn.WriteString(room.Info.PlayerName);
                gSPacketIn.WriteInt(room.Info.GroomID);
                gSPacketIn.WriteString(room.Info.GroomName);
                gSPacketIn.WriteInt(room.Info.BrideID);
                gSPacketIn.WriteString(room.Info.BrideName);
                gSPacketIn.WriteDateTime(room.Info.BeginTime);
                gSPacketIn.WriteByte((byte)room.RoomState);
                gSPacketIn.WriteString(room.Info.RoomIntroduction);
            }
            this.SendToScenePlayer(gSPacketIn);
            return(gSPacketIn);
        }
Esempio n. 6
0
 public int HandlePacket(GameClient client, GSPacketIn packet)
 {
     packet.ClearContext();
     packet.WriteDateTime(DateTime.Now);
     client.Out.SendTCP(packet);
     return(0);
 }
Esempio n. 7
0
        public void SendLogFight(int _roomId, eRoomType _roomType, eGameType _fightType, int _changeTeam, DateTime _playBegin, DateTime _playEnd, int _userCount, int _mapId, string _teamA, string _teamB, string _playResult, int _winTeam, string BossWar)
        {
            GSPacketIn pkg = new GSPacketIn(5);

            pkg.WriteInt(_roomId);
            pkg.WriteInt((int)_roomType);
            pkg.WriteInt((int)_fightType);
            pkg.WriteInt(_changeTeam);
            pkg.WriteDateTime(_playBegin);
            pkg.WriteDateTime(_playEnd);
            pkg.WriteInt(_userCount);
            pkg.WriteInt(_mapId);
            pkg.WriteString(_teamA);
            pkg.WriteString(_teamB);
            pkg.WriteString(_playResult);
            pkg.WriteInt(_winTeam);
            pkg.WriteString(BossWar);
            this.SendTCP(pkg);
        }
        public int HandlePacket(GameClient client, GSPacketIn packet)
        {
            packet.ReadInt();
            packet.ReadInt();
            int[] array = new int[]
            {
                3,
                2,
                4,
                1,
                5,
                7,
                6
            };
            GSPacketIn gSPacketIn = new GSPacketIn(159, client.Player.PlayerCharacter.ID);

            gSPacketIn.WriteByte(0);
            gSPacketIn.WriteInt(7);
            for (int i = 0; i < 7; i++)
            {
                gSPacketIn.WriteInt(array[i]);
                if (i == 0)
                {
                    gSPacketIn.WriteInt(1);
                }
                else
                {
                    if (i == 1)
                    {
                        gSPacketIn.WriteInt(1);
                    }
                    else
                    {
                        gSPacketIn.WriteInt(1);
                    }
                }
                gSPacketIn.WriteInt(-1);
                gSPacketIn.WriteDateTime(DateTime.Now.AddDays(-1.0));
                gSPacketIn.WriteDateTime(DateTime.Now.AddDays(7.0));
            }
            client.Player.Out.SendTCP(gSPacketIn);
            return(0);
        }
Esempio n. 9
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);
        }
Esempio n. 10
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        = (int)packet.ReadByte();
            int             num2       = packet.ReadInt();
            int             place      = packet.ReadInt();
            ItemInfo        itemAt     = client.Player.GetItemAt((eBageType)num2, place);
            PlayerInventory inventory  = client.Player.GetInventory((eBageType)num2);
            string          msg        = "Kích hoạt tiềm năng thành công!";
            GSPacketIn      gSPacketIn = new GSPacketIn(133, client.Player.PlayerCharacter.ID);

            if (num == 1)
            {
                int             num3       = packet.ReadInt();
                int             place2     = packet.ReadInt();
                ItemInfo        itemAt2    = client.Player.GetItemAt((eBageType)num3, place2);
                PlayerInventory inventory2 = client.Player.GetInventory((eBageType)num3);
                inventory2.RemoveCountFromStack(itemAt2, 1);
                ItemTemplateInfo itemTemplateInfo = ItemMgr.FindItemTemplate(itemAt2.TemplateID);
                int    property = itemTemplateInfo.Property3;
                string text     = property.ToString();
                for (int i = 1; i < 4; i++)
                {
                    text = text + "," + property.ToString();
                }
                if (itemAt.latentEnergyCurStr.Split(new char[]
                {
                    ','
                })[0] == "0")
                {
                    itemAt.latentEnergyCurStr = text;
                }
                itemAt.latentEnergyNewStr  = text;
                itemAt.latentEnergyEndTime = DateTime.Now.AddDays((double)itemTemplateInfo.Property4);
            }
            else
            {
                client.Player.MainBag.UpdatePlayerProperties();
                itemAt.latentEnergyCurStr = itemAt.latentEnergyNewStr;
                msg = "Cập nhật tiềm năng thành công!";
            }
            itemAt.IsBinds = true;
            inventory.UpdateItem(itemAt);
            inventory.SaveToDatabase();
            gSPacketIn.WriteInt(itemAt.Place);
            gSPacketIn.WriteString(itemAt.latentEnergyCurStr);
            gSPacketIn.WriteString(itemAt.latentEnergyNewStr);
            gSPacketIn.WriteDateTime(itemAt.latentEnergyEndTime);
            client.Out.SendTCP(gSPacketIn);
            client.Player.SendMessage(msg);
            return(0);
        }
Esempio n. 12
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);
        }
Esempio n. 13
0
        public static GSPacketIn SendBufferList(Player player, List <BufferInfo> infos)
        {
            GSPacketIn gSPacketIn = new GSPacketIn(168, player.Id);

            gSPacketIn.WriteInt(infos.Count);
            foreach (BufferInfo current in infos)
            {
                gSPacketIn.WriteInt(current.Type);
                gSPacketIn.WriteBoolean(current.IsExist);
                gSPacketIn.WriteDateTime(current.BeginDate);
                gSPacketIn.WriteInt(current.ValidDate);
                gSPacketIn.WriteInt(current.Value);
            }
            return(gSPacketIn);
        }
Esempio n. 14
0
        public GSPacketIn SendSpaRoomInfoUpdateToSpaScenePlayers(SpaRoom room)
        {
            GSPacketIn pkg = new GSPacketIn(173);

            pkg.WriteInt(room.Spa_Room_Info.RoomNumber);
            pkg.WriteInt(room.Spa_Room_Info.RoomID);
            pkg.WriteString(room.Spa_Room_Info.RoomName);
            pkg.WriteString(room.Spa_Room_Info.Pwd);
            pkg.WriteInt(room.RoomLeftMin);
            pkg.WriteInt(room.Count);
            pkg.WriteInt(room.Spa_Room_Info.PlayerID);
            pkg.WriteString(room.Spa_Room_Info.PlayerName);
            pkg.WriteDateTime(room.Spa_Room_Info.BeginTime);
            pkg.WriteString(room.Spa_Room_Info.RoomIntroduction);
            pkg.WriteInt(room.Spa_Room_Info.RoomType);
            pkg.WriteInt(room.Spa_Room_Info.MaxCount);
            this.SendToScenePlayer(pkg);
            return(pkg);
        }
Esempio n. 15
0
 private static void SendBufferList(BattleGame game)
 {
     foreach (Player p in game.GetAllFightPlayers())
     {
         List <BufferInfo> infos = (p.PlayerDetail as ProxyPlayer).Buffers;
         GSPacketIn        pkg   = new GSPacketIn(186, p.PlayerDetail.PlayerCharacter.ID);
         pkg.Parameter1 = p.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);
         }
         game.SendToAll(pkg);
     }
 }
Esempio n. 16
0
        public void SendMarryRoomInfoToPlayer(int playerId, bool state, MarryRoomInfo info)
        {
            GSPacketIn pkg = new GSPacketIn(26);

            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);
            }
            this.SendTCP(pkg);
        }
Esempio n. 17
0
        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);
        }
Esempio n. 18
0
        public int HandlePacket(GameClient client, GSPacketIn packet)
        {
            int        num        = packet.ReadInt();
            GamePlayer playerById = WorldMgr.GetPlayerById(num);
            PlayerInfo playerInfo;

            if (playerById != null)
            {
                playerInfo = playerById.PlayerCharacter;
            }
            else
            {
                using (PlayerBussiness playerBussiness = new PlayerBussiness())
                {
                    playerInfo = playerBussiness.GetUserSingleByUserID(num);
                }
            }
            GSPacketIn gSPacketIn = new GSPacketIn(85, client.Player.PlayerCharacter.ID);

            gSPacketIn.WriteDateTime(playerInfo.LastDate);
            client.SendTCP(gSPacketIn);
            return(0);
        }
Esempio n. 19
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)
        {
            int num    = packet.ReadInt();
            int itemID = int.Parse(packet.ReadString());
            int result;

            using (PlayerBussiness playerBussiness = new PlayerBussiness())
            {
                ItemInfo userItemSingle = playerBussiness.GetUserItemSingle(itemID);
                if (userItemSingle != null)
                {
                    GSPacketIn gSPacketIn = new GSPacketIn(119, client.Player.PlayerCharacter.ID);
                    gSPacketIn.WriteInt(num);
                    if (num == 4)
                    {
                        gSPacketIn.WriteString(client.Player.PlayerCharacter.NickName);
                        gSPacketIn.WriteInt(userItemSingle.TemplateID);
                        gSPacketIn.WriteInt(userItemSingle.TemplateID);
                        gSPacketIn.WriteInt(userItemSingle.TemplateID);
                        gSPacketIn.WriteInt(userItemSingle.TemplateID);
                        gSPacketIn.WriteInt(userItemSingle.TemplateID);
                    }
                    if (num == 5)
                    {
                        gSPacketIn.WriteString(client.Player.PlayerCharacter.NickName);
                        gSPacketIn.WriteInt(userItemSingle.TemplateID);
                        gSPacketIn.WriteInt(userItemSingle.TemplateID);
                        gSPacketIn.WriteInt(userItemSingle.TemplateID);
                        gSPacketIn.WriteInt(userItemSingle.TemplateID);
                        gSPacketIn.WriteInt(userItemSingle.TemplateID);
                        gSPacketIn.WriteInt(userItemSingle.TemplateID);
                        gSPacketIn.WriteInt(userItemSingle.TemplateID);
                        gSPacketIn.WriteInt(userItemSingle.TemplateID);
                    }
                    gSPacketIn.WriteString(client.Player.PlayerCharacter.NickName);
                    gSPacketIn.WriteInt(userItemSingle.TemplateID);
                    gSPacketIn.WriteInt(userItemSingle.ItemID);
                    gSPacketIn.WriteInt(userItemSingle.StrengthenLevel);
                    gSPacketIn.WriteInt(userItemSingle.AttackCompose);
                    gSPacketIn.WriteInt(userItemSingle.AgilityCompose);
                    gSPacketIn.WriteInt(userItemSingle.LuckCompose);
                    gSPacketIn.WriteInt(userItemSingle.DefendCompose);
                    gSPacketIn.WriteInt(userItemSingle.ValidDate);
                    gSPacketIn.WriteBoolean(userItemSingle.IsBinds);
                    gSPacketIn.WriteBoolean(userItemSingle.IsJudge);
                    gSPacketIn.WriteBoolean(userItemSingle.IsUsed);
                    if (userItemSingle.IsUsed)
                    {
                        gSPacketIn.WriteString(userItemSingle.BeginDate.ToString());
                    }
                    gSPacketIn.WriteInt(userItemSingle.Hole1);
                    gSPacketIn.WriteInt(userItemSingle.Hole2);
                    gSPacketIn.WriteInt(userItemSingle.Hole3);
                    gSPacketIn.WriteInt(userItemSingle.Hole4);
                    gSPacketIn.WriteInt(userItemSingle.Hole5);
                    gSPacketIn.WriteInt(userItemSingle.Hole6);
                    gSPacketIn.WriteString(userItemSingle.Template.Hole);
                    gSPacketIn.WriteString(userItemSingle.Template.Pic);
                    gSPacketIn.WriteInt(userItemSingle.Template.RefineryLevel);
                    gSPacketIn.WriteDateTime(DateTime.Now);
                    gSPacketIn.WriteByte((byte)userItemSingle.Hole5Level);
                    gSPacketIn.WriteInt(userItemSingle.Hole5Exp);
                    gSPacketIn.WriteByte((byte)userItemSingle.Hole6Level);
                    gSPacketIn.WriteInt(userItemSingle.Hole6Exp);
                    if (userItemSingle.IsGold)
                    {
                        gSPacketIn.WriteBoolean(userItemSingle.IsGold);
                        gSPacketIn.WriteInt(userItemSingle.goldValidDate);
                        gSPacketIn.WriteDateTime(userItemSingle.goldBeginTime);
                    }
                    else
                    {
                        gSPacketIn.WriteBoolean(false);
                    }
                    client.Out.SendTCP(gSPacketIn);
                }
                result = 1;
            }
            return(result);
        }
Esempio n. 21
0
        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(p.EquipEffect.Count);
                foreach (int i in p.EquipEffect)
                {
                    pkg.WriteInt(i);
                }
            }
            SendTCP(pkg);
        }
Esempio n. 22
0
        public void SendAddRoom(BaseRoom room)
        {
            GSPacketIn gSPacketIn = new GSPacketIn(64);

            gSPacketIn.WriteInt(room.RoomId);
            gSPacketIn.WriteInt((int)room.GameType);
            gSPacketIn.WriteInt(room.GuildId);
            List <GamePlayer> players = room.GetPlayers();

            gSPacketIn.WriteInt(players.Count);
            foreach (GamePlayer current in players)
            {
                gSPacketIn.WriteInt(current.PlayerCharacter.ID);
                gSPacketIn.WriteString(current.PlayerCharacter.NickName);
                gSPacketIn.WriteBoolean(current.PlayerCharacter.Sex);
                gSPacketIn.WriteByte(current.PlayerCharacter.typeVIP);
                gSPacketIn.WriteInt(current.PlayerCharacter.VIPLevel);
                gSPacketIn.WriteInt(current.PlayerCharacter.Hide);
                gSPacketIn.WriteString(current.PlayerCharacter.Style);
                gSPacketIn.WriteString(current.PlayerCharacter.Colors);
                gSPacketIn.WriteString(current.PlayerCharacter.Skin);
                gSPacketIn.WriteInt(current.PlayerCharacter.Offer);
                gSPacketIn.WriteInt(current.PlayerCharacter.GP);
                gSPacketIn.WriteInt(current.PlayerCharacter.Grade);
                gSPacketIn.WriteInt(current.PlayerCharacter.Repute);
                gSPacketIn.WriteInt(current.PlayerCharacter.ConsortiaID);
                gSPacketIn.WriteString(current.PlayerCharacter.ConsortiaName);
                gSPacketIn.WriteInt(current.PlayerCharacter.ConsortiaLevel);
                gSPacketIn.WriteInt(current.PlayerCharacter.ConsortiaRepute);
                gSPacketIn.WriteInt(current.PlayerCharacter.badgeID);
                gSPacketIn.WriteString(current.PlayerCharacter.WeaklessGuildProgressStr);
                gSPacketIn.WriteInt(current.PlayerCharacter.Attack);
                gSPacketIn.WriteInt(current.PlayerCharacter.Defence);
                gSPacketIn.WriteInt(current.PlayerCharacter.Agility);
                gSPacketIn.WriteInt(current.PlayerCharacter.Luck);
                gSPacketIn.WriteInt(current.PlayerCharacter.hp);
                gSPacketIn.WriteInt(current.PlayerCharacter.FightPower);
                gSPacketIn.WriteBoolean(current.PlayerCharacter.IsMarried);
                if (current.PlayerCharacter.IsMarried)
                {
                    gSPacketIn.WriteInt(current.PlayerCharacter.SpouseID);
                    gSPacketIn.WriteString(current.PlayerCharacter.SpouseName);
                }
                gSPacketIn.WriteDouble(current.GetBaseAttack());
                gSPacketIn.WriteDouble(current.GetBaseDefence());
                gSPacketIn.WriteDouble(current.GetBaseAgility());
                gSPacketIn.WriteDouble(current.GetBaseBlood());
                gSPacketIn.WriteInt(current.MainWeapon.TemplateID);
                gSPacketIn.WriteBoolean(current.CanUseProp);
                if (current.SecondWeapon != null)
                {
                    gSPacketIn.WriteInt(current.SecondWeapon.TemplateID);
                    gSPacketIn.WriteInt(current.SecondWeapon.StrengthenLevel);
                }
                else
                {
                    gSPacketIn.WriteInt(0);
                    gSPacketIn.WriteInt(0);
                }
                gSPacketIn.WriteDouble((double)RateMgr.GetRate(eRateType.Experience_Rate) * AntiAddictionMgr.GetAntiAddictionCoefficient(current.PlayerCharacter.AntiAddiction) * ((current.GPAddPlus == 0.0) ? 1.0 : current.GPAddPlus));
                gSPacketIn.WriteDouble(AntiAddictionMgr.GetAntiAddictionCoefficient(current.PlayerCharacter.AntiAddiction) * ((current.OfferAddPlus == 0.0) ? 1.0 : current.OfferAddPlus));
                gSPacketIn.WriteDouble((double)RateMgr.GetRate(eRateType.Experience_Rate));
                gSPacketIn.WriteInt(GameServer.Instance.Configuration.ServerID);
                if (current.Pet == null)
                {
                    gSPacketIn.WriteInt(0);
                }
                else
                {
                    gSPacketIn.WriteInt(1);
                    gSPacketIn.WriteInt(current.Pet.Place);
                    gSPacketIn.WriteInt(current.Pet.TemplateID);
                    gSPacketIn.WriteInt(current.Pet.ID);
                    gSPacketIn.WriteString(current.Pet.Name);
                    gSPacketIn.WriteInt(current.Pet.UserID);
                    gSPacketIn.WriteInt(current.Pet.Level);
                    gSPacketIn.WriteString(current.Pet.Skill);
                    gSPacketIn.WriteString(current.Pet.SkillEquip);
                }
                List <AbstractBuffer> allBuffer = current.BufferList.GetAllBuffer();
                gSPacketIn.WriteInt(allBuffer.Count);
                foreach (AbstractBuffer current2 in allBuffer)
                {
                    BufferInfo info = current2.Info;
                    gSPacketIn.WriteInt(info.Type);
                    gSPacketIn.WriteBoolean(info.IsExist);
                    gSPacketIn.WriteDateTime(info.BeginDate);
                    gSPacketIn.WriteInt(info.ValidDate);
                    gSPacketIn.WriteInt(info.Value);
                    gSPacketIn.WriteInt(info.ValidCount);
                }
                gSPacketIn.WriteInt(current.EquipEffect.Count);
                foreach (ItemInfo current3 in current.EquipEffect)
                {
                    gSPacketIn.WriteInt(current3.TemplateID);
                    gSPacketIn.WriteInt(current3.Hole1);
                }
            }
            this.SendTCP(gSPacketIn);
        }
Esempio n. 23
0
        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);
        }
Esempio n. 24
0
        public void SendAddRoom(BaseRoom room)
        {
            GSPacketIn pkg = new GSPacketIn(64);

            pkg.WriteInt(room.RoomId);
            pkg.WriteInt((int)room.GameType);
            pkg.WriteInt(room.GuildId);
            pkg.WriteInt(GameServer.Instance.Config.AreaID);
            pkg.WriteBoolean(room.IsArea);
            List <GamePlayer> players = room.GetPlayers();

            pkg.WriteInt(players.Count);
            foreach (GamePlayer p in players)
            {
                pkg.WriteInt(p.AreaID);
                pkg.WriteString(p.AreaName);
                pkg.WriteInt(p.PlayerCharacter.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.Nimbus);
                pkg.WriteInt(p.PlayerCharacter.ConsortiaID);
                pkg.WriteString(p.PlayerCharacter.ConsortiaName);
                pkg.WriteInt(p.PlayerCharacter.ConsortiaLevel);
                pkg.WriteInt(p.PlayerCharacter.ConsortiaRepute);
                pkg.WriteInt(p.PlayerCharacter.Win);
                pkg.WriteInt(p.PlayerCharacter.Total);
                pkg.WriteInt(p.PlayerCharacter.Attack);
                pkg.WriteInt(p.PlayerCharacter.Defence);
                pkg.WriteInt(p.PlayerCharacter.Agility);
                pkg.WriteInt(p.PlayerCharacter.Luck);
                pkg.WriteInt(p.PlayerCharacter.FightPower);
                pkg.WriteBoolean(p.PlayerCharacter.IsMarried);
                if (p.PlayerCharacter.IsMarried)
                {
                    pkg.WriteInt(p.PlayerCharacter.SpouseID);
                    pkg.WriteString(p.PlayerCharacter.SpouseName);
                }
                pkg.WriteDouble(p.GetBaseAttack());
                pkg.WriteDouble(p.GetBaseDefence());
                pkg.WriteDouble(p.GetBaseAgility());
                pkg.WriteDouble(p.GetBaseBlood());
                if (p.MainWeapon != null)
                {
                    pkg.WriteInt(p.MainWeapon.TemplateID);
                }
                else
                {
                    pkg.WriteInt(0);
                }
                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(p.GPAddPlus);
                pkg.WriteFloat(p.GMExperienceRate);
                pkg.WriteFloat(p.AuncherExperienceRate);
                pkg.WriteDouble(p.OfferAddPlus);
                pkg.WriteFloat(p.GMOfferRate);
                pkg.WriteFloat(p.AuncherOfferRate);
                pkg.WriteFloat(p.GMRichesRate);
                pkg.WriteFloat(p.AuncherRichesRate);
                pkg.WriteDouble(p.AntiAddictionRate);
                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(p.EquipEffect.Count);
                foreach (int i in p.EquipEffect)
                {
                    pkg.WriteInt(i);
                }
            }
            this.SendTCP(pkg);
        }