示例#1
0
        public void AddTaskRequest(string taskId, string requestId, string jobId, string profileId)
        {
            Job job = Repository.QueryEntities <Job>()
                      .Single(t => t.JobId == jobId);
            JobParam profileParam = Repository.QueryEntities <JobParam>()
                                    .Single(t => t.ParamId == profileId);

            dynamic profile   = profileParam.Value.FromJson <dynamic>();
            string  userId    = profile.User.UserId;
            string  userToken = profile.User.Token;
            string  dxpId     = profile.User.DxpId;
            string  msgType   = profile.System.MsgType;
            string  declType  = profile.System.DeclType;
            string  copMsgId  = Guid.NewGuid().ToString();
            string  timestamp = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            string  msg       = job.Content.FromJson <dynamic>().data;
            string  sign      = ($"copMsgId={copMsgId}&decltype={declType}" +
                                 $"&dxpId={dxpId}&msg={msg}&msgtype={msgType}&timestamp={timestamp}" +
                                 $"&userid={userId}&key={userToken}").ToMd5();

            var taskRequest = new Dictionary <string, string> {
                { "userid", userId },
                { "timestamp", timestamp },
                { "sign", sign },
                { "decltype", declType },
                { "msg", msg },
                { "msgtype", msgType },
                { "dxpId", dxpId },
                { "copMsgId", copMsgId },
            };
            string requestJson = taskRequest.ToJson();

            Repository.AddTaskRequest(taskId, requestId, requestJson, null);
            AddTaskState(taskId, nameof(TaskStates.Processing));
        }
示例#2
0
        public void AddTaskRequest(string taskId, string requestId, string jobId, string profileId)
        {
            Job job = Repository.QueryEntities <Job>()
                      .Single(t => t.JobId == jobId);
            JobParam profileParam = Repository.QueryEntities <JobParam>()
                                    .Single(t => t.ParamId == profileId);

            dynamic profile     = profileParam.Value.FromJson <dynamic>();
            string  signKey     = profile.User.SignKey;
            string  requestData = job.Content.FromJson <dynamic>().data;
            string  requestXml  = requestData.FromBase64();

            var requestItems = requestXml
                               .FromXml <SortedDictionary <string, string> >();
            var signKeys  = requestItems.Single(t => t.Key == "@signKeys").Value.Split(';');
            var signItems = requestItems
                            .Where(t => !string.IsNullOrEmpty(t.Value))
                            .Where(t => signKeys.Contains(t.Key));

            string requestText = string.Join("&", signItems.Select(t => $"{t.Key}={t.Value}"));
            string requestSign = $"{requestText}{signKey}".ToMd5().ToLower();
            string requestPath = $"{requestText}&sign={requestSign}&sign_type=MD5";

            Repository.AddTaskRequest(taskId, requestId, requestPath, null);
            AddTaskState(taskId, nameof(TaskStates.Processing));
        }
示例#3
0
    private static CharacterDB.Job GetCharacterData(UnitParam unit, JobParam job, ArtifactParam skin)
    {
        // ISSUE: object of a compiler-generated type is created
        // ISSUE: variable of a compiler-generated type
        DownloadUtility.\u003CGetCharacterData\u003Ec__AnonStorey1F1 dataCAnonStorey1F1 = new DownloadUtility.\u003CGetCharacterData\u003Ec__AnonStorey1F1();
        CharacterDB.Character character = CharacterDB.FindCharacter(unit.model);
        if (character == null)
        {
            DebugUtility.LogWarning("Unknown character '" + unit.model + "'");
            return((CharacterDB.Job)null);
        }
        // ISSUE: reference to a compiler-generated field
        dataCAnonStorey1F1.jobResourceID = skin == null ? string.Empty : skin.asset;
        // ISSUE: reference to a compiler-generated field
        if (string.IsNullOrEmpty(dataCAnonStorey1F1.jobResourceID))
        {
            // ISSUE: reference to a compiler-generated field
            dataCAnonStorey1F1.jobResourceID = job == null ? "none" : job.model;
        }
        // ISSUE: reference to a compiler-generated method
        int index = character.Jobs.FindIndex(new Predicate <CharacterDB.Job>(dataCAnonStorey1F1.\u003C\u003Em__1B7));

        if (index < 0)
        {
            // ISSUE: reference to a compiler-generated field
            DebugUtility.LogWarning("Invalid Character " + unit.model + "@" + dataCAnonStorey1F1.jobResourceID);
            index = 0;
        }
        return(character.Jobs[index]);
    }
        public void QueueFileUpdateCommandHandler(object s, CommandItemEventArgs e)
        {
            // Queue a job
            //
            const string PublishJobTypeName      = "Horst.File.FileUpdate";
            const string PublishJob_FileMasterId = "FileMasterId";
            const string PublishJob_FileName     = "FileName";

            foreach (ISelection vaultObj in e.Context.CurrentSelectionSet)
            {
                JobParam[] paramList     = new JobParam[2];
                JobParam   masterIdParam = new JobParam();
                masterIdParam.Name = PublishJob_FileMasterId;
                masterIdParam.Val  = vaultObj.Id.ToString();
                paramList[0]       = masterIdParam;

                JobParam fileNameParam = new JobParam();
                fileNameParam.Name = PublishJob_FileName;
                fileNameParam.Val  = vaultObj.Label;
                paramList[1]       = fileNameParam;

                // Add the job to the queue
                //
                e.Context.Application.Connection.WebServiceManager.JobService.AddJob(
                    PublishJobTypeName, String.Format("File Update - {0}", fileNameParam.Val),
                    paramList, 10);
            }
        }
        public void QueuePrintPDFCommandHandler(object s, CommandItemEventArgs e)
        {
            // Queue a job
            //
            const string PrintJobTypeName  = "Horst.File.PrintPDF";
            const string PrintJob_EntityId = "EntityId";  // this was changed from FileMasterID to EntityID

            foreach (ISelection vaultObj in e.Context.CurrentSelectionSet)
            {
                JobParam[] paramList = new JobParam[3];

                JobParam entityIdParam = new JobParam();
                entityIdParam.Name = PrintJob_EntityId;
                entityIdParam.Val  = vaultObj.Id.ToString();
                paramList[0]       = entityIdParam;

                JobParam fileNameParam = new JobParam();
                fileNameParam.Name = "EntityClassId";
                fileNameParam.Val  = "USER-REQUESTED " + vaultObj.Label;
                paramList[1]       = fileNameParam;

                JobParam lifeCycleTransitionParam = new JobParam();
                lifeCycleTransitionParam.Name = "LifeCycleTransitionId";
                lifeCycleTransitionParam.Val  = "88";
                paramList[2] = lifeCycleTransitionParam;

                // Add the job to the queue
                //
                e.Context.Application.Connection.WebServiceManager.JobService.AddJob(
                    PrintJobTypeName, String.Format("Print PDF - {0}", fileNameParam.Val),
                    paramList, 100);
            }
        }
