示例#1
0
        protected override void Perform(BooterHelper.BootFile file, XmlDbRow row)
        {
            BooterHelper.DocumentBootFile socialData = new BooterHelper.DocumentBootFile(file.ToString(), row.GetString("SocialData"), false);
            if (!socialData.IsValid)
            {
                BooterLogger.AddTrace(file + ": No SocialData");
                return;
            }

            BooterHelper.DataBootFile availability = new BooterHelper.DataBootFile(file.ToString(), row.GetString("SocializingActionAvailability"), false);
            if (!availability.IsValid)
            {
                BooterLogger.AddTrace(file + ": No SocializingActionAvailability");
                return;
            }

            Load(socialData, availability);
        }
示例#2
0
        protected override bool Perform(BooterHelper.BootFile file)
        {
            if (base.Perform(file))
            {
                return(true);
            }

            BooterHelper.DocumentBootFile docfile = file as BooterHelper.DocumentBootFile;
            if (docfile == null)
            {
                return(false);
            }

            BooterHelper.DataBootFile availability = new BooterHelper.DataBootFile(file.ToString(), VersionStamp.sNamespace + ".SocializingActionAvailability", false);
            if (!availability.IsValid)
            {
                return(false);
            }

            Load(docfile, availability);
            return(true);
        }
示例#3
0
        protected override void PerformFile(BooterHelper.BootFile file)
        {
            BooterHelper.DataBootFile dataFile = file as BooterHelper.DataBootFile;
            if (dataFile == null)
            {
                return;
            }

            if ((dataFile.GetTable("BuffList") == null) && (dataFile.GetTable("Buffs") == null))
            {
                return;
            }

            try
            {
                BuffManager.ParseBuffData(dataFile.Data, true);
            }
            catch (Exception e)
            {
                Common.Exception(file.ToString(), e);

                BooterLogger.AddError(file + ": ParseBuffData Error");
            }
        }
示例#4
0
        protected override void Perform(BooterHelper.BootFile file, XmlDbRow row)
        {
            BooterHelper.DataBootFile dataFile = file as BooterHelper.DataBootFile;
            if (dataFile == null)
            {
                return;
            }

            bool success = false;

            mIndex++;

            try
            {
                string methodName = row.GetString("Name");
                if (string.IsNullOrEmpty(methodName))
                {
                    BooterLogger.AddError(file + " : Method " + mIndex + " Unnamed");
                }
                else if (ScoringLookup.GetScoring(methodName, false) != null)
                {
                    BooterLogger.AddError(methodName + " Name already in use");
                    return;
                }
                else
                {
                    Type classType = row.GetClassType("FullClassName");
                    if (classType == null)
                    {
                        BooterLogger.AddError(methodName + " Unknown FullClassName: " + row.GetString("FullClassName"));
                    }
                    else
                    {
                        IListedScoringMethod scoring = null;
                        try
                        {
                            scoring = classType.GetConstructor(new Type[0]).Invoke(new object[0]) as IListedScoringMethod;
                        }
                        catch
                        { }

                        if (scoring == null)
                        {
                            BooterLogger.AddError(methodName + ": Constructor Fail " + row.GetString("FullClassName"));
                        }
                        else
                        {
                            XmlDbTable scoringTable = dataFile.GetTable(methodName);
                            if (scoringTable == null)
                            {
                                BooterLogger.AddError(methodName + ": Table Missing");
                            }
                            else
                            {
                                if (scoring.Parse(row, scoringTable))
                                {
                                    BooterLogger.AddTrace("Added Scoring : " + methodName);

                                    ScoringLookup.AddScoring(methodName, scoring);

                                    success = true;
                                }
                                else
                                {
                                    BooterLogger.AddError(methodName + ": Parsing Fail");
                                }
                            }
                        }
                    }
                }
            }
            finally
            {
                if (!success)
                {
                    foreach (string column in row.ColumnNames)
                    {
                        BooterLogger.AddError(column + "= " + row[column]);
                    }
                }
            }
        }