/// <summary> /// Class which helps you to take info from riot's api /// </summary> /// <param name="appKey">Riot Application Key (kinda sucks that u need to regenerate it each day)</param> /// <param name="CurrentServer">Server u're playing on (should be selected from Request.Server.ServerList)</param> /// <param name="Output">Ur void(string) which will process debug info (can be null)</param> public Request(string appKey, Server.ServerList CurrentServer, Action <string> Output) { SrvEndpoint = Server.GetServer(CurrentServer); AppKey = appKey; OutInfo = Output; RequestHandler.Timeout = TimeSpan.FromSeconds(5); }
public static void Execute() { Server.ServerList slist = new Server.ServerList(); //string[] ServerList = slist.GetServerList(); // gets a list of all of the created servers from the Servers/ directory. slist.PrintServerSettings(); }
public static void Execute() { Server.ServerList InitalizeSettings = new Server.ServerList(); // used to retrieve server settings and test the user input. string[] ServerList = InitalizeSettings.GetServerList(); // gets a list of all of the created servers from the Servers/ directory. if (ServerList.Length > 0) // does a server exist? { // Remove @"Servers\" from the strings in the server list. // HACK: consider adding to this ServerList.GetServerList(); for (int i = 0; i < ServerList.Length; i++) ServerList[i] = ServerList[i].Replace(@"Servers\", ""); // Display the server information and ask the user what server they would like to start. Console.WriteLine("What server would you like to start (Enter in the number or name)?"); for (int i = 0; i < ServerList.Length; i++) { int ServerIndex = i + 1; Console.WriteLine(ServerIndex.ToString() + "). " + ServerList[i]); } Console.WriteLine("------"); // gives the user some space string ServerName = Console.ReadLine(); ServerName = ServerName.ToUpper(); for (int i = 0; i < ServerList.Length; i++) { int ServerCount = i + 1; if (ServerName == ServerCount.ToString() || ServerName == ServerList[i].ToUpper()) // the user can enter the name or a number { ServerName = ServerList[i]; // if the user enters a number we need to make the input a string of the servers name. ServerName = ServerName.Replace(@"Servers\", ""); Server.ServerInit.ServerSettings Settings = InitalizeSettings.GetServerByName(ServerName); // load in user settings. Server.Server srv = new Server.Server(Settings); // create a new object with those server settings Console.WriteLine(Settings.server_name + " starting."); srv.Start(); // start the server } else { Console.WriteLine("Invalid server name supplied."); } } } else { Console.WriteLine("No Servers currently created."); } }
/*Overload for an argument that already has been supplied*/ public static void Execute(string ServerName) { Server.ServerList InitalizeSettings = new Server.ServerList(); if (InitalizeSettings.ServerExists(ServerName)) { Server.ServerInit.ServerSettings Settings = InitalizeSettings.GetServerByName(ServerName); // load in user settings. Server.Server srv = new Server.Server(Settings); // create a new object with those server settings Console.WriteLine(Settings.server_name + " starting."); srv.Start(); // start the server } else { Console.WriteLine("Invalid server name supplied."); } }
public static void Execute() { Server.ServerList srvList = new Server.ServerList(); srvList.DisplayServerList(); }
public static void Execute(string ServerName) { Server.ServerList Slist = new Server.ServerList(); Slist.Delete(ServerName); }
public static void Execute() { Server.ServerList Slist = new Server.ServerList(); Slist.Delete(); }