private IEnumerator LogRoutine()
        {
            while (IsRunning)
            {
                if (LogQueue.Count > 0)
                {
                    var data = LogQueue.Dequeue();

                    char logType = data [0];
                    var  message = data.Substring(1);

                    switch (logType)
                    {
                    case '0':
                        LogSignal.Dispatch(LogType.Connected, message);
                        break;

                    case '1':
                        LogSignal.Dispatch(LogType.Message, message);
                        break;

                    case '2':
                        LogSignal.Dispatch(LogType.Disconnected, message);
                        IsRunning = false;
                        break;
                    }
                }

                yield return(null);
            }
        }
    private void OnPlayFabServerStartup(ServerSettingsData settings)
    {
        _logger.Dispatch(LoggerTypes.Info, "PlayFab Server Has been started");
        _loadPlayFabDataCompleteSignal.RemoveListener(OnPlayFabServerStartup);

        var startGameServerSignal         = injectionBinder.GetInstance <MainGameServerStartupSignal>();
        var startGameServerCompleteSignal = injectionBinder.GetInstance <MainGameServerStartupCompleteSignal>();

        startGameServerCompleteSignal.AddListener(OnStartMainGameServerComplete);
        startGameServerSignal.Dispatch();
    }
    public override void Launch()
    {
        #region GAMER SERVER STARTUP CODE ( You don't need to touch this )
        _logger = injectionBinder.GetInstance <LogSignal>();
        _logger.Dispatch(LoggerTypes.Info, "Launch from MainGameServer Context.");

        //Bind to onComplete.
        _loadPlayFabDataCompleteSignal = injectionBinder.GetInstance <PlayFabServerStartupCompleteSignal>();
        _loadPlayFabDataCompleteSignal.AddListener(OnPlayFabServerStartup);

        //Dispatch Signal to startup
        var loadPlayFabDataSignal = injectionBinder.GetInstance <PlayFabServerStartupSignal>();
        loadPlayFabDataSignal.Dispatch();
        #endregion
    }
Exemple #4
0
    public override void Launch()
    {
        _logger = injectionBinder.GetInstance <LogSignal>();
        _logger.Dispatch(LoggerTypes.Info, "Launch from MainGameServer Context.");

        foreach (var pack in MainCtx.Packages)
        {
            pack.Launch(injectionBinder);
        }

        PlayFabServerEvents.OnServerStartupComplete += OnPlayFabServerStartup;

        //startup server
        _serverService = injectionBinder.GetInstance <PlayFabServerService>();
        _serverService.PlayFabServerStartup();
    }
    public override void Launch()
    {
        _logger = injectionBinder.GetInstance <LogSignal>();
        _logger.Dispatch(LoggerTypes.Info, "Launch from MainGameServer Context.");

        foreach (var pack in MainCtx.Packages)
        {
            pack.Launch(injectionBinder);
        }
        //Bind to onComplete.
        _loadPlayFabDataCompleteSignal = injectionBinder.GetInstance <PlayFabServerStartupCompleteSignal>();
        _loadPlayFabDataCompleteSignal.AddListener(OnPlayFabServerStartup);

        //Dispatch Signal to startup
        var loadPlayFabDataSignal = injectionBinder.GetInstance <PlayFabServerStartupSignal>();

        loadPlayFabDataSignal.Dispatch();
    }
    public override void Launch()
    {
        _logger = injectionBinder.GetInstance<LogSignal>();
        _logger.Dispatch(LoggerTypes.Info, "Launch from MainGameServer Context.");

        foreach (var pack in MainCtx.Packages)
        {
            pack.Launch(injectionBinder);
        }
        //Bind to onComplete.
        _loadPlayFabDataCompleteSignal = injectionBinder.GetInstance<PlayFabServerStartupCompleteSignal>();
        _loadPlayFabDataCompleteSignal.AddListener(OnPlayFabServerStartup);

        //Dispatch Signal to startup
        var loadPlayFabDataSignal = injectionBinder.GetInstance<PlayFabServerStartupSignal>();
        loadPlayFabDataSignal.Dispatch();

    }