public void ShutDownServer() { Current?.Stop(); m_NetManager?.Stop(); m_NetManager = null; Current = null; }
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."); } }
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(); }
public NetManager_Test() { m_Server = TestUtils.StartNewServer(); m_NetManagerServer = new LiteNetManagerServer(m_Server, Mock.Of <ISaveData>()); m_NetManagerServer.StartListening(); }