示例#1
0
        private static Struct BaseReadInfo(ReceivePacket p, bool OnlyBytes, bool genLog)
        {
            Struct info = new Struct
            {
                _weaponInfo    = p.readUH(),
                _weaponSlot    = p.readC(),
                _unk           = p.readUH(),
                _objPos_x      = p.readUH(),
                _objPos_y      = p.readUH(),
                _objPos_z      = p.readUH(),
                _unk5          = p.readUH(),
                _unk6          = p.readUH(),
                _unk7          = p.readUH(),
                _grenadesCount = p.readUH()
            };                       //id do item do mapa

            info._unk8 = p.readB(6); //Null 1.15.37

            /*
             * 1.15.42 - p.readB(6);
             */
            if (!OnlyBytes)
            {
                info.WeaponNumber = (info._weaponInfo >> 6);
                info.WeaponClass  = (info._weaponInfo & 47);
            }
            if (genLog)
            {
                Printf.warning("[code1_GrenadeSync] " + BitConverter.ToString(p.getBuffer()));
                Printf.warning("[code1_GrenadeSync] wInfo: " + info._weaponInfo + "; wSlot: " + info._weaponSlot + "; u: " + info._unk + "; obpX: " + info._objPos_x + "; obpY: " + info._objPos_y + "; obpZ: " + info._objPos_z + "; u5: " + info._unk5 + "; u6: " + info._unk6 + "; u7: " + info._unk7 + "; u8: " + info._unk8);
            }
            return(info);
        }
示例#2
0
 private static code1_GrenadeSync.Struct BaseReadInfo(ReceivePacket p, bool OnlyBytes, bool genLog)
 {
     code1_GrenadeSync.Struct @struct = new code1_GrenadeSync.Struct()
     {
         _weaponInfo    = p.readUH(),
         _weaponSlot    = p.readC(),
         _unk           = p.readUH(),
         _objPos_x      = p.readUH(),
         _objPos_y      = p.readUH(),
         _objPos_z      = p.readUH(),
         _unk5          = p.readUH(),
         _unk6          = p.readUH(),
         _unk7          = p.readUH(),
         _grenadesCount = p.readUH()
     };
     @struct._unk8 = p.readB(6);
     if (!OnlyBytes)
     {
         @struct.WeaponNumber = (int)@struct._weaponInfo >> 6;
         @struct.WeaponClass  = (int)@struct._weaponInfo & 47;
     }
     if (genLog)
     {
         Logger.warning("[code1_GrenadeSync] " + BitConverter.ToString(p.getBuffer()), false);
         Logger.warning("[code1_GrenadeSync] wInfo: " + (object)@struct._weaponInfo + "; wSlot: " + (object)@struct._weaponSlot + "; u: " + (object)@struct._unk + "; obpX: " + (object)@struct._objPos_x + "; obpY: " + (object)@struct._objPos_y + "; obpZ: " + (object)@struct._objPos_z + "; u5: " + (object)@struct._unk5 + "; u6: " + (object)@struct._unk6 + "; u7: " + (object)@struct._unk7 + "; u8: " + (object)@struct._unk8, false);
     }
     return(@struct);
 }
示例#3
0
 public static code13_ControledObj.Struct readSyncInfo(ReceivePacket p, bool genLog)
 {
     code13_ControledObj.Struct @struct = new code13_ControledObj.Struct()
     {
         _unk = p.readB(9)
     };
     if (genLog)
     {
         Logger.warning("[code13_ControledObj] " + BitConverter.ToString(@struct._unk), false);
     }
     return(@struct);
 }
        public static Struct readSyncInfo(ReceivePacket p, bool genLog)
        {
            Struct info = new Struct
            {
                _unk = p.readB(9)
            }; //160 existe no mapa OUTPOST

            if (genLog)
            {
                Printf.warning("[code13_ControledObj] " + BitConverter.ToString(info._unk));
            }
            return(info);
        }
示例#5
0
        public static Struct ReadInfo(ReceivePacket p, bool genLog)
        {
            Struct info = new Struct
            {
                state = p.readC(),
                _unk  = p.readB(6)
            };

            if (genLog)
            {
                Logger.warning("[code10_StageObjMove] " + BitConverter.ToString(info._unk));
            }
            return(info);
        }
示例#6
0
 public static byte[] ReadInfo(ReceivePacket p)
 {
     return(p.readB(7));
 }
