示例#1
0
        public ERROR_CODE CreateComponent()
        {
            var appServer = ActiveServerBootstrap.AppServers.FirstOrDefault() as MainServer;
            var error     = appServer.Distributor.Create(appServer);

            if (error != ERROR_CODE.NONE)
            {
                return(error);
            }

            InnerMessageHostProgram.CreateComponent();

            return(ERROR_CODE.NONE);
        }
示例#2
0
        public void NotifyInDisConnectClient(ServerPacketData requestData)
        {
            var sessionIndex = requestData.SessionIndex;
            var roomNum      = SessionManager.GetRoomNumber(sessionIndex);
            var user         = UserMgr.GetUser(sessionIndex);

            if (roomNum != PacketDef.INVALID_ROOM_NUMBER && user != null)
            {
                SendInternalRoomLeavePacket(roomNum, user.ID());
            }

            if (user != null)
            {
                UserMgr.RemoveUser(sessionIndex);
            }

            SessionManager.SetClear(sessionIndex);
            InnerMessageHostProgram.CurrentUserCount(ServerNetwork.SessionCount);
        }
示例#3
0
        public void CreateStartServer()
        {
            ActiveServerBootstrap = BootstrapFactory.CreateBootstrap();

            if (!ActiveServerBootstrap.Initialize())
            {
                Console.WriteLine(string.Format("서버 초기화 실패"), LOG_LEVEL.ERROR);
                return;
            }
            else
            {
                var refAppServer = ActiveServerBootstrap.AppServers.FirstOrDefault() as MainServer;
                MainLogger = refAppServer.Logger;
                WriteLog("서버 초기화 성공", LOG_LEVEL.INFO);
            }


            var result = ActiveServerBootstrap.Start();

            if (result != StartResult.Success)
            {
                MainServer.WriteLog(string.Format("서버 시작 실패"), LOG_LEVEL.ERROR);
                return;
            }
            else
            {
                WriteLog("서버 시작 성공", LOG_LEVEL.INFO);
            }

            WriteLog(string.Format("서버 생성 및 시작 성공"), LOG_LEVEL.INFO);


            ChatServerEnvironment.Setting();

            StartRemoteConnect();

            var appServer = ActiveServerBootstrap.AppServers.FirstOrDefault() as MainServer;

            InnerMessageHostProgram.ServerStart(ChatServerEnvironment.ChatServerUniqueID, appServer.Config.Port);

            ClientSession.CreateIndexPool(appServer.Config.MaxConnectionNumber);
        }
示例#4
0
 public void NotifyInConnectClient(ServerPacketData requestData)
 {
     InnerMessageHostProgram.CurrentUserCount(ServerNetwork.SessionCount);
 }