Ejemplo n.º 1
0
    static async Task test_server()
    {
        var context = new SerializationContext();
        var options = new GameServer.Options()
        {
            // required parameters:
            Context = context,
        };

        using (var server = await GameServer.ConnectAsync(options))
            server.Wait();
    }
Ejemplo n.º 2
0
        // Use this for initialization
        void Start()
        {
            m_rand = new System.Random();

            GameServer.Options options = new GameServer.Options();
            options.gameId        = "simple";
            options.controllerUrl = "http://localhost:8080/examples/simple/index.html";
            m_server = new GameServer(options, gameObject);
            m_server.Init();

            m_server.OnPlayerConnect += StartNewPlayer;
            m_server.OnConnect       += Connected;
            m_server.OnDisconnect    += Disconnected;
        }