public LegendaryPrompt(Configuration configuration, ConnectionProfile connectionData)
 {
     ProgramConfiguration = configuration;
     ConnectionData = connectionData;
     InitialiseCommandDictionary();
     Running = true;
 }
Esempio n. 2
0
 public RPCService(ConnectionProfile connectionData, ConnectCallbackType connectCallback, DisconnectCallbackType disconnectCallback = null, NetStatusCallbackType netStatusCallback = null)
 {
     ConnectionData = connectionData;
     ConnectCallback = connectCallback;
     DisconnectCallback = disconnectCallback;
     NetStatusCallback = netStatusCallback;
 }
        public RPCService(ConnectionProfile connectionData, ConnectCallbackType connectCallback, DisconnectCallbackType disconnectCallback = null, NetStatusCallbackType netStatusCallback = null)
        {
            ConnectionData     = connectionData;
            ConnectCallback    = connectCallback;
            DisconnectCallback = disconnectCallback;
            NetStatusCallback  = netStatusCallback;

            NetConnection = null;
        }
Esempio n. 4
0
        static void Main(string[] arguments)
        {
            Configuration configuration;
            try
            {
                Serialiser<Configuration> serialiser = new Serialiser<Configuration>(ConfigurationFile);
                configuration = serialiser.Load();
            }
            catch (System.IO.FileNotFoundException)
            {
                Console.WriteLine("Unable to load configuration file \"" + ConfigurationFile + "\"");
                return;
            }
            catch (System.InvalidOperationException)
            {
                Console.WriteLine("Malformed configuration file");
                return;
            }

            if (arguments.Length != 3)
            {
                Console.WriteLine("Usage:");
                Console.WriteLine(Environment.GetCommandLineArgs()[0] + " <server> <user> <password>");
                Console.Write("Servers available:");
                foreach (ServerProfile profile in configuration.ServerProfiles)
                    Console.Write(" " + profile.Abbreviation);
                Console.WriteLine("");
                return;
            }

            string server = arguments[0];
            string user = arguments[1];
            string password = arguments[2];

            ServerProfile chosenProfile = null;
            foreach (ServerProfile profile in configuration.ServerProfiles)
            {
                if (profile.Abbreviation.ToLower() == server.ToLower())
                {
                    chosenProfile = profile;
                    break;
                }
            }

            if (chosenProfile == null)
            {
                Console.WriteLine("Unable to find server profile \"" + server + "\"");
                return;
            }

            RegionProfile regionData = new RegionProfile(chosenProfile.LoginQueueURL, chosenProfile.RPCURL);
            ConnectionProfile connectionData = new ConnectionProfile(configuration.Authentication, regionData, configuration.Proxy, user, password);

            LegendaryPrompt prompt = new LegendaryPrompt(configuration, connectionData);
            prompt.Run();
        }
Esempio n. 5
0
        public RiotConnect(Configuration configure, string username, string password)
        {
            proxy = new ProxyProfile();
            //TODO: Make autowatch change based on input
            AutoWatch = false;
            config = configure;
            connectionData = new ConnectionProfile(config.Authentication, config.Region.RegionData, proxy, username, password);
            logPath = username + ".log";

            Connect();
        }
Esempio n. 6
0
        public Worker(EngineRegionProfile regionProfile, Configuration configuration, Database provider)
        {
            Profile = regionProfile;
            Provider = provider;

            WorkerProfiler = new Profiler();
            ActiveAccountIds = new HashSet<int>();

            Connection = Provider.GetConnection();
            ConnectionData = new ConnectionProfile(configuration.Authentication, regionProfile.Region, configuration.Proxy, Profile.Username, Profile.Password);
            Connect();
        }
Esempio n. 7
0
        public RPCService(ConnectionProfile connectionData, ConnectCallbackType connectCallback, DisconnectCallbackType disconnectCallback = null, NetStatusCallbackType netStatusCallback = null)
        {
            ConnectionData     = connectionData;
            ConnectCallback    = connectCallback;
            DisconnectCallback = disconnectCallback;
            NetStatusCallback  = netStatusCallback;

            /** Create service objects to call RPC functions */
            game         = new GameService(this);
            matchmaker   = new MatchmakerService(this);
            summoner     = new SummonerService(this);
            clientFacade = new ClientFacadeService(this);
            inventory    = new InventoryService(this);
            login        = new LoginService(this);
            mastery      = new MasteryService(this);
        }
Esempio n. 8
0
        public Worker(EngineRegionProfile regionProfile, Login login, Configuration configuration, RegionHandler regionHandler, DatabaseConnectionProvider databaseProvider)
        {
            RegionProfile = regionProfile;
            WorkerLogin = login;

            WorkerProfiler = new Profiler();

            JobEvent = new AutoResetEvent(false);

            Master = regionHandler;

            DatabaseProvider = databaseProvider;

            Database = DatabaseProvider.GetConnection();
            ConnectionData = new ConnectionProfile(configuration.Authentication, regionProfile.Region, configuration.Proxy, login.Username, login.Password);
            Connect();
        }
Esempio n. 9
0
 void Connect()
 {
     //Obtain a lock on the profile to avoid race conditions while the user is editing the data
     lock (Profile)
     {
         if (Profile.Login == null)
         {
             //The user has removed the login for this worker after the worker had been previously connecting - cancel
             WriteLine("No login specified");
             return;
         }
         else
         {
             ConnectionProfile connectionData = new ConnectionProfile(AuthenticationProfile, Profile.Region, Configuration.Proxy, Profile.Login.Username.ToLower(), Profile.Login.Password);
             RPC = new RPCService(connectionData, OnConnect, OnDisconnect);
             WriteLine("Connecting to the server");
         }
     }
     RPC.Connect();
 }