示例#6
0
    // Translates a file
    public int translate_File(String filename, String fileType, String encoding, String srcLang, String tgtLang, String user, Boolean unknown)
    {
        // Read the content of the file in a buffer
        FileStream file = new FileStream(filename, FileMode.Open);

        byte[] buffer = new byte[file.Length];
        file.Read(buffer, 0, buffer.Length);


        JobParam param = new JobParam();

        // Setting the title is optional
        param.title = filename;
        param.user  = user;


        TranslationContext context = new TranslationContext();

        // Setting language pair is mandatory
        context.sourceLangId = srcLang;
        context.targetLangId = tgtLang;
        context.inputFormat  = fileType;
        // If the encoding is not specified, the server will attempt
        // to detect it for text files
        context.encoding = encoding;

        // Create a translation job using the content of the buffer
        int jobID = _server.createJob(param, context, buffer);

        file.Close();
        return(jobID);
    }
示例#7
0
    // Translates URL
    public int translate_url(String url, String srcLang, String tgtLang, String user, Boolean unknown)
    {
        JobParam param = new JobParam();

        // Setting the title is optional
        param.title = url;
        param.url   = url;
        param.user  = user;

        TranslationContext context = new TranslationContext();

        // Setting language pair is mandatory
        context.sourceLangId = srcLang;
        context.targetLangId = tgtLang;
        context.inputFormat  = "text/html";
        context.showUnknown  = unknown;

        // createJob requires a text argument, even when translating a URL
        byte[] buffer = new byte[0];

        // Create a translation job using the content of the buffer
        int jobID = _server.createJob(param, context, buffer);

        return(jobID);
    }
示例#8
0
        public void AddTaskRequest(string taskId, string requestId, string jobId, string profileId)
        {
            Job job = Repository.QueryEntities <Job>()
                      .Single(t => t.JobId == jobId);
            JobParam profileParam = Repository.QueryEntities <JobParam>()
                                    .Single(t => t.ParamId == profileId);

            dynamic profile   = profileParam.Value.FromJson <dynamic>();
            string  userId    = profile.User.UserId;
            string  userToken = profile.User.Token;
            string  msgType   = profile.System.MsgType;
            string  declType  = profile.System.DeclType;
            string  guid      = Guid.NewGuid().ToString();
            string  timestamp = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            string  xmlStr    = job.Content.FromJson <dynamic>().data;
            string  sign      = $"{userId}{userToken}{timestamp}".ToMd5();

            var taskRequest = new Dictionary <string, string> {
                { "userid", userId },
                { "timestamp", timestamp },
                { "sign", sign },
                { "msgtype", msgType },
                { "xmlstr", xmlStr },
                { "guid", guid },
                { "decltype", declType },
            };
            string taskContent = taskRequest.ToJson();

            Repository.AddTaskRequest(taskId, requestId, taskContent, null);
            AddTaskState(taskId, nameof(TaskStates.Processing));
        }
示例#9
0
        private void ModifyJobInit(JobParam param)
        {
            EMSLoadFlowReportJobParam reportParam = (EMSLoadFlowReportJobParam)param;

            SelectedRecords      = reportParam.SelectedRecords;
            reportType           = reportParam.ReportType;
            hierarchyNetworkType = reportParam.HierarchyNetworkType;
        }
示例#10
0
 public ThreadWork(JobParam jParam)
 {
     if (CacheTool.MatchList.Count <= 5)
     {
         Log.Info($"即將重播 {jParam.MatchID} 場的賽事走地與賠率資料");
         new Match(jParam.MatchID, jParam.Time).BetRadarStart();
         CacheTool.MatchAdd(jParam.MatchID);
     }
 }
示例#11
0
        public void AddJobParam(string jobId, string paramId, string name, string value, string createdBy, long?createdAt)
        {
            var param = new JobParam {
                CreatedAt = createdAt ?? Generator.Timestamp,
                CreatedBy = createdBy,
                JobId     = jobId,
                Name      = name,
                ParamId   = paramId ?? Generator.RandomLongId,
                Value     = value,
            };

            DbContext?.InsertEntities(param);
        }
示例#12
0
    public static void DownloadJobEquipment(JobParam job)
    {
        if (job == null)
        {
            return;
        }
        string resourcePath = AssetPath.JobEquipment(job);

        if (string.IsNullOrEmpty(resourcePath))
        {
            return;
        }
        AssetManager.PrepareAssets(resourcePath);
    }
示例#13
0
 public static void PrepareJobAssets(JobParam job)
 {
     if (job == null)
     {
         return;
     }
     AssetManager.PrepareAssets(AssetPath.JobIconMedium(job));
     AssetManager.PrepareAssets(AssetPath.JobIconSmall(job));
     if (string.IsNullOrEmpty(job.wepmdl))
     {
         return;
     }
     AssetManager.PrepareAssets(AssetPath.JobEquipment(job));
 }
示例#14
0
        public void AddTaskRequest(string taskId, string requestId, string jobId, string profileId)
        {
            Job job = Repository.QueryEntities <Job>()
                      .Single(t => t.JobId == jobId);
            JobParam profileParam = Repository.QueryEntities <JobParam>()
                                    .Single(t => t.ParamId == profileId);

            var taskRequest = new Dictionary <string, object> {
                { "Content", job.Content.FromJson <object>() },
                { "Profile", profileParam.Value.FromJson <dynamic>() }
            };
            string requestXml = taskRequest.ToXml();

            Repository.AddTaskRequest(taskId, requestId, requestXml, null);
        }
示例#15
0
        public ActionResult Post(JobParam query)
        {
            try
            {
                if (query == null)
                {
                    return(Problem("Empty Params passed to RunJob method!", "Error", StatusCodes.Status500InternalServerError));
                }

                MainService.RunJobNow(query.Group, query.Name);
                return(Ok($"Job {query.Name} Launched!"));
            }
            catch (Exception e)
            {
                log.Info(e.ToString());
                return(Problem(e.ToString(), "Error", StatusCodes.Status500InternalServerError));
            }
        }
示例#16
0
        public bool add_job(Action doJobAction)
        {
            if (doJobAction == null)
            {
                return(false);
            }
            JobParam item = new JobParam
            {
                doJob = doJobAction
            };

            lock (this.jobList)
            {
                this.jobList.Add(item);
            }
            this.workEvent.Set();
            return(true);
        }
示例#17
0
        public HttpResponseMessage Post(JobParam query)
        {
            try
            {
                if (query == null)
                {
                    return(Request.CreateResponse(HttpStatusCode.InternalServerError,
                                                  "Empty Params passed to RunJob method!"));
                }

                MainService.RunJobNow(query.Group, query.Name);
                return(Request.CreateResponse(HttpStatusCode.OK, $"Job {query.Name} Launched!"));
            }
            catch (Exception e)
            {
                log.Info(e.ToString());
                return(Request.CreateResponse(HttpStatusCode.InternalServerError, e.ToString()));
            }
        }
