コード例 #1
0
 /// <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);
 }
コード例 #2
0
ファイル: view.cs プロジェクト: Blankpanda/chat_client
        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();
        }
コード例 #3
0
ファイル: Start.cs プロジェクト: Blankpanda/chat_client
        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.");
            }
        }
コード例 #4
0
ファイル: Start.cs プロジェクト: Blankpanda/chat_client
        /*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.");
            }
        }
コード例 #5
0
ファイル: SList.cs プロジェクト: Blankpanda/chat_client
        public static void Execute()
        {
            Server.ServerList srvList = new Server.ServerList();

            srvList.DisplayServerList();
        }
コード例 #6
0
ファイル: Delete.cs プロジェクト: Blankpanda/chat_client
        public static void Execute(string ServerName)
        {
            Server.ServerList Slist = new Server.ServerList();

            Slist.Delete(ServerName);
        }
コード例 #7
0
ファイル: Delete.cs プロジェクト: Blankpanda/chat_client
        public static void Execute()
        {
            Server.ServerList Slist = new Server.ServerList();

            Slist.Delete();
        }