Exemplo n.º 1
0
        public static void WriteMsg(uLink.BitStream stream, object obj, params object[] codecOptions)
        {
            IsoData msg = (IsoData)obj;

            stream.Write <ulong>(msg.isohashcode);
            stream.Write <ulong>(msg.uploader);
        }
Exemplo n.º 2
0
        internal static void SerializeInfo(uLink.BitStream stream, object value, params object[] codecOptions)
        {
            VATownNpcInfo townNpcInfo = value as VATownNpcInfo;

            stream.Write <IntVector2>(townNpcInfo.index);
            stream.Write <int>(townNpcInfo.id);
        }
Exemplo n.º 3
0
        public static void Serialize(uLink.BitStream stream, object value, params object[] codecOptions)
        {
            var item = (HistoryStruct)value;

            stream.Write <int>(item.m_Day);
            stream.Write <string> (item.m_Value);
        }
Exemplo n.º 4
0
        public static void Serialize(uLink.BitStream stream, object obj, params object[] codecOptions)
        {
            var iso = (RegisteredISO)obj;

            stream.Write(iso._hashCode);
            stream.Write(iso._isoName);
            stream.Write(iso.UGCHandle);
        }
Exemplo n.º 5
0
        public static void SerializeTile(uLink.BitStream stream, object obj, params object[] codecOptions)
        {
            MaskTile v = (MaskTile)(obj);

            stream.Write <int>(v.index);
            stream.Write <int>(v.forceGroup);
            stream.Write <byte>(v.type);
        }
Exemplo n.º 6
0
        public static void Serialize(uLink.BitStream stream, object value, params object[] codecOptions)
        {
            var item = (CompoudItem)value;

            stream.Write <float>(item.curTime);
            stream.Write <float> (item.time);
            stream.Write <int> (item.itemID);
            stream.Write <int> (item.itemCnt);
        }
Exemplo n.º 7
0
        internal static void Serialize(uLink.BitStream stream, object value, params object[] codecOptions)
        {
            var item = (MapObj)value;

            stream.Write <Vector3>(item.pos);
            stream.Write <int> (item.objID);
            //stream.Write<float>(item.rotY);
            //stream.Write<int>(item.pathID);
        }
Exemplo n.º 8
0
        public static void WriteMsg(uLink.BitStream stream, object obj, params object[] codecOptions)
        {
            TMsgInfo msg = (TMsgInfo)obj;

            stream.Write <EMsgType>(msg.msgtype);
            stream.Write <int>(msg.sendRoleId);
            stream.Write <int>(msg.recvRoleId);
            stream.Write <string>(msg.msg);
        }
Exemplo n.º 9
0
        /// <summary>
        /// ulink发送数据
        /// </summary>
        internal static void WriteItem(uLink.BitStream stream, object obj, params object[] codecOptions)
        {
            ItemObjectData _itemObjData = (ItemObjectData)obj;

            stream.Write <int>(_itemObjData.itemId);
            stream.Write <int>(_itemObjData.objId);
            stream.Write <int>(_itemObjData.num);
            stream.Write <int[]>(_itemObjData.properties);
            stream.Write <float[]>(_itemObjData.values);
        }
Exemplo n.º 10
0
        public static void WriteRoleInfo(uLink.BitStream stream, object obj, params object[] codecOptions)
        {
            RoleInfo info = (RoleInfo)obj;

            stream.Write <ulong>(info.steamId);
            stream.Write <byte>(info.level);
            stream.Write <int>(info.winrate);
            stream.Write <byte>(info.sex);
            stream.Write <string>(info.name);
            stream.Write <int>(info.deletedFlag);
            stream.Write <int>(info.roleID);
            stream.Write <byte[]>(info.appearData);
            stream.Write <byte[]>(info.nudeData);
            stream.Write <float>(info.lobbyExp);
        }
Exemplo n.º 11
0
        public static void Serialize(uLink.BitStream stream, object value, params object[] codecOptions)
        {
            SceneObject obj = value as SceneObject;

            stream.Write(obj._objId);
            stream.Write(obj._protoId);
            stream.Write(obj._worldId);
            stream.Write(obj._type);
            stream.Write(obj._pos);
            stream.Write(obj._scale);
            stream.Write(obj._rot);
            stream.Write(obj._scenarioId);
        }