示例#18
0
文件: JobDb.cs 项目: wite27/Horarium
 public JobMetadata ToJob(JsonSerializerSettings jsonSerializerSettings)
 {
     return(new JobMetadata
     {
         JobId = JobId,
         JobKey = JobKey,
         Status = Status,
         CountStarted = CountStarted,
         StartedExecuting = StartedExecuting,
         ExecutedMachine = ExecutedMachine,
         JobType = Type.GetType(JobType, true),
         JobParam = JobParam?.FromJson(Type.GetType(JobParamType), jsonSerializerSettings),
         StartAt = StartAt,
         NextJob = NextJob?.ToJob(jsonSerializerSettings),
         Cron = Cron,
         Delay = Delay,
         ObsoleteInterval = ObsoleteInterval
     });
 }
示例#19
0
        public override void Modify(JobParam param)
        {
            if (param.GetType() == typeof(EMSLoadFlowReportJobParam))
            {
                ModifyJobInit(param);
            }
            else if (param.GetType() == typeof(RefreshParam))
            {
                RefreshHierarhy();
            }

            if (selectedRecords.Count > 0)
            {
                PrepareReportData();
            }

            JobResult result = CreateResult();

            ResultsReady(Guid, result);
        }
示例#20
0
 public JobMetadata ToJob(JsonSerializerSettings jsonSerializerSettings)
 {
     return(new JobMetadata
     {
         JobId = JobId,
         JobKey = JobKey,
         Status = Status,
         CountStarted = CountStarted,
         StartedExecuting = StartedExecuting,
         ExecutedMachine = ExecutedMachine,
         JobType = Type.GetType(JobType, true),
         JobParam = JobParam?.FromJson(Type.GetType(JobParamType), jsonSerializerSettings),
         StartAt = StartAt,
         NextJob = NextJob?.ToJob(jsonSerializerSettings),
         Cron = Cron,
         Delay = Delay,
         ObsoleteInterval = ObsoleteInterval,
         RepeatStrategy = string.IsNullOrEmpty(RepeatStrategy) ? null : Type.GetType(RepeatStrategy, true),
         MaxRepeatCount = MaxRepeatCount
     });
 }
示例#21
0
 public static void PrepareUnitAssets(CharacterDB.Job jobData, JobParam param = null)
 {
     DownloadUtility.PrepareUnitModels(jobData);
     DownloadUtility.PrepareUnitAnimation(jobData, TacticsUnitController.ANIM_IDLE_FIELD, true, param);
     DownloadUtility.PrepareUnitAnimation(jobData, TacticsUnitController.ANIM_IDLE_DEMO, true, (JobParam)null);
     if (jobData.Movable)
     {
         DownloadUtility.PrepareUnitAnimation(jobData, TacticsUnitController.ANIM_RUN_FIELD, true, param);
         DownloadUtility.PrepareUnitAnimation(jobData, TacticsUnitController.ANIM_STEP, false, (JobParam)null);
         DownloadUtility.PrepareUnitAnimation(jobData, TacticsUnitController.ANIM_FALL_LOOP, false, (JobParam)null);
         DownloadUtility.PrepareUnitAnimation(jobData, TacticsUnitController.ANIM_FALL_END, false, (JobParam)null);
         DownloadUtility.PrepareUnitAnimation(jobData, TacticsUnitController.ANIM_CLIMBUP, false, (JobParam)null);
         DownloadUtility.PrepareUnitAnimation(jobData, TacticsUnitController.ANIM_GENKIDAMA, false, (JobParam)null);
     }
     DownloadUtility.PrepareUnitAnimation(jobData, TacticsUnitController.ANIM_PICKUP, false, (JobParam)null);
     DownloadUtility.PrepareUnitAnimation(jobData, "cmn_downstand0", false, (JobParam)null);
     DownloadUtility.PrepareUnitAnimation(jobData, "cmn_dodge0", false, (JobParam)null);
     DownloadUtility.PrepareUnitAnimation(jobData, "cmn_damage0", false, (JobParam)null);
     DownloadUtility.PrepareUnitAnimation(jobData, "cmn_damageair0", false, (JobParam)null);
     DownloadUtility.PrepareUnitAnimation(jobData, "cmn_down0", false, (JobParam)null);
     DownloadUtility.PrepareUnitAnimation(jobData, "itemuse0", false, (JobParam)null);
     DownloadUtility.PrepareUnitAnimation(jobData, "cmn_toss_lift0", false, (JobParam)null);
     DownloadUtility.PrepareUnitAnimation(jobData, "cmn_toss_throw0", false, (JobParam)null);
 }
