Пример #1
0
 public void Log(string s, int ColorCode)
 {
     if (ShowLog == false)
     {
         return;
     }
     MConsole.Log(s, (ConsoleColor)ColorCodes[ColorCode]);
 }
Пример #2
0
        private void MainWindow_Load(object sender, EventArgs e)
        {
            _console = new MConsole();
            _console.CreateConsole();

            ColorCodes.Add(ConsoleColor.DarkYellow);
            ColorCodes.Add(ConsoleColor.Green);
            ColorCodes.Add(ConsoleColor.Cyan);
            ColorCodes.Add(ConsoleColor.Gray);
            ColorCodes.Add(ConsoleColor.Red);
            OutputLogLegend();
            Log("AutoStart in 4 Seconds...", MServer.UTILITY);
            _Server = new MServer();

            IPAddressBox.Text = _Server.ServerIPAddress;
            PortBox.Text      = _Server.ServerPort.ToString();

            _Server.Version = MVersion.VERSION.ToString();

            _Server.ZoneChanged     += _Server_ZoneChanged;
            _Server.UniverseChanged += _Server_UniverseChanged;

            _Server.ServerInfo         += _Server_ServerInfo;
            _Server.MetricInfo         += _Server_MetricInfo;
            _Server.ClientConnected    += _Server_ClientConnected;
            _Server.ClientLoggedIn     += _Server_ClientLoggedIn;
            _Server.ClientDisconnected += _Server_ClientDisconnected;

            Log("Created Server Version:" + _Server.Version, MServer.UTILITY);
            Text     += " v" + _Server.Version;
            LocalName = HostInfo.HostName;
            //ConnectionsList.DataSource = MassiveConnections;
            //ZoneList.DataSource = MassiveZones;
            ZoneList.DisplayMember = "Name";


#if DEBUG
            timer1.Interval = 1000;
            Text           += " DEBUG";
#endif
            timer1.Start();
            BackupTimer.Start();
            // NetworkTimer.Start();

#if DEBUG
#else
#endif
            MaxConnectionsLabel.Text = "Max Connections" + MServer.MAXCONNECTIONS;
            Log("Backup schedule is: Backup every " + (BackupTimer.Interval / 3600000) + " hour", 3);
            GetPublicIP();
        }
Пример #3
0
        public void OutputLogLegend()
        {
            if (ShowLog == false)
            {
                return;
            }

            MConsole.LogSingle("OUTGOING", (ConsoleColor)ColorCodes[MServer.OUTGOING]);
            MConsole.LogSingle("OUTGOINGBROADCAST", (ConsoleColor)ColorCodes[MServer.OUTGOINGBROADCAST]);
            MConsole.LogSingle("INCOMING", (ConsoleColor)ColorCodes[MServer.INCOMING]);
            MConsole.LogSingle("UTILITY", (ConsoleColor)ColorCodes[MServer.UTILITY]);
            MConsole.LogSingle("ERROR", (ConsoleColor)ColorCodes[MServer.ERROR]);
            Log("", MServer.UTILITY);
        }