public FriendsServerPostHandler(string url, IFriendsService service, string SessionID, IRegistryCore registry) :
     base("POST", url)
 {
     m_FriendsService = service;
     m_SessionID      = SessionID;
     m_registry       = registry;
 }
 public HGFriendsServerPostHandler(IFriendsService service, IUserAgentService uservice) :
     base("POST", "/hgfriends")
 {
     m_FriendsService   = service;
     m_UserAgentService = uservice;
     MainConsole.Instance.DebugFormat("[HGFRIENDS HANDLER]: HGFriendsServerPostHandler is On");
 }
Esempio n. 3
0
 public FriendsServerPostHandler(string url, IFriendsService service, ulong regionHandle, IRegistryCore registry) :
         base("POST", url)
 {
     m_FriendsService = service;
     m_regionHandle = regionHandle;
     m_registry = registry;
 }
 public FriendsServerPostHandler(string url, IFriendsService service, string SessionID, IRegistryCore registry) :
     base("POST", url)
 {
     m_FriendsService = service;
     m_SessionID = SessionID;
     m_registry = registry;
 }
Esempio n. 5
0
 public FriendsServerPostHandler(string url, IFriendsService service, ulong regionHandle, IRegistryCore registry) :
     base("POST", url)
 {
     m_FriendsService = service;
     m_regionHandle   = regionHandle;
     m_registry       = registry;
 }
Esempio n. 6
0
 public FriendsController(
     IFriendsService friendsService,
     UserManager <ApplicationUser> userManager)
 {
     this.friendsService = friendsService;
     this.userManager    = userManager;
 }
        public void Initialize(IConfigSource config, IRegistryCore registry)
        {
            IConfig handlerConfig = config.Configs["Handlers"];
            if (handlerConfig.GetString("FriendsHandler", "") != Name)
                return;

            string localHandler = handlerConfig.GetString("LocalFriendsHandler", "FriendsService");
            List<IFriendsService> services = AuroraModuleLoader.PickupModules<IFriendsService>();
#if (!ISWIN)
            foreach (IFriendsService s in services)
            {
                if (s.GetType().Name == localHandler) m_localService = s;
            }
#else
            foreach (IFriendsService s in services.Where(s => s.GetType().Name == localHandler))
                m_localService = s;
#endif

            if (m_localService == null)
                m_localService = new FriendsService();
            m_localService.Initialize(config, registry);
            m_remoteService = new FriendsServicesConnector();
            m_remoteService.Initialize(config, registry);
            registry.RegisterModuleInterface<IFriendsService>(this);
            m_registry = registry;
        }
 public UsersController(IUserService userService, IMapper mapper, IOptions <AppSettings> appSetings, IFriendsService friendsService)
 {
     _friendsService = friendsService;
     _userService    = userService;
     _mapper         = mapper;
     _appSettings    = appSetings.Value;
 }
        public void Initialise(IConfigSource config)
        {
            IConfig friendsConfig = config.Configs["Friends"];

            if (friendsConfig != null)
            {
                int mPort = friendsConfig.GetInt("Port", 0);

                string   connector = friendsConfig.GetString("Connector", String.Empty);
                Object[] args      = new Object[] { config };

                m_FriendsService      = ServerUtils.LoadPlugin <IFriendsService>(connector, args);
                m_FriendsSimConnector = new FriendsSimConnector();

                // Instantiate the request handler
                IHttpServer server = MainServer.GetHttpServer((uint)mPort);
                server.AddStreamHandler(new FriendsRequestHandler(this));
            }

            if (m_FriendsService == null)
            {
                m_log.Error("[FRIENDS]: No Connector defined in section Friends, or failed to load, cannot continue");
                throw new Exception("Connector load error");
            }
        }
Esempio n. 10
0
 public UpdateManager(IVkApiService vkApiService, IFriendsService friendsService,
                      DataContextService contextService)
 {
     _vkApiService   = vkApiService;
     _friendsService = friendsService;
     _contextService = contextService;
 }
 public FriendsController(
     IFriendsService friends,
     ICurrentUserService currentUser)
 {
     this.friends     = friends;
     this.currentUser = currentUser;
 }
        public HGFriendsServerConnector(IConfigSource config, IHttpServer server, string configName) :
                base(config, server, configName)
        {
            if (configName != string.Empty) 
                m_ConfigName = configName;

            IConfig serverConfig = config.Configs[m_ConfigName];
            if (serverConfig == null)
                throw new Exception(String.Format("No section {0} in config file", m_ConfigName));

            string theService = serverConfig.GetString("LocalServiceModule",
                    String.Empty);

            if (theService == String.Empty)
                throw new Exception("No LocalServiceModule in config file");

            Object[] args = new Object[] { config };
            m_FriendsService = ServerUtils.LoadPlugin<IFriendsService>(theService, args);

            theService = serverConfig.GetString("UserAgentService", string.Empty);
            if (theService == String.Empty)
                throw new Exception("No UserAgentService in " + m_ConfigName);

            m_UserAgentService = ServerUtils.LoadPlugin<IUserAgentService>(theService, args);

            server.AddStreamHandler(new HGFriendsServerPostHandler(m_FriendsService, m_UserAgentService));
        }
Esempio n. 13
0
 public FriendsController(
     IFriendsService friendsService,
     IProfilesService profilesService)
 {
     this.friendsService  = friendsService;
     this.profilesService = profilesService;
 }
 public HGFriendsServerPostHandler(IFriendsService service, IUserAgentService uservice) :
         base("POST", "/hgfriends")
 {
     m_FriendsService = service;
     m_UserAgentService = uservice;
     m_log.DebugFormat("[HGFRIENDS HANDLER]: HGFriendsServerPostHandler is On");
 }
Esempio n. 15
0
        public Congreg8PageViewModel(ITokenService tokenService, IFriendsService friendsService)
        {
            this.friendsService = friendsService;
            this.tokenService   = tokenService;

            var userId = tokenService.GetCurrentToken().UserId;
            var token  = tokenService.GetCurrentToken().TokenString;

            var friends = friendsService.GetUserFriends(userId, token);

            CarouselPosition = 0;
            FriendOptions    = new List <UserTaggableFriend>();

            var rand            = new Random();
            var selectedNumbers = new List <int>();

            for (int i = 0; i < 3; i++)
            {
                var number = rand.Next(0, friends.Count - 1);
                while (selectedNumbers.Contains(number))
                {
                    number = rand.Next(0, friends.Count - 1);
                }
                selectedNumbers.Add(number);
                FriendOptions.Add(friends[number]);
            }
        }
        public FriendsServiceConnector(IConfigSource config, IHttpServer server, string configName) :
            base(config, server, configName)
        {
            IConfig serverConfig = config.Configs[m_ConfigName];

            if (serverConfig == null)
            {
                throw new Exception(String.Format("No section {0} in config file", m_ConfigName));
            }

            string theService = serverConfig.GetString("LocalServiceModule",
                                                       String.Empty);

            if (theService == String.Empty)
            {
                throw new Exception("No LocalServiceModule in config file");
            }

            Object[] args = new Object[] { config };
            m_FriendsService = ServerUtils.LoadPlugin <IFriendsService>(theService, args);

            IServiceAuth auth = ServiceAuth.Create(config, m_ConfigName);

            server.AddStreamHandler(new FriendsServerPostHandler(m_FriendsService, auth));
        }