示例#22
0
    public static void DownloadUnit(UnitParam unit, JobData[] jobs = null)
    {
        // ISSUE: object of a compiler-generated type is created
        // ISSUE: variable of a compiler-generated type
        DownloadUtility.\u003CDownloadUnit\u003Ec__AnonStorey1ED unitCAnonStorey1Ed = new DownloadUtility.\u003CDownloadUnit\u003Ec__AnonStorey1ED();
        // ISSUE: reference to a compiler-generated field
        unitCAnonStorey1Ed.unit = unit;
        // ISSUE: reference to a compiler-generated field
        if (unitCAnonStorey1Ed.unit == null)
        {
            return;
        }
        // ISSUE: reference to a compiler-generated field
        CharacterDB.Character character = CharacterDB.FindCharacter(unitCAnonStorey1Ed.unit.model);
        if (character == null)
        {
            return;
        }
        GameManager instance = MonoSingleton <GameManager> .Instance;

        // ISSUE: reference to a compiler-generated field
        if (unitCAnonStorey1Ed.unit.jobsets != null)
        {
            // ISSUE: reference to a compiler-generated field
            for (int index = 0; index < unitCAnonStorey1Ed.unit.jobsets.Length; ++index)
            {
                // ISSUE: reference to a compiler-generated field
                for (JobSetParam jobSetParam = instance.GetJobSetParam((string)unitCAnonStorey1Ed.unit.jobsets[index]); jobSetParam != null; jobSetParam = string.IsNullOrEmpty(jobSetParam.jobchange) ? (JobSetParam)null : instance.GetJobSetParam(jobSetParam.jobchange))
                {
                    JobParam jobParam = instance.GetJobParam(jobSetParam.job);
                    // ISSUE: reference to a compiler-generated field
                    SkillParam skillParam = string.IsNullOrEmpty(jobParam.atkskill[0]) ? instance.MasterParam.GetSkillParam(jobParam.atkskill[(int)unitCAnonStorey1Ed.unit.element]) : instance.MasterParam.GetSkillParam(jobParam.atkskill[0]);
                    if (skillParam != null)
                    {
                        SkillSequence sequence = SkillSequence.FindSequence(skillParam.motion);
                        if (sequence != null && !string.IsNullOrEmpty(sequence.SkillAnimation.Name) && index < character.Jobs.Count)
                        {
                            DownloadUtility.PrepareUnitAnimation(character.Jobs[index], sequence.SkillAnimation.Name, false, (JobParam)null);
                        }
                    }
                    DownloadUtility.DownloadJobEquipment(jobParam);
                    ArtifactParam artifactParam = MonoSingleton <GameManager> .GetInstanceDirect().MasterParam.GetArtifactParam(jobParam.artifact);

                    if (artifactParam != null)
                    {
                        DownloadUtility.DownloadArtifact(artifactParam);
                    }
                    int artifactSlotIndex = JobData.GetArtifactSlotIndex(ArtifactTypes.Arms);
                    if (jobs != null)
                    {
                        foreach (JobData job in jobs)
                        {
                            if (job != null)
                            {
                                // ISSUE: object of a compiler-generated type is created
                                // ISSUE: variable of a compiler-generated type
                                DownloadUtility.\u003CDownloadUnit\u003Ec__AnonStorey1EC unitCAnonStorey1Ec = new DownloadUtility.\u003CDownloadUnit\u003Ec__AnonStorey1EC();
                                List <ArtifactData> artifacts = MonoSingleton <GameManager> .GetInstanceDirect().Player.Artifacts;

                                // ISSUE: reference to a compiler-generated field
                                unitCAnonStorey1Ec.uniqId = job.Artifacts[artifactSlotIndex];
                                // ISSUE: reference to a compiler-generated method
                                ArtifactData artifactData = artifacts.Find(new Predicate <ArtifactData>(unitCAnonStorey1Ec.\u003C\u003Em__1B4));
                                if (artifactData != null)
                                {
                                    DownloadUtility.DownloadArtifact(artifactData.ArtifactParam);
                                }
                            }
                        }
                    }
                    else
                    {
                        DownloadUtility.DownloadArtifact(instance.MasterParam.GetArtifactParam(jobParam.artifact));
                    }
                    // ISSUE: reference to a compiler-generated field
                    AssetManager.PrepareAssets(AssetPath.UnitImage(unitCAnonStorey1Ed.unit, jobSetParam.job));
                    // ISSUE: reference to a compiler-generated field
                    AssetManager.PrepareAssets(AssetPath.UnitImage2(unitCAnonStorey1Ed.unit, jobSetParam.job));
                    // ISSUE: reference to a compiler-generated field
                    AssetManager.PrepareAssets(AssetPath.UnitIconSmall(unitCAnonStorey1Ed.unit, jobSetParam.job));
                    // ISSUE: reference to a compiler-generated field
                    AssetManager.PrepareAssets(AssetPath.UnitIconMedium(unitCAnonStorey1Ed.unit, jobSetParam.job));
                    // ISSUE: reference to a compiler-generated field
                    AssetManager.PrepareAssets(AssetPath.UnitEyeImage(unitCAnonStorey1Ed.unit, jobSetParam.job));
                }
            }
            // ISSUE: reference to a compiler-generated field
            JobSetParam[] changeJobSetParam = instance.GetClassChangeJobSetParam(unitCAnonStorey1Ed.unit.iname);
            if (changeJobSetParam != null && changeJobSetParam.Length > 0)
            {
                for (int index = 0; index < changeJobSetParam.Length; ++index)
                {
                    JobSetParam jobSetParam = changeJobSetParam[index];
                    if (jobSetParam != null)
                    {
                        JobParam      jobParam      = instance.GetJobParam(jobSetParam.job);
                        ArtifactParam artifactParam = MonoSingleton <GameManager> .GetInstanceDirect().MasterParam.GetArtifactParam(jobParam.artifact);

                        if (artifactParam != null)
                        {
                            DownloadUtility.DownloadArtifact(artifactParam);
                        }
                        // ISSUE: reference to a compiler-generated field
                        SkillParam skillParam = string.IsNullOrEmpty(jobParam.atkskill[0]) ? instance.MasterParam.GetSkillParam(jobParam.atkskill[(int)unitCAnonStorey1Ed.unit.element]) : instance.MasterParam.GetSkillParam(jobParam.atkskill[0]);
                        if (skillParam != null)
                        {
                            SkillSequence sequence = SkillSequence.FindSequence(skillParam.motion);
                            if (sequence != null && !string.IsNullOrEmpty(sequence.SkillAnimation.Name))
                            {
                                DownloadUtility.PrepareUnitAnimation(character.Jobs[index], sequence.SkillAnimation.Name, false, (JobParam)null);
                            }
                        }
                    }
                }
            }
        }
        for (int index = 0; index < character.Jobs.Count; ++index)
        {
            CharacterDB.Job job = character.Jobs[index];
            DownloadUtility.PrepareUnitModels(job);
            DownloadUtility.PrepareUnitAnimation(job, "unit_info_idle0", true, (JobParam)null);
            DownloadUtility.PrepareUnitAnimation(job, "unit_info_act0", true, (JobParam)null);
        }
        // ISSUE: reference to a compiler-generated field
        AssetManager.PrepareAssets("CHM/Home_" + unitCAnonStorey1Ed.unit.model + "_walk0");
        // ISSUE: reference to a compiler-generated field
        if (unitCAnonStorey1Ed.unit.skins != null)
        {
            List <ArtifactParam> artifacts = MonoSingleton <GameManager> .GetInstanceDirect().MasterParam.Artifacts;

            // ISSUE: object of a compiler-generated type is created
            // ISSUE: variable of a compiler-generated type
            DownloadUtility.\u003CDownloadUnit\u003Ec__AnonStorey1EE unitCAnonStorey1Ee = new DownloadUtility.\u003CDownloadUnit\u003Ec__AnonStorey1EE();
            // ISSUE: reference to a compiler-generated field
            unitCAnonStorey1Ee.\u003C\u003Ef__ref\u0024493 = unitCAnonStorey1Ed;
            // ISSUE: reference to a compiler-generated field
            // ISSUE: reference to a compiler-generated field
            // ISSUE: reference to a compiler-generated field
            // ISSUE: reference to a compiler-generated field
            for (unitCAnonStorey1Ee.i = 0; unitCAnonStorey1Ee.i < unitCAnonStorey1Ed.unit.skins.Length; ++unitCAnonStorey1Ee.i)
            {
                // ISSUE: reference to a compiler-generated method
                ArtifactParam skin = artifacts.Find(new Predicate <ArtifactParam>(unitCAnonStorey1Ee.\u003C\u003Em__1B5));
                if (skin != null)
                {
                    // ISSUE: reference to a compiler-generated field
                    AssetManager.PrepareAssets(AssetPath.UnitSkinImage(unitCAnonStorey1Ed.unit, skin, (string)null));
                    // ISSUE: reference to a compiler-generated field
                    AssetManager.PrepareAssets(AssetPath.UnitSkinImage2(unitCAnonStorey1Ed.unit, skin, (string)null));
                    // ISSUE: reference to a compiler-generated field
                    AssetManager.PrepareAssets(AssetPath.UnitSkinIconSmall(unitCAnonStorey1Ed.unit, skin, (string)null));
                    // ISSUE: reference to a compiler-generated field
                    AssetManager.PrepareAssets(AssetPath.UnitSkinIconMedium(unitCAnonStorey1Ed.unit, skin, (string)null));
                    // ISSUE: reference to a compiler-generated field
                    AssetManager.PrepareAssets(AssetPath.UnitSkinEyeImage(unitCAnonStorey1Ed.unit, skin, (string)null));
                }
            }
        }
        // ISSUE: reference to a compiler-generated field
        DownloadUtility.PrepareUnitVoice(unitCAnonStorey1Ed.unit);
    }
