Exemple #1
0
 public void ShutDownServer()
 {
     Current?.Stop();
     m_NetManager?.Stop();
     m_NetManager = null;
     Current      = null;
 }
Exemple #2
0
        public void StartServer()
        {
            if (Current == null)
            {
                Server.EType eServerType = Server.EType.Threaded;
                Current = new Server(eServerType);

                m_RailServer = new CoopServerRail(Current, new GameEnvironmentServer());
                Current.Updateables.Add(m_RailServer);
                Current.OnClientConnected += OnClientConnected;

                if (eServerType == Server.EType.Direct)
                {
                    Main.Instance.Updateables.Add(Current);
                }

                Current.Start(new ServerConfiguration());
                Logger.Debug("Created server.");
            }

            if (m_NetManager == null)
            {
                m_NetManager = new LiteNetManagerServer(Current, new SaveData());
                m_NetManager.StartListening();
                Logger.Debug("Setup network connection for server.");
            }
        }
Exemple #3
0
        public CoopClient_Test()
        {
            ServerConfiguration config = TestUtils.GetTestingConfig();

            config.DisconnectTimeout = m_DisconnectTimeout;
            m_Server = new Mock <Server>(Server.EType.Threaded)
            {
                CallBase = true
            };
            m_Server.Object.Start(config);
            m_NetManagerServer = new LiteNetManagerServer(m_Server.Object, m_WorldData.Object);
            m_NetManagerServer.StartListening();
        }
        public ClientServerCommunication_Test()
        {
            ServerConfiguration config = TestUtils.GetTestingConfig();

            config.KeepAliveInterval = m_keepAliveInterval;
            m_Server = new Mock <Server>(Server.EType.Threaded)
            {
                CallBase = true
            };
            m_Server.Object.Start(config);
            m_NetManagerServer = new LiteNetManagerServer(m_Server.Object, m_WorldData.Object);
            m_NetManagerServer.StartListening();
        }
Exemple #5
0
 public NetManager_Test()
 {
     m_Server           = TestUtils.StartNewServer();
     m_NetManagerServer = new LiteNetManagerServer(m_Server, Mock.Of <ISaveData>());
     m_NetManagerServer.StartListening();
 }