예제 #1
0
        public UI()
        {
            InitializeComponent();
            this.FormClosed += new FormClosedEventHandler(stopGSListen);

            settings = grabSid();

            if (settings.Length.Equals(0))
            {
                MessageBox.Show("Please paste your SteamID into the steamid.txt file created in the folder this program is in and restart the program.");
                Environment.Exit(0);
            }
            else
            {
                sid = settings[0];

                //Set custom colors
                if (settings.Length > 1)
                {
                    if (settings.Length.Equals(7))
                    {
                        string u, v, w, x, y, z;

                        u = settings[1];
                        v = settings[2];
                        w = settings[3];
                        x = settings[4];
                        y = settings[5];
                        z = settings[6];

                        setColors(u, v, w, x, y, z);
                    }
                    else
                    {
                        MessageBox.Show("In order to use custom colors, you muse serparate two sets of RGB values in the config.txt file like so:\n\n" +
                            "<steamid> <R> <G> <B> <R> <G> <B>\n\n" +
                            "All values must be within 0-255 and must be separated by spaces. The first set of values are for background color and the second set are for stat counter color. En example configuration would look like the following:\n\n" +
                            "STEAM_0:0:1234 64 64 64 0 192 0");
                    }
                }

                s = new SteamID(sid.Trim());

                if (s.IsValid)
                {
                    gsl = new GameStateListener(3000);
                    gsl.NewGameState += new NewGameStateHandler(OnNewGameState);
                    if (!gsl.Start())
                    {
                        Environment.Exit(0);
                    }
                    Console.WriteLine("Listening...");
                }
                else
                {
                    MessageBox.Show("INVALID STEAMID PROVIDED\n\nSteamID must be in regular SteamID format. EX: STEAM_0:0:39990");
                    Environment.Exit(0);
                }
            }
        }
예제 #2
0
 static void Main(string[] args)
 {
     gsl = new GameStateListener(3000);
     gsl.NewGameState += new NewGameStateHandler(OnNewGameState);
     if (!gsl.Start())
     {
         Environment.Exit(0);
     }
     Console.ForegroundColor = ConsoleColor.Green;
     Console.WriteLine("Mullistava WOOOOW ohjelma käynnistetty!");
     Console.WriteLine("");
     Console.ForegroundColor = ConsoleColor.White;
     Console.WriteLine("|~~~~~~~~~~ Kehittäjä: ArtsiX ~~~~~~~~~~|");
     Console.WriteLine("");
 }
예제 #3
0
 /// <summary>
 /// Starts the CSGSI connection
 /// </summary>
 /// <param name="ip"></param>
 public void connectToCS(string ip)
 {
     try
     {
         gs1 = new GameStateListener(string.Format("http://{0}/", ip));
         gs1.NewGameState += new NewGameStateHandler(OnNewGameState);
         if (gs1.Start())
         {
             Console.Write("Game Listener Started\n");
         }
         else
         {
             Console.Write("Couldn't Start Game Listener. Try running as admin.\n");
         }
     }
     catch(Exception ex)
     {
         Console.WriteLine("Exception occured in starting Game Listener!");
         Console.WriteLine("Message: " + ex.Message.ToString());
     }
 }
예제 #4
0
파일: Program.cs 프로젝트: jauhc/loudmouth
        // new variable to store last shooting weapon?

        /// <summary>
        /// Insert point, launch paramters; dev = log to console only, s = simple mode
        /// </summary>
        static void Main(string[] args)
        {
            if (!Utils.isWindows())
            {
                Utils.log(1, @$ "uh oh, looks like youre trying to run this NOT on windows,\n
this is possible BUT autoconfig will not work");
            }
            int port = 1338;

            // Parse args
            for (int i = 0; i < args.Length; i++)
            {   // oh god please there has to be a better way of doing this
                // if (args[i].ToLower.IndexOf("gameport") > -1)
                // Utils.gamePort = int.Parse(args[i].Substring(9));
                // if (args[i].ToLower.IndexOf("netport") > -1)
                // Utils.netPort = int.Parse(args[i].Substring(8));
                if (args[i] == "dev")
                {
                    Utils._testing = true;
                }
                if (args[i] == "s")
                {
                    Utils._singlesMode = true;
                }
                if (args[i] == "p")
                {
                    Utils._puntualMode = true;
                }
            }
            // dont allow overlapping modes
            if (Utils._puntualMode && Utils._singlesMode)
            {
                Utils.log(1, "Overlapping modes! Fix your parameters.");
                Environment.Exit(1);
            }
            Utils.Init();
            gsl = new GameStateListener(port);
            if (!gsl.Start())
            {
                Environment.Exit(0);
            }
            gsl.NewGameState      += OnNewGameState;
            gsl.RoundPhaseChanged += Utils.readMates;

            if (gsl.Running)
            {
                Utils.log("loud mouth online!");
            }
            if (Utils._testing)
            {
                Utils.log("dev mode on");
            }
            // actual modes here, have them as `else if` so they dont mess with eachother
            if (Utils._singlesMode)
            {
                Utils.log("simple output mode on");
            }
            else if (Utils._puntualMode)
            {
                Utils.log("punctual mode on");
            }
        }