Пример #1
0
        public static void EventSleeperAway(object obj, ulong userID)
        {
            if (obj != null && obj is EventTimer)
            {
                (obj as EventTimer).Dispose();
            }
            string username = Users.GetUsername(userID);

            RustProto.Avatar avatar = NetUser.LoadAvatar(userID);
            if (avatar != null && avatar.HasAwayEvent && avatar.AwayEvent.Type == AwayEvent.Types.AwayEventType.SLUMBER)
            {
                SleepingAvatar.TransientData transientData = (SleepingAvatar.TransientData) typeof(SleepingAvatar).GetMethod("Close", BindingFlags.Static | BindingFlags.NonPublic).Invoke(null, new object[]
                {
                    userID
                });
                if (transientData.exists)
                {
                    Helper.Log(string.Concat(new object[]
                    {
                        "User Sleeping [",
                        username,
                        ":",
                        userID,
                        "] is disappeared."
                    }), true);
                    transientData.AdjustIncomingAvatar(ref avatar);
                    NetUser.SaveAvatar(userID, ref avatar);
                }
            }
        }
Пример #2
0
 // Token: 0x060003AA RID: 938 RVA: 0x0001169C File Offset: 0x0000F89C
 public static void CopyPersistantMessages(ref RustProto.Avatar.Builder builder, ref RustProto.Avatar avatar)
 {
     builder.ClearBlueprints();
     for (int i = 0; i < avatar.BlueprintsCount; i++)
     {
         builder.AddBlueprints(avatar.GetBlueprints(i));
     }
 }
Пример #3
0
 /////////////////////////
 // OnPlayerSpawn(PlayerClient player, bool useCamp, RustProto.Avatar avatar)
 // Called when a player spawns (after connection or after death)
 /////////////////////////
 void OnPlayerSpawn(PlayerClient player, bool useCamp, RustProto.Avatar avatar)
 {
     if (jailinmates[player.userID.ToString()] != null)
     {
         NetUser netuser = player.netUser;
         SendPlayerToJail(netuser);
         CheckPlayerExpireTime(netuser);
     }
 }
Пример #4
0
 public static void ClusterServer_SaveAvatar(ulong UserID, ref RustProto.Avatar avatar)
 {
     object[] array = new object[]
     {
         UserID,
         avatar
     };
     Method.Invoke("RustExtended.RustHook.ClusterServer_SaveAvatar", array);
     avatar = (RustProto.Avatar)array[1];
 }
Пример #5
0
 void OnPlayerSpawn(PlayerClient player, bool useCamp, RustProto.Avatar avatar)
 {
     if (!useCamp)
     {
         return;
     }
     if (!antiRockGlitch)
     {
         return;
     }
     timer.Once(0.1f, () => CheckPlayerSpawn(player));
 }
Пример #6
0
        /////////////////////////
        // OnPlayerSpawn(PlayerClient player, bool useCamp, RustProto.Avatar avatar)
        // Called when a player spawns (after connection or after death)
        /////////////////////////
        void OnPlayerSpawn(PlayerClient player, bool useCamp, RustProto.Avatar avatar)
        {
            if (hasPermission(player.netUser))
            {
                return;
            }
            PlayerHandler phandler = player.GetComponent <PlayerHandler>();

            if (phandler == null)
            {
                phandler = player.gameObject.AddComponent <PlayerHandler>(); phandler.timeleft = GetPlayerData(player);
            }
            timer.Once(0.1f, () => phandler.StartCheck());
        }
Пример #7
0
        void OnPlayerSpawn(PlayerClient player, bool useCamp, RustProto.Avatar avatar)
        {
            if (KitsConfig["autokit"] == null)
            {
                return;
            }
            if (avatar != null && avatar.HasPos && avatar.HasAng)
            {
                return;
            }
            object thereturn = Interface.GetMod().CallHook("canRedeemKit", new object[] { player.netUser });

            if (thereturn == null)
            {
                timer.Once(0.01f, () => StripAndGiveKit(player.netUser, "autokit"));
            }
        }