/// <summary> /// Start up the user manager /// </summary> /// <param name="inventoryService"></param> protected virtual void StartupUserServerModules() { m_log.Info("[STARTUP]: Establishing data connection"); //we only need core components so we can request them from here IInterServiceInventoryServices inventoryService; TryGet <IInterServiceInventoryServices>(out inventoryService); CommunicationsManager commsManager = new UserServerCommsManager(inventoryService); //setup database access service, for now this has to be created before the other modules. m_userDataBaseService = new UserDataBaseService(commsManager); m_userDataBaseService.Initialise(this); //TODO: change these modules so they fetch the databaseService class in the PostInitialise method m_userManager = new UserManager(m_userDataBaseService); m_userManager.Initialise(this); m_avatarAppearanceModule = new UserServerAvatarAppearanceModule(m_userDataBaseService); m_avatarAppearanceModule.Initialise(this); m_friendsModule = new UserServerFriendsModule(m_userDataBaseService); m_friendsModule.Initialise(this); m_consoleCommandModule = new UserServerCommandModule(); m_consoleCommandModule.Initialise(this); m_messagesService = new MessageServersConnector(); m_messagesService.Initialise(this); m_gridInfoService = new GridInfoServiceModule(); m_gridInfoService.Initialise(this); }
public void PostInitialize() { UserConfig cfg; if (m_core.TryGet <UserConfig>(out cfg)) { m_cfg = cfg; } UserDataBaseService userDBservice; if (m_core.TryGet <UserDataBaseService>(out userDBservice)) { m_userDataBaseService = userDBservice; } UserLoginService loginService; if (m_core.TryGet <UserLoginService>(out loginService)) { m_loginService = loginService; } CommandConsole console; if ((m_core.TryGet <CommandConsole>(out console)) && (m_cfg != null) && (m_userDataBaseService != null) && (m_loginService != null)) { RegisterConsoleCommands(console); } }
protected override void StartupSpecific() { Cfg = new MessageServerConfig("MESSAGING SERVER", (Path.Combine(Util.configDir(), "MessagingServer_Config.xml"))); m_userDataBaseService = new UserDataBaseService(); m_userDataBaseService.AddPlugin(Cfg.DatabaseProvider, Cfg.DatabaseConnect); //Register the database access service so modules can fetch it // RegisterInterface<UserDataBaseService>(m_userDataBaseService); m_userServerModule = new InterMessageUserServerModule(Cfg, this); m_userServerModule.Initialise(); msgsvc = new MessageService(Cfg, this, m_userDataBaseService); msgsvc.Initialise(); m_regionModule = new MessageRegionModule(Cfg, this); m_regionModule.Initialise(); registerWithUserServer(); m_userServerModule.PostInitialise(); msgsvc.PostInitialise(); m_regionModule.PostInitialise(); m_log.Info("[SERVER]: Messageserver 0.5 - Startup complete"); base.StartupSpecific(); m_console.Commands.AddCommand("messageserver", false, "clear cache", "clear cache", "Clear presence cache", HandleClearCache); m_console.Commands.AddCommand("messageserver", false, "register", "register", "Re-register with user server(s)", HandleRegister); }