Exemplo n.º 1
0
 private static int compareLocalIDs(PrimToCreate x, PrimToCreate y)
 {
     return (int)((long)x.OldLocalID - (long)y.OldLocalID);
 }
Exemplo n.º 2
0
        public void ImportTaskObjects(ImportSettings importSettings)
        {
            DateTime lastProgressNotice    = DateTime.Now;
            int      incomplete            = 0;
            var      agentSyncFolderHolder = Exporting.FolderCalled("TaskInvHolder");
            int      created = 0;
            var      tos     = LocalScene.TaskObjects;

            foreach (var file in Directory.GetFiles(ExportCommand.dumpDir, "*.taskobj"))
            {
                string[]     c  = File.ReadAllText(file).Split(',');
                TaskFileInfo to = new TaskFileInfo()
                {
                    OldLid        = uint.Parse(c[0]),
                    RezzedID      = UUID.Parse(c[2]),
                    OldTaskHolder = UUID.Parse(c[3]),
                    AssetUUID     = UUID.Parse(c[4]),
                    TaskItemID    = UUID.Parse(c[5])
                };
                tos.Add(to);
                created++;
            }
            foreach (TaskFileInfo o in tos)
            {
                var r = o.Rezzed;
                if (r != null)
                {
                    r.SetIsAsset();
                }
            }

            foreach (TaskFileInfo o in tos)
            {
                PrimToCreate oInsideOf = o.InsideOf;
                if (oInsideOf == null)
                {
                    continue;
                }
                List <InventoryBase> taskInv = oInsideOf.SourceTaskInventory(true);
                if (taskInv == null)
                {
                    continue;
                }
                foreach (var b in taskInv)
                {
                    InventoryItem i = b as InventoryItem;
                    if (i == null)
                    {
                        continue;
                    }
                    if (CogbotHelpers.IsNullOrZero(i.AssetUUID))
                    {
                        if (i.UUID == o.TaskItemID)
                        {
                            i.RezzID   = o.RezzedID;
                            o.IsPlaced = true;
                            break;
                        }
                    }
                }
            }
            foreach (TaskFileInfo o in tos)
            {
                if (!o.IsPlaced)
                {
                    Failure("UNPLACED: " + o);
                }
            }
            // this makes sure we know that late found childs are assets
            foreach (PrimToCreate parent in LockInfo.CopyOf(parents))
            {
                if (parent.IsAsset)
                {
                    parent.SetIsAsset();
                }
            }
        }
Exemplo n.º 3
0
 private static int compareLocalIDs(PrimToCreate x, PrimToCreate y)
 {
     return((int)((long)x.OldLocalID - (long)y.OldLocalID));
 }
Exemplo n.º 4
0
 public TaskItemToCreate(PrimToCreate ptc, OSDMap taskOSD)
 {
     HolderPrim = ptc;
     TaskItemOSD = taskOSD;
 }