示例#23
0
 public static extern Result TextToSpeech(out int job_id, [In] ref JobParam job_param, string text);
示例#24
0
 public static extern Result TextToKana(out int job_id, [In] ref JobParam job_param, [In] byte[] text);
示例#25
0
    public static void DownloadUnit(Unit unit, bool dlStatusEffects = false)
    {
        UnitParam     unitParam    = unit.UnitParam;
        JobParam      job          = unit.Job == null ? (JobParam)null : unit.Job.Param;
        ArtifactParam selectedSkin = unit.UnitData.GetSelectedSkin(-1);

        CharacterDB.Job characterData = DownloadUtility.GetCharacterData(unitParam, job, selectedSkin);
        if (characterData == null)
        {
            return;
        }
        DownloadUtility.PrepareUnitAssets(characterData, job);
        if (unit.Job != null)
        {
            DownloadUtility.PrepareJobAssets(unit.Job.Param);
        }
        string jobName = unit.UnitData.CurrentJob == null ? string.Empty : unit.UnitData.CurrentJob.JobID;

        AssetManager.PrepareAssets(AssetPath.UnitSkinIconSmall(unitParam, selectedSkin, jobName));
        AssetManager.PrepareAssets(AssetPath.UnitSkinIconMedium(unitParam, selectedSkin, jobName));
        AssetManager.PrepareAssets(AssetPath.UnitSkinEyeImage(unitParam, selectedSkin, jobName));
        SkillData attackSkill = unit.GetAttackSkill();

        if (attackSkill != null)
        {
            DownloadUtility.PrepareSkillAssets(characterData, attackSkill.SkillParam);
        }
        for (int index = unit.BattleSkills.Count - 1; index >= 0; --index)
        {
            DownloadUtility.PrepareSkillAssets(characterData, unit.BattleSkills[index].SkillParam);
        }
        for (int index = unit.BattleAbilitys.Count - 1; index >= 0; --index)
        {
            AbilityData battleAbility = unit.BattleAbilitys[index];
            if (battleAbility != null && battleAbility.Param != null)
            {
                AssetManager.PrepareAssets(AssetPath.AbilityIcon(battleAbility.Param));
            }
        }
        if (unit != null)
        {
            DownloadUtility.PrepareUnitVoice(unit.UnitParam);
        }
        if (dlStatusEffects)
        {
            for (int index = 0; index < BadStatusEffects.Effects.Count; ++index)
            {
                if (!string.IsNullOrEmpty(BadStatusEffects.Effects[index].AnimationName))
                {
                    DownloadUtility.PrepareUnitAnimation(characterData, BadStatusEffects.Effects[index].AnimationName, false, (JobParam)null);
                }
            }
        }
        JobData[] jobs = unit.UnitData.Jobs;
        int       artifactSlotIndex = JobData.GetArtifactSlotIndex(ArtifactTypes.Arms);

        if (jobs != null)
        {
            List <ArtifactParam> artifacts = MonoSingleton <GameManager> .GetInstanceDirect().MasterParam.Artifacts;

            foreach (JobData jobData in jobs)
            {
                if (jobData != null)
                {
                    // ISSUE: object of a compiler-generated type is created
                    // ISSUE: reference to a compiler-generated method
                    ArtifactParam artifalct = artifacts.Find(new Predicate <ArtifactParam>(new DownloadUtility.\u003CDownloadUnit\u003Ec__AnonStorey1F2()
                    {
                        uniqId = (string)null, uniqId = jobData.ArtifactDatas[artifactSlotIndex] == null ? jobData.Param.artifact : jobData.ArtifactDatas[artifactSlotIndex].ArtifactParam.iname
                    }.\u003C\u003Em__1B8));
                    if (artifalct != null)
                    {
                        DownloadUtility.DownloadArtifact(artifalct);
                    }
                }
            }
        }
        else
        {
            if (unit.Job == null)
            {
                return;
            }
            DownloadUtility.DownloadArtifact(MonoSingleton <GameManager> .GetInstanceDirect().MasterParam.GetArtifactParam(unit.Job.Param.artifact));
        }
    }