Esempio n. 17
0
 public void Configure(NetworkServicesConfig config)
 {
     if (clubPenguinClient != null)
     {
         clubPenguinClient.Destroy();
     }
     clubPenguinClient = new ClubPenguinClient(monoBehaviour, config.CPAPIServicehost, config.CPAPIClientToken, config.ClientApiVersion, config.CPGameServerZone, !offlineMode && config.CPGameServerEncrypted, config.CPGameServerDebug, config.CPLagMonitoring, config.CPGameServerLatencyWindowSize, config.CPWebServiceLatencyWindowSize, config.CPMonitoringServicehost, config.CPWebsiteAPIServicehost, offlineMode);
     currentConfig     = config;
     worldService      = new WorldService();
     worldService.Initialize(clubPenguinClient);
     playerStateService = new PlayerStateService();
     playerStateService.Initialize(clubPenguinClient);
     chatService = new ChatService();
     chatService.Initialize(clubPenguinClient);
     playerActionService = new PlayerActionService();
     playerActionService.Initialize(clubPenguinClient);
     iglooService = new IglooService();
     iglooService.Initialize(clubPenguinClient);
     inventoryService = new InventoryService();
     inventoryService.Initialize(clubPenguinClient);
     breadcrumbService = new BreadcrumbService();
     breadcrumbService.Initialize(clubPenguinClient);
     savedOutfitService = new SavedOutfitService();
     savedOutfitService.Initialize(clubPenguinClient);
     prototypeService = new PrototypeService();
     prototypeService.Initialize(clubPenguinClient);
     questService = new QuestService();
     questService.Initialize(clubPenguinClient);
     consumableService = new ConsumableService();
     consumableService.Initialize(clubPenguinClient);
     friendsService = new FriendsService();
     friendsService.Initialize(clubPenguinClient);
     rewardService = new RewardService();
     rewardService.Initialize(clubPenguinClient);
     taskService = new TaskNetworkService();
     taskService.Initialize(clubPenguinClient);
     minigameService = new MinigameService();
     minigameService.Initialize(clubPenguinClient);
     iapService = new IAPService();
     iapService.Initialize(clubPenguinClient);
     tutorialService = new TutorialService();
     tutorialService.Initialize(clubPenguinClient);
     moderationService = new ModerationService();
     moderationService.Initialize(clubPenguinClient);
     disneyStoreService = new DisneyStoreService();
     disneyStoreService.Initialize(clubPenguinClient);
     newsfeedService = new NewsfeedService();
     newsfeedService.Initialize(clubPenguinClient);
     catalogService = new CatalogService();
     catalogService.Initialize(clubPenguinClient);
     partyGameService = new PartyGameService();
     partyGameService.Initialize(clubPenguinClient);
     scheduledEventService = new ScheduledEventService();
     scheduledEventService.Initialize(clubPenguinClient);
     diagnosticsService = new DiagnosticsService();
     diagnosticsService.Initialize(clubPenguinClient);
     captchaService = new CaptchaService();
     captchaService.Initialize(clubPenguinClient);
 }
Esempio n. 18
0
        public FriendsManager(IKeyValueStore keyValueStore, IRealmStore realmStore, IFriendsService friendsService)
        {
            _keyValueStore  = keyValueStore;
            _realmStore     = realmStore;
            _friendsService = friendsService;

            Friends = new ObservableCollection <Friend>();
        }
        public ProfileViewModel(IAchievementsService achievementsService, IFriendsService friendsService)
        {
            _achievementsService = achievementsService;
            _friendsService      = friendsService;

            Achievements = new ObservableCollection <AchievementsModel>();
            Friends      = new ObservableCollection <FriendModel>();
        }
        public UserAgentService(IConfigSource config, IFriendsSimConnector friendsConnector)
        {
            // Let's set this always, because we don't know the sequence
            // of instantiations
            if (friendsConnector != null)
            {
                m_FriendsLocalSimConnector = friendsConnector;
            }

            if (!m_Initialized)
            {
                m_Initialized = true;

                m_log.DebugFormat("[HOME USERS SECURITY]: Starting...");

                m_FriendsSimConnector = new FriendsSimConnector();

                IConfig serverConfig = config.Configs["UserAgentService"];
                if (serverConfig == null)
                {
                    throw new Exception(String.Format("No section UserAgentService in config file"));
                }

                string gridService        = serverConfig.GetString("GridService", String.Empty);
                string gridUserService    = serverConfig.GetString("GridUserService", String.Empty);
                string gatekeeperService  = serverConfig.GetString("GatekeeperService", String.Empty);
                string friendsService     = serverConfig.GetString("FriendsService", String.Empty);
                string presenceService    = serverConfig.GetString("PresenceService", String.Empty);
                string userAccountService = serverConfig.GetString("UserAccountService", String.Empty);

                m_BypassClientVerification = serverConfig.GetBoolean("BypassClientVerification", false);

                if (gridService == string.Empty || gridUserService == string.Empty || gatekeeperService == string.Empty)
                {
                    throw new Exception(String.Format("Incomplete specifications, UserAgent Service cannot function."));
                }

                Object[] args = new Object[] { config };
                m_GridService         = ServerUtils.LoadPlugin <IGridService>(gridService, args);
                m_GridUserService     = ServerUtils.LoadPlugin <IGridUserService>(gridUserService, args);
                m_GatekeeperConnector = new GatekeeperServiceConnector();
                m_GatekeeperService   = ServerUtils.LoadPlugin <IGatekeeperService>(gatekeeperService, args);
                m_FriendsService      = ServerUtils.LoadPlugin <IFriendsService>(friendsService, args);
                m_PresenceService     = ServerUtils.LoadPlugin <IPresenceService>(presenceService, args);
                m_UserAccountService  = ServerUtils.LoadPlugin <IUserAccountService>(userAccountService, args);

                m_GridName = serverConfig.GetString("ExternalName", string.Empty);
                if (m_GridName == string.Empty)
                {
                    serverConfig = config.Configs["GatekeeperService"];
                    m_GridName   = serverConfig.GetString("ExternalName", string.Empty);
                }
                if (!m_GridName.EndsWith("/"))
                {
                    m_GridName = m_GridName + "/";
                }
            }
        }
        public HGFriendsService(IConfigSource config, String configName, IFriendsSimConnector localSimConn)
        {
            if (m_FriendsLocalSimConnector == null)
            {
                m_FriendsLocalSimConnector = localSimConn;
            }

            if (!m_Initialized)
            {
                m_Initialized = true;

                if (configName != String.Empty)
                {
                    m_ConfigName = configName;
                }

                Object[] args = new Object[] { config };

                IConfig serverConfig = config.Configs[m_ConfigName];
                if (serverConfig == null)
                {
                    throw new Exception(String.Format("No section {0} in config file", m_ConfigName));
                }

                string theService = serverConfig.GetString("FriendsService", string.Empty);
                if (theService == String.Empty)
                {
                    throw new Exception("No FriendsService in config file " + m_ConfigName);
                }
                m_FriendsService = ServerUtils.LoadPlugin <IFriendsService>(theService, args);

                theService = serverConfig.GetString("UserAccountService", string.Empty);
                if (theService == String.Empty)
                {
                    throw new Exception("No UserAccountService in " + m_ConfigName);
                }
                m_UserAccountService = ServerUtils.LoadPlugin <IUserAccountService>(theService, args);

                theService = serverConfig.GetString("GridService", string.Empty);
                if (theService == String.Empty)
                {
                    throw new Exception("No GridService in " + m_ConfigName);
                }
                m_GridService = ServerUtils.LoadPlugin <IGridService>(theService, args);

                theService = serverConfig.GetString("PresenceService", string.Empty);
                if (theService == String.Empty)
                {
                    throw new Exception("No PresenceService in " + m_ConfigName);
                }
                m_PresenceService = ServerUtils.LoadPlugin <IPresenceService>(theService, args);

                m_FriendsSimConnector = new FriendsSimConnector();

                m_log.DebugFormat("[HGFRIENDS SERVICE]: Starting...");
            }
        }
