Exemplo n.º 1
0
 private void FilterMethod()
 {
     ProfanityChecker PF = new ProfanityChecker(ProfanityFilter);
     while (ProfanityActive)
     {
         this.Invoke(PF);
         Thread.Sleep(200);
     }
 }
Exemplo n.º 2
0
        private void FilterMethod()
        {
            ProfanityChecker PF = new ProfanityChecker(ProfanityFilter);

            while (ProfanityActive)
            {
                this.Invoke(PF);
                Thread.Sleep(200);
            }
        }
            public static bool MultiplayerPlayerInfoState_GetOrPrepareSafeDisplayName_Prefix(MultiplayerPlayerInfoState __instance, Action <string> onSafeDisplayNameReceived, ref bool ____isSafeDisplayNameBeingPrepared)
            {
                if (string.IsNullOrEmpty(Accessor.GetPrivateProperty <MultiplayerPlayerInfoState, string>("SafeDisplayName", __instance)))
                {
                    Action <string> singleCallback = null;
                    singleCallback = delegate(string safeDisplayName)
                    {
                        __instance.OnSafeDisplayNamePrepared -= singleCallback;
                        Action <string> onSafeDisplayNameReceived3 = onSafeDisplayNameReceived;
                        if (onSafeDisplayNameReceived3 != null)
                        {
                            onSafeDisplayNameReceived3(MultiplayerPlayerNameManager.GetFullPrefixForPlayfabID(__instance.state.PlayFabID) + MultiplayerPlayerNameManager.GetNameForPlayfabID(__instance.state.PlayFabID, safeDisplayName));
                        }
                    };

                    __instance.OnSafeDisplayNamePrepared += singleCallback;

                    if (____isSafeDisplayNameBeingPrepared)
                    {
                        return(false);
                    }

                    ____isSafeDisplayNameBeingPrepared = true;
                    ProfanityChecker.FilterForProfanities(__instance.state.DisplayName, delegate(string preparedName)
                    {
                        Accessor.SetPrivateProperty("SafeDisplayName", __instance, preparedName);
                        Accessor.SetPrivateField("_isSafeDisplayNameBeingPrepared", __instance, false);

                        EventInfo safeDisplayNamePreparedEvent = typeof(MultiplayerPlayerInfoState).GetEvent("OnSafeDisplayNamePrepared", BindingFlags.Public | BindingFlags.Instance);
                        if (safeDisplayNamePreparedEvent.RaiseMethod != null)
                        {
                            safeDisplayNamePreparedEvent.RaiseMethod.Invoke(__instance, new object[] { Accessor.GetPrivateProperty <MultiplayerPlayerInfoState, string>("SafeDisplayName", __instance) });
                        }
                    });
                }
                else
                {
                    Action <string> onSafeDisplayNameReceived2 = onSafeDisplayNameReceived;
                    if (onSafeDisplayNameReceived2 != null)
                    {
                        onSafeDisplayNameReceived2(MultiplayerPlayerNameManager.GetFullPrefixForPlayfabID(__instance.state.PlayFabID) + MultiplayerPlayerNameManager.GetNameForPlayfabID(__instance.state.PlayFabID, Accessor.GetPrivateProperty <MultiplayerPlayerInfoState, string>("SafeDisplayName", __instance)));
                    }
                }

                return(false);
            }