Ejemplo n.º 1
0
        public override void Process(NPHandler client)
        {
            Log.Data("Client authenticating with token");

            NPAuthAPI.RequestAuthForToken(this, client);
        }
Ejemplo n.º 2
0
        public NPAuthAPI()
        {
            _buffer = new byte[2048];

            _instance = this;
        }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
#if !DEBUG
            Log.Initialize("NPx.log", LogLevel.Data | LogLevel.Info | LogLevel.Error, true);
#else
            Log.Initialize("NPx.log", LogLevel.All, true);
#endif
            Log.Info("NPServer starting...");

            // connect to the database
            Database = XNP.Create();

            if (Database == null)
            {
                return;
            }

            // start the NP socket
            NPSocket streamServer = new NPSocket();
            streamServer.Start();

            // start the NP auth API
            NPAuthAPI authAPI = new NPAuthAPI();
            authAPI.Start();

            // start the Steam friend linker
            SteamFriendsLinker steamLinker = new SteamFriendsLinker();
            steamLinker.Start();

            // start the profile data handler
            ProfileData profileData = new ProfileData();
            profileData.Start();

            // start the matchdata parser
            //MatchData matchData = new MatchData();
            //matchData.Start();

            // start the matchdata converter
            //MatchDataConverter matchDataConverter = new MatchDataConverter();
            //matchDataConverter.Start();

            // start aux threads
            NPHandler.Start();
            TaskScheduler.Start();
            HttpHandler.Start();

            StatFileHandler.Register();

            TaskScheduler.EnqueueTask(Servers.CleanSessions, 300);

            // main idle loop
            while (true)
            {
                try
                {
                    Log.WriteAway();
                }
                catch (Exception e) { Log.Error(e.ToString()); }

                Thread.Sleep(5000);
            }
        }