Esempio n. 22
0
        public ChatViewModel(FriendsService friendsService, MessageService messageService, IUnityContainer container, EventAggregator eventAggregator, IRegionManager regionManager, ServerServiceProxy serverServie)
        {
            if (friendsService == null)
            {
                throw new ArgumentNullException("chatService");
            }

            if (container == null)
            {
                throw new ArgumentNullException("container");
            }

            if (messageService == null)
            {
                throw new ArgumentNullException("messageService");
            }

            username = serverServie.UserInfo.Username;

            this.container      = container;
            this.regionManager  = regionManager;
            this.friendsService = friendsService;
            this.messageService = messageService;

            friends  = new ListCollectionView(friendsService.Friends);
            messages = new ObservableCollection <Message>();

            this.sendCommand = DelegateCommand <object> .FromAsyncHandler(OnSend, CanSend);

            this.callCommand         = new DelegateCommand <object>(this.OnCall, this.CanCall);
            this.windowLoadedCommand = DelegateCommand <object> .FromAsyncHandler(this.OnWindowLoaded);

            this.searchTextBoxChanged  = new DelegateCommand <object>(this.OnSearchTextBoxChanged);
            this.messageTextBoxChanged = new DelegateCommand <object>(this.OnMessageTextBoxChanged);
            this.addFriendCommand      = DelegateCommand <object> .FromAsyncHandler(this.OnAddFriend);

            this.acceptFriendshipCommand = DelegateCommand <object> .FromAsyncHandler(this.OnAcceptFriendship);

            this.declineFriendshipCommand = DelegateCommand <object> .FromAsyncHandler(this.OnDeclineFriendship);

            this.showVoiceChatRequest     = new InteractionRequest <VoiceChatViewModel>();
            this.navigateToProfileCommand = new DelegateCommand <object>(OnNavigateToProfile, CanNavigateToProfile);
            this.deleteFriendCommand      = DelegateCommand <object> .FromAsyncHandler(OnDeleteFriend, CanDeleteFriend);

            FriendsCollectionView.CurrentChanged += SelectedFriendChanged;

            this.userId = container.Resolve <ServerServiceProxy>().UserInfo.UserID;

            eventAggregator.GetEvent <MessageEvent>().Subscribe(OnMessageReceived, ThreadOption.UIThread, true);
            eventAggregator.GetEvent <CallEvent>().Subscribe(OnIncomingCall, ThreadOption.UIThread, true);
            eventAggregator.GetEvent <FriendStatusChangedEvent>().Subscribe(OnFriendStatusChanged, ThreadOption.UIThread, true);
            eventAggregator.GetEvent <FriendshipRequestAnswerdEvent>().Subscribe(OnFriendshipRequestAnswered, ThreadOption.UIThread, true);

            showFriendshipInfo    = false;
            showFriendshipRequest = false;
        }
 public MainViewModel(
     IFriendsService dataService,
     IDialogService dialogService,
     INavigationService navigationService)
 {
     _dataService       = dataService;
     _dialogService     = dialogService;
     _navigationService = navigationService;
     Friends            = new ObservableCollection <Friend>();
 }
Esempio n. 24
0
 public MainViewModel(IFriendsService friendsService,
                      IPlatformService platformService,
                      INavigationService navigationService)
 {
     m_friendsService              = friendsService;
     m_platformService             = platformService;
     m_navigationService           = navigationService;
     AddFriendCommand              = new Command(AddFriend);
     NavigateToFriendDetailCommand = new Command <Friend>(NavigateToFriendDetail);
 }
Esempio n. 25
0
 private void InitService()
 {
     if (invoker != null)
     {
         userService    = new UsersService(invoker);
         authService    = new AuthService(invoker);
         friendsService = new FriendsService(invoker);
         hao123Service  = new Hao123Service(invoker);
     }
 }
Esempio n. 26
0
 public FriendsController(
     IUserSearchService userSearchService,
     IFriendsService friendsService,
     IOptions <HostConfiguration> hostConfiguration,
     ILogger <FriendsController> logger)
 {
     _userSearchService = userSearchService;
     _friendsService    = friendsService;
     _logger            = logger;
     _hostConfiguration = hostConfiguration.Value;
 }
Esempio n. 27
0
 public UsersController(
     IFriendsService friendsService,
     IReviewsService reviewsService,
     IRecommendationService recommendationService,
     IBorrowInfosService borrowInfosService)
 {
     FriendsService        = friendsService;
     ReviewsService        = reviewsService;
     RecommendationService = recommendationService;
     BorrowInfosService    = borrowInfosService;
 }