示例#7
0
        public static byte[] getBaseData132(byte[] data)
        {
            ReceivePacket p = new ReceivePacket(data);

            using (SendPacket s = new SendPacket())
            {
                s.writeT(p.readT());
                for (int i = 0; i < 16; i++)
                {
                    ActionModel ac = new ActionModel();
                    try
                    {
                        bool exception;
                        ac._type = (P2P_SUB_HEAD)p.readC(out exception);
                        if (exception)
                        {
                            break;
                        }
                        ac._slot       = p.readUH();
                        ac._lengthData = p.readUH();
                        if (ac._lengthData == 65535)
                        {
                            break;
                        }
                        s.writeC((byte)ac._type);
                        s.writeH(ac._slot);
                        s.writeH(ac._lengthData);
                        if (ac._type == P2P_SUB_HEAD.GRENADE)
                        {
                            code1_GrenadeSync.writeInfo(s, p);
                        }
                        else if (ac._type == P2P_SUB_HEAD.DROPEDWEAPON)
                        {
                            code2_WeaponSync.writeInfo(s, p);
                        }
                        else if (ac._type == P2P_SUB_HEAD.OBJECT_STATIC)
                        {
                            code3_ObjectStatic.writeInfo(s, p);
                        }
                        else if (ac._type == P2P_SUB_HEAD.OBJECT_ANIM)
                        {
                            code6_ObjectAnim.writeInfo(s, p);
                        }
                        else if (ac._type == P2P_SUB_HEAD.STAGEINFO_OBJ_STATIC)
                        {
                            code9_StageInfoObjStatic.writeInfo(s, p, false);
                        }
                        else if (ac._type == P2P_SUB_HEAD.STAGEINFO_OBJ_ANIM)
                        {
                            code12_StageObjAnim.writeInfo(s, p);
                        }
                        else if (ac._type == P2P_SUB_HEAD.CONTROLED_OBJECT)
                        {
                            code13_ControledObj.writeInfo(s, p, false);
                        }
                        else if (ac._type == P2P_SUB_HEAD.USER || ac._type == P2P_SUB_HEAD.STAGEINFO_CHARA)
                        {
                            ac._flags = (Events)p.readUD();
                            ac._data  = p.readB(ac._lengthData - 9);
                            s.writeD((uint)ac._flags);
                            s.writeB(ac._data);
                            if (ac._data.Length == 0 && (uint)ac._flags != 0)
                            {
                                break;
                            }
                        }
                        else
                        {
                            SaveLog.warning("[New user packet type2 '" + ac._type + "' or '" + (int)ac._type + "']: " + BitConverter.ToString(data));
                            throw new Exception("Unknown action type2");
                        }
                    }
                    catch (Exception ex)
                    {
                        SaveLog.fatal(ex.ToString());
                        Printf.b_danger("[Packet132Creator.getBaseData132] Erro fatal!");
                        s.mstream = new MemoryStream();
                        break;
                    }
                }
                return(s.mstream.ToArray());
            }
        }
示例#8
0
        public static byte[] getBaseData132(byte[] data)
        {
            ReceivePacket p = new ReceivePacket(data);

            using (SendPacket s = new SendPacket())
            {
                s.writeT(p.readT());
                for (int index = 0; index < 16; ++index)
                {
                    ActionModel actionModel = new ActionModel();
                    try
                    {
                        bool exception;
                        actionModel._type = (P2P_SUB_HEAD)p.readC(out exception);
                        if (!exception)
                        {
                            actionModel._slot       = p.readUH();
                            actionModel._lengthData = p.readUH();
                            if (actionModel._lengthData != ushort.MaxValue)
                            {
                                s.writeC((byte)actionModel._type);
                                s.writeH(actionModel._slot);
                                s.writeH(actionModel._lengthData);
                                if (actionModel._type == P2P_SUB_HEAD.GRENADE)
                                {
                                    code1_GrenadeSync.writeInfo(s, p);
                                }
                                else if (actionModel._type == P2P_SUB_HEAD.DROPEDWEAPON)
                                {
                                    code2_WeaponSync.writeInfo(s, p);
                                }
                                else if (actionModel._type == P2P_SUB_HEAD.OBJECT_STATIC)
                                {
                                    code3_ObjectStatic.writeInfo(s, p);
                                }
                                else if (actionModel._type == P2P_SUB_HEAD.OBJECT_ANIM)
                                {
                                    code6_ObjectAnim.writeInfo(s, p);
                                }
                                else if (actionModel._type == P2P_SUB_HEAD.STAGEINFO_OBJ_STATIC)
                                {
                                    code9_StageInfoObjStatic.writeInfo(s, p, false);
                                }
                                else if (actionModel._type == P2P_SUB_HEAD.STAGEINFO_OBJ_ANIM)
                                {
                                    code12_StageObjAnim.writeInfo(s, p);
                                }
                                else if (actionModel._type == P2P_SUB_HEAD.CONTROLED_OBJECT)
                                {
                                    code13_ControledObj.writeInfo(s, p, false);
                                }
                                else if (actionModel._type == P2P_SUB_HEAD.USER || actionModel._type == P2P_SUB_HEAD.STAGEINFO_CHARA)
                                {
                                    actionModel._flags = (Events)p.readUD();
                                    actionModel._data  = p.readB((int)actionModel._lengthData - 9);
                                    s.writeD((uint)actionModel._flags);
                                    s.writeB(actionModel._data);
                                    if (actionModel._data.Length == 0 && actionModel._flags > (Events)0)
                                    {
                                        break;
                                    }
                                }
                                else
                                {
                                    Logger.warning("[New user packet type2 '" + (object)actionModel._type + "' or '" + (object)actionModel._type + "']: " + BitConverter.ToString(data), false);
                                    throw new Exception("Unknown action type2");
                                }
                            }
                            else
                            {
                                break;
                            }
                        }
                        else
                        {
                            break;
                        }
                    }
                    catch (Exception ex)
                    {
                        Logger.warning("B: " + BitConverter.ToString(data), false);
                        Logger.warning(ex.ToString(), false);
                        s.mstream = new MemoryStream();
                        break;
                    }
                }
                return(s.mstream.ToArray());
            }
        }
示例#9
0
 public static byte[] ReadInfo(ReceivePacket p)
 {
     return(p.readB(25));//19 = 1.15.37 | 25 = 1.15.42
 }