Ejemplo n.º 1
0
 internal void OnScp079GainLevel(GainingLevelEventArgs ev)
 {
     if (!config.Scp.canScp079gainLevel)
     {
         ev.IsAllowed = false;
     }
 }
        public async void OnGainingLevel(GainingLevelEventArgs ev)
        {
            if (Instance.Config.EventsToLog.GainingScp079Level && (!ev.Player.DoNotTrack || !Instance.Config.ShouldRespectDoNotTrack))
#pragma warning disable CS0618 // Type or member is obsolete
            {
                await Network.SendAsync(new RemoteCommand("log", "gameEvents", string.Format(Language.GainedLevel, ev.Player.Nickname, Instance.Config.ShouldLogUserIds ? ev.Player.UserId : Language.Redacted, ev.Player.Role, ev.OldLevel, ev.NewLevel))).ConfigureAwait(false);
            }
#pragma warning restore CS0618 // Type or member is obsolete
        }
Ejemplo n.º 3
0
        private static bool Prefix(Scp079PlayerScript __instance, ref int newLvl)
        {
            var ev = new GainingLevelEventArgs(API.Features.Player.Get(__instance.gameObject), __instance.curLvl, newLvl);

            Scp079.OnGainingLevel(ev);

            newLvl = ev.NewLevel;

            return(ev.IsAllowed);
        }
Ejemplo n.º 4
0
        internal void GainingLevel(GainingLevelEventArgs ev)
        {
            if (Plugin.Instance.Config.GainingLevel == "")
            {
                return;
            }
            string message = Plugin.Instance.Config.GainingLevel.Replace("%player%", ev.Player.ToString());

            message = message.Replace("%level%", ev.NewLevel.ToString());
            message = message.Replace("%experience%", ev.Player.Experience.ToString());
            message = message.Replace("%energy%", ev.Player.Energy.ToString());
            message = message.Replace("%door%", ev.Player.Energy.ToString());


            if (Plugin.Instance.Config.debug_to_console)
            {
                Log.Debug(message: "[ " + Plugin.Instance.Config.scp079_name + "] " + message);
            }
            Plugin.sendWebHook(Plugin.Instance.Config.scp079_url, message, Plugin.Instance.Config.scp079_name);
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Invoked before gaining levels with SCP-079.
 /// </summary>
 /// <param name="ev">The <see cref="GainingLevelEventArgs"/> instance.</param>
 public static void OnGainingLevel(GainingLevelEventArgs ev) => GainingLevel.InvokeSafely(ev);