Example #1
0
        private static bool Prefix(ZNet __instance, ZRpc rpc, bool needPassword)
        {
            var cancel = false;

            BlockingPrefixEvent?.Invoke(__instance, ref cancel, rpc, needPassword);

            if (!cancel)
            {
                try
                {
                    PrefixEvent?.Invoke(__instance);
                }
                catch (Exception ex)
                {
                    Logger.LogError(ex.Message + Environment.NewLine + ex.StackTrace);
                }
            }

            return(!cancel);
        }
Example #2
0
        private static bool Prefix(TeleportWorld __instance)
        {
            var cancel = false;

            BlockingPrefixEvent?.Invoke(__instance, ref cancel);

            if (!cancel)
            {
                try
                {
                    PrefixEvent?.Invoke(__instance);
                }
                catch (Exception ex)
                {
                    Logger.LogError(ex.Message + Environment.NewLine + ex.StackTrace);
                }
            }

            return(!cancel);
        }
Example #3
0
        private static bool Prefix(Game __instance)
        {
            Logger.LogInfo($"{__instance} starting.");

            var cancel = false;

            BlockingPrefixEvent?.Invoke(__instance, ref cancel);

            if (!cancel)
            {
                try
                {
                    PrefixEvent?.Invoke(__instance);
                }
                catch (Exception ex)
                {
                    Logger.LogError(ex.Message + Environment.NewLine + ex.StackTrace);
                }
            }

            return(!cancel);
        }