async void Start()
    {
        server = new DemoServer();
        await server.StartNetworked((_) => true, (ses, remaining) => Debug.Log("session exited: " + ses + ", remaining:" + remaining), this, settings);

        var clients = GameObject.FindObjectsOfType <TestDemoClientComp>();

        Array.ForEach(clients, (client) => client.StartCommunications(settings.port));
    }
示例#2
0
        public void Configuration(IAppBuilder app)
        {
            DocumentStoreHolder.SetDbInfo("DemoServer", "Northwind", "Media");

            var configuration = new HttpConfiguration();

            DemoServer.Configure(configuration);

            app.UseWebApi(configuration);
        }
    private async void ActivateSession(GameSession gameSession)
    {
        try {
            Debug.Log("server start game session: " + gameSession.GameSessionId);
            server = new DemoServer();
            await server.StartNetworked(AcceptPlayer, HandlePlayerExit, this, settings);

            LogOutcome("activate", GameLiftServerAPI.ActivateGameSession());
        } catch (Exception e) {
            Debug.LogError("Exception on server update");
            Debug.LogError(e);
        }
    }