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);
        }
 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();
 }
        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;
            }
        }
Esempio n. 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);
            }
        }
        public override void Load(PangyaBinaryReader reader)
        {
            Game = new Game()
            {
                Un          = reader.ReadByte(),
                TimeSec     = reader.ReadUInt32(),
                TimeMin     = reader.ReadUInt32(),
                MaxPlayers  = reader.ReadByte(),
                Mode        = (GameTypeEnum)reader.ReadByte(), //ok
                Holes       = reader.ReadByte(),               //
                Course      = (GameMapTypeEnum)reader.ReadByte(),
                HoleOrder   = (GameModeTypeEnum)reader.ReadByte(),
                NaturalMode = reader.ReadUInt32(),

                RoomTitle = reader.ReadPStr(),
                Password  = reader.ReadPStr(),
                Artifact  = reader.ReadUInt32()
            };

            Game.BuildCreateHole();
        }
 public override void Load(PangyaBinaryReader reader)
 {
     Action = (PlayerActionEnum)reader.ReadByte();
 }
        private void Handle(PangyaBinaryReader reader)
        {
            var response = new PangyaBinaryWriter();

            switch (PacketResult.Command)
            {
            case Packet_PLAYER_GM_COMMAND.GMCommandTypeEnum.Help:
                break;

            case Packet_PLAYER_GM_COMMAND.GMCommandTypeEnum.Status:
                break;

            case Packet_PLAYER_GM_COMMAND.GMCommandTypeEnum.Visible:
            {
                var visible = reader.ReadByte();
            }
            break;

            case Packet_PLAYER_GM_COMMAND.GMCommandTypeEnum.Whisper:
                break;

            case Packet_PLAYER_GM_COMMAND.GMCommandTypeEnum.Channel:
                break;

            case Packet_PLAYER_GM_COMMAND.GMCommandTypeEnum.List:
                break;

            case Packet_PLAYER_GM_COMMAND.GMCommandTypeEnum.Open:
                break;

            case Packet_PLAYER_GM_COMMAND.GMCommandTypeEnum.Open2:
                break;

            case Packet_PLAYER_GM_COMMAND.GMCommandTypeEnum.Wind:
                break;

            case Packet_PLAYER_GM_COMMAND.GMCommandTypeEnum.Weather:
                break;

            case Packet_PLAYER_GM_COMMAND.GMCommandTypeEnum.Notice:
            {
                var notice = reader.ReadPStr();

                response.Write(new byte[] { 0x40, 0x00, 0x07 });
                response.WritePStr(Player.Member_Old.Nickname);
                response.WritePStr(notice);
            }
            break;

            case Packet_PLAYER_GM_COMMAND.GMCommandTypeEnum.GiveItem:
                break;

            case Packet_PLAYER_GM_COMMAND.GMCommandTypeEnum.GoldenBell:
                break;

            case Packet_PLAYER_GM_COMMAND.GMCommandTypeEnum.SetMission:
                break;

            case Packet_PLAYER_GM_COMMAND.GMCommandTypeEnum.MathMap:
                break;

            case Packet_PLAYER_GM_COMMAND.GMCommandTypeEnum.KickPlayer:
                break;

            case Packet_PLAYER_GM_COMMAND.GMCommandTypeEnum.Discon_Uid:
                break;

            default:
                break;
            }
        }
 public override void Load(PangyaBinaryReader reader)
 {
     this.ChannelId = reader.ReadByte();
 }
 public override void Load(PangyaBinaryReader reader)
 {
     Action = (ChangeEquipmentEnumB)reader.ReadByte();
     Id     = reader.ReadInt32();
 }
 public override void Load(PangyaBinaryReader reader)
 {
     Progress = reader.ReadByte();
 }
        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);
        }
Esempio n. 12
0
 public override void Load(PangyaBinaryReader reader)
 {
     Status = (StatusEnum)reader.ReadByte();
 }