Esempio n. 28
0
        protected object OnGenericEvent(string FunctionName, object parameters)
        {
            if (FunctionName == "UserStatusChange")
            {
                //A user has logged in or out... we need to update friends lists across the grid

                ISyncMessagePosterService asyncPoster    = m_registry.RequestModuleInterface <ISyncMessagePosterService>();
                IFriendsService           friendsService = m_registry.RequestModuleInterface <IFriendsService>();
                if (asyncPoster != null && friendsService != null)
                {
                    //Get all friends
                    object[] info     = (object[])parameters;
                    UUID     us       = UUID.Parse(info[0].ToString());
                    bool     isOnline = bool.Parse(info[1].ToString());

                    List <FriendInfo> friends       = friendsService.GetFriends(us);
                    List <UUID>       OnlineFriends = new List <UUID>();
                    foreach (FriendInfo friend in friends)
                    {
                        if (friend.TheirFlags == -1 || friend.MyFlags == -1)
                        {
                            continue; //Not validiated yet!
                        }
                        UUID FriendToInform = UUID.Zero;
                        if (!UUID.TryParse(friend.Friend, out FriendToInform))
                        {
                            continue;
                        }

                        UserInfo user = m_agentInfoService.GetUserInfo(friend.Friend);
                        //Now find their caps service so that we can find where they are root (and if they are logged in)
                        if (user != null && user.IsOnline)
                        {
                            //Find the root agent
                            OnlineFriends.Add(FriendToInform);
                            //Post!
                            asyncPoster.Post(user.CurrentRegionURI,
                                             SyncMessageHelper.AgentStatusChange(us, FriendToInform, isOnline));
                        }
                    }
                    //If the user is coming online, send all their friends online statuses to them
                    if (isOnline)
                    {
                        UserInfo user = m_agentInfoService.GetUserInfo(us.ToString());
                        if (user != null)
                        {
                            asyncPoster.Post(user.CurrentRegionURI,
                                             SyncMessageHelper.AgentStatusChanges(OnlineFriends, us, true));
                        }
                    }
                }
            }
            return(null);
        }
        public UserInfoStatService(
            IQuickStatService quickStatService,
            IFriendsService friendsService,
            IUserInfoService userInfoService)
        {
            this.quickStatService = quickStatService;
            this.friendsService   = friendsService;
            this.userInfoService  = userInfoService;

            UserInfoStatDB = dataProvider.Read();
        }
Esempio n. 30
0
 public IActionResult Get(int latitude, int longitude, [FromServices] IFriendsService friendsService)
 {
     try
     {
         return(new ObjectResult(friendsService.GetFriends(latitude, longitude)));
     }
     catch
     {
         return(BadRequest());
     }
 }
        public void PostStart(IConfigSource config, IRegistryCore registry)
        {
            IConfig handlerConfig = config.Configs["Handlers"];
            if (handlerConfig.GetString("FriendsInHandler", "") != Name)
                return;

            IHttpServer server = registry.RequestModuleInterface<ISimulationBase>().GetHttpServer((uint)handlerConfig.GetInt("FriendsInHandlerPort"));
            m_FriendsService = registry.RequestModuleInterface<IFriendsService>();

            server.AddStreamHandler(new FriendsServerPostHandler(m_FriendsService));
        }
Esempio n. 32
0
 public FriendsController(IFriendsService friendsService,
                          IUserService userService,
                          IFriendsInvitationService friendsInvitationService,
                          INotificationService notificationService,
                          IHubContext <NotificationHub> notificationHub)
 {
     _friendsService           = friendsService;
     _userService              = userService;
     _friendsInvitationService = friendsInvitationService;
     _notificationService      = notificationService;
     _notificationHub          = notificationHub;
 }
 public WallController(
     IFriendsService friends,
     IPostsService posts,
     ILikesService likes,
     ICurrentUserService currentUser
     )
 {
     this.friends     = friends;
     this.posts       = posts;
     this.likes       = likes;
     this.currentUser = currentUser;
 }
Esempio n. 34
0
 public TeamCandidatService(
     IFriendsService friendsService,
     ITopService topService,
     IQuickStatService quickStatService,
     IPeriodStatService periodStatService,
     IForumService forumService)
 {
     this.friendsService    = friendsService;
     this.topService        = topService;
     this.quickStatService  = quickStatService;
     this.periodStatService = periodStatService;
     this.forumService      = forumService;
 }
 public void FinishedStartup()
 {
     if (m_registry == null)
     {
         return;//Not enabled
     }
     m_GridService         = m_registry.RequestModuleInterface <IGridService> ();
     m_asyncPostService    = m_registry.RequestModuleInterface <IAsyncMessagePostService> ();
     m_GatekeeperConnector = new GatekeeperServiceConnector(m_registry.RequestModuleInterface <IAssetService> ());
     m_GatekeeperService   = m_registry.RequestModuleInterface <IGatekeeperService> ();
     m_FriendsService      = m_registry.RequestModuleInterface <IFriendsService> ();
     m_PresenceService     = m_registry.RequestModuleInterface <IAgentInfoService> ();
     m_UserAccountService  = m_registry.RequestModuleInterface <IUserAccountService> ();
 }
Esempio n. 36
0
        protected object OnGenericEvent(string FunctionName, object parameters)
        {
            if (FunctionName == "UserStatusChange")
            {
                //A user has logged in or out... we need to update friends lists across the grid

                IAsyncMessagePostService asyncPoster    = m_registry.RequestModuleInterface <IAsyncMessagePostService>();
                IFriendsService          friendsService = m_registry.RequestModuleInterface <IFriendsService>();
                ICapsService             capsService    = m_registry.RequestModuleInterface <ICapsService>();
                IGridService             gridService    = m_registry.RequestModuleInterface <IGridService>();
                if (asyncPoster != null && friendsService != null && capsService != null && gridService != null)
                {
                    //Get all friends
                    UserInfo     info          = (UserInfo)parameters;
                    FriendInfo[] friends       = friendsService.GetFriends(UUID.Parse(info.UserID));
                    List <UUID>  OnlineFriends = new List <UUID>();
                    UUID         us            = UUID.Parse(info.UserID);
                    foreach (FriendInfo friend in friends)
                    {
                        UUID FriendToInform = UUID.Parse(friend.Friend);
                        //Now find their caps service so that we can find where they are root (and if they are logged in)
                        IClientCapsService clientCaps = capsService.GetClientCapsService(FriendToInform);
                        if (clientCaps != null)
                        {
                            OnlineFriends.Add(FriendToInform);
                            //Find the root agent
                            IRegionClientCapsService regionClientCaps = clientCaps.GetRootCapsService();
                            if (regionClientCaps != null)
                            {
                                //Post!
                                asyncPoster.Post(regionClientCaps.RegionHandle, SyncMessageHelper.AgentStatusChange(us, FriendToInform, info.IsOnline));
                            }
                        }
                    }
                    //If they are online, send all friends online statuses to them
                    if (info.IsOnline)
                    {
                        GridRegion ourRegion = gridService.GetRegionByUUID(UUID.Zero, info.CurrentRegionID);
                        if (ourRegion != null)
                        {
                            foreach (UUID onlineFriend in OnlineFriends)
                            {
                                asyncPoster.Post(ourRegion.RegionHandle, SyncMessageHelper.AgentStatusChange(onlineFriend, us, info.IsOnline));
                            }
                        }
                    }
                }
            }
            return(null);
        }
        public FriendsServiceConnector(IConfigSource config, IHttpServer server, string configName) :
                base(config, server, configName)
        {
            IConfig serverConfig = config.Configs[m_ConfigName];
            if (serverConfig == null)
                throw new Exception(String.Format("No section {0} in config file", m_ConfigName));

            string gridService = serverConfig.GetString("LocalServiceModule",
                    String.Empty);

            if (gridService == String.Empty)
                throw new Exception("No LocalServiceModule in config file");

            Object[] args = new Object[] { config };
            m_FriendsService = ServerUtils.LoadPlugin<IFriendsService>(gridService, args);

            server.AddStreamHandler(new FriendsServerPostHandler(m_FriendsService));
        }
