Example #1
0
        private static void Main(string[] args)
        {
            // Logger
            Log.Logger = new LoggerConfiguration()
                         .MinimumLevel.Debug()
                         .WriteTo.Console(theme: AnsiConsoleTheme.Code)
                         .WriteTo.File("Logs/Log.txt", rollingInterval: RollingInterval.Day)
                         .CreateLogger();

            // Configuration
            Configuration = GetConfiguration();
            Log.Information("Configuration loaded.");

            // Messages
            MessagesManager.Initialize();
            Log.Information($"{MessagesManager.MessagesCount} messages loaded.");

            // Handlers
            HandlersManager.Initialize();
            Log.Information($"{HandlersManager.HandlersCount} handlers loaded.");

            // Start server
            Log.Debug("Starting server...");
            ServerManager.Start();

            Console.ReadKey();
        }
Example #2
0
 public void Init()
 {
     Handlers                 = new HandlersManager();
     MatchServerIPs           = new Dictionary <int, string>();
     DisconnectedMatchServers = new List <int>();
     NetworkSocket.RegisterOnDisconnectionCallback(OnDisconnection);
 }
Example #3
0
        public MainWindowViewModel()
        {
            InitializeControls();
            InitializeDelegatesFromHandlersManager();

            HandlersManager.LoadOptionsFromConfig();
            HandlersManager.LoadProgramsToStartFromConfig();
        }
    public void Init()
    {
        Handlers            = new HandlersManager();
        KnownClients        = new Dictionary <string, ClientAccountInfo>(); // TODO : Ecrire une fonction pour charger cette liste à partir d'un fichier / base de données.
        OnlineClients       = new Dictionary <int, ClientAccountInfo>();
        DisconnectedClients = new List <int>();

        NetworkSocket.RegisterOnDisconnectionCallback(OnDisconnection);
    }
Example #5
0
    public void Initialise()
    {
        ConnectedPlayers = new Dictionary <int, string>();

        NetworkHandlers = new HandlersManager();

        MatchmakingQueue = new List <int>();

        PlayerControlManager = new BloodAndBileEngine.PlayerControlCommandManager();
        PlayerControlManager.SetExecuteLocally();
    }
Example #6
0
        private static void ServerClientDisconnected(ClientWrapper client)
        {
            if (ClientManagers.TryRemove(client.Id, out ClientManager clientManager))
            {
                HandlersManager.UnhandleClient(clientManager);
                Log.Information($"Client N°{client.Id} removed.");
                return;
            }

            Log.Error($"Client N°{client.Id} doesn't have a manager.");
        }
Example #7
0
        private static void ServerClientConnected(ClientWrapper client)
        {
            var clientManager = new ClientManager(client);

            if (ClientManagers.TryAdd(client.Id, clientManager))
            {
                HandlersManager.HandleClient(clientManager);
                Log.Information($"Client N°{client.Id} is now being managed.");
                return;
            }

            Log.Error($"Couldn't manage client N°{client.Id}.");
        }
Example #8
0
        private void MainAppForm_Load(object sender, EventArgs e)
        {
            _curTreeNode = null;

            // TODO: i pass this here now to do the handlers related stuff outside this file keeping it small
            //       perhaps a better way is to create another partial class that handles HandlersManager event
            //       and do these tasks in it...later!
            //       Also it seems that we need a Handler class to wrap the even growing handler things:
            //       like: image, button, events,...
            _handlersManager = new HandlersManager(this);

            // create imagelist in the tab control to be used when tab pages are added for handlers
            handlersTabControl.ImageList = new ImageList();

#if DEBUG
            Left += 1920 + 200;
#endif

            NajmConfigs.Load();

            _handlersManager.LoadHandlers(NajmConfigs.Handlers);
        }
Example #9
0
 private void SaveButtonCommand()
 {
     HandlersManager.SaveProgramsToStartToConfig();
 }