コード例 #1
0
        public void Load(PangyaBinaryReader reader, byte[] roomKey)
        {
            //var result = reader.ReadBytes(56);

            var decrypted = DecryptShot(
                reader.ReadBytes((int)(reader.BaseStream.Length - reader.BaseStream.Position))
                , roomKey);

            ResponseShot = decrypted.Take(38).ToArray();

            var readerDecripted = new PangyaBinaryReader(new MemoryStream(decrypted));

            ConnectionId = readerDecripted.ReadInt32();
            X            = readerDecripted.ReadInt32();
            Y            = readerDecripted.ReadInt32();
            Z            = readerDecripted.ReadInt32();

            ShotType  = (ShotTypeEnum)readerDecripted.ReadByte();
            Unknown1  = readerDecripted.ReadInt16();
            Pang      = readerDecripted.ReadUInt32();
            BonusPang = readerDecripted.ReadUInt32();
            Unknown2  = readerDecripted.ReadInt32();
            MatchData = readerDecripted.ReadBytes(6);
            Unknown3  = readerDecripted.ReadBytes(17);
        }
コード例 #2
0
 public override void Load(PangyaBinaryReader reader)
 {
     HolePosition = reader.ReadInt32();
     Unknown      = reader.ReadInt32();
     Par          = reader.ReadByte();
     A            = reader.ReadSingle();
     B            = reader.ReadSingle();
     X            = reader.ReadSingle();
     Z            = reader.ReadSingle();
 }
コード例 #3
0
        public override void Load(PangyaBinaryReader reader)
        {
            Action = (ChangeEquipmentEnum)reader.ReadByte();

            switch (Action)
            {
            case ChangeEquipmentEnum.SetEquip_Char:
            {
                this.Character = new Character();

                Character.TYPEID = reader.ReadInt32();
                Character.CID    = reader.ReadInt32();
            }
            break;

            case ChangeEquipmentEnum.SetIndexCaddie:
            {
                CaddieId = reader.ReadInt32();
            }
            break;

            case ChangeEquipmentEnum.SetItensPlay:
                break;

            case ChangeEquipmentEnum.SetGolfEQP:
                break;

            case ChangeEquipmentEnum.SetDecoration:
                break;

            case ChangeEquipmentEnum.SetIndexChar:
                break;

            case ChangeEquipmentEnum.SetIndexMascot:
            {
                MascoteId = reader.ReadInt32();
            }
            break;

            case ChangeEquipmentEnum.SetCharCutin:
                break;

            default:
                break;
            }
        }
コード例 #4
0
        public override void Load(PangyaBinaryReader reader)
        {
            BuyType = (GameShopEnum)reader.ReadByte();

            BuyTotal = reader.ReadUInt16();

            for (int Count = 0; Count <= BuyTotal - 1; Count++)
            {
                var item = new ShopItem();
                item.UN1         = reader.ReadInt32(); //PlayerCurrentMoney
                item.TypeId      = reader.ReadInt32();
                item.TotalDay    = reader.ReadInt16();
                item.UN2         = reader.ReadInt16();
                item.ItenQtd     = reader.ReadInt32();
                item.PangPrice   = reader.ReadInt32();
                item.CookiePrice = reader.ReadInt32();

                BuyItens.Add(item);
            }
        }
コード例 #5
0
 public override void Load(PangyaBinaryReader reader)
 {
     this.Username = reader.ReadPStr();
     this.UID      = reader.ReadInt32();
     reader.Skip(6);
     this.AuthKeyLogin  = reader.ReadPStr();
     this.ServerVersion = reader.ReadPStr();
     this.Check         = reader.ReadUInt32();
     reader.Skip(4);
     this.AuthKeyGame = reader.ReadPStr();
 }
コード例 #6
0
 public override void Load(PangyaBinaryReader reader)
 {
     CHAR_TYPEID = reader.ReadInt32();
     HAIR_COLOR  = reader.ReadUInt16();
 }
コード例 #7
0
 public override void Load(PangyaBinaryReader reader)
 {
     Action = (ChangeEquipmentEnumB)reader.ReadByte();
     Id     = reader.ReadInt32();
 }
コード例 #8
0
 public override void Load(PangyaBinaryReader reader)
 {
     Angle = reader.ReadInt32();
 }
コード例 #9
0
 public override void Load(PangyaBinaryReader reader)
 {
     ServerID = reader.ReadInt32();
 }
コード例 #10
0
 public override void Load(PangyaBinaryReader reader)
 {
     Username     = reader.ReadPStr();
     UID          = reader.ReadInt32();
     AuthKey_Game = reader.ReadPStr();
 }
コード例 #11
0
        private void Handle(PangyaBinaryReader reader)
        {
            var response = new PangyaBinaryWriter();

            response.Write(new byte[] { 0xC4, 0x00 });
            response.Write(Player.ConnectionId);
            response.Write((byte)PacketResult.Action);

            switch (PacketResult.Action)
            {
            case PlayerActionEnum.PLAYER_ACTION_ROTATION:
            {
                Player.Position.W = reader.ReadSingle();

                response.WriteSingle(Player.Position.W);
            }
            break;

            case PlayerActionEnum.PLAYER_ACTION_UNK:
                break;

            case PlayerActionEnum.PLAYER_ACTION_APPEAR:
            {
                Player.Position.X = reader.ReadSingle();
                Player.Position.Y = reader.ReadSingle();
                Player.Position.Z = reader.ReadSingle();

                response.Write(Player.Position.X);
                response.Write(Player.Position.Y);
                response.Write(Player.Position.Z);
            }
            break;

            case PlayerActionEnum.PLAYER_ACTION_SUB:
            {
                Player.ChatGameInfo.Posture = (PlayerPostureEnum)reader.ReadByte();
                response.Write((int)Player.ChatGameInfo.Posture);
            }
            break;

            case PlayerActionEnum.PLAYER_ACTION_MOVE:
            {
                var x = reader.ReadSingle();
                var y = reader.ReadSingle();
                var z = reader.ReadSingle();

                Player.Position.X += x;
                Player.Position.Y += y;
                Player.Position.Z += z;

                response.WriteSingle(x);
                response.WriteSingle(y);
                response.WriteSingle(z);
            }
            break;

            case PlayerActionEnum.PLAYER_ACTION_ANIMATION:
            {
                Player.ChatGameInfo.Animation = reader.ReadPStrBytes();
                response.WritePStrBytes(Player.ChatGameInfo.Animation);
            }
            break;

            case PlayerActionEnum.PLAYER_ACTION_ANIMATION_2:
            {
                Player.ChatGameInfo.Animation_2 = reader.ReadInt32();

                response.Write(Player.ChatGameInfo.Animation_2);
            }
            break;

            case PlayerActionEnum.PLAYER_ANIMATION_WITH_EFFECTS:
            {
                Player.ChatGameInfo.AnimationWithEffects = reader.ReadPStr();
                response.WritePStr(Player.ChatGameInfo.AnimationWithEffects);
            }
            break;
            }

            string notice = $"POS X: {Player.Position.X} Y: {Player.Position.Y} Z: {Player.Position.Z}";

            Player.SendNotice(notice);

            //Console.WriteLine(Player.Member.Nickname + );
            Player.Game.SendToAll(response);
        }