WriteByte() публичный Метод

public WriteByte ( byte v ) : void
v byte
Результат void
Пример #1
0
        private const String XPFULL = "xpfull"; //xp满 参数: xp值

        #endregion Fields

        #region Methods

        public static void ExecuteGMCommand(String str, PlayerObject play)
        {
            try
            {
                String[] option = str.Split(' ');
                String command = option[0];
                command = command.Substring(1);
                command = command.ToLower();
                switch (command)
                {
                    case AWARDITEM:
                        {
                            uint itemid;
                            byte postion = NetMsg.MsgItemInfo.ITEMPOSITION_BACKPACK; //默认背包
                            if (option.Length >= 2)
                            {
                                itemid = Convert.ToUInt32(option[1]);
                                if (option.Length > 2) postion = Convert.ToByte(option[2]);
                                play.GetItemSystem().AwardItem(itemid, postion);
                            }

                            break;
                        }
                    case ADDMAGIC:
                        {
                            uint magicid;
                            byte level = 0;
                            uint exp = 0;
                            if (option.Length >= 2)
                            {
                                magicid = Convert.ToUInt32(option[1]);
                                if (option.Length >= 3) level = Convert.ToByte(option[2]);
                                if (option.Length >= 4) exp = Convert.ToUInt32(option[3]);
                                play.GetMagicSystem().AddMagicInfo(magicid, level, exp);
                            }
                            break;
                        }
                    case XPFULL:
                        {
                            //byte[] data1 = { 20, 0, 249, 3, 84, 66, 15, 0, 1, 0, 0, 0, 28, 0, 0, 0, 30, 0, 0, 0 };
                            //play.GetGamePackKeyEx().EncodePacket(ref data1, data1.Length);
                            //play.SendData(data1);

                            int exp = 100;
                            if (option.Length >= 2)
                            {
                                exp = Convert.ToInt32(option[1]);
                            }
                            play.ChangeAttribute(GameStruct.UserAttribute.XP, exp);
                            //NetMsg.MsgUserAttribute attr = new NetMsg.MsgUserAttribute();
                            //attr.Create(null, play.GetGamePackKeyEx());
                            //attr.AddAttribute(GameStruct.UserAttribute.XP, (uint)exp);
                            //attr.role_id = play.GetTypeId();
                            //play.SendData(attr.GetBuffer());
                            break;
                        }
                    case MOB:
                        {
                            if (option.Length < 2) break;

                            uint monsterid = Convert.ToUInt32(option[1]);
                            GameStruct.MonsterInfo info = ConfigManager.Instance().GetMonsterInfo(monsterid);
                            if (info == null) break;
                            MapServer.MonsterObject obj = new MapServer.MonsterObject(monsterid, info.ai,play.GetCurrentX(),play.GetCurrentY());

                            play.GetGameMap().AddObject(obj);
                            obj.Walk(GameStruct.DIR.MAX_DIRSIZE);

                            //play.SendMonsterInfo(obj);
                            //GameStruct.Action action = new GameStruct.Action(GameStruct.Action.MOVE, null);
                            //play.PushAction(action);
                            break;
                        }
                    case ADDGOLD:
                        {
                            if (option.Length < 2) break;
                            byte btype = Convert.ToByte(option[1]);
                            int count = Convert.ToInt32(option[2]);
                            if (btype == 1)//金币
                            {
                                play.ChangeAttribute(GameStruct.UserAttribute.GOLD, count);
                            }
                            else if (btype == 2)
                            {
                                play.ChangeAttribute(GameStruct.UserAttribute.GAMEGOLD, count);
                            }
                            break;
                        }
                    case FOLLOW:
                        {
                            if (option.Length < 2) break;
                            String name = option[1];
                            PlayerObject target = UserEngine.Instance().FindPlayerObjectToName(name);
                            if (target != null)
                            {
                                //在同一张地图上
                                if (target.GetGameMap().GetID() == play.GetGameMap().GetID())
                                {
                                    play.ScroolRandom(target.GetCurrentX(), target.GetCurrentY());
                                }
                                else
                                {
                                    play.ChangeMap(target.GetGameMap().GetID(), target.GetCurrentX(), target.GetCurrentY());
                                }
                            }
                            else
                            {
                                play.LeftNotice("玩家不存在,无法传送到玩家点。");
                            }
                            break;
                        }
                    case LEVEL:
                        {
                            if (option.Length < 2) break;
                            int level = Convert.ToInt32(option[1]);
                            play.ChangeAttribute(GameStruct.UserAttribute.LEVEL, level);
                            break;
                        }
                    case RELOAD:
                        {
                            String sPath = option[1];
                            ScripteManager.Instance().LoadScripteFile(sPath, true);
                            break;
                        }
                    case RELOADALL:
                        {
                            ConfigManager.Instance().ReloadAllScripte();
                            play.ChatNotice("重加载脚本成功!");
                            break;
                        }
                    case CHANGEMAP:
                        {
                            uint mapid = Convert.ToUInt32(option[1]);
                            GameMap map = MapManager.Instance().GetGameMapToID(mapid);
                            if (map == null) break;
                            short x = (short)map.GetMapInfo().recallx;
                            short y = (short)map.GetMapInfo().recally;
                            if (option.Length >= 4)
                            {
                                x = Convert.ToInt16(option[2]);
                                y = Convert.ToInt16(option[3]);
                            }
                            play.ChangeMap(mapid, x, y);
                            break;

                        }
                    case ROBOTACTION:
                        {
                            uint action_id = Convert.ToUInt32(option[1]);
                            play.PlayRobotAction(action_id);
                            break;
                        }
                    case KILLPLAY:
                        {
                            String name = option[1];
                            PlayerObject obj_play = UserEngine.Instance().FindPlayerObjectToName(option[1]);
                            if (obj_play != null)
                            {
                                obj_play.ExitGame();
                                play.MsgBox("踢出成功!");
                            }
                            else play.MsgBox("踢出失败,未找到玩家对象!");
                            break;
                        }
                    case "test":
                        {
                            //测试更改幻兽信息
                            int type = Convert.ToInt32(option[1]);
                            int value = Convert.ToInt32(option[2]);
                            //PacketOut outpack = new PacketOut(play.GetGamePackKeyEx());
                            //byte[] buff = {24,0,245,7,1,0,0,0,208,175,166,119,1,0,0,0};
                            //outpack.WriteBuff(buff);
                            //outpack.WriteInt32(type);
                            //outpack.WriteInt32(value);
                            //play.SendData(outpack.Flush());
                            PacketOut outpack = new PacketOut(play.GetGamePackKeyEx());

                            outpack.WriteUInt16(176);
                            outpack.WriteUInt16(1102);
                            outpack.WriteInt32(2005);
                            outpack.WriteByte(0);
                            outpack.WriteByte(10);
                            outpack.WriteInt16(0);
                            outpack.WriteInt32(0);
                            outpack.WriteUInt32(play.GetTypeId());
                            outpack.WriteInt32((int)1);
                            outpack.WriteUInt32(656);

                            outpack.WriteUInt32(420171);
                            //当前耐久度
                            outpack.WriteUInt16(1000);
                            //最大耐久度
                            outpack.WriteUInt16(9000);

                            byte[] data = new byte[72];
                            data[type] = (byte)value;
                            outpack.WriteBuff(data);
                            GameStruct.ItemTypeInfo baseitem = MapServer.ConfigManager.Instance().GetItemTypeInfo(420170);

                            if (baseitem != null)
                            {
                                byte[] namebyte = Coding.GetDefauleCoding().GetBytes(baseitem.name);
                                outpack.WriteBuff(namebyte);
                                data = new byte[68 - namebyte.Length];
                                outpack.WriteBuff(data);
                            }
                            else
                            {
                                data = new byte[68];
                                outpack.WriteBuff(data);
                            }
                            play.SendData(outpack.Flush());

                            // Log.Instance().WriteLog(GamePacketKeyEx.byteToText(outpack.GetNormalBuff()));

                            break;
                        }
                    case TESTCOMBO:
                        {
                            Program._Head = Convert.ToByte(option[1]);
                            Program._Tail = Convert.ToByte(option[2]);
                            break;
                        }
                    case CHANGELOOKFACE:
                        {
                            int look = Convert.ToInt32(option[1]);
                            play.ChangeAttribute(GameStruct.UserAttribute.LOOKFACE, look);
                            break;
                        }
                    case OTHERROLE:
                        {

                            //军团职位

                            // 200 普通团员
                            // 1000 军团长
                            // 690 指挥官
                            //680 荣誉指挥官

                            //收到网络协议:长度:185协议号:1014

                            //{189,0,246,3,217,168,113,0,17,152,2,0,17,152,2,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,250,17,0,0,42,0,2,0,132,66,6,0,0,0,0,0,0,0,0,0,59,1,217,1,161,0,0,0,6,5,0,0,100,0,0,0,130,20,0,0,0,7,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,138,130,2,0,0,0,0,0,1,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,53,0,1,0,0,0,250,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,8,179,224,215,211,196,167,207,192,0,0,0}
                            short legion_pos = Convert.ToInt16(option[1]);
                            PacketOut outpack = new PacketOut(play.GetGamePackKeyEx());
                            byte[] data11 = { 185, 0, 246, 3, 200, 16, 24, 0, 209, 251, 1, 0, 209, 251, 1, 0, 0, 0, 0, 0,
                                              0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                                              0, 0, 0, 117, 1, 0, 0, 64, 234, 2, 0, 244, 83, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                                              214, 0, 138, 0, 119, 0, 0, 0, 3, 5, 0, 0, 100, 0, 0, 0, 125, 70, 0, 0, 0, 5, 0,
                                              0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1/*军团头衔*/, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};// /*军团职位*//*178, 2*/,0/* 1*/,
                            byte[] data2 = {          0, 0, 0, 0, 0, /*1, 16*/0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                                              0, 0, 74, 0, 255, 8, 0, 0, 117, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                                              0, 0, 0, 0, 0, 0, 1, 4, 210, 193, 183, 227, 0, 0, 0 };
                            outpack.WriteBuff(data11);
                            outpack.WriteInt16(legion_pos);
                            outpack.WriteBuff(data2);
                            play.SendData(outpack.Flush());

                            //byte[] data11 = { 185, 0, 246, 3, 200, 16, 24, 0, 209, 251, 1, 0, 209, 251, 1, 0, 0, 0, 0, 0,
                            //                    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                            //                    0, 0, 0, 117, 1, 0, 0, 64, 234, 2, 0, 244, 83, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                            //                    214, 0, 138, 0, 119, 0, 0, 0, 3, 5, 0, 0, 100, 0, 0, 0, 125, 70, 0, 0, 0, 5, 0,
                            //                    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1/*军团头衔*/, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,232,3 /*军团职位*//*178, 2*/,0/* 1*/,
                            //                    0, 0, 0, 0, 0, /*1, 16*/0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                            //                    0, 0, 74, 0, 255, 8, 0, 0, 117, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                            //                    0, 0, 0, 0, 0, 0, 1, 4, 210, 193, 183, 227, 0, 0, 0 };
                            // play.GetGamePackKeyEx().EncodePacket(ref data11, data11.Length);
                            // play.SendData(data11);
                            //收到网络协议:长度:28协议号:2036

                            //byte[] data1 = {28,0,244,7,109,0,5,0,84,66,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
                            //         play.GetGamePackKeyEx().EncodePacket(ref data1, data1.Length);
                            //          play.SendData(data1);
                            //收到网络协议:长度:16协议号:1012

                            //byte[] data12 = {16,0,244,3,212,21,24,0,0,0,0,0,0,0,0,0};
                            //         play.GetGamePackKeyEx().EncodePacket(ref data12, data12.Length);
                            //          play.SendData(data12);
                            //收到网络协议:长度:27协议号:1015

                            byte[] data13 = { 27, 0, 247, 3, 117, 1, 0, 0, 3, 0, 1, 14, 169, 89, 211, 200, 207, 170, 161, 239, 180, 180, 187, 212, 187, 205, 0 };
                            play.GetGamePackKeyEx().EncodePacket(ref data13, data13.Length);
                            play.SendData(data13);

                            //收到网络协议:长度:16协议号:2036

                            //                                        byte[] data14 = {16,0,244,7,199,0,2,0,84,66,15,0,40,0,0,0};
                            //                         play.GetGamePackKeyEx().EncodePacket(ref data14, data14.Length);
                            //                          play.SendData(data14);
                            ////收到网络协议:长度:16协议号:1034

                            //byte[] data15 = { 16, 0, 10, 4, 2, 0, 1, 0, 200, 16, 24, 0, 206, 0, 130, 0 };
                            //play.GetGamePackKeyEx().EncodePacket(ref data15, data15.Length);
                            //play.SendData(data15);

                            //收到网络协议:长度:16协议号:1034
                            ////
                            //                          byte[] data11 = { 16, 0, 10, 4, 2, 0, 1, 0, 200, 16, 24, 0, 224, 0, 135, 0 };
                            //                          play.GetGamePackKeyEx().EncodePacket(ref data11, data11.Length);
                            //                          play.SendData(data11);
                            //                          byte[] data1 = {187,0,246,3,58,255,230,0,17,152,2,0,17,152,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,243,2,0,0,18,0,2,0,247,65,6,0,0,0,0,0,0,0,0

                            //,0,243,0,249,0,101,0,0,0,4,5,0,0,100,0,0,0,112,20,0,0,0,5,0,5,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,200,0,3,0,0,0,0,0,1,21,0,0,0,0,0,0,0,0,0,0,0,0,0,

                            //0,0,0,0,0,0,0,0,0,91,0,127,4,0,0,243,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,6,97,118,49,51,49,52,0,0,0};
                            // byte pos = Convert.ToByte(option[1]);
                            // byte value = Convert.ToByte(option[2]);
                            // byte[] data2 = {187,0,246,3,58,255,230,0,17,152,2,0,17,152,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,243,2,0,0,18,0,2,0,247,65,6,0,0,0,0,0,0,0,0,0,243,0,249,0,101,0,0,0,4,5,0,0,100,0,0,0,112,20};
                            // byte[] data3 = new byte[90];
                            // data3[pos] = value;
                            // byte[] data4 = { 1, 6, 97, 118, 49, 51, 49, 52, 0, 0, 0 };
                            // PacketOut outpack = new PacketOut(play.GetGamePackKeyEx());
                            // outpack.WriteBuff(data2);
                            // outpack.WriteBuff(data3);
                            // outpack.WriteBuff(data4);
                            //// play.GetGamePackKeyEx().EncodePacket(ref data1, data1.Length);
                            // play.SendData(outpack.Flush());

                            //byte[] data2 = { 28, 0, 244, 7, 109, 0, 5, 0, 58, 255, 230, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
                            //play.GetGamePackKeyEx().EncodePacket(ref data2, data2.Length);
                            //play.SendData(data2);

                            //byte[] data3 = { 20, 0, 249, 3, 58, 255, 230, 0, 1, 0, 0, 0, 36, 0, 0, 0, 0, 4, 0, 0 };
                            //play.GetGamePackKeyEx().EncodePacket(ref data3, data3.Length);
                            //play.SendData(data3);

                            ////军团信息
                            //byte[] data4 = { 20, 0, 247, 3, 243, 2, 0, 0, 3, 0, 1, 7, 65, 198, 172, 190, 252, 205, 197, 0 };
                            //play.GetGamePackKeyEx().EncodePacket(ref data4, data4.Length);
                            //play.SendData(data4);

                            //byte[] data5 = { 28, 0, 242, 3, 174, 95, 70, 0, 58, 255, 230, 0, 243, 0, 249, 0, 4, 0, 0, 0, 100, 0, 0, 0, 58, 37, 0, 0 };
                            //play.GetGamePackKeyEx().EncodePacket(ref data5, data5.Length);
                            //play.SendData(data5);

                            break;
                        }

                    case "qicheng":
                        {
                            uint rid_id = Convert.ToUInt32(option[1]);
                            //byte[] data = { 36, 0, 244, 7, 209, 0, 7, 0 };
                            //byte[] data1 = { 226, 200, 184, 119, 45, 0, 0, 0, 1, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0 };
                            //PacketOut outpack = new PacketOut(play.GetGamePackKeyEx());
                            //outpack.WriteBuff(data);
                            //outpack.WriteUInt32(play.GetTypeId());
                            //outpack.WriteUInt32(rid_id);
                            //outpack.WriteBuff(data1);

                            //play.SendData(outpack.Flush());
                            play.TakeMount(0,rid_id);
                            break;
                        }
                    case "下马":
                        {
                            play.TakeOffMount(0);
                            break;
                        }
                    case CALLSCRIPT:
                        {
                            uint scripte_id = Convert.ToUInt32(option[1]);
                            ScripteManager.Instance().ExecuteAction(scripte_id, play);
                            break;
                        }
                    case "魔龙守护":
                        {

                            //收到网络协议:长度:40协议号:1022
                            //byte[] data2 = { 40, 0, 254, 3, 0, 0, 0, 0, 84, 66, 15, 0, 0, 0, 0, 0, 67, 2, 56, 1, 21, 0, 0, 0, 105, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
                            //play.GetGamePackKeyEx().EncodePacket(ref data2, data2.Length);
                            //play.SendData(data2);
                            ////收到网络协议:长度:116协议号:1105
                            //byte[] data3 = { 116, 0, 81, 4, 84, 66, 15, 0, 67, 2, 56, 1, 105, 20, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84, 66, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 226, 200, 184, 119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
                            //play.GetGamePackKeyEx().EncodePacket(ref data3, data3.Length);
                            //play.SendData(data3);
                            ////收到网络协议:长度:20协议号:1017
                            byte[] data7 = { 20, 0, 249, 3, 84, 66, 15, 0, 1, 0, 0, 0, 99, 0, 0, 0, 1, 0, 0, 0 };

                            play.GetGamePackKeyEx().EncodePacket(ref data7, data7.Length);
                            play.SendData(data7);
                            ////收到网络协议:长度:48协议号:1127
                            //8, 7,0,0
                            byte[] data4 = { 48, 0, 103, 4, 84, 66, 15, 0, 8, 7, 0, 0, 200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
                            play.GetGamePackKeyEx().EncodePacket(ref data4, data4.Length);
                            play.SendData(data4);
                            ////收到网络协议:长度:48协议号:1127
                            //byte[] data5 = { 48, 0, 103, 4, 226, 200, 184, 119, 8, 7, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
                            //play.GetGamePackKeyEx().EncodePacket(ref data5, data5.Length);
                            //play.SendData(data5);
                            ////收到网络协议:长度:16协议号:1104
                            //byte[] data6 = { 16, 0, 80, 4, 84, 66, 15, 0, 114, 0, 0, 0, 105, 20, 1, 0 };
                            //play.GetGamePackKeyEx().EncodePacket(ref data6, data6.Length);
                            //play.SendData(data6);

                            break;
                        }
                    case TESTDIE: //测试死亡
                        {

                            //血量清零
                            //byte[] data1 = { 20, 0, 249, 3, 84, 66, 15, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
                            //play.GetGamePackKeyEx().EncodePacket(ref data1, data1.Length);
                            //play.SendData(data1);
                            ////收到网络协议:长度:40协议号:1022
                            //                        byte[] data2 = { 40, 0, 254, 3, 0, 0, 0, 0, 200, 105, 7, 0, 84, 66, 15, 0, 47, 3, 17, 4, 2, 0, 0, 0, 233, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
                            //                                play.GetGamePackKeyEx().EncodePacket(ref data2, data2.Length);
                            //                        play.SendData(data2);
                            ////收到网络协议:长度:40协议号:1022
                            //参数
                            //time  0, 0, 0, 0
                            //怪物id 200, 105, 7, 0
                            //角色id 84, 66, 15, 0
                            //x 50, 3
                            //y 17, 4
                            //标记 14
                            byte[] data3 = { 40, 0, 254, 3, 0, 0, 0, 0, 200, 105, 7, 0, 84, 66, 15, 0, 50, 3, 17, 4, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
                            play.GetGamePackKeyEx().EncodePacket(ref data3, data3.Length);
                            play.SendData(data3);
                            //收到网络协议:长度:20协议号:1017 --
                            //                        byte[] data4 = { 20, 0, 249, 3, 84, 66, 15, 0, 1, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0 };
                            //         play.GetGamePackKeyEx().EncodePacket(ref data4, data4.Length);
                            //                        play.SendData(data4);
                            ////收到网络协议:长度:20协议号:1017
                            //                        byte[] data5 = { 20, 0, 249, 3, 84, 66, 15, 0, 1, 0, 0, 0, 26, 0, 0, 0, 2, 0, 0, 0 };
                            //play.GetGamePackKeyEx().EncodePacket(ref data5, data5.Length);
                            //play.SendData(data5);
                            //收到网络协议:长度:32协议号:1101

                            //byte[] data6 = { 32, 0, 77, 4, 248, 149, 1, 0, 204, 165, 16, 0, 50, 3, 17, 4, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
                            //play.GetGamePackKeyEx().EncodePacket(ref data6, data6.Length);
                            //play.SendData(data6);
                            ////收到网络协议:长度:20协议号:1017
                            //byte[] data7 = { 20, 0, 249, 3, 84, 66, 15, 0, 1, 0, 0, 0, 4, 0, 0, 0, 137, 172, 15, 0 };
                            //play.GetGamePackKeyEx().EncodePacket(ref data7, data7.Length);
                            //play.SendData(data7);
                            ////收到网络协议:长度:67协议号:1004
                            //byte[] data8 = { 67, 0, 236, 3, 0, 0, 255, 0, 213, 7, 0, 0, 173, 8, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, 4, 6, 83, 89, 83, 84, 69, 77, 8, 210, 176, 177, 200, 186, 243, 204, 236, 0, 21, 196, 227, 210, 197, 202, 167, 193, 203, 50, 50, 52, 50, 54, 195, 182, 189, 240, 177, 210, 161, 163, 0, 0, 0 };

                            //play.GetGamePackKeyEx().EncodePacket(ref data8, data8.Length);
                            //play.SendData(data8);
                            //                          //收到网络协议:长度:16协议号:1012
                            //byte[] data9 = { 16, 0, 244, 3, 84, 66, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
                            //play.GetGamePackKeyEx().EncodePacket(ref data9, data9.Length);
                            //play.SendData(data9);

                            // byte[] data2 = {  20, 0, 249, 3, 84, 66, 15, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} ;
                            // play.GetGamePackKeyEx().EncodePacket(ref data2, data2.Length);
                            // play.SendData(data2);

                            // byte[] data1 = { 20, 0, 249, 3, 84, 66, 15, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
                            // play.GetGamePackKeyEx().EncodePacket(ref data1, data1.Length);
                            // play.SendData(data1);

                            // byte[] data3 = {40,0,254,3,0,0,0,0,24,87,7,0,76,152,15,0,228,3,214,1,2,0,0,0,233,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
                            // play.GetGamePackKeyEx().EncodePacket(ref data3, data3.Length);
                            // play.SendData(data3);

                            // byte[] data4 = {40,0,254,3,0,0,0,0,24,87,7,0,76,152,15,0,225,3,214,1,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
                            // play.GetGamePackKeyEx().EncodePacket(ref data4, data4.Length);
                            // play.SendData(data4);
                            // byte[] data5= {20,0,249,3, 66, 15, 0, 1,1,0,0,0,28,0,0,0,0,0,0,0};
                            // play.GetGamePackKeyEx().EncodePacket(ref data5, data5.Length);
                            // play.SendData(data5);
                            // byte[] data6 = { 20, 0, 249, 3, 66, 15, 0, 1, 1, 0, 0, 0, 26, 0, 0, 0, 2, 0, 0, 0 };
                            // play.GetGamePackKeyEx().EncodePacket(ref data6, data6.Length);
                            // play.SendData(data6);
                            // byte[] data7 = {32,0,77,4,48,101,1,0,204,165,16,0,225,3,214,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0};
                            // play.GetGamePackKeyEx().EncodePacket(ref data7, data7.Length);
                            // play.SendData(data7);
                            //byte[] data8 = {16,0,244,3, 66, 15, 0, 1,0,0,0,0,0,0,0,0};
                            //play.GetGamePackKeyEx().EncodePacket(ref data8, data8.Length);
                            //play.SendData(data8);
                            byte[] data = { 28, 0, 249, 3, 84, 66, 15, 0, 2, 0, 0, 0, 26, 0, 0, 0, 6, 0, 0, 0, 12, 0, 0, 0, 33, 92, 108, 58 };
                            play.GetGamePackKeyEx().EncodePacket(ref data, data.Length);
                            play.SendData(data);
                            break;
                        }
                    case "引诱":
                        {

                            NetMsg.MsgMonsterMagicInjuredInfo injuredInfo = new NetMsg.MsgMonsterMagicInjuredInfo();
                            injuredInfo.tag = 21;
                            //   public int time;                //时间
                            //public uint roleid;             //角色id
                            //public uint monsterid;          //怪物id
                            //public short role_x;           //角色x
                            //public short role_y;           //角色y
                            //public uint tag;                 //标记
                            //public ushort magicid;          //技能id
                            //public ushort magiclv;      //技能等级
                            //public uint injuredvalue;       //攻击伤害值
                            //public int[] param;           //未知参数
                            // 收到网络协议:长度:20协议号:1017
                            //{20,0,249,3,76,152,15,0,1,0,0,0,9,0,0,0,97,0,0,0}
                            //收到网络协议:长度:40协议号:1022
                            byte[] data1 = { 40, 0, 254, 3, 0, 0, 0, 0, 84, 66, 15, 0, 84, 66, 15, 0, 63, 3, 7, 4, 21, 0, 0, 0, 235, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
                            play.GetGamePackKeyEx().EncodePacket(ref data1, data1.Length);
                            play.SendData(data1);
                            //收到网络协议:长度:88协议号:1105
                            byte[] data2 = { 88, 0, 81, 4, 84, 66, 15, 0, 84, 66, 15, 0, 235, 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84, 66, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
                            play.GetGamePackKeyEx().EncodePacket(ref data2, data2.Length);
                            play.SendData(data2);
                            //收到网络协议:长度:16协议号:1104
                            //                            byte[] data3 = { 16, 0, 80, 4, 84, 66, 15, 0, 83, 0, 0, 0, 235, 3, 1, 0 };
                            //                                           play.GetGamePackKeyEx().EncodePacket(ref data3, data3.Length);
                            //                            play.SendData(data3);
                            ////收到网络协议:长度:16协议号:1012
                            //                            byte[] data4 = { 16, 0, 244, 3, 84, 66, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
                            //                                                       play.GetGamePackKeyEx().EncodePacket(ref data4, data4.Length);
                            //                            play.SendData(data4);
                            //收到网络协议:长度:20协议号:1017

                            //byte[] data5 = { 20, 0, 249, 3, 76, 152, 15, 0, 1, 0, 0, 0, 28, 0, 0, 0, 30, 0, 0, 0 };
                            //play.GetGamePackKeyEx().EncodePacket(ref data5, data5.Length);
                            //play.SendData(data5);
                            break;
                        }
                    case "骑士团守护":
                        {
                            //收到网络协议:长度:40协议号:1022
                            byte[] data1 = { 40, 0, 254, 3, 0, 0, 0, 0, 84, 66, 15, 0, 0, 0, 0, 0, 63, 2, 56, 1, 21, 0, 0, 0, 91, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
                            play.GetGamePackKeyEx().EncodePacket(ref data1, data1.Length);
                            play.SendData(data1);
                            //收到网络协议:长度:172协议号:1105
                            byte[] data10 = { 172, 0, 81, 4, 84, 66, 15, 0, 63, 2, 56, 1, 91, 20, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 90, 180, 11, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 91, 180, 11, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 92, 180, 11, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 93, 180, 11, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
                            play.GetGamePackKeyEx().EncodePacket(ref data10, data10.Length);
                            play.SendData(data10);

                            //收到网络协议:长度:81协议号:2069
                            //byte[] data2 = { 81, 0, 21, 8, 90, 180, 11, 0, 84, 66, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 201, 5, 0, 0, 63, 2, 63, 1, 0, 0, 125, 0, 43, 42, 0, 0, 80, 159, 4, 0, 80, 159, 4, 0, 1, 0, 100, 0, 1, 4, 210, 193, 183, 227, 0, 0, 0 };
                            //play.GetGamePackKeyEx().EncodePacket(ref data2, data2.Length);
                            //play.SendData(data2);
                            //收到网络协议:长度:28协议号:1010
                            //byte[] data3 = { 28, 0, 242, 3, 6, 140, 47, 86, 90, 180, 11, 0, 63, 2, 63, 1, 1, 0, 0, 0, 43, 42, 0, 0, 115, 37, 0, 0 };
                            //play.GetGamePackKeyEx().EncodePacket(ref data3, data3.Length);
                            //play.SendData(data3);
                            //收到网络协议:长度:81协议号:2069
                            //byte[] data4 = { 81, 0, 21, 8, 91, 180, 11, 0, 84, 66, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 201, 5, 0, 0, 55, 2, 51, 1, 0, 0, 125, 0, 43, 42, 0, 0, 80, 159, 4, 0, 80, 159, 4, 0, 2, 0, 100, 0, 1, 4, 210, 193, 183, 227, 0, 0, 0 };
                            //play.GetGamePackKeyEx().EncodePacket(ref data4, data4.Length);
                            //play.SendData(data4);
                            //收到网络协议:长度:28协议号:1010
                            //byte[] data5 = { 28, 0, 242, 3, 6, 140, 47, 86, 91, 180, 11, 0, 55, 2, 51, 1, 2, 0, 0, 0, 43, 42, 0, 0, 115, 37, 0, 0 };
                            //play.GetGamePackKeyEx().EncodePacket(ref data5, data5.Length);
                            //play.SendData(data5);
                            //收到网络协议:长度:81协议号:2069
                            //byte[] data6 = { 81, 0, 21, 8, 92, 180, 11, 0, 84, 66, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 201, 5, 0, 0, 67, 2, 51, 1, 0, 0, 125, 0, 43, 42, 0, 0, 80, 159, 4, 0, 80, 159, 4, 0, 5, 0, 100, 0, 1, 4, 210, 193, 183, 227, 0, 0, 0 };
                            //play.GetGamePackKeyEx().EncodePacket(ref data6, data6.Length);
                            //play.SendData(data6);
                            //收到网络协议:长度:28协议号:1010
                            //byte[] data7 = { 28, 0, 242, 3, 6, 140, 47, 86, 92, 180, 11, 0, 67, 2, 51, 1, 5, 0, 0, 0, 43, 42, 0, 0, 115, 37, 0, 0 };
                            //play.GetGamePackKeyEx().EncodePacket(ref data7, data7.Length);
                            //play.SendData(data7);
                            //收到网络协议:长度:81协议号:2069
                            //byte[] data8 = { 81, 0, 21, 8, 93, 180, 11, 0, 84, 66, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 201, 5, 0, 0, 71, 2, 59, 1, 0, 0, 125, 0, 43, 42, 0, 0, 80, 159, 4, 0, 80, 159, 4, 0, 6, 0, 100, 0, 1, 4, 210, 193, 183, 227, 0, 0, 0 };
                            //play.GetGamePackKeyEx().EncodePacket(ref data8, data8.Length);
                            //play.SendData(data8);
                            //收到网络协议:长度:28协议号:1010
                            //byte[] data9 = { 28, 0, 242, 3, 6, 140, 47, 86, 93, 180, 11, 0, 71, 2, 59, 1, 6, 0, 0, 0, 43, 42, 0, 0, 115, 37, 0, 0 };
                            //play.GetGamePackKeyEx().EncodePacket(ref data9, data9.Length);
                            //play.SendData(data9);

                            //收到网络协议:长度:32协议号:1101 //地面持续特效
                            //176, 9, 13, 0 时间戳
                            // 176, 23, 0, 0 特效id
                            //63, 2 x坐标
                            //55,1 y坐标

                            byte[] data11 = { 32, 0, 77, 4, 176, 9, 13, 0, 176, 23, 0, 0, 63, 2, 55, 1, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0 };
                            play.GetGamePackKeyEx().EncodePacket(ref data11, data11.Length);
                            play.SendData(data11);
                            ////收到网络协议:长度:16协议号:1104
                            //byte[] data12 = { 16, 0, 80, 4, 84, 66, 15, 0, 89, 0, 0, 0, 91, 20, 1, 0 };
                            //play.GetGamePackKeyEx().EncodePacket(ref data12, data12.Length);
                            //play.SendData(data12);
                            break;
                        }
                    case "清除特效":
                        {
                            byte[] data11 = { 32, 0, 77, 4, 176, 9, 13, 0, 176, 23, 0, 0, 63, 2, 55, 1, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0 };
                            play.GetGamePackKeyEx().EncodePacket(ref data11, data11.Length);
                            play.SendData(data11);
                            break;
                        }
                    case "下雪":
                        {

                           // 收到网络协议:长度:28协议号:1010
            //        byte[] data1 = {28,0,242,3,232,3,0,0,76,152,15,0,75,1,155,1,0,0,0,0,232,3,0,0,63,37,0,0};
            //                                     play.GetGamePackKeyEx().EncodePacket(ref data1, data1.Length);
            //                            play.SendData(data1);
            ////收到网络协议:长度:28协议号:1010
            //                            byte[] data2 = { 28, 0, 242, 3, 52, 159, 49, 86, 76, 152, 15, 0, 75, 1, 155, 1, 0, 0, 0, 0, 255, 255, 255, 255, 95, 37, 0, 0 };
            //                            play.GetGamePackKeyEx().EncodePacket(ref data2, data2.Length);
            //                            play.SendData(data2);
            //收到网络协议:长度:20协议号:1110
                            //地图id
                            //地图id
                            //类型

                        byte[] data3={20,0,86,4,232,3,0,0,232,3,0,0,0,0,32,0,128,0,18,0};
                              play.GetGamePackKeyEx().EncodePacket(ref data3, data3.Length);
                            play.SendData(data3);
                            break;
                        }
                    case "元素掌控":
                        {
                     //       收到网络协议:长度:40协议号:1022
                            byte[] data1 = { 40, 0, 254, 3, 186, 192, 18, 1, 84, 66, 15, 0, 0, 0, 0, 0, 93, 1, 179, 1, 21, 0, 0, 0, 180, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
                               play.GetGamePackKeyEx().EncodePacket(ref data1, data1.Length);
                            play.SendData(data1);
            //收到网络协议:长度:20协议号:1017
                            byte[] data2 = { 20, 0, 249, 3, 84, 66, 15, 0, 1, 0, 0, 0, 101, 0, 0, 0, 0, 2, 0, 0 };
                            play.GetGamePackKeyEx().EncodePacket(ref data2, data2.Length);
                            play.SendData(data2);
            //收到网络协议:长度:48协议号:1127
                            byte[] data3 = { 48, 0, 103, 4, 84, 66, 15, 0, 128, 81, 1, 0, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0 };
                            play.GetGamePackKeyEx().EncodePacket(ref data3, data3.Length);
                            play.SendData(data3);
                            //收到网络协议:长度:88协议号:1105
                            byte[] data4 = { 88, 0, 81, 4, 84, 66, 15, 0, 0, 0, 0, 0, 180, 20, 0, 0, 4, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            play.GetGamePackKeyEx().EncodePacket(ref data4, data4.Length);
            play.SendData(data4);

            byte[] data5 = { 20, 0, 249, 3, 84, 66, 15, 0, 1, 0, 0, 0, 107, 0, 0, 0, 3, 0, 0, 0 };
            play.GetGamePackKeyEx().EncodePacket(ref data5, data5.Length);
            play.SendData(data5);
                            break;
                        }
                    case WUDI:
                        {
                            if (play.GetTimerSystem().QueryStatus(GameStruct.RoleStatus.STATUS_WUDI) != null)
                            {
                                play.GetTimerSystem().DeleteStatus(GameStruct.RoleStatus.STATUS_WUDI);
                                play.LeftNotice("角色已取消无敌!!!");
                            }
                            else {
                                play.GetTimerSystem().AddStatus(GameStruct.RoleStatus.STATUS_WUDI);
                                play.LeftNotice("角色已无敌!!!");
                            }
                            break;
                        }
                    case "幻兽死亡":
                        {
                            EudemonObject obj = play.GetEudemonSystem().GetBattleEudemonSystem(0);
                            if (obj == null) break;
                            GameStruct.Action action = new GameStruct.Action(GameStruct.Action.DIE);
                            obj.PushAction(action);
                            break;
                        }
                    case "幻兽技能":
                        {
                            EudemonObject obj = play.GetEudemonSystem().GetBattleEudemonSystem(0);
                            if (obj == null) break;
                            ushort magicid = Convert.ToUInt16(option[1]);
                            obj.AddMagicInfo(magicid);
                            break;
                        }
                    case "幻兽等级":
                        {
                            EudemonObject obj = play.GetEudemonSystem().GetBattleEudemonSystem(0);
                            if (obj == null) break;
                            obj.GetEudemonInfo().level = 100;
                            play.GetEudemonSystem().SendEudemonInfo(obj.GetEudemonInfo());
                            break;
                        }
                    case "怪物外观":
                        {
                            uint lookface = Convert.ToUInt32(option[1]);
                            NetMsg.MsgMonsterInfo info = new NetMsg.MsgMonsterInfo();
                            info.id = 500000;
                            info.typeid = 3020;
                            info.lookface = lookface;
                            info.x = play.GetCurrentX();
                            info.y = play.GetCurrentY();
                            info.level = 125;
                            info.maxhp =10000;
                            info.hp = 10000;
                            info.dir = 7;
                            play.SendData(info.GetBuffer(), true);
                            break;
                        }
                    case "怪物名字":
                        {
                            uint typeid = Convert.ToUInt32(option[1]);
                            NetMsg.MsgMonsterInfo info = new NetMsg.MsgMonsterInfo();
                            info.id = 500000;
                            info.typeid = typeid;
                            info.lookface = 1243;
                            info.x = play.GetCurrentX();
                            info.y = play.GetCurrentY();
                            info.level = 125;
                            info.maxhp = 10000;
                            info.hp = 10000;
                            info.dir = 7;
                            play.SendData(info.GetBuffer(), true);
                            break;
                        }
                    case "创建npc":
                        {
                            uint id = Convert.ToUInt32(option[1]);
                            NetMsg.MsgNpcInfo info = new NetMsg.MsgNpcInfo();

                            info.Init(id, play.GetCurrentX(), play.GetCurrentY(), play.GetDir());
                            play.SendData(info.GetBuffer(),true);
                            break;
                        }
                    case GETONLINECOUNT:
                        {
                            play.ChatNotice("当前在线人数:" + UserEngine.Instance().GetOnlineCount().ToString());
                            break;
                        }
                    case "名人堂":
                        {
                            //248,42,0,0  用做NPC索引ID
                            //241,73,2,0  lookface
                            //241,73,2,0  lookface
                            //0, 0, 0, 0 未知
                            //60, 156, 29, 0 动作
                            //1, 0      名人堂排名名次
                            //132,16,2,0  衣服
                            //193, 182, 6, 0 学徒杖 武器
                            //205, 10, 0, 0 战斗力
                            // 178, 2, 0, 0 未知
                            // 33, 0, 0, 0  未知
                            //101, 0        X坐标
                            // 185, 0      Y坐标
                            //132, 0, 0, 0  发型
                            byte[] data = { 195, 0, 246, 3, 248, 42, 0, 0, 241, 73, 2, 0, 241, 73, 2, 0, 0, 0, 0, 0, /*60, 156, 29, 0*/0,0,0,0, 1, 0, 205, 10, 0, 0, 0, 0, 0,
                                              0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 132, 16, 2, 0, 193, 182, 6, 0,/* 178, 2, 0, 0, 33, 0, 0, 0*/0,0,0,0,0,0,0,0,
                                              101, 0, 185, 0, 132, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /*33, 10,*/0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                                              0, 0, 0, /*100*/0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                                              0, 0, 0, 0, 0, 0, 0, 0, 0, 0/*5*/, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
                                              14, 185, 254, 176, 205, 185, 183, 176, 188, 161, 204, 205, 185, 194, 252, 0, 0, 0 };
                            play.SendData(data, true);
                            break;
                        }
                    case NOTICE:
                        {
                            String sMsg = option[1];
                            UserEngine.Instance().SceneNotice(sMsg);
                            break;
                        }
                    case "角色属性":
                        {
                            GameStruct.UserAttribute attr = (GameStruct.UserAttribute)Convert.ToInt32(option[1]);
                            int v = Convert.ToInt32(option[2]);
                            NetMsg.MsgUserAttribute msg = new NetMsg.MsgUserAttribute();
                            msg.role_id = play.GetTypeId();
                            msg.Create(null, null);

                            msg.AddAttribute(attr, (uint)v);
                            play.SendData(msg.GetBuffer(), true);
                            break;
                        }

                }
            }
            catch (System.Exception ex)
            {
                Log.Instance().WriteLog("----------------------------------------------------------------");
                Log.Instance().WriteLog("执行GM命令出错!!" + str);
                Log.Instance().WriteLog(ex.Message);
                Log.Instance().WriteLog(ex.StackTrace);
                Log.Instance().WriteLog("----------------------------------------------------------------");
            }
        }
Пример #2
0
 public override byte[] GetBuffer()
 {
     PacketOut outpack = new PacketOut(mKey);
     for (int i = 0; i < strcount; i++)
     {
         mMsgLen += (ushort)(1 + Coding.GetDefauleCoding().GetBytes(liststr[i]).Length);
     }
     outpack.WriteUInt16(mMsgLen);
     outpack.WriteUInt16(mParam);
     outpack.WriteUInt16(unTxtAttribute);
     outpack.WriteUInt16(tag);
     outpack.WriteInt32(param);
     outpack.WriteInt32(param1);
     outpack.WriteInt32(param2);
     outpack.WriteByte(strcount);
     for (int i = 0; i < strcount; i++)
     {
         outpack.WriteString(liststr[i]);
     }
     outpack.WriteByte(0);
     outpack.WriteByte(0);
     outpack.WriteByte(0);
     return outpack.Flush();
 }
Пример #3
0
     public override byte[] GetBuffer()
     {
         PacketOut outpack = new PacketOut(mKey);
         byte nNameLen = (byte)GameBase.Core.Coding.GetDefauleCoding().GetBytes(name).Length;
         mMsgLen += nNameLen;
         outpack.WriteUInt16(mMsgLen);
         outpack.WriteUInt16(mParam);
         outpack.WriteUInt32(roleid);
         outpack.WriteUInt32(lookface);
         outpack.WriteUInt32(hair);
         outpack.WriteUInt32(gold);
         outpack.WriteUInt32(gamegold);
         outpack.WriteUInt32(exp);
         outpack.WriteUInt32(expparam);
         outpack.WriteUInt32(mentorexp);
         outpack.WriteUInt32(mercenarexp);
         outpack.WriteUInt32(potential);
         outpack.WriteUInt16(attackpower);
         outpack.WriteUInt16(constitution);
         outpack.WriteUInt16(doage);
         outpack.WriteUInt16(decdoage);
         outpack.WriteUInt16(health);
        // outpack.WriteUInt16(soul);
         outpack.WriteUInt16(magic_attack);
         outpack.WriteUInt16(addpoint);
         outpack.WriteUInt16(life);
         outpack.WriteUInt16(maxlife);
         outpack.WriteUInt16(manna);
         outpack.WriteUInt32(param);
         outpack.WriteUInt32(param1);
         outpack.WriteUInt16(pk);
         outpack.WriteByte(level);
         outpack.WriteByte(profession);
         outpack.WriteByte(param2);
         outpack.WriteByte(param3);
         outpack.WriteByte(param4);
         outpack.WriteByte(mentorlevel);
         outpack.WriteByte(param14);
         outpack.WriteByte(guanjue);
        // outpack.WriteUInt16(Mercenarylevel);
         outpack.WriteUInt16(maxpetcall);
         outpack.WriteInt32(exploit);
         outpack.WriteInt32(bonuspoint);
         outpack.WriteByte(edubroodpacksize);
         outpack.WriteByte(winglevel);
         outpack.WriteByte(godpetpackagelimit);
         outpack.WriteByte(demonlev);
         outpack.WriteInt32(demonexp);
         outpack.WriteInt32(demonexpparam);
         outpack.WriteInt32(param5);
         outpack.WriteInt32(godlevel);
         outpack.WriteByte(param9);
         outpack.WriteByte(param11);
         outpack.WriteUInt16(param10);
 
         for (int i = 0; i < param6.Length; i++)
         {
             outpack.WriteInt32(param6[i]);
         }
         outpack.WriteInt32(originalserverid);
         outpack.WriteUInt16(wordtreeareaid);
         for (int i = 0; i < param7.Length; i++)
         {
             outpack.WriteInt32(param7[i]);
         }
         outpack.WriteUInt16(param8);
         outpack.WriteByte(2);
         outpack.WriteString(name);
         for (int i = 0; i < param13.Length; i++)
         {
             outpack.WriteByte(param13[i]);
         }
      
   
         return outpack.Flush();
     }
Пример #4
0
        //获取远程摊位
        //id 为从指定序号摊位 -1为自动顺序
        public void GetRemotePtich(PlayerObject play,int id = -1)
        {
            int ptich_id = -1;
            if (id != -1 && id >= 0 && id < mListPtichInfo.Count)
            {
                if (mListPtichInfo[id].play == null)
                {
                    play.MsgBox("该摊位未开放");
                    return;
               }
                ptich_id = id;
            }else
            {
                    ptich_id = GetRemotePtichId(play.GetCurrentRemotePtichId());
            }

            if (ptich_id == -1) return; //无摊位 返回
            play.SetCurrentRemotePtichId(ptich_id);

            //远程摊位信息
            String sName = mListPtichInfo[ptich_id].play.GetName();
            int nLen = 13 + Coding.GetDefauleCoding().GetBytes(sName).Length;
            PacketOut outpack = new PacketOut();
            outpack.WriteInt16((short)nLen);
            outpack.WriteInt16(1015);

               // {19,0,247,3,14,0,0,0,125,0,1,6,203,167,208,161,187,239,0}
            outpack.WriteInt32(ptich_id + 1);
            outpack.WriteInt16(125);
            outpack.WriteByte(1);
            outpack.WriteString(sName);
            outpack.WriteByte(0);
            play.SendData(outpack.Flush(), true);
            for (int i = 0; i < mListPtichInfo[ptich_id].mSellItemList.Count
                ; i++)
            {
                RoleItemInfo item_info = null;
                RoleData_Eudemon eudemon = null;
                if (mListPtichInfo[ptich_id].mSellItemList[i].item_id >= IDManager.eudemon_start_id)
                {
                    eudemon = mListPtichInfo[ptich_id].play.GetEudemonSystem().FindEudemon(
                        mListPtichInfo[ptich_id].mSellItemList[i].item_id);
                    if (eudemon == null) continue;
                    item_info = mListPtichInfo[ptich_id].play.GetItemSystem().FindItem(eudemon.itemid);
                }
                else
                {
                    item_info = mListPtichInfo[ptich_id].play.GetItemSystem().FindItem(
                    mListPtichInfo[ptich_id].mSellItemList[i].item_id);
                }

                if (item_info != null)
                {
                    NetMsg.MsgPtichItemInfo msg = new NetMsg.MsgPtichItemInfo(item_info,
                        (uint)(ptich_id + 1), mListPtichInfo[ptich_id].mSellItemList[i].price, mListPtichInfo[ptich_id].mSellItemList[i].sell_type,true);
                    play.SendData(msg.GetBuffer(), true);
                    //发送幻兽信息
                    if (item_info.typeid >= IDManager.eudemon_start_id)
                    {
                        mListPtichInfo[ptich_id].play.GetEudemonSystem().SendLookPtichEudemonInfo(play, eudemon);

                    }
                }
            }
        }
Пример #5
0
     public override byte[] GetBuffer()
     {
       
         PacketOut outpack = new PacketOut(mKey);
         byte[] data = Coding.GetDefauleCoding().GetBytes(name);
         mMsgLen += (ushort)data.Length;
         outpack.WriteUInt16(mMsgLen);
         outpack.WriteUInt16(mParam);
         outpack.WriteUInt32(id);
         outpack.WriteUInt32(lookface);
         outpack.WriteBuff(param);
         outpack.WriteUInt32(play_id);
         outpack.WriteInt32(life);
         outpack.WriteInt32(life_max);
         outpack.WriteInt16(x);
         outpack.WriteInt16(y);
         outpack.WriteInt16(dir);
         outpack.WriteByte(wuxing);
       
         outpack.WriteBuff(param1);
         outpack.WriteUInt32(monsterid);
         outpack.WriteInt32(param3);
         outpack.WriteInt32(param4);
 outpack.WriteInt32(param5);
   outpack.WriteInt32(star);
  
         outpack.WriteBuff(param2);
         outpack.WriteByte(count);
         outpack.WriteString(name);
         outpack.WriteInt16(0);
         return outpack.Flush();
     }
Пример #6
0
     public override byte[] GetBuffer()
     {
 
         if (legion_id1 == 0)
         {
             legion_id1 = legion_id;
         }
         PacketOut outpack = new PacketOut(mKey);
         outpack.WriteUInt16(mMsgLen);
         outpack.WriteUInt16(mParam);
         outpack.WriteUInt32(legion_id);
         outpack.WriteInt32(money);
         outpack.WriteInt32(devote);
         outpack.WriteBuff(param);
         outpack.WriteInt32(param1);
         outpack.WriteInt32(param2);
         outpack.WriteInt16(param3);
         outpack.WriteInt16(place);
         outpack.WriteInt16(param4);
         outpack.WriteByte(title);
         outpack.WriteBuff(param5);
         byte[] byte_name = Coding.GetDefauleCoding().GetBytes(legion_name);
         outpack.WriteBuff(byte_name);
         int nLen = 18 - byte_name.Length;
         if (nLen > 0)
         {
             byte[] byte_len = new byte[nLen];
             byte_len = new byte[nLen];
             outpack.WriteBuff(byte_len);
         }
         outpack.WriteUInt32(legion_id1);
         outpack.WriteBuff(param6);
         return outpack.Flush();
     }
Пример #7
0
        public override byte[] GetBuffer()
        {
            mMsgLen++; //字符串长度
            for (int i = 0; i < str.Count; i++)
            {
                mMsgLen += (ushort)(1 + Coding.GetDefauleCoding().GetBytes(str[i]).Length);
            }
            PacketOut outpack = new PacketOut(mKey);
            outpack.WriteUInt16(mMsgLen);
            outpack.WriteUInt16(mParam);
            outpack.WriteUInt32(role_id);
            outpack.WriteUInt32(face_sex);
            outpack.WriteUInt32(face_sex1);
            for (int i = 0; i < param.Length; i++)
            {
                outpack.WriteInt32(param[i]);
            }
            outpack.WriteUInt32(legion_id);
            outpack.WriteUInt32(armor_id);
            outpack.WriteUInt32(wepon_id);
            outpack.WriteInt32(param1);
            outpack.WriteUInt32(rid_id);
            //如果是坐骑有一个标识。。目前暂时不太清楚这个参数有什么用
            if (rid_id > 0)
            {
                //2015.10.15  20下标是角色缩放。。。
                param11[22] = 75; //这个是幻兽星级,根据幻兽星级显示坐骑的外观
            }
        
            outpack.WriteInt16(x);
            outpack.WriteInt16(y);
            outpack.WriteUInt32(hair_id);
            outpack.WriteByte(dir);
            outpack.WriteByte(TodayGuideCountByOther);
            outpack.WriteUInt16(param2);
            outpack.WriteUInt32(action);
            outpack.WriteByte(level);
            outpack.WriteByte(job);

            outpack.WriteInt16(param6);
            outpack.WriteByte(param7);
            outpack.WriteInt16(param8);
            outpack.WriteByte(guanjue);
 
            outpack.WriteBuff(param9);
            outpack.WriteByte(legion_title);
            outpack.WriteBuff(param10);
            outpack.WriteInt16(legion_place);
            //public byte[] param11 = new byte[35];
            //public uint legion_id1; //军团id?
            outpack.WriteBuff(param11);
            outpack.WriteUInt32(legion_id1);
            for (int i = 0; i < param5.Length; i++)
            {
                outpack.WriteByte(param5[i]);
            }
            outpack.WriteByte((byte)str.Count);
            for (int i = 0; i < str.Count; i++)
            {
                outpack.WriteString(str[i]);
              //  outpack.WriteByte(0);
            }
            for (int i = 0; i < param3.Length; i++)
            {
                outpack.WriteByte(param3[i]);
            }
           // Log.Instance().WriteLog(GamePacketKeyEx.byteToText(outpack.GetNormalBuff()));
            return outpack.Flush();
        }
Пример #8
0
 public override byte[] GetBuffer()
 {
     byte[] data = Coding.GetUtf8Coding().GetBytes(str);
     mMsgLen += (ushort)(1 + data.Length);
     PacketOut outpack = new PacketOut(mKey);
     outpack.WriteUInt16(mMsgLen);
     outpack.WriteUInt16(mParam);
     outpack.WriteInt32(type);
     outpack.WriteInt16(tag);
     outpack.WriteByte(tag2);
     outpack.WriteString(str);
     for (int i = 0; i < param1.Length; i++)
     {
         outpack.WriteByte(param1[i]);
     }
     return outpack.Flush();
 }
Пример #9
0
        public override byte[] GetBuffer()
        {

            mMsgLen += (ushort)GameBase.Core.Coding.GetDefauleCoding().GetBytes(text).Length;
            mMsgLen += (ushort)param3.Length;
            PacketOut outpack = new PacketOut(mKey);
            outpack.WriteUInt16(mMsgLen);
            outpack.WriteUInt16(mParam);
            outpack.WriteInt32(param);
            outpack.WriteUInt16(param2);
            outpack.WriteByte(optionid);
            outpack.WriteUInt16(interactType);
           
            outpack.WriteString(text);
            for(int i = 0;i < param3.Length;i++)
            {
                outpack.WriteByte(param3[i]);
            }

            return outpack.Flush();
        }
Пример #10
0
        public override byte[] GetBuffer()
        {
            PacketOut outpack = new PacketOut(mKey);
            outpack.WriteUInt16(mMsgLen);
            outpack.WriteUInt16(mParam);
            outpack.WriteInt32(time);
            outpack.WriteUInt32(roleId);
            outpack.WriteUInt32(idTarget);
            outpack.WriteUInt16(usPosX);
            outpack.WriteUInt16(usPosY);
            outpack.WriteUInt32(tag);
            outpack.WriteUInt16(skillid);
            outpack.WriteUInt32(usType);
 
            for (int i = 0; i < param.Length; i++)
            {
                outpack.WriteByte(param[i]);
            }
            return outpack.Flush();
        }
Пример #11
0
        //查看幻兽- 把自身装备信息发给对方
        public void SendLookEudemonInfo(PlayerObject target)
        {
            uint play_id = play.GetTypeId();

            PacketOut outpack = new PacketOut();

            EudemonObject obj = null;
            for (int i = 0; i < mListObj.Count; i++)
            {
                obj = mListObj[i];
                uint itemid = obj.GetEudemonInfo().itemid;
                RoleItemInfo item_info = play.GetItemSystem().FindItem(itemid);
                RoleData_Eudemon info = obj.GetEudemonInfo();
                if (item_info == null) continue;
                //发送道具信息
                outpack = new PacketOut();
                int nLen = 84 + Coding.GetDefauleCoding().GetBytes(item_info.forgename).Length;
                outpack.WriteInt16((short)nLen);
                outpack.WriteInt16(1008); //道具信息
                outpack.WriteUInt32(play_id);
                outpack.WriteUInt32(info.GetTypeID());
                outpack.WriteUInt32(item_info.itemid);
                outpack.WriteInt32(0);
                outpack.WriteByte(NetMsg.MsgItemInfo.TAG_LOOKROLEEUDEMONINFO); //幻兽背包
                outpack.WriteByte(0);
                outpack.WriteByte(NetMsg.MsgItemInfo.ITEMPOSITION_EUDEMON_PACK);//幻兽背包
                byte[] _data = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 };
                outpack.WriteBuff(_data);
                outpack.WriteString(item_info.forgename);
                outpack.WriteByte(0);
                outpack.WriteByte(0);
                outpack.WriteByte(0);
                target.SendData(outpack.Flush(), true);
                //target.GetItemSystem().SendItemInfo(item_info, NetMsg.MsgItemInfo.TAG_LOOKROLEEUDEMONINFO);

                //发送幻兽详细信息
                NetMsg.MsgEudemonInfo msg = new NetMsg.MsgEudemonInfo();

                msg.id = info.GetTypeID();
                msg.tag = 2;
                msg.AddAttribute(GameStruct.EudemonAttribute.Atk_Max, info.atk_max);
                msg.AddAttribute(GameStruct.EudemonAttribute.Atk_Min, info.atk_min);
                msg.AddAttribute(GameStruct.EudemonAttribute.MagicAtk_Max, info.magicatk_max);
                msg.AddAttribute(GameStruct.EudemonAttribute.MagicAtk_Min, info.magicatk_min);
                msg.AddAttribute(GameStruct.EudemonAttribute.Defense, info.defense);
                msg.AddAttribute(GameStruct.EudemonAttribute.Magic_Defense, info.magicdef);
                msg.AddAttribute(GameStruct.EudemonAttribute.Life, info.life);
                msg.AddAttribute(GameStruct.EudemonAttribute.Life_Max, info.life_max);
                msg.AddAttribute(GameStruct.EudemonAttribute.Intimacy, info.intimacy);
                msg.AddAttribute(GameStruct.EudemonAttribute.Level, info.level);
                msg.AddAttribute(GameStruct.EudemonAttribute.WuXing, info.wuxing);
                msg.AddAttribute(GameStruct.EudemonAttribute.Luck, info.luck);
                msg.AddAttribute(GameStruct.EudemonAttribute.Recall_Count, info.recall_count);
                msg.AddAttribute(EudemonAttribute.Card, info.card);
                msg.AddAttribute(EudemonAttribute.Exp, info.exp);
                msg.AddAttribute(EudemonAttribute.Quality, info.quality);
                msg.AddAttribute(EudemonAttribute.Init_Atk, info.GetInitAtk());
                msg.AddAttribute(EudemonAttribute.Init_Magic_Atk, info.GetInitMagicAtk());
                msg.AddAttribute(EudemonAttribute.Init_Defense, info.GetInitDefense());
                msg.AddAttribute(EudemonAttribute.Init_Life, info.init_life);
                msg.AddAttribute(EudemonAttribute.Life_Grow_Rate, ConvertGrowRate(info.life_grow_rate));
                msg.AddAttribute(EudemonAttribute.Atk_Min_Grow_Rate, ConvertGrowRate(info.phyatk_grow_rate));
                msg.AddAttribute(EudemonAttribute.Atk_Max_Grow_Rate, ConvertGrowRate(info.phyatk_grow_rate_max));
                msg.AddAttribute(EudemonAttribute.MagicAtk_Min_Grow_Rate, ConvertGrowRate(info.magicatk_grow_rate));
                msg.AddAttribute(EudemonAttribute.MagicAtk_Max_Grow_Rate, ConvertGrowRate(info.magicatk_grow_rate_max));
                msg.AddAttribute(EudemonAttribute.Defense_Grow_Rate, ConvertGrowRate(info.defense_grow_rate));
                msg.AddAttribute(EudemonAttribute.MagicDefense_Grow_Rate, ConvertGrowRate(info.magicdef_grow_rate));
                GameStruct.MonsterInfo _info = EudemonObject.GetMonsterInfo(play, info.itemid);
                if (_info != null)
                {
                    msg.AddAttribute(EudemonAttribute.Riding, _info.eudemon_type);
                }
                target.SendData(msg.GetBuffer(), true);

            }
             //   收到网络协议:长度:99协议号:1008
            //byte[] data1 = {99,0,240,3,73,48,96,5,253,159,138,131,93,92,16,0,0,0,0,0,7,0,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,14,218,164,186,211,189,228,193,233,161,164,206,172,193,208,0,0,0};
            //            target.SendData(data1,true);
            //            //收到网络协议:长度:143协议号:1116
            //byte[] data2 = {143,0,92,4,253,159,138,131,183,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,73,48,96,5,220,3,0,0,220,3,0,0,199,1,52,2,6,0,3,0,0,0,0,0,29,26,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,93,92,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,14,218,164,186,211,189,228,193,233,161,164,206,172,193,208,0,0};
            //              target.SendData(data2,true);
            //            //收到网络协议:长度:24协议号:2037
            //              byte[] data3 = { 24, 0, 245, 7, 2, 0, 0, 0, 253, 159, 138, 131, 1, 0, 0, 0, 24, 0, 0, 0, 7, 0, 0, 0 };
            //              target.SendData(data3, true);
            ////收到网络协议:长度:496协议号:2037
            //byte[] data4 = {240,1,245,7,2,0,0,0,253,159,138,131,60,0,0,0,6,0,0,0,220,3,0,0,7,0,0,0,220,3,0,0,10,0,0,0,37,0,0,0,8,0,0,0,149,0,0,0,9,0,0,0,51,235,16,0,55,0,0,0,0,0,0,0,12,0,0,0,3,0,0,0,14,0,0,0,0,0,0,0,15,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,17,0,0,0,0,0,0,0,18,0,0,0,0,0,0,0,19,0,0,0,3,0,0,0,21,0,0,0,5,0,0,0,23,0,0,0,1,0,0,0,25,0,0,0,202,0,0,0,26,0,0,0,188,4,0,0,27,0,0,0,142,3,0,0,28,0,0,0,9,0,0,0,50,0,0,0,1,0,32,0,73,0,0,0,0,0,0,0,51,0,0,0,0,0,0,0,59,0,0,0,0,0,0,0,60,0,0,0,0,0,0,0,61,0,0,0,0,0,0,0,62,0,0,0,0,0,0,0,63,0,0,0,11,0,0,0,64,0,0,0,0,0,0,0,65,0,0,0,0,0,0,0,66,0,0,0,0,0,0,0,74,0,0,0,0,0,0,0,75,0,0,0,0,0,0,0,76,0,0,0,0,0,0,0,77,0,0,0,0,0,0,0,78,0,0,0,0,0,0,0,79,0,0,0,0,0,0,0,80,0,0,0,0,0,0,0,81,0,0,0,0,0,0,0,84,0,0,0,0,0,0,0,20,0,0,0,0,0,0,0,24,0,0,0,7,0,0,0,13,0,0,0,48,0,0,0,1,0,0,0,38,0,0,0,0,0,0,0,83,0,0,0,3,0,0,0,250,0,0,0,2,0,0,0,221,1,0,0,4,0,0,0,182,1,0,0,5,0,0,0,196,0,0,0,64,0,0,0,0,0,0,0,65,0,0,0,0,0,0,0,66,0,0,0,0,0,0,0,82,0,0,0,0,0,0,0,36,0,0,0,162,10,0,0,37,0,0,0,233,3,0,0,38,0,0,0,208,8,0,0,39,0,0,0,234,25,0,0,40,0,0,0,144,50,0,0,41,0,0,0,164,46,0,0,42,0,0,0,72,20,0,0,83,0,0,0,50,0,0,0};
            //target.SendData(data4, true);
            //收到网络协议:长度:20协议号:1103
            //{20,0,79,4,253,159,138,131,0,0,0,0,213,7,0,0,0,0,0,0}
            //收到网络协议:长度:20协议号:1103
            //{20,0,79,4,253,159,138,131,0,0,0,0,233,3,0,0,0,0,0,0}
            //收到网络协议:长度:20协议号:1103
            //{20,0,79,4,253,159,138,131,0,0,0,0,185,11,0,0,0,0,0,0}
            //收到网络协议:长度:20协议号:1103
            //{20,0,79,4,253,159,138,131,0,0,0,0,230,7,0,0,0,0,0,0}
            //收到网络协议:长度:172协议号:1117
            //byte[] data5 = { 172, 0, 93, 4 };
            //    byte[] data6 = {0,0,0,0,0,70,0,0,0,0,1,0,12,228,48,138,92,92,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,15,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,4,0,0,0,0,0,15,0,26,18,104,0,107,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,164,186,211,189,228,193,233,161,164,206,172,193,208,0,0,0,0,0,0,0,0,0,0,0,0};
            //    PacketOut outpack = new PacketOut();
            //    outpack.WriteBuff(data5);
            //    outpack.WriteUInt32(play.GetTypeId());
            //    outpack.WriteBuff(data6);
            //    target.SendData(outpack.Flush(), true);
            //for (int i = 0; i < mListObj.Count; i++);
            //{
            //    EudemonObject obj = mListObj[i];
            //    GameStruct.RoleItemInfo item = play.GetItemSystem().FindItem(obj.GetEudemonInfo().itemid);
            //    if (item == null) continue;
            //    target.GetItemSystem().SendItemInfo(item, NetMsg.MsgItemInfo.TAG_LOOKROLEEUDEMONINFO);
            //    target.GetEudemonSystem().SendEudemonInfo(obj.GetEudemonInfo(),false,true);
            //}
        }
Пример #12
0
        public void SendLegionInfo()
        {
            //广播给周围的人刷新自身信息
            play.RefreshRoleInfo();
            NetMsg.MsgSelfLegionInfo self_info = new NetMsg.MsgSelfLegionInfo();
            self_info.Create(null, play.GetGamePackKeyEx());
            if (legion == null)
            {
                self_info.legion_name = "";
                self_info.legion_id = 0;
                self_info.money = 0;
                self_info.devote =0;
                self_info.place = 0;
                self_info.title = 0;
                self_info.title = 0;
                play.SendData(self_info.GetBuffer());

                return;
            }

            //byte[] dat5 = { 108, 0, 82, 4, 246, 0, 0, 0, 144, 208, 3, 0, 144, 208, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 232, 3, 0, 0, 4/*!!!头衔*/, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 210, 176, 177, 200, 186, 243, 204, 236, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 246, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            //play.GetGamePackKeyEx().EncodePacket(ref dat5, dat5.Length);
            //play.SendData(dat5);
            //byte[] data10 = { 21, 0, 247, 3, 246, 0, 0, 0, 3, 0, 1, 8, 196, 234, 201, 217, 187, 196, 204, 198, 0 };
            //play.GetGamePackKeyEx().EncodePacket(ref data10, data10.Length);
            //play.SendData(data10);

            //return;

            self_info.legion_name = legion.GetBaseInfo().name;
            self_info.legion_id = legion.GetBaseInfo().id;
            self_info.money = (int)legion.GetBaseInfo().money;
            self_info.devote = GetDevote();
            self_info.place = GetPlace();
            self_info.title = legion.GetBaseInfo().title;
            play.SendData(self_info.GetBuffer());

            //收到网络协议:长度:21协议号:1015
            byte[] legion_name = Coding.GetDefauleCoding().GetBytes(legion.GetBaseInfo().name);
            PacketOut outpack = new PacketOut(play.GetGamePackKeyEx());
            outpack.WriteUInt16((ushort)(12 + legion_name.Length));
            outpack.WriteUInt16(1015);
            outpack.WriteUInt32(legion.GetBaseInfo().id);
            outpack.WriteUInt16(3);
            outpack.WriteByte(1);
            outpack.WriteString(legion.GetBaseInfo().name);
            outpack.WriteByte(0);

            play.SendData(outpack.Flush());
        }
Пример #13
0
 public void SendInfo(PlayerObject play)
 {
     byte[] data3 = { 41, 0, 238, 7, 28, 162, 1, 0, 91, 1, 27, 2, 144, 1, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 76, 0, 0, 0, 1, 8, 211, 249, 193, 250, 207, 201, 181, 192, 0, 0, 0 };
     //play.SendData(data3, true);
     PacketOut outpack = new PacketOut();
     String sName = mPlay.GetName();
     int nLen = 33 + GameBase.Core.Coding.GetDefauleCoding().GetBytes(sName).Length;
     outpack.WriteInt16((short)nLen);
     outpack.WriteInt16(2030);
     outpack.WriteUInt32(this.GetTypeId());
     outpack.WriteInt16(this.GetCurrentX());
     outpack.WriteInt16(this.GetCurrentY());
     outpack.WriteInt32(400);//144, 1, 0, 0
     outpack.WriteInt32(34);
     outpack.WriteInt32(0);
     outpack.WriteInt32(76);
     outpack.WriteByte(1);
     outpack.WriteString(sName);
     outpack.WriteByte(0);
     outpack.WriteByte(0);
     outpack.WriteByte(0);
       //  Log.Instance().WriteLog(GamePacketKeyEx.byteToText(outpack.GetNormalBuff()));
     play.SendData(outpack.Flush(), true);
      //   byte[] data3 = { 41, 0, 238, 7, 28, 162, 1, 0, 91, 1, 27, 2, 144, 1, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 76, 0, 0, 0, 1, 8, 211, 249, 193, 250, 207, 201, 181, 192, 0, 0, 0 };
        // this.SendData(data3, true);
 }
Пример #14
0
 public override byte[] GetBuffer()
 {
     combo.WriteByte(0);
     byte[] combodata = combo.GetBuffer();
    // Log.Instance().WriteLog(Coding.GetDefauleCoding().GetString(combodata));
    
     mMsgLen += (ushort)combodata.Length;
     PacketOut outpack = new PacketOut(mKey);
     outpack.WriteUInt16(mMsgLen);
     outpack.WriteUInt16(mParam);
     outpack.WriteUInt32(count);
     outpack.WriteInt16(type);
     outpack.WriteByte((byte)count);
    
     outpack.WriteBuff(combodata);
     byte[] ret = outpack.Flush();
    // Log.Instance().WriteLog(GamePacketKeyEx.byteToText(ret));
     return ret;
 }
Пример #15
0
        public override byte[] GetBuffer()
        {
            if (forgetname.Length > 0)
            {
                mMsgLen = (ushort)(mMsgLen + Coding.GetDefauleCoding().GetBytes(forgetname).Length + 1);
            }
            PacketOut outpack = new PacketOut();
            outpack.WriteUInt16(mMsgLen);
            outpack.WriteUInt16(mParam);
            outpack.WriteUInt32(id);
            outpack.WriteUInt32(ptich_obj_id);
            outpack.WriteInt32(price);
            outpack.WriteUInt32(base_item_id);
            outpack.WriteInt16(max_dura);
            outpack.WriteInt16(cur_dura);
            outpack.WriteByte(tag);
            outpack.WriteByte(status);
            outpack.WriteByte(postion);
            outpack.WriteByte(gem1);
            outpack.WriteByte(gem2);
            outpack.WriteInt16(param1);
            outpack.WriteByte(strong_lv);
            outpack.WriteInt32(param2);
            outpack.WriteInt32(param3);
            outpack.WriteInt16(soul_lv);
            outpack.WriteBuff(param4);
            outpack.WriteByte(di_attack);
            outpack.WriteByte(shui_attack);
            outpack.WriteByte(huo_attack);
            outpack.WriteByte(feng_attack);
            outpack.WriteByte(effect);
            outpack.WriteByte(gem3);
            outpack.WriteBuff(param5);
            if (forgetname.Length > 0)
            {
                //六个空字节
                outpack.WriteInt32(0);
                outpack.WriteInt16(0);

                outpack.WriteByte(1);
                outpack.WriteString(forgetname);
                outpack.WriteByte(0);
                outpack.WriteByte(0);
                outpack.WriteByte(0);
            }
            else
            {
                outpack.WriteInt32(0);
            }
         
            return outpack.Flush();
        }
Пример #16
0
 public override byte[] GetBuffer()
 {
     for (int i = 0; i < str.Length; i++)
     {
         byte[] data = Coding.GetDefauleCoding().GetBytes(str[i]);
         mMsgLen += /*第一个字节为字符串长度*/(ushort)(data.Length + 1);
     }
    
     PacketOut outpack = new PacketOut(mKey);
     outpack.WriteUInt16(mMsgLen);
     outpack.WriteUInt16(mParam);
     outpack.WriteInt32(color);
     outpack.WriteInt16(type);
     outpack.WriteInt16(tag);
     outpack.WriteInt32(param);
     outpack.WriteInt32(param1);
     outpack.WriteInt32(param2);
     outpack.WriteByte(amount);
     for (int i = 0; i < str.Length; i++)
     {
         outpack.WriteString(str[i]);
     }
     outpack.WriteByte(0);
     outpack.WriteByte(0);
     outpack.WriteByte(0);
     return outpack.Flush();
 }
Пример #17
0
        public override byte[] GetBuffer()
        {


            byte nNameLen = (byte)GameBase.Core.Coding.GetDefauleCoding().GetBytes(name).Length;
            mMsgLen += nNameLen;
            PacketOut outpack = new PacketOut(mKey);
            outpack.WriteUInt16(mMsgLen);
            outpack.WriteUInt16(mParam);
            outpack.WriteInt32(time);
            outpack.WriteUInt32(id);
            outpack.WriteUInt32(item_id);
            outpack.WriteUInt16(amount);
            outpack.WriteUInt16(amount_limit);
            outpack.WriteByte(tag);
            outpack.WriteByte(status);
            outpack.WriteByte(postion);
            outpack.WriteByte(gem);
            outpack.WriteByte(gem2);
            outpack.WriteByte(magic);
            outpack.WriteByte(magic2);
            outpack.WriteByte(magic3);
            outpack.WriteInt32(param3);
            outpack.WriteInt32(lock_time);
            outpack.WriteInt32(warghost_exp);
            outpack.WriteInt32(param4);
            outpack.WriteInt32(param5);
            outpack.WriteByte(di_attack);
            outpack.WriteByte(shui_attack);
            outpack.WriteByte(huo_attack);
            outpack.WriteByte(feng_attack);
            outpack.WriteByte(add_eff);
            outpack.WriteByte(param6);
            outpack.WriteByte(param7);
            outpack.WriteInt32(properties);
            outpack.WriteInt16(param10);
           
            outpack.WriteByte(gem3);
            outpack.WriteInt32(god_strong);
            outpack.WriteInt16(param12);
            outpack.WriteInt32(god_exp);
            outpack.WriteInt32(param8);
            outpack.WriteInt32(param1);
            outpack.WriteByte(pram9);
            outpack.WriteString(name);
     
            for (int i = 0; i < param2.Length; i++) outpack.WriteByte(param2[i]);
            return outpack.Flush();
        }
Пример #18
0
        public override byte[] GetBuffer()
        {
            PacketOut outpack = new PacketOut(mKey);
            mMsgLen += (ushort)(152/*道具数据结构信息*/* list_item.Count);
            outpack.WriteUInt16(mMsgLen);
            outpack.WriteUInt16(mParam);
            outpack.WriteInt32(tag);
            outpack.WriteByte(param1);
            outpack.WriteByte(type);
            outpack.WriteInt16(action);
            outpack.WriteInt32(param2);
            outpack.WriteUInt32(playid);
            outpack.WriteInt32((int)list_item.Count);
            byte[] data = null;
            for (int i = 0; i < list_item.Count; i++)
            {
                GameStruct.RoleItemInfo item = list_item[i];
                GameStruct.ItemTypeInfo baseitem = MapServer.ConfigManager.Instance().GetItemTypeInfo(list_item[i].itemid);
                if (baseitem == null)
                {
                    data = new byte[152];
                    outpack.WriteBuff(data);
                    continue;
                }

               outpack.WriteUInt32(item.id);
         
                outpack.WriteUInt32(item.itemid);
              //当前耐久度
                outpack.WriteUInt16(item.amount);
                //最大耐久度
                outpack.WriteUInt16(baseitem.amount_limit);

                outpack.WriteByte(0);  //状态 1.未鉴定 0.已鉴定
                outpack.WriteByte((byte)item.gem1);
                outpack.WriteByte((byte)item.gem2);
                outpack.WriteByte((byte)0); //技能
                outpack.WriteByte((byte)0); //技能
               
                outpack.WriteByte(item.GetStrongLevel());
                outpack.WriteByte((byte)0); //技能
                outpack.WriteInt32(0);
                outpack.WriteInt32(0);//装备锁住时间
                outpack.WriteInt32(item.war_ghost_exp);
                outpack.WriteInt32(0);
                outpack.WriteInt32(0);
                outpack.WriteByte(item.di_attack);//地攻击
                outpack.WriteByte(item.shui_attack);//水攻击
                outpack.WriteByte(item.huo_attack);//火攻击
                outpack.WriteByte(item.feng_attack);//风攻击
                outpack.WriteByte(0);//特效
                outpack.WriteByte(0);
                outpack.WriteByte(0);
                outpack.WriteInt16(0);
                outpack.WriteInt32(0);//道具属性 什么封印道具 系统赠送道具 魂契武器的标识
                outpack.WriteByte((byte)item.gem3);//第三个宝石
                outpack.WriteInt32(item.god_strong); //神炼强度
                outpack.WriteInt16((short)item.god_exp); //神佑经验
                outpack.WriteInt32(0); //未激活时间 
                data = new byte[21];
                outpack.WriteBuff(data);
  


                //写名称-
                 byte[] namebyte = Coding.GetDefauleCoding().GetBytes(baseitem.name);
                 outpack.WriteBuff(namebyte);
                 data = new byte[68 - namebyte.Length];
                 outpack.WriteBuff(data);
 
            }

           // Log.Instance().WriteLog(GamePacketKeyEx.byteToText(outpack.GetNormalBuff()));
            return outpack.Flush();
        }
Пример #19
0
        public override byte[] GetBuffer()
        {
            byte[] bBuff = new byte[18];
            PacketOut outpack = new PacketOut(mKey);
            mMsgLen += (ushort)(List_Obj.Count * (28 + 1)+bBuff.Length);
            if (bSigle)
            {
                mMsgLen += 13;
            }
            outpack.WriteUInt16(mMsgLen);
            outpack.WriteUInt16(mParam);
            outpack.WriteUInt32(nID);
            //单体魔法攻击是对方的id,这样才会有轨迹特效
            if (bSigle)
            {
                outpack.WriteUInt32(nTargetID);
            }
            else
            {
                outpack.WriteInt16(nX);
                outpack.WriteInt16(nY);
            }
            outpack.WriteUInt16(nMagicID);
            outpack.WriteUInt16(nMagicLv);
            outpack.WriteByte(bDir);
            //int nCount = List_Obj.Count == 0 ? 1 : List_Obj.Count;
            outpack.WriteByte((byte)List_Obj.Count);
            outpack.WriteBuff(bBuff);
            if (bSigle)
            {
                bBuff = new byte[43];
            }
            else
            {
                bBuff = new byte[20];
            }
           
            for (int i = 0; i < List_Obj.Count; i++)
            {
                outpack.WriteUInt32(List_Obj[i]);
                outpack.WriteInt32(List_Value[i]);
                outpack.WriteBuff(bBuff);
            }
            outpack.WriteInt32(0);
            outpack.WriteInt32(0);

            outpack.WriteBuff(bBuff);
          //  Log.Instance().WriteLog(GameBase.Network.GamePacketKeyEx.byteToText(outpack.GetNormalBuff()));
            return outpack.Flush();
        } 
Пример #20
0
 public override byte[] GetBuffer()
 {
     PacketOut outpack = new PacketOut(mKey);
     outpack.WriteUInt16(mMsgLen);
     outpack.WriteUInt16(mParam);
     outpack.WriteUInt32(playerid);
     outpack.WriteUInt32(fightpower);
     outpack.WriteByte(type);
     outpack.WriteByte(Online);
     outpack.WriteByte(level);
     outpack.WriteByte(param);
     byte[] namebyte = Coding.GetDefauleCoding().GetBytes(name);
     outpack.WriteBuff(namebyte);
     byte[] end = new byte[32 - namebyte.Length];
     outpack.WriteBuff(end);
     return outpack.Flush();
 }
Пример #21
0
        public override byte[] GetBuffer()
        {
            strlist.Add(str1);
            strlist.Add(str2);
            strlist.Add(str3);
            strlist.Add(str4);
            PacketOut pout = new PacketOut(mKey);
            ushort nLen = 0;
            String str;
          
            for (int i = 0; i < strlist.Count; i++)
            {
                str = (String)strlist[i];
                nLen += (ushort)(Coding.GetDefauleCoding().GetBytes(str).Length + sizeof(byte));
            }
            mMsgLen += 1;
            mMsgLen += nLen;
            pout.WriteUInt16(mMsgLen);
            pout.WriteUInt16(mParam);
            pout.WriteInt32(rgba);
            pout.WriteUInt16(type);
            pout.WriteUInt16(tag);
            pout.WriteInt32(param);
            pout.WriteInt32(param1);
            pout.WriteInt32(param2);
            pout.WriteByte(btype);
          
            pout.WriteString(str1);
           
            pout.WriteString(str2);

            pout.WriteByte(0);
            pout.WriteString(str3);
       

            //pout.WriteString(str4);

            
            pout.WriteByte(0);
            pout.WriteUInt16(param3);
            return pout.Flush();
        }
Пример #22
0
 public override byte[] GetBuffer()
 {
     mMsgLen += (ushort)Coding.GetDefauleCoding().GetBytes(legion_name).Length;
     PacketOut outpack = new PacketOut(mKey);
     outpack.WriteUInt16(mMsgLen);
     outpack.WriteUInt16(mParam);
     outpack.WriteUInt32(legion_id);
     outpack.WriteUInt16(3);
     outpack.WriteByte(1);
     outpack.WriteString(legion_name);
     outpack.WriteByte(0);
     return outpack.Flush();
 }
Пример #23
0
 public override byte[] GetBuffer()
 {
     PacketOut outpack = new PacketOut(mKey);
     outpack.WriteUInt16(mMsgLen);
     outpack.WriteUInt16(mParam);
     outpack.WriteUInt32(roleid);
     outpack.WriteInt16(x);
     outpack.WriteInt16(y);
     outpack.WriteUInt16(magicid);
     outpack.WriteUInt16(magiclv);
     outpack.WriteByte(dir);
     outpack.WriteByte(param);
     for (int i = 0; i < param1.Length; i++)
     {
         outpack.WriteInt32(param1[i]);
     }
         return outpack.Flush();
 }
Пример #24
0
 public override byte[] GetBuffer()
 {
     PacketOut packout = new PacketOut(mKey);
     packout.WriteUInt16(mMsgLen);
     packout.WriteUInt16(mParam);
     packout.WriteInt32(time);
     packout.WriteUInt32(id);
     packout.WriteInt16(x);
     packout.WriteInt16(y);
     packout.WriteByte(dir);
     packout.WriteByte(ucMode);
     packout.WriteUInt16(param);
     packout.WriteInt32(param2);
     return packout.Flush();
 }
Пример #25
0
 public override byte[] GetBuffer()
 {
   
     PacketOut outpack = new PacketOut(mKey);
     outpack.WriteUInt16(mMsgLen);
     outpack.WriteUInt16(mParam);
     outpack.WriteUInt32(id);
     outpack.WriteUInt32(targetid);
     //outpack.WriteInt16(x);
     //outpack.WriteInt16(y);
     outpack.WriteUInt16(magicid);
     outpack.WriteUInt16(level);
     outpack.WriteByte(dir);
     outpack.WriteByte(type);
     outpack.WriteInt16(param);
     for (int i = 0; i < param1.Length; i++) { outpack.WriteInt32(param1[i]); }
     outpack.WriteUInt32(targetid);
     outpack.WriteUInt32(value);
     for (int i = 0; i < param2.Length; i++) { outpack.WriteInt32(param2[i]); }
     return outpack.Flush();
 }
Пример #26
0
        public static void SendConnectMapServer(GameSession session, int key, int key2)
        {
            byte[] defdata = { 232, 16, 67, 3 };
            byte[] defdata2 = { 121, 39, 0, 0, 49, 50, 48, 46, 49, 51, 50, 46, 54,
                                          57, 46, 49, 52, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            byte[] ipdata = Coding.GetDefauleCoding().GetBytes(m_GameServerIP);

            PacketOut packout = new PacketOut(session.GetGamePackKeyEx());
            packout.WriteUInt16(84);
            packout.WriteUInt16(PacketProtoco.S_GAMESERVERINFO);
            packout.WriteInt32(key);
            packout.WriteInt32(key2);
            packout.WriteInt32(m_GameServerPort);
            packout.WriteBuff(defdata);
            packout.WriteBuff(ipdata);
            for (int i = 0; i < 28 - ipdata.Length; i++)
            {
                packout.WriteByte(0);
            }
            packout.WriteBuff(defdata2);

            defdata = packout.Flush();
            server.SendData(session.m_Socket, defdata);
        }
Пример #27
0
        public void ProcessNetMsg(ushort tag, byte[] netdata)
        {
            PlayerObject play = this;
            // Log.Instance().WriteLog("协议号:" + tag.ToString());
            // Log.Instance().WriteLog("data:"+GamePacketKeyEx.byteToText(netdata));
            switch (tag)
            {
                case PacketProtoco.C_MOVE:
                    {

                        //被锁定之后无法进行操作
                        NetMsg.MsgMoveInfo moveinfo = new NetMsg.MsgMoveInfo();
                        moveinfo.Create(netdata, session.GetGamePackKeyEx());
                        byte[] movebuf = null;
                        //角色移动
                        if (moveinfo.id == this.GetTypeId())
                        {
                            if (this.IsLock()) return;
                            //摆摊状态
                            if (this.GetTimerSystem().QueryStatus(GameStruct.RoleStatus.STATUS_PTICH) != null) return;
                            if (this.Move(moveinfo))
                            {
                                moveinfo.id = this.GetTypeId();
                                moveinfo.x = this.GetCurrentX();
                                moveinfo.y = this.GetCurrentY();
                                moveinfo.dir = this.GetDir();
                                movebuf = moveinfo.GetBuffer();
                                //发给自己
                                this.SendData(movebuf);

                            }
                            break;
                        }
                        //幻兽移动
                        play.GetEudemonSystem().Move(moveinfo);

                        //正在跳舞中- 就设置停止跳舞标记
                        if (this.IsDancing())
                        {
                            this.SetDancing(0);
                        }
                        // this.GetGameMap().BroadcastMove(play, movebuf);
                        break;
                    }
                case PacketProtoco.C_OPENNPC: //单击npc
                    {
                        PackIn inpack = new PackIn(netdata);
                        inpack.ReadUInt16();
                        uint npcid = inpack.ReadUInt32();
                        ScripteManager.Instance().ExecuteActionForNpc(npcid, this);
                        break;
                    }
                case PacketProtoco.C_NPCREPLY: //点击npc选项
                    {

                        PackIn inpack = new PackIn(netdata);
                        inpack.ReadUInt16();
                        inpack.ReadUInt32();
                        inpack.ReadUInt16();
                        byte selectindex = inpack.ReadByte();
                        inpack.ReadInt16();
                        String szStr = inpack.ReadString();
                        if (selectindex == 255) //退出该npc对话脚本
                        {
                            this.SetTaskID(0);
                            break;
                        }
                        if ((selectindex > 0))
                        {
                            ScripteManager.Instance().ExecuteOptionId(selectindex, this, szStr);

                        }
                        else if (this.GetTaskID() != 0) //回调-
                        {
                            ScripteManager.Instance().ExecuteOptionId(play.GetTaskID(), this, szStr);
                            this.SetTaskID(0);
                        }
                        break;
                    }
                case PacketProtoco.C_ATTACK:        //攻击
                    {
                        //检测是否是安全区- 防作弊
                        if (this.GetGameMap().IsSafeArea(this.GetCurrentX(), this.GetCurrentY()))
                        {
                            this.LeftNotice("该区域内禁止PK!");
                            break;
                        }
                        NetMsg.MsgAttackInfo info = new NetMsg.MsgAttackInfo();
                        info.Create(netdata, this.GetGamePackKeyEx());
                        if (info.tag == 21)//魔法攻击 要解密
                        {
                            uint nData = ((info.usPosX) ^ (info.roleId) ^ 0x2ED6);
                            info.usPosX = (ushort)(0xFFFF & (BaseFunc.ExchangeShortBits(nData, 16 - 1) + 0xDD12));
                            nData = ((info.usPosY) ^ (info.roleId) ^ 0xB99B);
                            info.usPosY = (ushort)(0xFFFF & (BaseFunc.ExchangeShortBits(nData, 16 - 5) + 0x76DE));
                            info.idTarget = (BaseFunc.ExchangeLongBits((info.idTarget), 13) ^ (info.roleId) ^ 0x5F2D2463) + 0x8B90B51A;
                            info.usType = 0xFFFF & (BaseFunc.ExchangeShortBits(((info.usType) ^ (info.roleId) ^ 0x915D), 16 - 3) + 0x14BE);
                        }

                        if (info.roleId == this.GetTypeId()) //角色攻击
                        {
                            //被锁定之后无法进行操作
                            this.GetFightSystem().SetFighting();
                            //摆摊状态
                            if (this.GetTimerSystem().QueryStatus(GameStruct.RoleStatus.STATUS_PTICH) != null) return;
                            if (this.IsLock() || this.IsDie()) return;
                            //潜行状态就移除
                            if (this.GetTimerSystem().QueryStatus(GameStruct.RoleStatus.STATUS_STEALTH) != null)
                            {
                                this.GetTimerSystem().DeleteStatus(GameStruct.RoleStatus.STATUS_STEALTH);
                            }
                            switch (info.tag)
                            {
                                case 2:     //普通攻击
                                    {
                                        // this.Attack(info);
                                        GetFightSystem().Attack(info);
                                        break;
                                    }
                                case 21:     //魔法攻击
                                    {

                                        //this.MagicAttack(info);
                                        GetFightSystem().MagicAttack(info);
                                        break;
                                    }
                            }
                            //正在跳舞中- 就设置停止跳舞标记
                            if (this.IsDancing())
                            {
                                this.SetDancing(0);
                            }
                            break;
                        }
                        //幻兽攻击
                        this.GetEudemonSystem().Eudemon_Attack(info);
                        break;
                    }
                case PacketProtoco.C_MSGIEM:    //道具操作信息
                    {
                        //被锁定后是无法使用道具的
                        if (this.IsLock()) break;
                        NetMsg.MsgOperateItem info = new NetMsg.MsgOperateItem();
                        info.Create(netdata);
                        switch (info.usAction)
                        {
                            //case NetMsg.MsgOperateItem.ITEMACT_EQUIP:   //穿戴装备
                            //    {
                            //        this.GetItemSystem().Equip(info.id, info.dwData);
                            //        break;
                            //    }
                            case NetMsg.MsgOperateItem.ITEMACT_BUY: //购买道具
                                {
                                    //魔石商店 1207为魔石商店的id
                                    switch (info.id)
                                    {
                                        case GameBase.Config.Define.GMAESHOPID: //魔石商店
                                            {
                                                this.GetItemSystem().BuyGameShopItem(info.dwData, info.amount);
                                                break;
                                            }
                                        case GameBase.Config.Define.LOOKFACEID: //头像商店
                                            {
                                                this.GetItemSystem().ChangeLookFace(info.dwData);
                                                break;
                                            }
                                        case GameBase.Config.Define.HAIRID:     //发型商店
                                            {
                                                this.GetItemSystem().ChangeHair(info.dwData);
                                                break;
                                            }

                                        default:
                                            {
                                                //普通的npc商店
                                                this.GetItemSystem().BuyItem(info.id, info.dwData);
                                                break;
                                            }
                                    }

                                    break;
                                }
                            case NetMsg.MsgOperateItem.ITEMACT_SELL: //卖出道具
                                {
                                    this.GetItemSystem().SellItem(info.id, info.dwData);
                                    break;
                                }
                            case NetMsg.MsgOperateItem.ITEMACT_UNEQUIP: //卸下装备
                                {
                                    this.GetItemSystem().UnEquip(info.id, info.dwData);
                                    break;
                                }
                            case NetMsg.MsgOperateItem.ITEMACT_USE: //使用道具
                                {
                                    //
                                    this.GetItemSystem().UseItem(info.id, info.dwData, (short)info.amount, (short)info.param1);
                                    break;
                                }
                            case NetMsg.MsgOperateItem.ITEMACT_REPAIREQUIP:
                                {
                                    this.GetItemSystem().RepairEquip(info.param1, info.id);
                                    break;
                                }
                            case NetMsg.MsgOperateItem.ITEMACT_DROP:    //丢弃道具,从道具栏
                                {
                                    this.GetItemSystem().DropItemBag(info.id);
                                    break;
                                }

                            case NetMsg.MsgOperateItem.ITEMACT_OPENGEM: //装备打洞
                                {
                                    //Log.Instance().WriteLog("装备打洞:" + play.GetName() + " " + GamePacketKeyEx.byteToText(netdata));
                                    EquipOperation.Instance().OpenGem(this, info.id, (uint)BaseFunc.MakeLong(info.amount,info.param1));
                                    break;
                                }
                            case NetMsg.MsgOperateItem.STRONGACT_SAVEMONEY: //仓库存钱
                                {
                                    this.GetItemSystem().SaveStrongMoney((int)info.dwData);
                                    break;
                                }
                            case NetMsg.MsgOperateItem.STRONGACT_GIVEMONEY: //仓库取钱
                                {
                                    this.GetItemSystem().GiveStrongMoney((int)info.dwData);
                                    break;
                                }
                            case NetMsg.MsgOperateItem.EUDEMONACT_RECALL: //幻兽召回
                                {
                                    this.GetEudemonSystem().Eudemon_ReCall(info.id);
                                    break;
                                }
                            case NetMsg.MsgOperateItem.EUDEMONACT_FIT://幻兽合体
                                {
                                    this.GetEudemonSystem().Eudemon_Fit(info.id);
                                    break;
                                }
                            case NetMsg.MsgOperateItem.EUDEMONACT_BREAK_UP: //幻兽解体
                                {
                                    this.GetEudemonSystem().Eudemon_BreakUp(info.id);
                                    break;
                                }
                            case NetMsg.MsgOperateItem.EUDEMON_EVOLUTION:  //幻兽进化
                                {
                                    this.GetEudemonSystem().Eudemon_Evolution(info.id);
                                    break;
                                }
                            case NetMsg.MsgOperateItem.EUDEMON_DELETE_MAGIC: //删除幻兽技能
                                {
                                    this.GetEudemonSystem().Eudemon_DeleteMagic(info.id, (ushort)info.amount);
                                    break;
                                }
                            case NetMsg.MsgOperateItem.TAKEMOUNT: //骑乘
                                {
                                    //如果幻兽出征了,先召回
                                    EudemonObject obj = this.GetEudemonSystem().GetEudmeonObject(info.id);
                                    if (obj == null) break;
                                    GameStruct.RoleItemInfo item = this.GetItemSystem().FindItem(obj.GetEudemonInfo().itemid);
                                    if (item == null) break;
                                    this.TakeMount(obj.GetTypeId(), item.itemid);
                                    break;
                                }
                            case NetMsg.MsgOperateItem.TAKEOFFMOUNT: //下马
                                {
                                    this.TakeOffMount(info.id);
                                    break;
                                }
                            case NetMsg.MsgOperateItem.GET_EXPBALL_EXP: //获取经验球的等级
                                {
                                    int id = BaseFunc.MakeLong(info.amount, info.param1);
                                    if (id == this.GetTypeId())
                                    {
                                        this.LeftNotice("经验球不允许给人物使用");
                                        break;
                                    }
                                  //  收到网络协议:长度:28协议号:1009
                                    //{28,0,241,3,122,243,157,131,32,147,105,18,50,0,0,0,122,243,157,131,0,0,0,0,0,0,0,0}
                                    break;
                                }
                            case NetMsg.MsgOperateItem.USE_EXPBALL_EXP: //使用经验球
                                {
                                    int id = BaseFunc.MakeLong(info.amount, info.param1);
                                    if (id == this.GetTypeId())
                                    {
                                        this.LeftNotice("经验球不允许给人物使用");
                                        break;
                                    }
                                    //给幻兽使用
                                    RoleData_Eudemon eudemon_info = this.GetEudemonSystem().FindEudemon((uint)id);
                                    EudemonObject _obj = this.GetEudemonSystem().GetEudmeonObject((uint)id);
                                    if (_obj == null || eudemon_info == null) break;
                                    eudemon_info.level = 0;
                                  //  _obj.GetAttr().level = 0;
                                    _obj.ChangeAttribute(EudemonAttribute.Level, this.GetBaseAttr().level + GameBase.Config.Define.EXPBALL_EUDEMON_MAXLEVEL, false);
                                    //删除经验球
                                    this.GetItemSystem().DeleteItemByID(info.id);
                                    break;
                                }
                            case NetMsg.MsgOperateItem.PTICH_SELL_ITEM_GOLD: //摊位以金币方式出售道具
                                {
                                    PtichManager.Instance().SellItem(this, info.id, (byte)NetMsg.MsgOperateItem.PTICH_SELL_ITEM_GOLD, (int)info.dwData);
                                    break;
                                }
                            case NetMsg.MsgOperateItem.PTICH_SELL_ITEM_GAMEGOLD: //摊位以魔石方式出售道具
                                {
                                    PtichManager.Instance().SellItem(this, info.id, (byte)NetMsg.MsgOperateItem.PTICH_SELL_ITEM_GAMEGOLD, (int)info.dwData);
                                    break;
                                }
                            case NetMsg.MsgOperateItem.PTICH_GETBACK_SELLITEM: //摊位取回道具
                                {
                                    PtichManager.Instance().GetBackItem(this, info.id);
                                    break;
                                }
                            case NetMsg.MsgOperateItem.PTICH_BUY_ITEM: //购买摊位道具
                                {
                                    PtichManager.Instance().BuyItem(this, info.dwData, info.id);
                                    break;
                                }
                            case NetMsg.MsgOperateItem.GET_REMOTE_PTICH://获取远程摊位
                                {
                                    PtichManager.Instance().GetRemotePtich(this);
                                    break;
                                }
                            case NetMsg.MsgOperateItem.BUY_REMOTE_PTICH_ITEM:   //购买远程摊位道具
                                {

                                    PtichManager.Instance().BuyRemotePtichItem(this,info.id);
                                    break;
                                }
                            case NetMsg.MsgOperateItem.GET_REMOTE_PTICH_ID: //获取远程摊位- 从指定摊位号
                                {
                                    PtichManager.Instance().GetRemotePtich(this,(int) (info.dwData - 1)/*客户端传上来的是以1为下标*/);
                                    break;
                                }
                            case NetMsg.MsgOperateItem.EUDEMON_FOOD: //幻兽喂食圣兽魔晶
                                {
                                    if (this.GetMoneyCount(MONEYTYPE.GAMEGOLD) < 19) return;
                                    uint eudemon_id = (uint)BaseFunc.MakeLong(info.amount, info.param1);
                                    EudemonObject eudemon = this.GetEudemonSystem().GetBattleEudemon(eudemon_id);

                                    if (eudemon == null ) break;
                                    //幻兽等级不能超过角色九级以上
                                    if (eudemon.GetAttr().level + 50 > this.GetBaseAttr().level + 8)
                                    {
                                        eudemon.ChangeAttribute(EudemonAttribute.Level, this.GetBaseAttr().level + 8 - eudemon.GetAttr().level);
                                    }
                                    //最高255级
                                    else if (eudemon.GetAttr().level + 50 > 255)
                                    {
                                        eudemon.ChangeAttribute(EudemonAttribute.Level, 255 - eudemon.GetAttr().level);

                                    }
                                    else eudemon.ChangeAttribute(EudemonAttribute.Level, 50);
                                    eudemon.CalcAttribute();
                                    this.ChangeMoney(MONEYTYPE.GAMEGOLD, -19);
                                    break;
                                }
                            default: {
                                //Log.Instance().WriteLog("未知操作封包:" + play.GetName() + " " + GamePacketKeyEx.byteToText(netdata));
                                break;
                            }
                        }

                        break;
                    }
                case PacketProtoco.C_MSGTALK:
                    {
                        NetMsg.MsgTalkInfo talkinfo = new NetMsg.MsgTalkInfo();
                        talkinfo.Create(netdata);
                        String talk = talkinfo.GetTalkText();
                        if (talk.Length > 0)
                        {
                            if (talk[0] == '\\' && this.IsGM())
                            {
                                //GM命令--
                                GMCommand.ExecuteGMCommand(talk, this);
                            }
                            if (talk[0] == '\\') //普通命令--
                            {
                                GMCommand.ExecuteNormalCommand(talk, this);
                            }
                        }

                        PacketOut outpack;
                        switch (talkinfo.unTxtAttribute)
                        {
                            case NetMsg.MsgTalkInfo._TXTATR_TALK: //公聊
                                {
                                    outpack = new PacketOut();
                                    outpack.WriteUInt16((ushort)(netdata.Length + 2));
                                    outpack.WriteBuff(netdata);
                                    this.BroadcastBuffer(outpack.Flush(), false);
                                    break;
                                }
                            case NetMsg.MsgTalkInfo._TXTATR_PRIVATE: //私聊
                                {
                                    String targetname = talkinfo.GetTalkTargetText();
                                    PlayerObject targetobj = UserEngine.Instance().FindPlayerObjectToName(targetname);
                                    if (targetobj != null)
                                    {
                                        outpack = new PacketOut(targetobj.GetGamePackKeyEx());
                                        outpack.WriteUInt16((ushort)(netdata.Length + 2));
                                        outpack.WriteBuff(netdata);
                                        targetobj.SendData(outpack.Flush());
                                    }
                                    break;
                                }
                            case NetMsg.MsgTalkInfo._TXTATR_REJECT: //驳回
                                {
                                    String targetname = talkinfo.GetTalkTargetText();
                                    PlayerObject targetobj = UserEngine.Instance().FindPlayerObjectToName(targetname);
                                    if (targetobj != null)
                                    {
                                        switch (talkinfo.GetTalkText())
                                        {
                                            case "a": //好友请求驳回
                                                {
                                                    break;
                                                }
                                            case "b": //交易请求驳回
                                                {
                                                    this.GetTradSystem().SetTradTarget(0);
                                                    targetobj.GetTradSystem().SetTradTarget(0);
                                                    targetobj.LeftNotice("对方拒绝你的交易请求");
                                                    break;
                                                }
                                            case "c": //队伍请求
                                                {
                                                    break;
                                                }
                                        }
                                    }
                                    break;
                                }
                        }

                        break;
                    }
                case PacketProtoco.C_PICKDROPITEM: //拾取道具
                    {
                        NetMsg.MsgDropItem item = new NetMsg.MsgDropItem();
                        item.Create(netdata, null);
                        BaseObject obj = GetGameMap().GetObject(item.id);
                        if (obj == null) break;
                        if (this.IsDie() || this.IsLock()) break;//死亡或者被锁定
                        if (this.GetCurrentX() != obj.GetCurrentX() || this.GetCurrentY() != obj.GetCurrentY())
                        {
                            //连击技能或者xp技能没校验过坐标。。 就校验一下坐标 2015.11.21
                            //该道具暂时不可拾取-
                            this.ScroolRandom(this.GetCurrentX(), this.GetCurrentY());

                        }
                        if ((obj as DropItemObject).IsOwner() && (obj as DropItemObject).GetOwnerId() != this.GetTypeId())
                        {
                            this.LeftNotice("该道具暂时无法拾取!");
                            return;
                        }

                        //在地图
                        GameStruct.RoleItemInfo roleitem = (obj as DropItemObject).GetRoleItemInfo();
                        (obj as DropItemObject).BroadcastInfo(2);
                        this.GetGameMap().RemoveObj(obj);
                        //捡起来放到背包
                        if (roleitem == null) //怪物爆的
                        {
                            this.GetItemSystem().AwardItem(obj.GetTypeId(), NetMsg.MsgItemInfo.ITEMPOSITION_BACKPACK);
                        }
                        else
                        {
                            //玩家丢的
                            //如果是幻兽蛋,就得有幻兽数据
                            if (roleitem.postion == NetMsg.MsgItemInfo.ITEMPOSITION_EUDEMON_PACK)
                            {
                                this.GetEudemonSystem().AddTempEudemon((obj as DropItemObject).GetRoleEudemonInfo());
                            }
                            this.GetItemSystem().AwardItem(roleitem);

                        }

                        break;
                    }
                case PacketProtoco.C_CHANGEPKMODE: //更改pk模式
                    {
                        bool isrecall = false;
                        NetMsg.MsgChangePkMode action = new NetMsg.MsgChangePkMode();
                        action.Create(netdata, GetGamePackKeyEx());
                        switch (action.tag)
                        {
                            case NetMsg.MsgAction.TYPE_CHANGEPKMODE:
                                {
                                    if (action.value >= 0 && action.value <= 5)
                                    {
                                        this.SetPkMode((byte)action.value);
                                        isrecall = true;

                                    }
                                    break;
                                }
                            //xp技能单击
                            case NetMsg.MsgAction.TYPE_XPFULL:
                                {
                                    GetTimerSystem().XPFull((short)action.value);
                                    //测试--
                                    //PacketOut outpack = new PacketOut(this.GetGamePackKeyEx());
                                    //outpack.WriteUInt16(28);
                                    //outpack.WriteUInt16(1017);
                                    //outpack.WriteUInt32(this.GetTypeId());
                                    //outpack.WriteUInt32(2);
                                    //outpack.WriteInt32(36);
                                    //outpack.WriteInt32(64);
                                    //outpack.WriteInt32(71);
                                    //outpack.WriteInt32(2048);
                                    //byte[] data = outpack.Flush();
                                    //this.SendData(data);

                                    break;
                                }
                            //幻兽出征
                            case NetMsg.MsgAction.TYPE_EUDEMON_BATTLE:
                                {
                                    //value = id;
                                    this.GetEudemonSystem().Eudemon_Battle((uint)action.value);
                                    break;
                                }
                            //表情动作
                            case NetMsg.MsgAction.TYPE_FACEACTION:
                                {
                                    if (this.IsLock()) break;

                                    uint nAction = BitConverter.ToUInt32(netdata, 18);
                                    this.SetCurrentAction(nAction);
                                    action.SetKey(null);
                                    this.BroadcastBuffer(action.GetBuffer());
                                    //迷心术
                                    if (this.GetTimerSystem().QueryStatus(GameStruct.RoleStatus.STATUS_MIXINSHU) != null)
                                    {
                                        foreach (RefreshObject refobj in this.GetVisibleList().Values)
                                        {
                                            BaseObject obj = refobj.obj;
                                            if (obj.type == OBJECTTYPE.PLAYER)
                                            {
                                                (obj as PlayerObject).PlayAction(nAction);
                                            }
                                        }
                                    }
                                    break;
                                }
                            //获取角色详细信息
                            case NetMsg.MsgAction.TYPE_FRIENDINFO:
                                {
                                    this.GetFriendSystem().GetFriendInfo(action.value);

                                    break;
                                }
                            //复活角色
                            case NetMsg.MsgAction.TYPE_ALIVE:
                                {
                                    //要是鬼魂状态 并且死亡超过等于二十秒
                                    if (IsGhost() && System.Environment.TickCount - mnGhostTick >= GameBase.Config.Define.ALIVE_TIME)
                                    {

                                        Alive();

                                    }

                                    break;
                                }
                            case NetMsg.MsgAction.TYPE_FLY_DOWN:    //雷霆万钧 下降
                                {
                                    play.GetTimerSystem().DeleteStatus(GameStruct.RoleStatus.STATUS_FLY);
                                    play.GetTimerSystem().DeleteStatus(GameStruct.RoleStatus.STATUS_XPFULL_ATTACK);
                                    if (play.GetTimerSystem().QueryStatus(GameStruct.RoleStatus.STATUS_HEILONGWU) != null)
                                    {
                                        play.GetTimerSystem().DeleteStatus(GameStruct.RoleStatus.STATUS_HEILONGWU);
                                    }
                                    break;

                                }
                            case NetMsg.MsgAction.TYPE_EUDEMON_RANK: //查看幻兽排行榜
                                {
                                    //data1 从总星排行开始 超出100名为0
                                    byte[] data1 = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };
                                    //{36,0,102,4,114,189,89,134,39,31,97,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,83,85,0,0,0,0}
                                    PacketOut outpack = new PacketOut();
                                    outpack.WriteInt16(36);
                                    outpack.WriteInt16(1126);
                                    outpack.WriteUInt32((uint)action.value);
                                    outpack.WriteUInt32(this.GetTypeId());
                                    outpack.WriteInt16(0);
                                    outpack.WriteBuff(data1);
                                    this.SendData(outpack.Flush(), true);
                                    break;
                                }
                            case NetMsg.MsgAction.TYPE_EUDEMON_SOULINFO: //主幻兽增加分数信息
                                {

                                    EudemonObject obj = this.GetEudemonSystem().GetEudmeonObject((uint)action.time);
                                    if (obj == null) break;
                                    this.GetEudemonSystem().SetSoulEudemon((uint)action.time);
                                    GameStruct.EudemonSoulInfo soulinfo = ConfigManager.Instance().GetEudemonSoulInfo((int)(obj.GetEudemonInfo().quality / 100));
                                    if (soulinfo == null)
                                    {
                                        this.MsgBox("获取幻化信息错误!!");
                                        Log.Instance().WriteLog("获取幻化信息错误:名称:" + play.GetName() + " 品质:" + obj.GetEudemonInfo().quality.ToString()
                                            + "道具id:" + obj.GetEudemonInfo().itemid.ToString());
                                        break;
                                    }
                                    //125为等级需求
                                  //  byte[] data1 = { 32, 0, 244, 7, 73, 0, 6, 0, 125, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0/*, 9, 0, 0, 0, 1, 0, 0, 0*/ };
                                    PacketOut outpack = new PacketOut();
                                    outpack.WriteInt16(32);
                                    outpack.WriteInt16(2036);
                                    outpack.WriteInt16(73);
                                    outpack.WriteInt16(6);
                                    outpack.WriteInt32(soulinfo.level);
                                    outpack.WriteInt32(soulinfo.fu_star);
                                    outpack.WriteInt32(0);//亲密度
                                    outpack.WriteInt32(0);
                                    outpack.WriteInt32(0);
                                  //  outpack.WriteBuff(data1);
                                    //这个问成长率总分
                                    outpack.WriteInt32(obj.GetEudemonInfo().quality);
                                   // outpack.WriteInt32(9);
                                    outpack.WriteInt32(1);
                                    play.SendData(outpack.Flush(), true);
                                    break;
                                }
                            case NetMsg.MsgAction.TYPE_EUDEMON_SOUL: //幻兽幻化
                                {
                                    this.GetEudemonSystem().Eudemon_Soul((uint)action.value);
                                    break;
                                }
                            case NetMsg.MsgAction.TYPE_LOOKROLEINFO: //查看装备
                                {
                                    PlayerObject obj = UserEngine.Instance().FindPlayerObjectToTypeID((uint)action.value);
                                    if (obj == null) break;

                                    obj.GetItemSystem().SendLookRoleInfo(this);
                                    break;
                                }
                            case NetMsg.MsgAction.TYPE_LOOKEUDEMONINFO: //查看幻兽
                                {
                                    PlayerObject obj = UserEngine.Instance().FindPlayerObjectToTypeID((uint)action.value);
                                    if (obj == null) break;

                                    obj.GetEudemonSystem().SendLookEudemonInfo(this);
                                    break;
                                }
                            case NetMsg.MsgAction.TYPE_FINDPATH: //单击地图自动寻路
                                {
                                    short x = BaseFunc.LoWord(action.type);
                                    short y = BaseFunc.HiWord(action.type);
                                    if (!this.GetGameMap().CanMove(x, y)) break;

                                    //{28,0,242,3,1,0,0,0,73,48,96,5,195,1,159,1,0,0,0,0,232,3,0,0,166,38,0,0}
                                    PacketOut outpack = new PacketOut();
                                    outpack.WriteInt16(28);
                                    outpack.WriteInt16(1010);
                                    outpack.WriteInt32(1);
                                    outpack.WriteUInt32(this.GetTypeId());
                                    outpack.WriteInt16(x);
                                    outpack.WriteInt16(y);
                                    outpack.WriteInt32(0);
                                    outpack.WriteUInt32(this.GetGameMap().GetMapInfo().id);
                                    outpack.WriteInt32(9894);
                                    this.SendData(outpack.Flush(), true);
                                    break;
                                }
                            case NetMsg.MsgAction.TYPE_CONTINUEGAME:    //继续游戏
                                {

                                    PacketOut outpack = new PacketOut();
                                    outpack.WriteInt16(28);
                                    outpack.WriteInt16(1010);
                                    outpack.WriteInt32(System.Environment.TickCount);
                                    outpack.WriteUInt32(this.GetTypeId());
                                    outpack.WriteInt32(0);
                                    outpack.WriteInt32(0);
                                    outpack.WriteInt32(0);
                                    outpack.WriteInt32(9630);
                                    this.SendData(outpack.Flush(), true);
                                    break;
                                }
                            case NetMsg.MsgAction.TYPE_PTICH: //摆摊有关
                                {
                                    if (this.GetCurrentPtichID() == -1) break;
                                    PtichManager.Instance().AddPlayPtich(this.GetCurrentPtichID(), this);
                                    break;
                                }
                            case  NetMsg.MsgAction.TYPE_SHUT_PTICH: //收摊
                                {

                                    PtichManager.Instance().ShutPtich(this,true);

                                    break;
                                }
                            case 9528:
                                {
                                    //{242,3,180,167,114,0,174,66,15,0,70,1,211,1,0,0,0,0,0,0,0,0,56,37,0,0,}
                                 //   Log.Instance().WriteLog(GamePacketKeyEx.byteToText(netdata));
                                    break;
                                }
                            case 9855: //开启远程浏览
                                {
                                    break;
                                }
                            case NetMsg.MsgAction.TYPE_LOOK_PTICH: //查看摊位
                                {
                                    uint ptich_obj_id = (uint)action.time;
                                    PtichManager.Instance().LookPtich(this, ptich_obj_id);
                                    //Log.Instance().WriteLog(GamePacketKeyEx.byteToText(netdata));
                                    break;
                                }
                        }
                        //是否回发-
                        if (isrecall)
                        {
                            this.SendData(action.GetBuffer());
                        }
                        break; ;
                    }
                //保存热键信息
                case PacketProtoco.C_HOTKEY:
                    {
                        // Log.Instance().WriteLog("data:" + GamePacketKeyEx.byteToText(netdata));
                        NetMsg.MsgHotKey hotkey = new NetMsg.MsgHotKey();
                        hotkey.Create(netdata, GetGamePackKeyEx());
                        switch (hotkey.tag)
                        {
                            case NetMsg.MsgHotKey.TAG_SAVEHOTKEY: //保存热键
                                {
                                    String[] hotkeyarr = hotkey.GetHotKeyArr();
                                    if (hotkeyarr != null)
                                    {
                                        this.ClearHotKey(hotkey.GetGroup());
                                        for (int i = 0; i < hotkeyarr.Length; i++)
                                        {
                                            GameStruct.HotkeyInfo info = new GameStruct.HotkeyInfo(hotkey.GetGroup(), hotkeyarr[i]);
                                            if (info.index == 0 && info.id == 0) continue;
                                            this.AddHotKeyInfo(info);
                                        }
                                    }
                                    break;
                                }
                            case NetMsg.MsgHotKey.TAG_WANGLING_STATE: //切换亡灵形态
                                {
                                    if (this.GetTimerSystem().QueryStatus(GameStruct.RoleStatus.STATUS_HUASHENWANGLING) != null)
                                    {
                                        this.GetTimerSystem().DeleteStatus(GameStruct.RoleStatus.STATUS_HUASHENWANGLING);
                                    }
                                    else
                                    {
                                        this.GetTimerSystem().AddStatus(GameStruct.RoleStatus.STATUS_HUASHENWANGLING);
                                    }

                                    break;
                                }
                            case NetMsg.MsgHotKey.WORLD_CHAT: //魔法飞鸽
                                {
                                    //this.MsgBox("游戏当前禁止发送飞鸽!");
                                    //break;
                                   // hotkey.str;
                                    int Index = WorldPigeon.Instance().AddText(this.GetName(), this.GetTypeId(), hotkey.str);
                                    if (Index > 1)
                                    {
                                        this.MsgBox("发布飞鸽成功,目前排在:" + Index.ToString() + "位");
                                    }
                                    else if (Index == -1)
                                    {
                                        this.MsgBox("你已经发过一次飞鸽了,请等上一次的飞鸽发完。");
                                    }

                                    break;
                                }
                            case NetMsg.MsgHotKey.CHANGE_EUDEMON_NAME:  //更改幻兽名字
                                {
                                   // hotkey.type 幻兽id
                                  //  hotkey.str
                                    if (hotkey.str.Length > 8) return;
                                    EudemonObject obj = this.GetEudemonSystem().GetEudmeonObject((uint)hotkey.type);
                                    if (obj == null) return;
                                    GameStruct.RoleItemInfo role_item = this.GetItemSystem().FindItem(obj.GetEudemonInfo().itemid);
                                    if (role_item == null) return;
                                    role_item.forgename = hotkey.str;
                                   // {21,0,247,3,114,189,89,134,24,0,1,8,210,187,184,246,201,181,177,198,0}
                                    PacketOut outpack = new PacketOut();
                                    outpack.WriteInt16((short)(11 + Coding.GetDefauleCoding().GetBytes(role_item.forgename).Length + 2));
                                    outpack.WriteInt16(1015);
                                    outpack.WriteUInt32((uint)hotkey.type);
                                    outpack.WriteInt16(24);
                                    outpack.WriteByte(1);
                                    outpack.WriteString(role_item.forgename);
                                    outpack.WriteByte(0);
                                    this.BroadcastBuffer(outpack.Flush(), true);

                                    this.GetItemSystem().UpdateItemInfo(role_item.id);
                                    this.GetEudemonSystem().SendEudemonInfo(obj.GetEudemonInfo());

                                    //出战的时候也要同步改名
                                    if (this.GetEudemonSystem().GetBattleEudemon((uint)hotkey.type) != null)
                                    {
                                        obj.SendEudemonInfo();
                                    }
                                    break;
                                }
                            case 288: //进入/离开名人堂
                                {
                                    this.MsgBox("名人堂下一个版本开放!");
                                    break;
                                }
                        }

                        break;
                    }
                case PacketProtoco.C_EQUIPOPERATION:
                    {
                        NetMsg.MsgEquipOperation equip = new NetMsg.MsgEquipOperation();
                        equip.Create(netdata, null);
                      //  Log.Instance().WriteLog(GamePacketKeyEx.byteToText(netdata));
                        switch (equip.type)
                        {
                            //提升魔魂等级
                            case NetMsg.MsgEquipOperation.EQUIPSTRONG:
                            case NetMsg.MsgEquipOperation.EQUIPSTRONGEX:
                                {
                                    EquipOperation.Instance().EquipStrong(this, equip.itemid, equip.materialid);
                                    break;
                                }
                            //提升幻魔等级
                            case NetMsg.MsgEquipOperation.EQUIPLEVEL:
                                {
                                    EquipOperation.Instance().EquipLevel(this, equip.itemid, equip.materialid);
                                    break;
                                }
                            //提升装备品质
                            case NetMsg.MsgEquipOperation.EQUIPQUALITY:
                                {
                                    EquipOperation.Instance().EquipQuality(this, equip.itemid, equip.materialid);
                                    break;
                                }
                            //宝石镶嵌
                            case NetMsg.MsgEquipOperation.GEMSET:
                                {
                                    byte index = 0;//第几个洞
                                    uint gemid = 0;
                                    if (equip.materialid != 0)
                                    {
                                        gemid = equip.materialid;
                                        index = 0;
                                    }
                                    else if (equip.param != 0)
                                    {
                                        gemid = equip.param;
                                        index = 1;
                                    }
                                    else if (equip.param1 != 0)
                                    {
                                        gemid = equip.param1;
                                        index = 2;
                                    }
                                    if (gemid == 0) return;
                                    EquipOperation.Instance().GemSet(this, gemid, equip.itemid, index);
                                    break;
                                }
                            case NetMsg.MsgEquipOperation.MAMIC_ADD_GOD:
                                {
                                    EquipOperation.Instance().Magic_Add_God(this, equip.itemid, equip.materialid);
                                    break;
                                }
                            //宝石融合
                            case NetMsg.MsgEquipOperation.GEMFUSION:
                                {
                                    EquipOperation.Instance().GemFusion(this, equip.itemid);
                                    break;
                                }
                                //宝石替换
                            case NetMsg.MsgEquipOperation.GEMREPLACE:
                                {
                                    EquipOperation.Instance().GemReplace(this, netdata);
                                    break;
                                }
                            case NetMsg.MsgEquipOperation.EQUIP_GODEXP://提升神佑
                                {
                                    EquipOperation.Instance().Equip_GodExp(this,equip.itemid, equip.materialid);
                                    break;
                                }
                            case NetMsg.MsgEquipOperation.GUANJUE_GOLD:
                                {
                                    GuanJueManager.Instance().Donation(this, MONEYTYPE.GOLD, (int)equip.itemid);
                                    break;
                                }
                            case NetMsg.MsgEquipOperation.GUANJUE_GAMEGOLD:
                                {
                                    GuanJueManager.Instance().Donation(this, MONEYTYPE.GAMEGOLD, (int)equip.itemid);
                                    break;
                                }
                            case NetMsg.MsgEquipOperation.EXIT_GAME:
                                {
                                   byte[] data = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,29,0,0,0,0,0,0,0,0,0};
                                    PacketOut outpack = new PacketOut();
                                    outpack.WriteInt16(32);
                                    outpack.WriteInt16(1032);
                                    outpack.WriteInt32(System.Environment.TickCount);
                                    outpack.WriteBuff(data);
                                    this.SendData(outpack.Flush(), true);
                                    break;
                                }

                        }

                        break;
                    }
                case PacketProtoco.C_STRONGPACK:
                    {

                        NetMsg.MsgStrongPack msgstrongpack = new NetMsg.MsgStrongPack();
                        msgstrongpack.Create(netdata);

                        switch (msgstrongpack.param)
                        {
                            case NetMsg.MsgStrongPack.STRONGPACK_TYPE: //仓库操作
                                {
                                    switch (msgstrongpack.type)
                                    {
                                        case NetMsg.MsgStrongPack.STRONGPACK_TYPE_SAVE: //存道具
                                            {
                                                if (this.GetItemSystem().GetStrongItemCount() >= PlayerItem.MAX_STRONGITEM) return; //仓库道具已满,存不了了
                                                this.GetItemSystem().MoveItem(msgstrongpack.itemid, (ushort)NetMsg.MsgItemInfo.ITEMPOSTION_STRONG_PACK);
                                                break;
                                            }
                                        case NetMsg.MsgStrongPack.STRONGPACK_TYPE_GIVE://取道具
                                            {
                                                if (this.GetItemSystem().IsItemFull()) return; //包裹道具已满,存不了了
                                                this.GetItemSystem().MoveItem(msgstrongpack.itemid, (ushort)NetMsg.MsgItemInfo.ITEMPOSITION_BACKPACK);
                                                break;
                                            }
                                    }

                                    break;
                                }
                            case NetMsg.MsgStrongPack.CHEST_TYPE:
                                {
                                    switch (msgstrongpack.type)
                                    {
                                        case NetMsg.MsgStrongPack.CHEST_TYPE_GIVE: //取回衣柜时装
                                            {
                                                this.GetItemSystem().Give_FashionChest(msgstrongpack.itemid);
                                                break;
                                            }
                                    }
                                    break;
                                }
                        }
                        break;
                    }
                case PacketProtoco.C_GETFRIENDINFO:
                    {
                        //for (int i = 0; i < 10; i++)
                        //{
                        //    NetMsg.MsgFriendInfo info = new NetMsg.MsgFriendInfo();
                        //    info.Create(null, this.GetGamePackKeyEx());
                        //    info.level = 130;
                        //    info.type = 15;
                        //    info.actorid = this.GetTypeId() + 1;
                        //    info.name = "狂拽酷炫屌炸天"+i.ToString();
                        //    info.Online = 1;
                        //    this.SendData(info.GetBuffer());
                        //}

                        //info = new NetMsg.MsgFriendInfo();
                        //info.Create(null, this.GetGamePackKeyEx());
                        //info.level = 130;
                        //info.type = 15;
                        //info.actorid = this.GetTypeId() + 2;
                        //info.name = "离线人物";
                        //info.Online = 0;
                        //this.SendData(info.GetBuffer());
                        //  this.GetFriendSystem().SendAllFriendInfo();
                        break;
                    }
                case PacketProtoco.C_ADDFRIEND:
                    {
                        NetMsg.MsgFriendInfo info = new NetMsg.MsgFriendInfo();
                        info.Create(netdata);
                        switch (info.type)
                        {
                            case NetMsg.MsgFriendInfo.TYPE_ADDFRIEND:
                                {
                                    this.GetFriendSystem().RequestAddFriend(info);
                                    break;
                                }
                            case NetMsg.MsgFriendInfo.TYPE_AGREED: //接收好友请求
                                {
                                    this.GetFriendSystem().AddFriend(info.playerid, NetMsg.MsgFriendInfo.TYPE_FRIEND);
                                    break;
                                }
                            case NetMsg.MsgFriendInfo.TYPE_REFUSE: //拒绝好友请求
                                {
                                    this.GetFriendSystem().RefuseFriend(info.playerid);
                                    break;
                                }
                            case NetMsg.MsgFriendInfo.TYPE_KILL:  //绝交
                                {
                                    this.GetFriendSystem().DeleteFriend(info.playerid);
                                    break;
                                }
                        }

                        break;
                    }
                case PacketProtoco.C_TRAD:
                    {
                        NetMsg.MsgTradInfo info = new NetMsg.MsgTradInfo();
                        info.Create(netdata, null);

                        switch (info.type)
                        {
                            case NetMsg.MsgTradInfo.REQUEST_TRAD:
                                {
                                    this.GetTradSystem().RequstTrad(info);
                                    break;
                                }
                            case NetMsg.MsgTradInfo.QUIT_TRAD:
                                {
                                    this.GetTradSystem().QuitTrad(info);
                                    break;
                                }
                            case NetMsg.MsgTradInfo.GOLD_TRAD:
                                {
                                    this.GetTradSystem().SetTradGold((int)info.typeid);
                                    break;
                                }
                            case NetMsg.MsgTradInfo.GAMEGOLD_TRAD:
                                {
                                    this.GetTradSystem().SetTradGameGold((int)info.typeid);
                                    break;
                                }
                            case NetMsg.MsgTradInfo.ITEM_TRAD:
                                {
                                    this.GetTradSystem().AddTradItem(info.typeid);
                                    break;
                                }
                            case NetMsg.MsgTradInfo.SURE_TRAD:
                                {
                                    this.GetTradSystem().SureTrad();
                                    break;
                                }
                        }
                        break;
                    }
                case PacketProtoco.C_GUANJUE:
                    {
                        PackIn inguanjue = new PackIn(netdata);
                        inguanjue.ReadUInt16();
                        short type = inguanjue.ReadInt16();
                        byte page = inguanjue.ReadByte();
                        if (type == 2) //请求获得爵位数据
                        {
                            GuanJueManager.Instance().RequestData(this, page);
                        }

                        //                        byte[] data = {162,1,12,8,2,0,0,0,0,0,5,0,0,0,0,0,10,0,226,12,16,0,205,168,204,236,177,166,56,0,0,0,0,0,0,0,0,0,0,0,0,0,128,226,104,182,10,0,0,0,1,0,0,0,0,0,0,0,119,109,

                        //15,0,161,254,192,230,194,228,161,254,0,0,0,0,0,0,0,0,0,0,0,0,80,231,196,204,9,0,0,0,1,0,0,0,1,0,0,0,130,72,16,0,185,243,215,229,193,236,208,228,0,0,0,0,0,0

                        //,0,0,0,0,0,0,0,190,229,228,8,0,0,0,1,0,0,0,2,0,0,0,230,90,15,0,126,194,182,45,194,182,45,193,250,126,0,0,0,0,0,0,0,0,0,0,98,3,137,149,7,0,0,0,3,0,0,0,3,0,0

                        //,0,30,145,15,0,126,204,236,200,244,211,208,199,233,126,0,0,0,0,0,0,0,0,0,0,176,56,161,110,6,0,0,0,3,0,0,0,4,0,0,0,236,69,15,0,193,233,202,166,0,0,0,0,0,0,0

                        //,0,0,0,0,0,0,0,0,0,195,147,65,41,5,0,0,0,3,0,0,0,5,0,0,0,179,169,15,0,213,189,198,199,161,162,208,204,204,236,0,0,0,0,0,0,0,0,0,0,184,62,118,7,4,0,0,0,3,0,

                        //0,0,6,0,0,0,213,95,16,0,40,95,136,181,165,235,164,240,213,108,215,237,0,0,0,0,0,0,0,0,0,59,223,155,3,0,0,0,3,0,0,0,7,0,0,0,206,207,15,0,182,192,185,194,161

                        //,162,176,212,204,236,0,0,0,0,0,0,0,0,0,0,128,149,127,73,3,0,0,0,3,0,0,0,8,0,0,0,40,79,15,0,196,234,199,225,190,205,210,170,192,203,0,0,0,0,0,0,0,0,0,0,115,

                        //166,15,67,3,0,0,0,3,0,0,0,9,0,0,0};
                        //                        this.GetGamePackKeyEx().EncodePacket(ref data, data.Length);
                        //                        this.SendData(data);
                        break;
                    }
                case PacketProtoco.C_DANCING: //跳舞
                    {
                        PackIn inpack = new PackIn(netdata);
                        short _param = inpack.ReadInt16();
                        uint role_id = inpack.ReadUInt32();
                        uint target_id = inpack.ReadUInt32();
                        int param1 = inpack.ReadInt32();
                        short magic_id = inpack.ReadInt16();
                        short magic_lv = inpack.ReadInt16();

                        PacketOut outpack = new PacketOut();
                        switch (param1)
                        {
                            case 1280: //请求跳舞
                                {
                                    BaseObject targetobj = play.GetGameMap().FindObjectForID(target_id);
                                    if (targetobj == null)
                                    {
                                        return;
                                    }
                                    //距离太远
                                    if (Math.Abs(this.GetCurrentX() - targetobj.GetCurrentX()) > 2 ||
                                        Math.Abs(this.GetCurrentY() - targetobj.GetCurrentY()) > 2)
                                    {
                                        this.LeftNotice("离对方太远了,再走近点吧。");
                                        return;
                                    }
                                    //     收到网络协议:长度:28协议号:1049
                                    byte[] data1 = { 2, 5, 0, 0, 232, 0, 0, 0, 131, 0, 0, 0, 255, 255, 255, 255 };
                                    outpack.WriteUInt16(28);
                                    outpack.WriteUInt16(1049);
                                    outpack.WriteUInt32(this.GetTypeId());
                                    outpack.WriteUInt32(target_id);
                                    outpack.WriteBuff(data1);
                                    play.BroadcastBuffer(outpack.Flush(), true);

                                    outpack = new PacketOut();

                                    byte[] data2 = { 3, 5, 0, 0, 25, 2, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255 };
                                    outpack.WriteUInt16(28);
                                    outpack.WriteUInt16(1049);
                                    outpack.WriteUInt32(this.GetTypeId());
                                    outpack.WriteUInt32(target_id);
                                    outpack.WriteBuff(data2);
                                    play.BroadcastBuffer(outpack.Flush(), true);
                                    mnDancingId = magic_id;
                                    mnDancingTick = System.Environment.TickCount;
                                    break;
                                }
                            case 1285: //停止跳舞
                                {
                                    if (mnDancingId > 0 && System.Environment.TickCount - mnDancingTick > 2000)
                                    {
                                        byte[] data1 = { 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
                                        outpack = new PacketOut();
                                        outpack.WriteUInt16(28);
                                        outpack.WriteUInt16(1049);
                                        outpack.WriteUInt32(this.GetTypeId());
                                        outpack.WriteUInt32(target_id);
                                        outpack.WriteBuff(data1);
                                        play.BroadcastBuffer(outpack.Flush(), true);
                                        mnDancingId = 0;
                                    }

                                    break;
                                }
                        }

                        //Log.Instance().WriteLog(GameBase.Network.GamePacketKeyEx.byteToText(netdata));
                        break;
                    }
                default:
                    {
                        Debug.WriteLine("未知封包,协议号:" + tag.ToString());
                        break;
                    }
            }
        }