Esempio n. 38
0
        public void Start(IConfigSource config, IRegistryCore registry)
        {
            m_UserAccountService = registry.RequestModuleInterface<IUserAccountService>().InnerService;
            m_agentInfoService = registry.RequestModuleInterface<IAgentInfoService>().InnerService;
            m_AuthenticationService = registry.RequestModuleInterface<IAuthenticationService>();
            m_InventoryService = registry.RequestModuleInterface<IInventoryService>();
            m_GridService = registry.RequestModuleInterface<IGridService>();
            m_AvatarService = registry.RequestModuleInterface<IAvatarService>().InnerService;
            m_FriendsService = registry.RequestModuleInterface<IFriendsService>();
            m_SimulationService = registry.RequestModuleInterface<ISimulationService>();
            m_AssetService = registry.RequestModuleInterface<IAssetService> ().InnerService;
            m_LibraryService = registry.RequestModuleInterface<ILibraryService>();
            m_CapsService = registry.RequestModuleInterface<ICapsService>();

            if (!Initialized)
            {
                Initialized = true;
                RegisterCommands();
            }
            //Start the grid profile archiver.
            new GridAvatarProfileArchiver(m_UserAccountService);
            archiver = new GridAvatarArchiver(m_UserAccountService, m_AvatarService, m_InventoryService, m_AssetService);

            LoginModules = Aurora.Framework.AuroraModuleLoader.PickupModules<ILoginModule>();
            foreach (ILoginModule module in LoginModules)
            {
                module.Initialize(this, m_config, m_UserAccountService);
            }

            m_log.DebugFormat("[LLOGIN SERVICE]: Starting...");
        }
Esempio n. 39
0
        public HGFriendsService(IConfigSource config, String configName, IFriendsSimConnector localSimConn)
        {
            if (m_FriendsLocalSimConnector == null)
                m_FriendsLocalSimConnector = localSimConn;

            if (!m_Initialized)
            {
                m_Initialized = true;

                if (configName != String.Empty)
                    m_ConfigName = configName;

                Object[] args = new Object[] { config };

                IConfig serverConfig = config.Configs[m_ConfigName];
                if (serverConfig == null)
                    throw new Exception(String.Format("No section {0} in config file", m_ConfigName));

                string theService = serverConfig.GetString("FriendsService", string.Empty);
                if (theService == String.Empty)
                    throw new Exception("No FriendsService in config file " + m_ConfigName);
                m_FriendsService = ServerUtils.LoadPlugin<IFriendsService>(theService, args);

                theService = serverConfig.GetString("UserAccountService", string.Empty);
                if (theService == String.Empty)
                    throw new Exception("No UserAccountService in " + m_ConfigName);
                m_UserAccountService = ServerUtils.LoadPlugin<IUserAccountService>(theService, args);

                theService = serverConfig.GetString("GridService", string.Empty);
                if (theService == String.Empty)
                    throw new Exception("No GridService in " + m_ConfigName);
                m_GridService = ServerUtils.LoadPlugin<IGridService>(theService, args);

                theService = serverConfig.GetString("PresenceService", string.Empty);
                if (theService == String.Empty)
                    throw new Exception("No PresenceService in " + m_ConfigName);
                m_PresenceService = ServerUtils.LoadPlugin<IPresenceService>(theService, args);

                m_FriendsSimConnector = new FriendsSimConnector();

                m_log.DebugFormat("[HGFRIENDS SERVICE]: Starting...");

            }
        }
 public FriendsServerPostHandler(IFriendsService service, IServiceAuth auth) :
         base("POST", "/friends", auth)
 {
     m_FriendsService = service;
 }
