Exemplo n.º 1
0
 static Global()
 {
     Class7.RIuqtBYzWxthF();
     DOMAIN               = AppDomain.CurrentDomain;
     RANDOM               = new Random(DateTime.Now.Millisecond);
     DI_DATA              = new Dictionary <string, string>();
     Logger               = LogManager.GetLogger("logger");
     PRIVACY_MANAGER      = null;
     HddSerial            = "";
     SERIAL               = "";
     SERIAL64             = "";
     TestingOn            = false;
     AES_KEY              = "B84EFA83B3236@%=";
     AES_IV               = "0664117802981456";
     SENSOR               = null;
     CAPTCHA_QUEUE        = new ObservableCollection <TaskObject>();
     SUCCESS              = new ObservableCollection <SuccessObject>();
     SUCCESS_PROFILES     = new List <KeyValuePair <string, string> >();
     ChromeDrivers        = new List <ChromeDriver>();
     SupremeTokens        = new ObservableCollection <CaptchaToken>();
     ShopifyTokens        = new ObservableCollection <CaptchaToken>();
     SnsTokens            = new ObservableCollection <CaptchaToken>();
     MrPorterTokens       = new ObservableCollection <CaptchaToken>();
     SivasTokens          = new ObservableCollection <CaptchaToken>();
     HibbettTokens        = new ObservableCollection <CaptchaToken>();
     OWTokens             = new ObservableCollection <CaptchaToken>();
     FootactionTokens     = new ObservableCollection <CaptchaToken>();
     PrivacyTokens        = new ObservableCollection <CaptchaToken>();
     HolypopTokens        = new ObservableCollection <CaptchaToken>();
     CaptchaLocker        = new object();
     SolverLocker         = new object();
     SuccessLocker        = new object();
     IsProxyTestRunning   = false;
     PROXY_USAGE          = new List <KeyVal <string, int> >();
     ProxyLocker          = new object();
     RUNNING_SERVERS      = new List <string>();
     CAPTCHA_ASSIGN_LOCK  = new object();
     SHOPIFY_SESSIONS     = new List <ShopifySession>();
     SessionLocker        = new object();
     SHOPIFY_API_TOKENS   = new List <KeyValuePair <string, string> >();
     ADDED_VALS           = new List <string>();
     CaptchaSolver1Opened = false;
     CaptchaSolver2Opened = false;
     CaptchaSolver3Opened = false;
     CaptchaSolver4Opened = false;
     CaptchaSolver5Opened = false;
     L = new object();
 }
Exemplo n.º 2
0
        public void IgnoreUser(string username)
        {
            username = username.ToLower();
            if (username == this.Me.UserName.ToLowerInvariant())
            {
                return;
            }

            var user = new User(new Jid(username + "@" + this.Config.ChatHost));

            if (Ignorees.Contains(user))
            {
                return;
            }

            var order = (IgnoreList.Count == 0) ? 1 : IgnoreList.Max(x => x.Order) + 1;
            var block = RuleManager.BlockByJid(user.JidUser, order, Stanza.Message);

            IgnoreList.Add(block);

            PrivacyManager.AddList("ignore", IgnoreList.ToArray(), OnIgnorelistUpdated, null);
            PrivacyManager.ChangeActiveList("ignore");
            PrivacyManager.ChangeDefaultList("ignore");
        }
Exemplo n.º 3
0
        public void UnignoreUser(User user)
        {
            IgnoreList.RemoveAll(x => x.Val == user.JidUser);

            PrivacyManager.UpdateList("ignore", IgnoreList.ToArray(), OnIgnorelistUpdated, null);
        }
