Beispiel #1
0
 public static void StartServer()
 {
     if (FightServer.Instance?.IsRunning >= 0)
     {
         return;
     }
     FightServer.m_instance = new FightServer(new FightServerConfig());
     if (Instance.Start() == false)
     {
         Instance.IsRunning = -1;
     }
 }
Beispiel #2
0
        public static void CreateInstance(FightServerConfig config)
        {
            if (FightServer.m_instance != null)
            {
                return;
            }
            FileInfo fileInfo = new FileInfo(config.LogConfigFile);

            if (!fileInfo.Exists)
            {
                ResourceUtil.ExtractResource(fileInfo.Name, fileInfo.FullName, Assembly.GetAssembly(typeof(FightServer)));
            }
            XmlConfigurator.ConfigureAndWatch(fileInfo);
            FightServer.m_instance = new FightServer(config);
        }
Beispiel #3
0
        public static void CreateInstance(FightServerConfig config)
        {
            //Only one intance
            if (m_instance != null)
                return;

            FileInfo logConfig = new FileInfo(config.LogConfigFile);
            if (!logConfig.Exists)
            {
                ResourceUtil.ExtractResource(logConfig.Name, logConfig.FullName, Assembly.GetAssembly(typeof(FightServer)));
            }
            //Configure and watch the config file
            XmlConfigurator.ConfigureAndWatch(logConfig);
            //Create the instance
            m_instance = new FightServer(config);
        }
Beispiel #4
0
        public static void CreateInstance(FightServerConfig config)
        {
            //Only one intance
            if (m_instance != null)
            {
                return;
            }

            FileInfo logConfig = new FileInfo(config.LogConfigFile);

            if (!logConfig.Exists)
            {
                ResourceUtil.ExtractResource(logConfig.Name, logConfig.FullName, Assembly.GetAssembly(typeof(FightServer)));
            }
            //Configure and watch the config file
            XmlConfigurator.ConfigureAndWatch(logConfig);
            //Create the instance
            m_instance = new FightServer(config);
        }
Beispiel #5
0
 /// <summary>
 /// 构造函数
 /// </summary>
 public ServerClient(FightServer svr)
     : base(new byte[2048], new byte[2048])
 {
     m_svr = svr;
 }
Beispiel #6
0
 /// <summary>
 /// 构造函数
 /// </summary>
 public ServerClient(FightServer svr)
     : base(new byte[2048], new byte[2048])
 {
     m_svr = svr;
 }
Beispiel #7
0
 public ServerClient(FightServer svr) : base(new byte[8192], new byte[8192])
 {
     this.m_svr = svr;
 }
Beispiel #8
0
 public ServerClient(FightServer svr) : base(new byte[20480], new byte[20480])
 {
     this.m_svr  = svr;
     base.Strict = false;
 }