Exemplo n.º 1
0
        //"\tinv_item\t0\n\t{\n\t\titem_id\t064c58be-30e1-d5ff-ff8c-94b25bf17e8d\n\t\tparent_id\t12a86241-ab3d-49c0-ae75-c067cede6cb4\n\tpermissions 0\n\t{\n\t\tbase_mask\t7fffffff\n\t\towner_mask\t7fffffff\n\t\tgroup_mask\t00000000\n\t\teveryone_mask\t00000000\n\t\tnext_owner_mask\t7fffffff\n\t\tcreator_id\t2bbff43c-e25d-4514-9c28-81bceb372b9c\n\t\towner_id\t2bbff43c-e25d-4514-9c28-81bceb372b9c\n\t\tlast_owner_id\t00000000-0000-0000-0000-000000000000\n\t\tgroup_id\t00000000-0000-0000-0000-000000000000\n\t}\n\t\tasset_id\t94362507-033d-9680-d18b-1baf24d0da83\n\t\ttype\ttexture\n\t\tinv_type\tsnapshot\n\t\tflags\t00000000\n\tsale_info\t0\n\t{\n\t\tsale_type\tnot\n\t\tsale_price\t10\n\t}\n\t\tname\tSeneca's Buildings|\n\t\tdesc\tSeneca's buildings|\n\t\tcreation_date\t1161405411\n\t}\r\n"
        //"\tinv_item\t0{\titem_id\t064c58be-30e1-d5ff-ff8c-94b25bf17e8d\tparent_id\t12a86241-ab3d-49c0-ae75-c067cede6cb4permissions 0{\tbase_mask\t7fffffff\towner_mask\t7fffffff\tgroup_mask\t00000000\teveryone_mask\t00000000\tnext_owner_mask\t7fffffff\tcreator_id\t2bbff43c-e25d-4514-9c28-81bceb372b9c\towner_id\t2bbff43c-e25d-4514-9c28-81bceb372b9c\tlast_owner_id\t00000000-0000-0000-0000-000000000000\tgroup_id\t00000000-0000-0000-0000-000000000000}\tasset_id\t94362507-033d-9680-d18b-1baf24d0da83\ttype\ttexture\tinv_type\tsnapshot\tflags\t00000000sale_info\t0{\tsale_type\tnot\tsale_price\t10}\tname\tSeneca's Buildings|\tdesc\tSeneca's buildings|\tcreation_date\t1161405411}\r\n"
        //"item_id\t064c58be-30e1-d5ff-ff8c-94b25bf17e8d\tparent_id\t12a86241-ab3d-49c0-ae75-c067cede6cb4permissions 0{\tbase_mask\t7fffffff\towner_mask\t7fffffff\tgroup_mask\t00000000\teveryone_mask\t00000000\tnext_owner_mask\t7fffffff\tcreator_id\t2bbff43c-e25d-4514-9c28-81bceb372b9c\towner_id\t2bbff43c-e25d-4514-9c28-81bceb372b9c\tlast_owner_id\t00000000-0000-0000-0000-000000000000\tgroup_id\t00000000-0000-0000-0000-000000000000}\tasset_id\t94362507-033d-9680-d18b-1baf24d0da83\ttype\ttexture\tinv_type\tsnapshot\tflags\t00000000sale_info\t0{\tsale_type\tnot\tsale_price\t10}\tname\tSeneca's Buildings|\tdesc\tSeneca's buildings|\tcreation_date\t1161405411}\r\n"
        //"item_id\t064c58be-30e1-d5ff-ff8c-94b25bf17e8d\tparent_id\t12a86241-ab3d-49c0-ae75-c067cede6cb4permissions 0{\tbase_mask\t7fffffff\towner_mask\t7fffffff\tgroup_mask\t00000000\teveryone_mask\t00000000\tnext_owner_mask\t7fffffff\tcreator_id\t2bbff43c-e25d-4514-9c28-81bceb372b9c\towner_id\t2bbff43c-e25d-4514-9c28-81bceb372b9c\tlast_owner_id\t00000000-0000-0000-0000-000000000000\tgroup_id\t00000000-0000-0000-0000-000000000000}\tasset_id\t94362507-033d-9680-d18b-1baf24d0da83\ttype\ttexture\tinv_type\tsnapshot\tflags\t00000000sale_info\t0{\tsale_type\tnot\tsale_price\t10}\tname\tSeneca's Buildings|\tdesc\tSeneca's buildings|\tcreation_date\t1161405411"
        public static Item Create(string sc_inv_line)
        {
            //Remove the begining and brackets
            sc_inv_line = sc_inv_line.Replace("\n\t", "");
            sc_inv_line = sc_inv_line.Replace("\tinv_item\t0{\t", "");
            sc_inv_line = sc_inv_line.Replace("}\r\n", "");
            //sc_inv_line = sc_inv_line.Replace("}", "");

            string[] seperators = new string[] { "item_id\t", "\tparent_id\t", "permissions 0{\t", "}\tasset_id\t", "}\tshadow_id\t", "\ttype\t", "\tinv_type\t", "\tflags\t", "sale_info\t0{\t", "}\tname\t", "\tdesc\t", "\tcreation_date\t" };
            string[] allpieces  = sc_inv_line.ToString().Split(seperators, StringSplitOptions.None);

            string Item_id       = allpieces[1].Trim();
            string Parent_id     = allpieces[2].Trim(); //the object it belongs to
            string Perms         = allpieces[3].Trim(); //"base_mask\t7fffffff\towner_mask\t7fffffff\tgroup_mask\t00000000\teveryone_mask\t00000000\tnext_owner_mask\t7fffffff\tcreator_id\t2bbff43c-e25d-4514-9c28-81bceb372b9c\towner_id\t2bbff43c-e25d-4514-9c28-81bceb372b9c\tlast_owner_id\t00000000-0000-0000-0000-000000000000\tgroup_id\t00000000-0000-0000-0000-000000000000"
            string Asset_id      = allpieces[4].Trim(); //May also be shadow_id
            string sType         = allpieces[5].Trim();
            string Inv_type      = allpieces[6].Trim();
            string sFlags        = allpieces[7].Trim();
            string sale_info     = allpieces[8].Trim();                                      //"sale_type\tnot\tsale_price\t10"
            string Name          = allpieces[9].Remove(allpieces[9].Length - 1, 1).Trim();   // The text of the object (shown in the inventory)
            string Desc          = allpieces[10].Remove(allpieces[10].Length - 1, 1).Trim(); //Removes trailing '|'
            string Creation_date = allpieces[11].Remove(allpieces[11].Length - 2, 2).Trim(); //Removes trailing '}'

            return(new Item(Item_id, Parent_id, Asset_id, sType, Inv_type, sFlags, Name, Desc, Creation_date,
                            permissions.Create(Perms), SalesInfo.Create(sale_info)));
        }
Exemplo n.º 2
0
 public Item(string _item_id, string _parent_id, string _asset_id, string _type, string _inv_type, string _flags, string _name, string _desc, string _creation_date, permissions _permission, SalesInfo _salesinfo)
 {
     item_id       = _item_id;
     parent_id     = _parent_id;
     asset_id      = _asset_id;
     type          = _type;
     inv_type      = _inv_type;
     flags         = _flags;
     name          = _name;
     desc          = _desc;
     creation_date = _creation_date;
     permission    = _permission;
     salesinfo     = _salesinfo;
 }
Exemplo n.º 3
0
 public Item(string _item_id, string _parent_id, string _asset_id, string _type, string _inv_type, string _flags, string _name, string _desc, string _creation_date, permissions _permission, SalesInfo _salesinfo)
 {
     item_id = _item_id;
     parent_id = _parent_id;
     asset_id = _asset_id;
     type = _type;
     inv_type = _inv_type;
     flags = _flags;
     name = _name;
     desc = _desc;
     creation_date = _creation_date;
     permission = _permission;
     salesinfo = _salesinfo;
 }