示例#26
0
    public static string GetDescription(this TrophyObjective self)
    {
        GameManager instance = MonoSingleton <GameManager> .Instance;
        string      str1     = string.Empty;
        string      str2     = string.Empty;

        char[] chArray = new char[1] {
            ','
        };
        if (!string.IsNullOrEmpty(self.Param.Expr))
        {
            return(string.Format(LocalizedText.Get(self.Param.Expr), (object)self.ival));
        }
        switch (self.type)
        {
        case TrophyConditionTypes.winquest:
            if (string.IsNullOrEmpty(self.sval))
            {
                return(string.Format(LocalizedText.Get("sys.TROPHY_WINQUEST_NORMAL"), (object)self.ival));
            }
            QuestParam quest1 = instance.FindQuest(self.sval);
            return(string.Format(LocalizedText.Get("sys.TROPHY_WINQUEST"), quest1 == null ? (object)("?" + self.sval) : (object)quest1.name, (object)self.ival));

        case TrophyConditionTypes.killenemy:
            UnitParam unitParam1 = instance.GetUnitParam(self.sval);
            return(string.Format(LocalizedText.Get("sys.TROPHY_KILLENEMY"), unitParam1 == null ? (object)("?" + self.sval) : (object)unitParam1.name, (object)self.ival));

        case TrophyConditionTypes.getitem:
            ItemParam itemParam = instance.GetItemParam(self.sval);
            return(string.Format(LocalizedText.Get("sys.TROPHY_GETITEM"), itemParam == null ? (object)("?" + self.sval) : (object)itemParam.name, (object)self.ival));

        case TrophyConditionTypes.playerlv:
            return(string.Format(LocalizedText.Get("sys.TROPHY_PLAYERLV"), (object)self.ival));

        case TrophyConditionTypes.winelite:
            return(string.Format(LocalizedText.Get("sys.TROPHY_WINQUEST_ELITE"), (object)self.ival));

        case TrophyConditionTypes.winevent:
            return(string.Format(LocalizedText.Get("sys.TROPHY_WINQUEST_EVENT"), (object)self.ival));

        case TrophyConditionTypes.gacha:
            return(string.Format(LocalizedText.Get("sys.TROPHY_GACHA"), (object)self.ival));

        case TrophyConditionTypes.multiplay:
            return(string.Format(LocalizedText.Get("sys.TROPHY_MULTIPLAY"), (object)self.ival));

        case TrophyConditionTypes.ability:
            return(string.Format(LocalizedText.Get("sys.TROPHY_ABILITY"), (object)self.ival));

        case TrophyConditionTypes.soubi:
            return(string.Format(LocalizedText.Get("sys.TROPHY_SOUBI"), (object)self.ival));

        case TrophyConditionTypes.buygold:
            return(string.Format(LocalizedText.Get("sys.TROPHY_BUYGOLD"), (object)self.ival));

        case TrophyConditionTypes.vip:
            return(string.Format(LocalizedText.Get("sys.TROPHY_VIP"), (object)self.ival));

        case TrophyConditionTypes.stamina:
            return(string.Format(LocalizedText.Get("sys.TROPHY_STAMINA"), (object)int.Parse(self.sval.Substring(0, 2)), (object)int.Parse(self.sval.Substring(3, 2))));

        case TrophyConditionTypes.arena:
            return(string.Format(LocalizedText.Get("sys.TROPHY_ARENA"), (object)self.ival));

        case TrophyConditionTypes.winarena:
            return(string.Format(LocalizedText.Get("sys.TROPHY_WINARENA"), (object)self.ival));

        case TrophyConditionTypes.review:
            return(LocalizedText.Get("sys.TROPHY_REVIEW"));

        case TrophyConditionTypes.followtwitter:
            return(LocalizedText.Get("sys.TROPHY_FOLLOWTWITTER"));

        case TrophyConditionTypes.fggid:
            return(LocalizedText.Get("sys.TROPHY_FGGID"));

        case TrophyConditionTypes.unitlevel:
            UnitParam unitParam2 = instance.GetUnitParam(self.sval);
            return(string.Format(LocalizedText.Get("sys.TROPHY_UNITLV"), unitParam2 == null ? (object)("?" + self.sval) : (object)unitParam2.name, (object)self.ival));

        case TrophyConditionTypes.evolutionnum:
            UnitParam unitParam3 = instance.GetUnitParam(self.sval);
            return(string.Format(LocalizedText.Get("sys.TROPHY_EVOLUTIONCNT"), unitParam3 == null ? (object)("?" + self.sval) : (object)unitParam3.name, (object)(self.ival + 1)));

        case TrophyConditionTypes.joblevel:
            string[]  strArray1  = self.sval.Split(chArray);
            UnitParam unitParam4 = instance.GetUnitParam(strArray1[0]);
            JobParam  jobParam1  = instance.GetJobParam(strArray1[1]);
            return(string.Format(LocalizedText.Get("sys.TROPHY_JOBLV"), unitParam4 == null ? (object)("?" + strArray1[0]) : (object)unitParam4.name, jobParam1 == null ? (object)("?" + strArray1[1]) : (object)jobParam1.name, (object)self.ival));

        case TrophyConditionTypes.logincount:
            return(string.Format(LocalizedText.Get("sys.TROPHY_LOGINCNT"), (object)self.ival));

        case TrophyConditionTypes.upunitlevel:
            return(string.Format(LocalizedText.Get("sys.TROPHY_UNITLVUP"), (object)SRPG_Extensions.GetUnitName(self.sval), (object)self.ival));

        case TrophyConditionTypes.makeunitlevel:
            if (!string.IsNullOrEmpty(self.sval))
            {
                return(string.Format(LocalizedText.Get("sys.TROPHY_UNITLVMAKE"), (object)SRPG_Extensions.GetUnitName(self.sval), (object)self.ival));
            }
            return(string.Format(LocalizedText.Get("sys.TROPHY_UNITLVMAKE_DEFAULT"), (object)self.ival));

        case TrophyConditionTypes.unitequip:
            return(string.Format(LocalizedText.Get("sys.TROPHY_EQUIP"), (object)SRPG_Extensions.GetUnitName(self.sval), (object)self.ival));

        case TrophyConditionTypes.upjoblevel:
            if (!string.IsNullOrEmpty(self.sval))
            {
                string[]  strArray2  = self.sval.Split(chArray);
                UnitParam unitParam5 = instance.GetUnitParam(strArray2[0]);
                JobParam  jobParam2  = instance.GetJobParam(strArray2[1]);
                str2 = unitParam5 == null ? "?" + strArray2[0] : unitParam5.name;
                str1 = jobParam2 == null ? "?" + strArray2[1] : jobParam2.name;
            }
            if (!string.IsNullOrEmpty(str2))
            {
                if (!string.IsNullOrEmpty(str1))
                {
                    return(string.Format(LocalizedText.Get("sys.TROPHY_JOBLVUP"), (object)str2, (object)str1, (object)self.ival));
                }
                return(string.Format(LocalizedText.Get("sys.TROPHY_JOBLVUP_ANYJOB"), (object)str2, (object)self.ival));
            }
            if (!string.IsNullOrEmpty(str1))
            {
                return(string.Format(LocalizedText.Get("sys.TROPHY_JOBLVUP_ANYJOB_ANYUNIT"), (object)self.ival));
            }
            return(string.Format(LocalizedText.Get("sys.TROPHY_JOBLVUP"), (object)str2, (object)str1, (object)self.ival));

        case TrophyConditionTypes.makejoblevel:
            if (!string.IsNullOrEmpty(self.sval))
            {
                string[]  strArray2  = self.sval.Split(chArray);
                UnitParam unitParam5 = instance.GetUnitParam(strArray2[0]);
                JobParam  jobParam2  = instance.GetJobParam(strArray2[1]);
                string    str3       = unitParam5 == null ? "?" + strArray2[0] : unitParam5.name;
                string    str4       = jobParam2 == null ? "?" + strArray2[1] : jobParam2.name;
                if (!string.IsNullOrEmpty(str3))
                {
                    if (!string.IsNullOrEmpty(str4))
                    {
                        return(string.Format(LocalizedText.Get("sys.TROPHY_JOBLVMAKE"), (object)str3, (object)str4, (object)self.ival));
                    }
                    return(string.Format(LocalizedText.Get("sys.TROPHY_JOBLVMAKE_ANYJOB"), (object)str3, (object)self.ival));
                }
                if (!string.IsNullOrEmpty(str4))
                {
                    return(string.Format(LocalizedText.Get("sys.TROPHY_JOBLVMAKE_ANYUNIT"), (object)str4, (object)self.ival));
                }
            }
            return(string.Format(LocalizedText.Get("sys.TROPHY_JOBLVMAKE_DEFAULT"), (object)self.ival));

        case TrophyConditionTypes.limitbreak:
            if (!string.IsNullOrEmpty(self.sval))
            {
                return(string.Format(LocalizedText.Get("sys.TROPHY_LIMITBREAK"), (object)SRPG_Extensions.GetUnitName(self.sval), (object)self.ival));
            }
            return(string.Format(LocalizedText.Get("sys.TROPHY_LIMITBREAK_DEFAULT"), (object)self.ival));

        case TrophyConditionTypes.evoltiontimes:
            if (string.IsNullOrEmpty(self.sval) || string.IsNullOrEmpty(SRPG_Extensions.GetUnitName(self.sval)))
            {
                return(string.Format(LocalizedText.Get("sys.TROPHY_EVOLUTIONTIMES_ANY"), (object)self.ival));
            }
            return(string.Format(LocalizedText.Get("sys.TROPHY_EVOLUTIONTIMES"), (object)SRPG_Extensions.GetUnitName(self.sval), (object)self.ival));

        case TrophyConditionTypes.changejob:
            if (!string.IsNullOrEmpty(self.sval))
            {
                return(string.Format(LocalizedText.Get("sys.TROPHY_CHANGEJOB"), (object)SRPG_Extensions.GetUnitName(self.sval), (object)self.ival));
            }
            return(string.Format(LocalizedText.Get("sys.TROPHY_CHANGEJOB_DEFAULT"), (object)self.ival));

        case TrophyConditionTypes.changeability:
            return(string.Format(LocalizedText.Get("sys.TROPHY_CHANGEABILITY"), (object)SRPG_Extensions.GetUnitName(self.sval), (object)self.ival));

        case TrophyConditionTypes.makeabilitylevel:
            if (string.IsNullOrEmpty(self.sval))
            {
                return(string.Format(LocalizedText.Get("sys.TROPHY_ABILITYLV_DEFAULT"), (object)self.ival));
            }
            string[] strArray3 = self.sval.Split(chArray);
            string   empty1    = string.Empty;
            if (string.IsNullOrEmpty(strArray3[1]))
            {
                return(string.Format(LocalizedText.Get("sys.TROPHY_ABILITYLV_ANYABILITY"), (object)SRPG_Extensions.GetUnitName(strArray3[0]), (object)self.ival));
            }
            AbilityParam abilityParam = instance.GetAbilityParam(strArray3[1]);
            string       str5         = abilityParam == null ? "?" + strArray3[1] : abilityParam.name;
            if (!string.IsNullOrEmpty(strArray3[0]))
            {
                return(string.Format(LocalizedText.Get("sys.TROPHY_ABILITYLV"), (object)SRPG_Extensions.GetUnitName(strArray3[0]), (object)str5, (object)self.ival));
            }
            return(string.Format(LocalizedText.Get("sys.TROPHY_ABILITYLV_ANYUNIT"), (object)str5, (object)self.ival));

        case TrophyConditionTypes.winquestsoldier:
            return(string.Format(LocalizedText.Get("sys.TROPHY_WINSOLIDER"), (object)self.ival));

        case TrophyConditionTypes.winmulti:
            return(string.Format(LocalizedText.Get("sys.TROPHY_WINMULTI"), (object)SRPG_Extensions.GetQuestName(self.sval), (object)self.ival));

        case TrophyConditionTypes.buyatshop:
            string empty2 = string.Empty;
            string empty3 = string.Empty;
            if (!string.IsNullOrEmpty(self.sval))
            {
                string[] strArray2 = self.sval.Split(chArray);
                if (!string.IsNullOrEmpty(strArray2[0]))
                {
                    int    shopType = instance.MasterParam.GetShopType(strArray2[0]);
                    string shopName = instance.Player.GetShopName((EShopType)shopType);
                    if (!string.IsNullOrEmpty(strArray2[1]))
                    {
                        return(string.Format(LocalizedText.Get("sys.TROPHY_BUYATSHOP"), (object)shopName, (object)empty3, (object)self.ival));
                    }
                    return(string.Format(LocalizedText.Get("sys.TROPHY_BUYATSHOP_ANYITEM"), (object)shopName, (object)self.ival));
                }
                string itemName = SRPG_Extensions.GetItemName(strArray2[1]);
                if (!string.IsNullOrEmpty(strArray2[1]))
                {
                    return(string.Format(LocalizedText.Get("sys.TROPHY_BUYATSHOP_ANYSHOP"), (object)itemName, (object)self.ival));
                }
            }
            return(string.Format(LocalizedText.Get("sys.TROPHY_BUYATSHOP_DEFAULT"), (object)self.ival));

        case TrophyConditionTypes.artifacttransmute:
            if (string.IsNullOrEmpty(self.sval) || string.IsNullOrEmpty(SRPG_Extensions.GetArtifactName(self.sval)))
            {
                return(string.Format(LocalizedText.Get("sys.TROPHY_AFORDRILL_ANY"), (object)self.ival));
            }
            return(string.Format(LocalizedText.Get("sys.TROPHY_AFORDRILL"), (object)SRPG_Extensions.GetArtifactName(self.sval), (object)self.ival));

        case TrophyConditionTypes.artifactstrength:
            if (string.IsNullOrEmpty(self.sval) || string.IsNullOrEmpty(SRPG_Extensions.GetArtifactName(self.sval)))
            {
                return(string.Format(LocalizedText.Get("sys.TROPHY_AFSTRENGTHEN_ANY"), (object)self.ival));
            }
            return(string.Format(LocalizedText.Get("sys.TROPHY_AFSTRENGTHEN"), (object)SRPG_Extensions.GetArtifactName(self.sval), (object)self.ival));

        case TrophyConditionTypes.artifactevolution:
            if (string.IsNullOrEmpty(self.sval) || string.IsNullOrEmpty(SRPG_Extensions.GetArtifactName(self.sval)))
            {
                return(string.Format(LocalizedText.Get("sys.TROPHY_AFVOLUTION_ANY"), (object)self.ival));
            }
            return(string.Format(LocalizedText.Get("sys.TROPHY_AFVOLUTION"), (object)SRPG_Extensions.GetArtifactName(self.sval), (object)self.ival));

        case TrophyConditionTypes.winmultimore:
            return(string.Format(LocalizedText.Get("sys.TROPHY_WINMULTIMORE"), (object)SRPG_Extensions.GetQuestName(self.sval), (object)self.ival));

        case TrophyConditionTypes.winmultiless:
            return(string.Format(LocalizedText.Get("sys.TROPHY_WINMULTILESS"), (object)SRPG_Extensions.GetQuestName(self.sval), (object)self.ival));

        case TrophyConditionTypes.collectunits:
            return(string.Format(LocalizedText.Get("sys.TROPHY_COLLECTUNITS"), (object)self.ival));

        case TrophyConditionTypes.totaljoblv11:
            return(string.Format(LocalizedText.Get("sys.TROPHY_TOTALJOBLV11"), (object)self.ival));

        case TrophyConditionTypes.totalunitlvs:
            return(string.Format(LocalizedText.Get("sys.TROPHY_TOTALUNITLVS"), (object)self.ival));

        case TrophyConditionTypes.childrencomp:
            return(string.Format(LocalizedText.Get("sys.TROPHY_CHILDRENCOMP"), (object)self.ival));

        case TrophyConditionTypes.wintower:
            if (string.IsNullOrEmpty(self.sval))
            {
                return(string.Format(LocalizedText.Get("sys.TROPHY_WINTOWER_NORMAL"), (object)self.ival));
            }
            QuestParam quest2 = instance.FindQuest(self.sval);
            if (quest2 != null)
            {
                return(string.Format(LocalizedText.Get("sys.TROPHY_WINTOWER"), (object)quest2.title, (object)quest2.name, (object)self.ival));
            }
            DebugUtility.Log("「" + self.sval + "」quest_id is not found.");
            return(string.Empty);

        case TrophyConditionTypes.losequest:
            if (string.IsNullOrEmpty(self.sval))
            {
                return(string.Format(LocalizedText.Get("sys.TROPHY_LOSEQUEST_NORMAL"), (object)self.ival));
            }
            QuestParam quest3 = instance.FindQuest(self.sval);
            return(string.Format(LocalizedText.Get("sys.TROPHY_LOSEQUEST"), quest3 == null ? (object)("?" + self.sval) : (object)quest3.name, (object)self.ival));

        case TrophyConditionTypes.loseelite:
            return(string.Format(LocalizedText.Get("sys.TROPHY_LOSEQUEST_ELITE"), (object)self.ival));

        case TrophyConditionTypes.loseevent:
            return(string.Format(LocalizedText.Get("sys.TROPHY_LOSEQUEST_EVENT"), (object)self.ival));

        case TrophyConditionTypes.losetower:
            if (string.IsNullOrEmpty(self.sval))
            {
                return(string.Format(LocalizedText.Get("sys.TROPHY_LOSETOWER_NORMAL"), (object)self.ival));
            }
            QuestParam quest4 = instance.FindQuest(self.sval);
            if (quest4 != null)
            {
                return(string.Format(LocalizedText.Get("sys.TROPHY_LOSETOWER"), (object)quest4.title, (object)quest4.name, (object)self.ival));
            }
            DebugUtility.Log("「" + self.sval + "」quest_id is not found.");
            return(string.Empty);

        case TrophyConditionTypes.losearena:
            return(string.Format(LocalizedText.Get("sys.TROPHY_LOSEARENA"), (object)self.ival));

        case TrophyConditionTypes.dailyall:
            return(string.Format(LocalizedText.Get("sys.TROPHY_DAILYALL"), (object)self.ival));

        case TrophyConditionTypes.vs:
            return(string.Format(LocalizedText.Get("sys.TROPHY_VS"), (object)self.ival));

        case TrophyConditionTypes.vswin:
            return(string.Format(LocalizedText.Get("sys.TROPHY_VSWIN"), (object)self.ival));

        case TrophyConditionTypes.vslose:
            return(string.Format(LocalizedText.Get("sys.TROPHY_VSLOSE"), (object)self.ival));

        case TrophyConditionTypes.fblogin:
            return(LocalizedText.Get("sys.TROPHY_FBLOGIN"));

        default:
            return(string.Empty);
        }
    }
        private void VaultFoldertoPDF(Folder folder, WebServiceManager mgr)
        {
            const string PrintJobTypeName  = "Horst.File.PrintPDF";
            const string PrintJob_EntityId = "EntityId";

            if (folder.Cloaked)
            {
                return;
            }

            ADSK.File[] files = mgr.DocumentService.GetLatestFilesByFolderId(
                folder.Id, true);
            if (files != null)
            {
                foreach (ADSK.File file in files)
                {
                    if (file.Cloaked)
                    {
                        continue;
                    }

                    if (!file.Name.EndsWith(".idw"))
                    {
                        continue;
                    }

                    if (!(file.FileLfCyc.LfCycStateName == "Released"))     // only process released idws
                    {
                        continue;
                    }

                    JobParam[] paramList = new JobParam[3];

                    JobParam entityIdParam = new JobParam();
                    entityIdParam.Name = PrintJob_EntityId;
                    entityIdParam.Val  = file.MasterId.ToString();
                    paramList[0]       = entityIdParam;

                    JobParam fileNameParam = new JobParam();
                    fileNameParam.Name = "EntityClassId";
                    fileNameParam.Val  = "USER-REQUESTED " + file.Name;
                    paramList[1]       = fileNameParam;

                    JobParam lifeCycleTransitionParam = new JobParam();
                    lifeCycleTransitionParam.Name = "LifeCycleTransitionId";
                    lifeCycleTransitionParam.Val  = "88";
                    paramList[2] = lifeCycleTransitionParam;

                    // Add the job to the queue
                    //
                    mgr.JobService.AddJob(
                        PrintJobTypeName, String.Format("Print PDF - {0}", fileNameParam.Val),
                        paramList, 100);
                }
            }

            Folder[] subFolders = mgr.DocumentService.GetFoldersByParentId(folder.Id, false);
            if (subFolders != null)
            {
                foreach (Folder subFolder in subFolders)
                {
                    VaultFoldertoPDF(subFolder, mgr);
                }
            }
        }
