コード例 #1
0
 public LiveEntityViewModel()
 {
     ValidLanguages = ConfigDataCache.GetAll <ILanguage>();
 }
コード例 #2
0
        //Also called Dashboard in most of the html
        public ActionResult Index()
        {
            IGlobalConfig globalConfig = ConfigDataCache.Get <IGlobalConfig>(new ConfigDataCacheKey(typeof(IGlobalConfig), "LiveSettings", ConfigDataType.GameWorld));
            IGossipConfig gossipConfig = ConfigDataCache.Get <IGossipConfig>(new ConfigDataCacheKey(typeof(IGossipConfig), "GossipSettings", ConfigDataType.GameWorld));

            DashboardViewModel dashboardModel = new DashboardViewModel
            {
                AuthedUser = UserManager.FindById(User.Identity.GetUserId()),

                Inanimates = TemplateCache.GetAll <IInanimateTemplate>(),
                NPCs       = TemplateCache.GetAll <INonPlayerCharacterTemplate>(),
                Zones      = TemplateCache.GetAll <IZoneTemplate>(),
                Worlds     = TemplateCache.GetAll <IGaiaTemplate>(),
                Locales    = TemplateCache.GetAll <ILocaleTemplate>(),
                Rooms      = TemplateCache.GetAll <IRoomTemplate>(),

                HelpFiles         = TemplateCache.GetAll <IHelp>(),
                Races             = TemplateCache.GetAll <IRace>(),
                Celestials        = TemplateCache.GetAll <ICelestial>(),
                Journals          = TemplateCache.GetAll <IJournalEntry>(),
                DimensionalModels = TemplateCache.GetAll <IDimensionalModelData>(),
                Flora             = TemplateCache.GetAll <IFlora>(),
                Fauna             = TemplateCache.GetAll <IFauna>(),
                Minerals          = TemplateCache.GetAll <IMineral>(),
                Materials         = TemplateCache.GetAll <IMaterial>(),
                DictionaryWords   = ConfigDataCache.GetAll <ILexeme>(),
                DictionaryPhrases = ConfigDataCache.GetAll <IDictataPhrase>(),
                Languages         = ConfigDataCache.GetAll <ILanguage>(),
                Genders           = TemplateCache.GetAll <IGender>(),
                UIModules         = ConfigDataCache.GetAll <IUIModule>(),

                LiveTaskTokens = Processor.GetAllLiveTaskStatusTokens(),
                LivePlayers    = LiveCache.GetAll <IPlayer>().Count(),
                LiveInanimates = LiveCache.GetAll <IInanimate>().Count(),
                LiveNPCs       = LiveCache.GetAll <INonPlayerCharacter>().Count(),
                LiveZones      = LiveCache.GetAll <IZone>().Count(),
                LiveWorlds     = LiveCache.GetAll <IGaia>().Count(),
                LiveLocales    = LiveCache.GetAll <ILocale>().Count(),
                LiveRooms      = LiveCache.GetAll <IRoom>().Count(),

                ConfigDataObject      = globalConfig,
                WebsocketPortalActive = globalConfig.WebsocketPortalActive,
                AdminsOnly            = globalConfig.AdminsOnly,
                UserCreationActive    = globalConfig.UserCreationActive,
                BaseLanguage          = globalConfig.BaseLanguage,
                AzureTranslationKey   = globalConfig.AzureTranslationKey,
                TranslationActive     = globalConfig.TranslationActive,

                QualityChange      = new string[0],
                QualityChangeValue = new int[0],

                ValidZones     = TemplateCache.GetAll <IZoneTemplate>(true),
                ValidLanguages = ConfigDataCache.GetAll <ILanguage>(),

                GossipConfigDataObject = gossipConfig,
                GossipActive           = gossipConfig.GossipActive,
                ClientId                 = gossipConfig.ClientId,
                ClientSecret             = gossipConfig.ClientSecret,
                ClientName               = gossipConfig.ClientName,
                SuspendMultiplier        = gossipConfig.SuspendMultiplier,
                SuspendMultiplierMaximum = gossipConfig.SuspendMultiplierMaximum,
                SupportedChannels        = gossipConfig.SupportedChannels,
                SupportedFeatures        = gossipConfig.SupportedFeatures
            };

            return(View(dashboardModel));
        }
コード例 #3
0
        public JsonResult <Dictionary <long, string> > GetRoomsOfLocale(int localeId)
        {
            IEnumerable <IRoomTemplate> rooms = ConfigDataCache.GetAll <IRoomTemplate>().Where(room => room.ParentLocation.Id == localeId);

            return(Json(rooms.ToDictionary(room => room.Id, room => room.Name)));
        }
コード例 #4
0
        public ActionResult Index(string SearchTerms = "", int CurrentPageNumber = 1, int ItemsPerPage = 20)
        {
            ManageDictionaryPhraseViewModel vModel = new ManageDictionaryPhraseViewModel(ConfigDataCache.GetAll <IDictataPhrase>())
            {
                AuthedUser = UserManager.FindById(User.Identity.GetUserId()),

                CurrentPageNumber = CurrentPageNumber,
                ItemsPerPage      = ItemsPerPage,
                SearchTerms       = SearchTerms
            };

            return(View("~/Views/GameAdmin/DictionaryPhrase/Index.cshtml", vModel));
        }
コード例 #5
0
        public JsonResult <string[]> GetDictata(string languageCode, LexicalType wordType, string term)
        {
            IEnumerable <ILexeme> words = ConfigDataCache.GetAll <ILexeme>().Where(dict => dict.GetForm(wordType) != null && dict.Name.Contains(term) && dict.Language.GoogleLanguageCode.Equals(languageCode));

            return(Json(words.Select(word => word.Name).ToArray()));
        }