Esempio n. 41
0
        public LLLoginService(IConfigSource config, ISimulationService simService, ILibraryService libraryService)
        {
            m_config = config;
            m_AuroraLoginConfig = config.Configs["AuroraLoginService"];
            if (m_AuroraLoginConfig != null)
            {
                m_UseTOS = m_AuroraLoginConfig.GetBoolean("UseTermsOfServiceOnFirstLogin", false);
                m_DefaultHomeRegion = m_AuroraLoginConfig.GetString("DefaultHomeRegion", "");
                m_DefaultUserAvatarArchive = m_AuroraLoginConfig.GetString("DefaultAvatarArchiveForNewUser", "");
                m_AllowAnonymousLogin = m_AuroraLoginConfig.GetBoolean("AllowAnonymousLogin", false);
                m_AuthenticateUsers = m_AuroraLoginConfig.GetBoolean("AuthenticateUsers", true);
                m_TOSLocation = m_AuroraLoginConfig.GetString("FileNameOfTOS", "");
                m_AllowFirstLife = m_AuroraLoginConfig.GetBoolean("AllowFirstLifeInProfile", true);
                m_TutorialURL = m_AuroraLoginConfig.GetString("TutorialURL", m_TutorialURL);
                ReadEventValues(m_AuroraLoginConfig);
                ReadClassifiedValues(m_AuroraLoginConfig);
                CAPSServerURL = m_AuroraLoginConfig.GetString("CAPSServiceURL", "");
                CAPSServicePassword = m_AuroraLoginConfig.GetString("CAPSServicePassword", "");
            }
            m_LoginServerConfig = config.Configs["LoginService"];
            if (m_LoginServerConfig == null)
                throw new Exception(String.Format("No section LoginService in config file"));

            string accountService = m_LoginServerConfig.GetString("UserAccountService", String.Empty);
            string gridUserService = m_LoginServerConfig.GetString("GridUserService", String.Empty);
            string agentService = m_LoginServerConfig.GetString("UserAgentService", String.Empty);
            string authService = m_LoginServerConfig.GetString("AuthenticationService", String.Empty);
            string invService = m_LoginServerConfig.GetString("InventoryService", String.Empty);
            string gridService = m_LoginServerConfig.GetString("GridService", String.Empty);
            string presenceService = m_LoginServerConfig.GetString("PresenceService", String.Empty);
            string libService = m_LoginServerConfig.GetString("LibraryService", String.Empty);
            string friendsService = m_LoginServerConfig.GetString("FriendsService", String.Empty);
            string avatarService = m_LoginServerConfig.GetString("AvatarService", String.Empty);
            string simulationService = m_LoginServerConfig.GetString("SimulationService", String.Empty);

            m_DefaultRegionName = m_LoginServerConfig.GetString("DefaultRegion", String.Empty);
            m_WelcomeMessage = m_LoginServerConfig.GetString("WelcomeMessage", "Welcome to OpenSim!");
            m_RequireInventory = m_LoginServerConfig.GetBoolean("RequireInventory", true);
            m_AllowRemoteSetLoginLevel = m_LoginServerConfig.GetBoolean("AllowRemoteSetLoginLevel", false);
            m_MinLoginLevel = m_LoginServerConfig.GetInt("MinLoginLevel", 0);
            m_GatekeeperURL = m_LoginServerConfig.GetString("GatekeeperURI", string.Empty);
            m_MapTileURL = m_LoginServerConfig.GetString("MapTileURL", string.Empty);
            m_SearchURL = m_LoginServerConfig.GetString("SearchURL", string.Empty);
            
            // These are required; the others aren't
            if (accountService == string.Empty || authService == string.Empty)
                throw new Exception("LoginService is missing service specifications");

            Object[] args = new Object[] { config };
            m_UserAccountService = ServerUtils.LoadPlugin<IUserAccountService>(accountService, args);
            m_GridUserService = ServerUtils.LoadPlugin<IGridUserService>(gridUserService, args);
            m_AuthenticationService = ServerUtils.LoadPlugin<IAuthenticationService>(authService, args);
            m_InventoryService = ServerUtils.LoadPlugin<IInventoryService>(invService, args);

            if (gridService != string.Empty)
                m_GridService = ServerUtils.LoadPlugin<IGridService>(gridService, args);
            if (presenceService != string.Empty)
                m_PresenceService = ServerUtils.LoadPlugin<IPresenceService>(presenceService, args);
            if (avatarService != string.Empty)
                m_AvatarService = ServerUtils.LoadPlugin<IAvatarService>(avatarService, args);
            if (friendsService != string.Empty)
                m_FriendsService = ServerUtils.LoadPlugin<IFriendsService>(friendsService, args);
            if (simulationService != string.Empty)
                m_RemoteSimulationService = ServerUtils.LoadPlugin<ISimulationService>(simulationService, args);
            if (agentService != string.Empty)
                m_UserAgentService = ServerUtils.LoadPlugin<IUserAgentService>(agentService, args);

            //
            // deal with the services given as argument
            //
            m_LocalSimulationService = simService;
            if (libraryService != null)
            {
                m_log.DebugFormat("[LLOGIN SERVICE]: Using LibraryService given as argument");
                m_LibraryService = libraryService;
            }
            else if (libService != string.Empty)
            {
                m_log.DebugFormat("[LLOGIN SERVICE]: Using instantiated LibraryService");
                m_LibraryService = ServerUtils.LoadPlugin<ILibraryService>(libService, args);
            }

            m_GatekeeperConnector = new GatekeeperServiceConnector();

            if (!Initialized)
            {
                Initialized = true;
                RegisterCommands();
            }
            //Start the grid profile archiver.
            new GridAvatarProfileArchiver(m_UserAccountService);
            archiver = new GridAvatarArchiver(m_UserAccountService, m_AvatarService, m_InventoryService);
            LoginModules = Aurora.Framework.AuroraModuleLoader.PickupModules<ILoginModule>();
            foreach (ILoginModule module in LoginModules)
            {
                module.Initialize(this, config, m_UserAccountService);
            }

            m_log.DebugFormat("[LLOGIN SERVICE]: Starting...");

        }
        public LLLoginService(IConfigSource config, ISimulationService simService, ILibraryService libraryService)
        {
            m_LoginServerConfig = config.Configs["LoginService"];
            if (m_LoginServerConfig == null)
                throw new Exception(String.Format("No section LoginService in config file"));

            string accountService = m_LoginServerConfig.GetString("UserAccountService", String.Empty);
            string gridUserService = m_LoginServerConfig.GetString("GridUserService", String.Empty);
            string agentService = m_LoginServerConfig.GetString("UserAgentService", String.Empty);
            string authService = m_LoginServerConfig.GetString("AuthenticationService", String.Empty);
            string invService = m_LoginServerConfig.GetString("InventoryService", String.Empty);
            string gridService = m_LoginServerConfig.GetString("GridService", String.Empty);
            string presenceService = m_LoginServerConfig.GetString("PresenceService", String.Empty);
            string libService = m_LoginServerConfig.GetString("LibraryService", String.Empty);
            string friendsService = m_LoginServerConfig.GetString("FriendsService", String.Empty);
            string avatarService = m_LoginServerConfig.GetString("AvatarService", String.Empty);
            string simulationService = m_LoginServerConfig.GetString("SimulationService", String.Empty);

            m_DefaultRegionName = m_LoginServerConfig.GetString("DefaultRegion", String.Empty);
            m_WelcomeMessage = m_LoginServerConfig.GetString("WelcomeMessage", "Welcome to OpenSim!");
            m_RequireInventory = m_LoginServerConfig.GetBoolean("RequireInventory", true);
            m_AllowRemoteSetLoginLevel = m_LoginServerConfig.GetBoolean("AllowRemoteSetLoginLevel", false);
            m_MinLoginLevel = m_LoginServerConfig.GetInt("MinLoginLevel", 0);
            m_GatekeeperURL = m_LoginServerConfig.GetString("GatekeeperURI", string.Empty);
            m_MapTileURL = m_LoginServerConfig.GetString("MapTileURL", string.Empty);
            m_SearchURL = m_LoginServerConfig.GetString("SearchURL", string.Empty);

            m_AllowedClients = m_LoginServerConfig.GetString("AllowedClients", string.Empty);
            m_DeniedClients = m_LoginServerConfig.GetString("DeniedClients", string.Empty);

            // These are required; the others aren't
            if (accountService == string.Empty || authService == string.Empty)
                throw new Exception("LoginService is missing service specifications");

            Object[] args = new Object[] { config };
            m_UserAccountService = ServerUtils.LoadPlugin<IUserAccountService>(accountService, args);
            m_GridUserService = ServerUtils.LoadPlugin<IGridUserService>(gridUserService, args);
            m_AuthenticationService = ServerUtils.LoadPlugin<IAuthenticationService>(authService, args);
            m_InventoryService = ServerUtils.LoadPlugin<IInventoryService>(invService, args);

            if (gridService != string.Empty)
                m_GridService = ServerUtils.LoadPlugin<IGridService>(gridService, args);
            if (presenceService != string.Empty)
                m_PresenceService = ServerUtils.LoadPlugin<IPresenceService>(presenceService, args);
            if (avatarService != string.Empty)
                m_AvatarService = ServerUtils.LoadPlugin<IAvatarService>(avatarService, args);
            if (friendsService != string.Empty)
                m_FriendsService = ServerUtils.LoadPlugin<IFriendsService>(friendsService, args);
            if (simulationService != string.Empty)
                m_RemoteSimulationService = ServerUtils.LoadPlugin<ISimulationService>(simulationService, args);
            if (agentService != string.Empty)
                m_UserAgentService = ServerUtils.LoadPlugin<IUserAgentService>(agentService, args);

            //
            // deal with the services given as argument
            //
            m_LocalSimulationService = simService;
            if (libraryService != null)
            {
                m_log.DebugFormat("[LLOGIN SERVICE]: Using LibraryService given as argument");
                m_LibraryService = libraryService;
            }
            else if (libService != string.Empty)
            {
                m_log.DebugFormat("[LLOGIN SERVICE]: Using instantiated LibraryService");
                m_LibraryService = ServerUtils.LoadPlugin<ILibraryService>(libService, args);
            }

            m_GatekeeperConnector = new GatekeeperServiceConnector();

            if (!Initialized)
            {
                Initialized = true;
                RegisterCommands();
            }

            m_log.DebugFormat("[LLOGIN SERVICE]: Starting...");

        }
