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); }
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); }
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); }
public void NotifyInConnectClient(ServerPacketData requestData) { InnerMessageHostProgram.CurrentUserCount(ServerNetwork.SessionCount); }