Exemplo n.º 4
0
        public Plugin()
        {
            Logger.LogDebug("Binding configs...");
            {
                TomlTypeConverter.AddConverter(typeof(IPAddress), new TypeConverter
                {
                    ConvertToObject = (raw, type) => IPAddress.Parse(raw),
                    ConvertToString = (value, type) => ((IPAddress)value).ToString()
                });

                _config = new RootConfig(Config);
            }

            Logger.LogDebug("Initializing utilities...");
            {
                _version = new Version(VERSION);
                _rng     = RandomNumberGenerator.Create();

                _clientLog  = BepInEx.Logging.Logger.CreateLogSource(NAME + "-CL");
                _serverLog  = BepInEx.Logging.Logger.CreateLogSource(NAME + "-SV");
                _discordLog = BepInEx.Logging.Logger.CreateLogSource(NAME + "-DC");
            }

            Logger.LogDebug("Initializing Discord game SDK...");
            {
                DiscordClient = new Discord.Discord(DISCORD_APP_ID, (ulong)CreateFlags.Default);
                DiscordClient.SetLogHook(Discord.LogLevel.Debug, (level, message) =>
                {
                    switch (level)
                    {
                    case Discord.LogLevel.Error:
                        _discordLog.LogError(message);
                        break;

                    case Discord.LogLevel.Warn:
                        _discordLog.LogWarning(message);
                        break;

                    case Discord.LogLevel.Info:
                        _discordLog.LogInfo(message);
                        break;

                    case Discord.LogLevel.Debug:
                        _discordLog.LogDebug(message);
                        break;

                    default:
                        throw new NotImplementedException(level.ToString());
                    }
                });

                ActivityManager = DiscordClient.GetActivityManager();
                Activity        = new StatefulActivity(ActivityManager, DiscordCallbackHandler);

                ActivityManager.RegisterSteam(STEAM_APP_ID);

                ActivityManager.OnActivityJoinRequest += OnJoinRequested;
                ActivityManager.OnActivityJoin        += OnJoin;
            }

            Logger.LogDebug("Creating message table...");
            {
                _messages = new UniversalMessageList <H3Client, H3Server>(_clientLog, _serverLog)
                            // =======
                            // Client
                            // =======
                            // Time synchronization (reliable adds latency)
                            .AddClient <PingMessage>(0, DeliveryMethod.Sequenced, H3Server.OnClientPing)
                            // Player movement
                            .AddClient <Timestamped <PlayerTransformsMessage> >(1, DeliveryMethod.Sequenced, H3Server.OnPlayerMove)
                            // Asset management
                            .AddClient <LevelChangeMessage>(2, DeliveryMethod.ReliableOrdered, H3Server.OnLevelChange)
                            //
                            // =======
                            // Server
                            // =======
                            // Time synchronization (reliable adds latency)
                            .AddServer <Timestamped <PingMessage> >(0, DeliveryMethod.Sequenced, H3Client.OnServerPong)
                            // Player movement
                            .AddServer <PlayerMovesMessage>(1, DeliveryMethod.Sequenced, H3Client.OnPlayersMove)
                            // Asset management
                            .AddServer <InitMessage>(2, DeliveryMethod.ReliableOrdered, H3Client.OnInit)
                            .AddServer <LevelChangeMessage>(2, DeliveryMethod.ReliableOrdered, H3Client.OnLevelChange)
                            .AddServer <PlayerJoinMessage>(2, DeliveryMethod.ReliableOrdered, H3Client.OnPlayerJoin)
                            .AddServer <PlayerLeaveMessage>(2, DeliveryMethod.ReliableOrdered, H3Client.OnPlayerLeave)
                ;
            }

            Logger.LogDebug("Initializing party privacy...");
            _privacyManager = new PrivacyManager(Activity, _config.Host);

            Logger.LogDebug("Initializing wrist menu and options panel...");
            _wristMenuButtons = new WristMenuButtons(Logger, _privacyManager);

            Logger.LogDebug("Initializing shared Harmony state...");
            HarmonyState.Init(Activity, _wristMenuButtons);
        }
Exemplo n.º 5
0
        public void ProcessPrivacy(string usersFile, string privacyPreference)
        {
            List <string> usersList = new List <string>();

            try
            {
                usersList = FileAccess.GetUsersFileData(usersFile);
            }
            catch (Exception ex)
            {
                Log.WriteLogEntry("ERROR", String.Format("Error while reading Users file: {0}", ex.Message), "Error while reading Users file.");
                CleanupEnvironment();
                Program.CloseApplicationOnError();
            }

            PrivacyModePreference userPrivacyPreference = PrivacyModePreference.None;

            switch (privacyPreference.ToLowerInvariant())
            {
            case "default":
                userPrivacyPreference = PrivacyModePreference.None;
                break;

            case "private":
                userPrivacyPreference = PrivacyModePreference.Private;
                break;

            case "public":
                userPrivacyPreference = PrivacyModePreference.Standard;
                break;

            default:
                // Should not happen
                Log.WriteLogEntry("ERROR", "Incorrect value for PrivacyPreference parameter.");
                CleanupEnvironment();
                Program.CloseApplicationOnError();
                break;
            }

            if (usersList.Count > 0)
            {
                ucmaPlatform.StartupPlatform();
                ucmaEndpoint = new Endpoint(ucmaPlatform.CollabPlatform);
                PrivacyManager privacyManager = new PrivacyManager(ucmaEndpoint);

                foreach (string user in usersList)
                {
                    Log.WriteLogEntry("INFO", String.Format("Processing user {0}...", user.ToLowerInvariant()), String.Format("Processing user {0}...", user.ToLowerInvariant()));

                    try
                    {
                        privacyManager.SetPrivacyPreference(user, userPrivacyPreference);
                    }
                    catch (RegisterException rex)
                    {
                        Log.WriteLogEntry("ERROR", String.Format("Error while processing user {0}: {1}. Inner Exception: {2}. Diag Info: {3}.", user.ToLowerInvariant(), rex.Message, (rex.InnerException == null ? "N/A" : rex.InnerException.Message), (String.IsNullOrEmpty(rex.DiagnosticInformation.ToString()) ? "N/A" : rex.DiagnosticInformation.ToString())), String.Format("Error while processing user {0}", user.ToLowerInvariant()));
                    }
                    catch (Exception ex)
                    {
                        Log.WriteLogEntry("ERROR", String.Format("Error while processing user {0}: {1}. Inner Exception: {2}", user.ToLowerInvariant(), ex.Message, (ex.InnerException == null ? "N/A" : ex.InnerException.Message)), String.Format("Error while processing user {0}", user.ToLowerInvariant()));
                    }
                }
            }
            else
            {
                Log.WriteLogEntry("WARNING", "Users file is empty or invalid. No action will be performed.");
            }
        }