Esempio n. 43
0
 public FriendsServerPostHandler(IFriendsService service) :
         base("POST", "/friends")
 {
     m_FriendsService = service;
 }
 public FriendsController(IFriendsService ifriendsService)
 {
     friendsService = ifriendsService;
 }
Esempio n. 45
0
        public UserAgentService(IConfigSource config, IFriendsSimConnector friendsConnector)
        {
            // Let's set this always, because we don't know the sequence
            // of instantiations
            if (friendsConnector != null)
                m_FriendsLocalSimConnector = friendsConnector;

            if (!m_Initialized)
            {
                m_Initialized = true;

                m_log.DebugFormat("[HOME USERS SECURITY]: Starting...");

                m_FriendsSimConnector = new FriendsSimConnector();

                IConfig serverConfig = config.Configs["UserAgentService"];
                if (serverConfig == null)
                    throw new Exception(String.Format("No section UserAgentService in config file"));

                string gridService = serverConfig.GetString("GridService", String.Empty);
                string gridUserService = serverConfig.GetString("GridUserService", String.Empty);
                string gatekeeperService = serverConfig.GetString("GatekeeperService", String.Empty);
                string friendsService = serverConfig.GetString("FriendsService", String.Empty);
                string presenceService = serverConfig.GetString("PresenceService", String.Empty);
                string userAccountService = serverConfig.GetString("UserAccountService", String.Empty);

                m_BypassClientVerification = serverConfig.GetBoolean("BypassClientVerification", false);

                if (gridService == string.Empty || gridUserService == string.Empty || gatekeeperService == string.Empty)
                    throw new Exception(String.Format("Incomplete specifications, UserAgent Service cannot function."));

                Object[] args = new Object[] { config };
                m_GridService = ServerUtils.LoadPlugin<IGridService>(gridService, args);
                m_GridUserService = ServerUtils.LoadPlugin<IGridUserService>(gridUserService, args);
                m_GatekeeperConnector = new GatekeeperServiceConnector();
                m_GatekeeperService = ServerUtils.LoadPlugin<IGatekeeperService>(gatekeeperService, args);
                m_FriendsService = ServerUtils.LoadPlugin<IFriendsService>(friendsService, args);
                m_PresenceService = ServerUtils.LoadPlugin<IPresenceService>(presenceService, args);
                m_UserAccountService = ServerUtils.LoadPlugin<IUserAccountService>(userAccountService, args);

                m_LevelOutsideContacts = serverConfig.GetInt("LevelOutsideContacts", 0);

                LoadTripPermissionsFromConfig(serverConfig, "ForeignTripsAllowed");
                LoadDomainExceptionsFromConfig(serverConfig, "AllowExcept", m_TripsAllowedExceptions);
                LoadDomainExceptionsFromConfig(serverConfig, "DisallowExcept", m_TripsDisallowedExceptions);

                m_GridName = serverConfig.GetString("ExternalName", string.Empty);
                if (m_GridName == string.Empty)
                {
                    serverConfig = config.Configs["GatekeeperService"];
                    m_GridName = serverConfig.GetString("ExternalName", string.Empty);
                }
                if (!m_GridName.EndsWith("/"))
                    m_GridName = m_GridName + "/";

            }
        }
Esempio n. 46
0
 private void InitService()
 {
     if (invoker != null)
     {
         userService = new UsersService(invoker);
         authService = new AuthService(invoker);
         friendsService = new FriendsService(invoker);
         hao123Service = new Hao123Service(invoker);
     }
 }
Esempio n. 47
0
 public void FinishedStartup()
 {
     if (m_registry == null)
         return;//Not enabled
     m_GridService = m_registry.RequestModuleInterface<IGridService> ();
     m_asyncPostService = m_registry.RequestModuleInterface<IAsyncMessagePostService> ();
     m_GatekeeperConnector = new GatekeeperServiceConnector (m_registry.RequestModuleInterface<IAssetService> ());
     m_GatekeeperService = m_registry.RequestModuleInterface<IGatekeeperService> ();
     m_FriendsService = m_registry.RequestModuleInterface<IFriendsService> ();
     m_PresenceService = m_registry.RequestModuleInterface<IAgentInfoService> ();
     m_UserAccountService = m_registry.RequestModuleInterface<IUserAccountService> ();
 }
Esempio n. 48
0
        public void Initialise(IConfigSource config)
        {
            IConfig friendsConfig = config.Configs["Friends"];
            if (friendsConfig != null)
            {
                int mPort = friendsConfig.GetInt("Port", 0);

                string connector = friendsConfig.GetString("Connector", String.Empty);
                Object[] args = new Object[] { config };

                m_FriendsService = ServerUtils.LoadPlugin<IFriendsService>(connector, args);
                m_FriendsSimConnector = new FriendsSimConnector();

                // Instantiate the request handler
                IHttpServer server = MainServer.GetHttpServer((uint)mPort);
                server.AddStreamHandler(new FriendsRequestHandler(this));

            }

            if (m_FriendsService == null)
            {
                m_log.Error("[FRIENDS]: No Connector defined in section Friends, or failed to load, cannot continue");
                throw new Exception("Connector load error");
            }

        }
Esempio n. 49
0
        public void Start(IConfigSource config, IRegistryCore registry)
        {
            m_UserAccountService = registry.RequestModuleInterface<IUserAccountService>().InnerService;
            m_agentInfoService = registry.RequestModuleInterface<IAgentInfoService>().InnerService;
            m_AuthenticationService = registry.RequestModuleInterface<IAuthenticationService>();
            m_InventoryService = registry.RequestModuleInterface<IInventoryService>();
            m_GridService = registry.RequestModuleInterface<IGridService>();
            m_AvatarService = registry.RequestModuleInterface<IAvatarService>().InnerService;
            m_FriendsService = registry.RequestModuleInterface<IFriendsService>();
            m_SimulationService = registry.RequestModuleInterface<ISimulationService>();
            m_AssetService = registry.RequestModuleInterface<IAssetService>().InnerService;
            m_LibraryService = registry.RequestModuleInterface<ILibraryService>();
            m_CapsService = registry.RequestModuleInterface<ICapsService>();
            m_ArchiveService = registry.RequestModuleInterface<IAvatarAppearanceArchiver>();

            if (!Initialized)
            {
                Initialized = true;
                RegisterCommands();
            }

            LoginModules = WhiteCoreModuleLoader.PickupModules<ILoginModule>();
            foreach (ILoginModule module in LoginModules)
            {
                module.Initialize(this, m_config, registry);
            }

            MainConsole.Instance.DebugFormat("[LLOGIN SERVICE]: Starting...");
        }
