Ejemplo n.º 1
0
    RoomGroupClient initBalanceEngine()
    {
        Config config = new Config();

        config.hostname = ServerAddress;
        config.port     = ServerPort;
        config.debugLog = ClientDebugLog;

        Config udpConfig = new Config();

        udpConfig.hostname = ServerAddress;
        udpConfig.port     = UdpServerPort;
        config.debugLog    = ClientDebugLog;

        WSClient        ws  = new WSClient();
        RoomGroupClient rgc = new RoomGroupClient(config, ws, udpConfig, this.debugLog);

        ws.OnConnect += () => {
            Debug.Log("connected.");
        };

        rgc.OnReady += () => {
            Debug.Log("rgc is ready: " + rgc.GetIdentification());
        };

        rgc.OnJoinedQueue += packet => {
            Debug.Log("queue joined.");
        };

        rgc.Run();
        return(rgc);
    }