static object UUIDReplacer(MemberInfo memberName, object arg, HashSet<MissingItemInfo> missing)
 {
     if (typeof(Primitive) == memberName.DeclaringType)
     {
         string n = memberName.Name;
         if (n == "ID") return arg;
         if (n == "LocalID") return arg;
     }
     if (typeof(Primitive.ObjectProperties) == memberName.DeclaringType)
     {
         string n = memberName.Name;
         if (n == "ObjectID") return arg;
         if (n == "FolderID") return arg;
     }
     if (typeof(Asset) == memberName.DeclaringType)
     {
         string n = memberName.Name;
         //if (n == "AssetID") return arg;
     }
     {
         // skip identities such as FolderUUID AssetUUID Item.UUID
         string n = memberName.Name;
         if (n.Contains("UUID")) return arg;
     }
     if (typeof(InventoryItem) == memberName.DeclaringType)
     {
         // skip identities such as FolderUUID AssetUUID Item.UUID
         string n = memberName.Name;
         if (n.Contains("Creator")) return arg;
         if (n.Contains("Owner")) return arg;
     }
     UUID before = (UUID)arg;
     if (CogbotHelpers.IsNullOrZero(before)) return before;
     if (UnresolvedUUIDs.Contains(before))
     {
         return before;
     }
     UUID other;
     if (ChangeList.TryGetValue(before, out other))
     {
         return other;
     }
     UUIDChange utc;
     if (UUID2OBJECT.TryGetValue(before, out utc))
     {
         UUID utcNewID = utc.NewID;
         if (!CogbotHelpers.IsNullOrZero(utcNewID))
         {
             ChangeList.Add(before, utcNewID);
             return utcNewID;
         }
         return utcNewID;
     }
     MissingItemInfo mis = new MissingItemInfo(memberName, before);
     if (missing != null) missing.Add(mis);
     Importing.Failure("Missing: " + mis);
     UnresolvedUUIDs.Add(before);
     return before;
 }
Exemple #2
0
        static object UUIDReplacer(MemberInfo memberName, object arg, HashSet <MissingItemInfo> missing)
        {
            if (typeof(Primitive) == memberName.DeclaringType)
            {
                string n = memberName.Name;
                if (n == "ID")
                {
                    return(arg);
                }
                if (n == "LocalID")
                {
                    return(arg);
                }
            }
            if (typeof(Primitive.ObjectProperties) == memberName.DeclaringType)
            {
                string n = memberName.Name;
                if (n == "ObjectID")
                {
                    return(arg);
                }
                if (n == "FolderID")
                {
                    return(arg);
                }
            }
            if (typeof(Asset) == memberName.DeclaringType)
            {
                string n = memberName.Name;
                //if (n == "AssetID") return arg;
            }
            {
                // skip identities such as FolderUUID AssetUUID Item.UUID
                string n = memberName.Name;
                if (n.Contains("UUID"))
                {
                    return(arg);
                }
            }
            if (typeof(InventoryItem) == memberName.DeclaringType)
            {
                // skip identities such as FolderUUID AssetUUID Item.UUID
                string n = memberName.Name;
                if (n.Contains("Creator"))
                {
                    return(arg);
                }
                if (n.Contains("Owner"))
                {
                    return(arg);
                }
            }
            UUID before = (UUID)arg;

            if (CogbotHelpers.IsNullOrZero(before))
            {
                return(before);
            }
            if (UnresolvedUUIDs.Contains(before))
            {
                return(before);
            }
            UUID other;

            if (ChangeList.TryGetValue(before, out other))
            {
                return(other);
            }
            UUIDChange utc;

            if (UUID2OBJECT.TryGetValue(before, out utc))
            {
                UUID utcNewID = utc.NewID;
                if (!CogbotHelpers.IsNullOrZero(utcNewID))
                {
                    ChangeList.Add(before, utcNewID);
                    return(utcNewID);
                }
                return(utcNewID);
            }
            MissingItemInfo mis = new MissingItemInfo(memberName, before);

            if (missing != null)
            {
                missing.Add(mis);
            }
            Importing.Failure("Missing: " + mis);
            UnresolvedUUIDs.Add(before);
            return(before);
        }