Esempio n. 50
0
 public void PostInitialize(IConfigSource config, IRegistryCore registry)
 {
     m_UserAccountService = registry.RequestModuleInterface<IUserAccountService>();
     m_GridUserService = registry.RequestModuleInterface<IGridUserService>();
     m_AuthenticationService = registry.RequestModuleInterface<IAuthenticationService>();
     m_InventoryService = registry.RequestModuleInterface<IInventoryService>();
     m_GridService = registry.RequestModuleInterface<IGridService>();
     m_PresenceService = registry.RequestModuleInterface<IPresenceService>();
     m_AvatarService = registry.RequestModuleInterface<IAvatarService>();
     m_FriendsService = registry.RequestModuleInterface<IFriendsService>();
     m_SimulationService = registry.RequestModuleInterface<ISimulationService>();
     m_AssetService = registry.RequestModuleInterface<IAssetService>();
     m_LibraryService = registry.RequestModuleInterface<ILibraryService>();
     m_CapsService = registry.RequestModuleInterface<ICapsService>();
 }
Esempio n. 51
0
//        IConfig m_ClientsConfig;

        public LLLoginService(IConfigSource config, ISimulationService simService, ILibraryService libraryService)
        {
            m_LoginServerConfig = config.Configs["LoginService"];
            if (m_LoginServerConfig == null)
                throw new Exception(String.Format("No section LoginService in config file"));

            string accountService = m_LoginServerConfig.GetString("UserAccountService", String.Empty);
            string gridUserService = m_LoginServerConfig.GetString("GridUserService", String.Empty);
            string agentService = m_LoginServerConfig.GetString("UserAgentService", String.Empty);
            string authService = m_LoginServerConfig.GetString("AuthenticationService", String.Empty);
            string invService = m_LoginServerConfig.GetString("InventoryService", String.Empty);
            string gridService = m_LoginServerConfig.GetString("GridService", String.Empty);
            string presenceService = m_LoginServerConfig.GetString("PresenceService", String.Empty);
            string libService = m_LoginServerConfig.GetString("LibraryService", String.Empty);
            string friendsService = m_LoginServerConfig.GetString("FriendsService", String.Empty);
            string avatarService = m_LoginServerConfig.GetString("AvatarService", String.Empty);
            string simulationService = m_LoginServerConfig.GetString("SimulationService", String.Empty);

            m_DefaultRegionName = m_LoginServerConfig.GetString("DefaultRegion", String.Empty);
            m_WelcomeMessage = m_LoginServerConfig.GetString("WelcomeMessage", "Welcome to OpenSim!");
            m_RequireInventory = m_LoginServerConfig.GetBoolean("RequireInventory", true);
            m_AllowRemoteSetLoginLevel = m_LoginServerConfig.GetBoolean("AllowRemoteSetLoginLevel", false);
            m_MinLoginLevel = m_LoginServerConfig.GetInt("MinLoginLevel", 0);
            m_GatekeeperURL = Util.GetConfigVarFromSections<string>(config, "GatekeeperURI",
                new string[] { "Startup", "Hypergrid", "LoginService" }, String.Empty);
            m_MapTileURL = m_LoginServerConfig.GetString("MapTileURL", string.Empty);
            m_ProfileURL = m_LoginServerConfig.GetString("ProfileServerURL", string.Empty);
            m_OpenIDURL = m_LoginServerConfig.GetString("OpenIDServerURL", String.Empty);
            m_SearchURL = m_LoginServerConfig.GetString("SearchURL", string.Empty);
            m_Currency = m_LoginServerConfig.GetString("Currency", string.Empty);
            m_ClassifiedFee = m_LoginServerConfig.GetString("ClassifiedFee", string.Empty);
            m_DestinationGuide = m_LoginServerConfig.GetString ("DestinationGuide", string.Empty);
            m_AvatarPicker = m_LoginServerConfig.GetString ("AvatarPicker", string.Empty);

            m_AllowedClients = m_LoginServerConfig.GetString("AllowedClients", string.Empty);
            m_DeniedClients = m_LoginServerConfig.GetString("DeniedClients", string.Empty);

            m_DSTZone = m_LoginServerConfig.GetString("DSTZone", "America/Los_Angeles;Pacific Standard Time");

            // Clean up some of these vars
            if (m_MapTileURL != String.Empty)
            {
                m_MapTileURL = m_MapTileURL.Trim();
                if (!m_MapTileURL.EndsWith("/"))
                    m_MapTileURL = m_MapTileURL + "/";
            }

            // These are required; the others aren't
            if (accountService == string.Empty || authService == string.Empty)
                throw new Exception("LoginService is missing service specifications");

            // replace newlines in welcome message
            m_WelcomeMessage = m_WelcomeMessage.Replace("\\n", "\n");

            Object[] args = new Object[] { config };
            m_UserAccountService = ServerUtils.LoadPlugin<IUserAccountService>(accountService, args);
            m_GridUserService = ServerUtils.LoadPlugin<IGridUserService>(gridUserService, args);
            m_AuthenticationService = ServerUtils.LoadPlugin<IAuthenticationService>(authService, args);
            m_InventoryService = ServerUtils.LoadPlugin<IInventoryService>(invService, args);

            if (gridService != string.Empty)
                m_GridService = ServerUtils.LoadPlugin<IGridService>(gridService, args);
            if (presenceService != string.Empty)
                m_PresenceService = ServerUtils.LoadPlugin<IPresenceService>(presenceService, args);
            if (avatarService != string.Empty)
                m_AvatarService = ServerUtils.LoadPlugin<IAvatarService>(avatarService, args);
            if (friendsService != string.Empty)
                m_FriendsService = ServerUtils.LoadPlugin<IFriendsService>(friendsService, args);
            if (simulationService != string.Empty)
                m_RemoteSimulationService = ServerUtils.LoadPlugin<ISimulationService>(simulationService, args);
            if (agentService != string.Empty)
                m_UserAgentService = ServerUtils.LoadPlugin<IUserAgentService>(agentService, args);

            // Get the Hypergrid inventory service (exists only if Hypergrid is enabled)
            string hgInvServicePlugin = m_LoginServerConfig.GetString("HGInventoryServicePlugin", String.Empty);
            if (hgInvServicePlugin != string.Empty)
            {
                string hgInvServiceArg = m_LoginServerConfig.GetString("HGInventoryServiceConstructorArg", String.Empty);
                Object[] args2 = new Object[] { config, hgInvServiceArg };
                m_HGInventoryService = ServerUtils.LoadPlugin<IInventoryService>(hgInvServicePlugin, args2);
            }

            //
            // deal with the services given as argument
            //
            m_LocalSimulationService = simService;
            if (libraryService != null)
            {
                m_log.DebugFormat("[LLOGIN SERVICE]: Using LibraryService given as argument");
                m_LibraryService = libraryService;
            }
            else if (libService != string.Empty)
            {
                m_log.DebugFormat("[LLOGIN SERVICE]: Using instantiated LibraryService");
                m_LibraryService = ServerUtils.LoadPlugin<ILibraryService>(libService, args);
            }

            m_GatekeeperConnector = new GatekeeperServiceConnector();

            if (!Initialized)
            {
                Initialized = true;
                RegisterCommands();
            }

            m_log.DebugFormat("[LLOGIN SERVICE]: Starting...");

        }
Esempio n. 52
0
 public void PostInitialize(IConfigSource config, IRegistryCore registry)
 {
     m_FriendsService = registry.RequestModuleInterface<IFriendsService>();
 }