/// <summary> /// 获取SessionServer的实例 /// </summary> /// <returns></returns> public static ISessionServer GetSessionServer() { ISessionServer sessionServer = CallContext.LogicalGetData("SessionServer") as ISessionServer; if (sessionServer == null) { sessionServer = new SessionServer(); CallContext.LogicalSetData("SessionServer", sessionServer); } return(sessionServer); }
public void Initialize() { if (sessionType == eSessionType.Local || sessionType == eSessionType.Server) { sessionServer = getSessionServer(sessionType); sessionServer.Start(); sessionServer.WaitServerStartEvent.WaitOne(); // Wait until the server starts... } else { sessionServer = null; } log.Info("Initializing a local multiplayer session."); Task.Run(() => Listen()); }
public ServerTestServices(ISessionServer server) { m_server = server; }