Exemplo n.º 12
0
        public static void Serialize(uLink.BitStream stream, object obj, params object[] codecOptions)
        {
            LobbyShopData data = (LobbyShopData)obj;

            stream.Write <int>(data.id);
            stream.Write <int>(data.itemtype);
            stream.Write <int>(data.price);
            stream.Write <int>(data.rebate);
            stream.Write <int>(data.tab);
            stream.Write <bool>(data.bind);
            stream.Write <bool>(data.bshow);
            stream.Write <int>(data.forbid);
        }
Exemplo n.º 13
0
        public static void WriteRoleInfoProxy(uLink.BitStream stream, object obj, params object[] codecOptions)
        {
            RoleInfoProxy info = obj as RoleInfoProxy;

            stream.Write <ulong>(info.steamId);
            stream.Write <byte>(info.level);
            stream.Write <int>(info.winrate);
            stream.Write <int>(info.roleID);
            stream.Write <byte>(info.sex);
            stream.Write <string>(info.name);
            stream.Write <float>(info.lobbyExp);
        }
Exemplo n.º 14
0
        public static void Serialize(uLink.BitStream stream, object obj, params object[] codecOptions)
        {
            var creation = (CreationOriginData)obj;

            stream.Write <ulong>(creation.SteamId);
            stream.Write <int>(creation.ObjectID);
            stream.Write <ulong>(creation.HashCode);
            stream.Write <int>(creation.Seed);
            stream.Write <float>(creation.Fuel);
            stream.Write <float>(creation.HP);
        }
Exemplo n.º 15
0
 public void AutoWood()
 {
     if (CVars.Misc.AutoWood)
     {
         WoodBlockerTemp.numWood = -1f;
         Character component = PlayerClient.GetLocalPlayer().controllable.GetComponent <Character>();
         Inventory inventory = component.GetComponent(typeof(Inventory)) as Inventory;
         MeleeWeaponItem <MeleeWeaponDataBlock> meleeWeaponItem = inventory._activeItem as MeleeWeaponItem <MeleeWeaponDataBlock>;
         if (inventory._activeItem is MeleeWeaponItem <MeleeWeaponDataBlock> && Time.time - this.LAST_ATTACK_TIME > meleeWeaponItem.datablock.fireRate && this.AUTO_WOOD_GATHER)
         {
             this.LAST_ATTACK_TIME = Time.time;
             ItemRepresentation itemRepresentation = meleeWeaponItem.itemRepresentation;
             IMeleeWeaponItem   meleeWeaponItem2   = meleeWeaponItem.iface as IMeleeWeaponItem;
             RaycastHit2        raycastHit;
             bool    flag  = Physics2.Raycast2(component.eyesRay, out raycastHit, meleeWeaponItem.datablock.range, 406721553);
             Vector3 point = raycastHit.point;
             itemRepresentation.Action(3, uLink.RPCMode.Server);
             uLink.BitStream bitStream = new uLink.BitStream(false);
             if (flag)
             {
                 IDMain idMain = raycastHit.idMain;
                 bitStream.WriteBoolean(true);
                 bitStream.Write <NetEntityID>(NetEntityID.Get(idMain), new object[0]);
                 bitStream.WriteVector3(point);
                 bitStream.WriteBoolean(false);
                 itemRepresentation.ActionStream(1, uLink.RPCMode.Server, bitStream);
                 HUDHitIndicator hUDHitIndicator;
                 if (Facepunch.Bundling.Load <HUDHitIndicator>("content/hud/HUDHitIndicator", out hUDHitIndicator))
                 {
                     HUDHitIndicator.CreateIndicator(point, true, hUDHitIndicator);
                 }
             }
             else
             {
                 bitStream.WriteBoolean(false);
                 bitStream.WriteVector3(Vector3.zero);
                 bitStream.WriteBoolean(true);
                 itemRepresentation.ActionStream(1, uLink.RPCMode.Server, bitStream);
             }
         }
     }
 }
Exemplo n.º 16
0
    // BitStream Writer
    public static void WriteToBitStream(uLink.BitStream stream, object val, params object[] args)
    {
        var obj = (SkillBuild)val;

        stream.Write <WeaponBuild[]>(obj.weapons);
    }