コード例 #1
0
        /// <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);
        }
コード例 #2
0
        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());
        }
コード例 #3
0
 public ServerTestServices(ISessionServer server)
 {
     m_server = server;
 }