Пример #1
0
 public static void StartServer()
 {
     if (Instance?.IsRunning >= 0)
     {
         return;
     }
     m_instance = new CenterServer(new CenterServerConfig());
     if (Instance.Start() == false)
     {
         Instance.Stop();
         Instance.IsRunning = -1;
     }
     return;
 }
Пример #2
0
        public static void CreateInstance(CenterServerConfig config)
        {
            if (CenterServer.Instance != null)
            {
                return;
            }
            FileInfo fileInfo = new FileInfo(config.LogConfigFile);

            if (!fileInfo.Exists)
            {
                ResourceUtil.ExtractResource(fileInfo.Name, fileInfo.FullName, Assembly.GetAssembly(typeof(CenterServer)));
            }
            XmlConfigurator.ConfigureAndWatch(fileInfo);
            CenterServer._instance = new CenterServer(config);
        }
Пример #3
0
        public static void CreateInstance(CenterServerConfig config)
        {
            //Only one intance
            if (Instance != null)
            {
                return;
            }

            FileInfo logConfig = new FileInfo(config.LogConfigFile);

            if (!logConfig.Exists)
            {
                ResourceUtil.ExtractResource(logConfig.Name, logConfig.FullName, Assembly.GetAssembly(typeof(CenterServer)));
            }
            //Configure and watch the config file
            XmlConfigurator.ConfigureAndWatch(logConfig);
            //Create the instance
            _instance = new CenterServer(config);
        }
Пример #4
0
        public static void CreateInstance(CenterServerConfig config)
        {
            //Only one intance
            if (Instance != null)
                return;

            FileInfo logConfig = new FileInfo(config.LogConfigFile);
            if (!logConfig.Exists)
            {
                ResourceUtil.ExtractResource(logConfig.Name, logConfig.FullName, Assembly.GetAssembly(typeof(CenterServer)));
            }
            //Configure and watch the config file
            XmlConfigurator.ConfigureAndWatch(logConfig);
            //Create the instance
            _instance = new CenterServer(config);
        }
Пример #5
0
 public ServerClient(CenterServer svr)
     : base(new byte[8192], new byte[8192])
 {
     this._svr = svr;
 }
Пример #6
0
 /// <summary>
 /// 构造函数
 /// </summary>
 public ServerClient(CenterServer svr)
     : base(new byte[2048], new byte[2048])
 {
     _svr = svr;
 }
Пример #7
0
 /// <summary>
 /// 构造函数
 /// </summary>
 public ServerClient(CenterServer svr)
     : base(new byte[2048], new byte[2048])
 {
     _svr = svr;
 }