示例#28
0
        public ActionResult Edit(Job model, IEnumerable <string> parameters, string submit)
        {
            if (ModelState.IsValid)
            {
                Job job = db.Jobs.Where(o => o.ID == model.ID).Single();

                job.JobName        = model.JobName;
                job.Details        = model.Details;
                job.GroupName      = model.GroupName;
                job.TypeID         = model.TypeID;
                job.JobType        = model.JobType;
                job.CronExpression = model.CronExpression;
                job.TriggerName    = model.TriggerName;
                job.TriggerGroup   = model.TriggerGroup;
                job.Enabled        = model.Enabled;

                JobType jtype = db.JobTypes.Where(o => o.ID == model.TypeID).Single();

                // insert or update added parameters
                if (jtype.ParamKeys != "")
                {
                    string[] keys   = jtype.ParamKeys.Split('|');
                    string[] values = parameters.ToArray();

                    // delete removed parameters
                    db.JobParams.RemoveRange(job.JobParams.Where(o => !keys.Contains(o.ParamKey)));

                    if (keys.Length == values.Length)
                    {
                        for (int i = 0; i < keys.Length; i++)
                        {
                            JobParam par = job.JobParams.Where(o => o.ParamKey == keys[i]).SingleOrDefault();
                            if (par == null)
                            {
                                job.JobParams.Add(new JobParam()
                                {
                                    ParamKey = keys[i], ParamValue = values[i]
                                });
                            }
                            else
                            {
                                par.ParamValue = values[i];
                            }
                        }
                    }
                }

                db.SaveChanges();
                if (submit == "Update and sync")
                {
                    return(RedirectToAction("SyncJobs", new { id = model.ID }));
                }
                else
                {
                    return(RedirectToAction("Index", new { group = model.GroupName }));
                }
            }

            ViewBag.JobTypes = db.JobTypes.OrderBy(o => o.TypeName);
            return(View(db.Jobs.Where(o => o.ID == model.ID).Single()));
        }
示例#29
0
    private static void PrepareUnitAnimation(CharacterDB.Job jobData, string animationName, bool addJobName, JobParam param = null)
    {
        StringBuilder stringBuilder = GameUtility.GetStringBuilder();

        stringBuilder.Append("CHM/");
        stringBuilder.Append(jobData.AssetPrefix);
        stringBuilder.Append('_');
        if (addJobName)
        {
            if (param != null)
            {
                stringBuilder.Append(param.model);
                stringBuilder.Append('_');
            }
            else
            {
                stringBuilder.Append(jobData.JobID);
                stringBuilder.Append('_');
            }
        }
        stringBuilder.Append(animationName);
        AssetManager.PrepareAssets(stringBuilder.ToString());
    }