Exemplo n.º 1
0
        public override void StartServer()
        {
            HostTopology topology = new HostTopology(GetConfig(), MaxConnections);

            if (SupportWebsocket)
            {
                if (!UseMLAPIRelay)
                {
                    int websocketHostId = NetworkTransport.AddWebsocketHost(topology, ServerWebsocketListenPort);
                }
                else
                {
                    if (LogHelper.CurrentLogLevel <= LogLevel.Error)
                    {
                        LogHelper.LogError("Cannot create websocket host when using MLAPI relay");
                    }
                }
            }

            int normalHostId = RelayTransport.AddHost(topology, ServerListenPort, true);
        }
Exemplo n.º 2
0
        public override void StartClient()
        {
            serverHostId = RelayTransport.AddHost(new HostTopology(GetConfig(), 1), false);

            serverConnectionId = RelayTransport.Connect(serverHostId, ConnectAddress, ConnectPort, 0, out byte error);
        }