Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Sat Jun 05, 2010 7:33 pm   

[3.18d]BUG: Copy/paste db variables with string list values reorders string list
 
I was doing some testing with database variables, and therefore was bringing one of my own variables from an existing session to an untitled session. I copied it, and when I pasted it into the untitled session, the string lists were completely reordered (seems to have been sorted).

As you might imagine, this will create problems with scripts that depend on %item usage. Here is the variable this was tested with:

Code:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
  <var name="Portals" type="Record" sorted="true" json="true" copy="yes">{"Adaldar":["Permanent Peace",1,"bag1",150,0,1,43645],"Aiighialla":["teleport device denali",1,"bag1",140,0,1,40037],"AllinaFaykeDay":["Wizards Prism",1,"bag1",10,0,1,40269],"AmazonNation":["queen melosa mirror",1,"bag1",100,0,1,4137],"Angband":["black darkness angband",1,"bag1",130,0,1,12099],"ArisianRealm":["arisian portal dolphin",1,"bag1",150,0,1,15189],"ArtificersMayhem":["compendium fal shara royal history q6",1,"bag1",180,0,1,12424],"AstralPlanes":["strange metal amulet planes",1,"bag1",25,0,1,42854],"AylorianAcademy":["academy portal",1,"bag1",1,0,1,42362],"BlackLagoon":["black lagoon pendant",1,"bag1",160,0,1,12518],"CallofHeroes":["aura sage portal whirlwind vortex",1,"bag1",5,0,1,41344],"Casino":["chip poker",1,"bag1",90,0,1,9737],"Cataclysm":["golden crown laurels victor",1,"bag1",147,0,1,9280],"CougarianQueendom":["trust cowlina cougarian",1,"bag1",100,0,1,16450],"Crecall":["vortex light Charneus",1,"bag1",1,0,1,45680],"DarkElf":["glowing sphere enchanted dreams",1,"bag1",75,0,1,9971],"DarkLight":["orb star",1,"bag1",85,0,1,6884],"Deadlights":["Seal Timeless Ages serpents dimensional infinitely",1,"bag1",160,0,1,8802],"DeathGate":["entrance death gate",1,"bag1",180,0,1,11315],"Deneria":["mirror deneria past",1,"bag1",70,0,1,43399],"DesertDoom":["Desert Doom",1,"bag1",141,0,1,14136],"DesertPrison":["gate rune",1,"bag1",130,0,1,10498],"DiamondReach":["heliodor shard portal",1,"bag1",60,0,1,9150],"DrageranAudience":["ornate scroll royal audience",1,"bag1",142,0,1,8525],"DrageranBackstage":["backstage pass",1,"bag1",132,0,1,8502],"DragonMountain":["dragon amulet warding",1,"bag1",98,0,1,9329],"DreadTower":["Broken Curse",1,"bag1",140,0,1,13449],"Dune":["Muad'dib's thoughts visions",1,"bag1",152,0,1,7094],"EighteenthDynasty":["Hatshepsut cartouche",1,"bag1",120,0,1,12700],"Entropy":["lemniscate",1,"bag1",121,0,1,40066],"EternalAutumMap":["map woods eternal map_woods_autumn",1,"bag1",170,0,1,40215],"Falcovnia":["crystal ball",1,"bag1",98,0,1,6033],"Fens":["dreary hole despair",1,"bag1",200,0,1,17281],"FlyingCitadel":["majestic orb",1,"bag1",50,0,1,13469],"GiantsPetStore":["employee entrance pet collar",1,"bag1",10,0,1,40870],"Gilda":["Sir Lauren Despair",1,"bag1",120,0,1,2489],"GladiatorsArena":["lifetime pass gladiator arena",1,"bag1",80,0,1,28783],"GoblinFortress":["portal hopefully Goblin warplans",1,"bag1",60,0,1,13966],"GoldRush":["train ticket",1,"bag1",42,0,1,2443],"Hades":["golden obol hadesportal",1,"bag1",190,0,1,13294],"Helegear":["ice portal helegear gvozd",1,"bag1",130,0,1,41416],"Horath":["dragon amulet warding",1,"bag1",98,0,1,9329],"HouseofCardsTrump":["card benedict trump portal",1,"bag1",100,0,1,43727],"Illoria":["sigul illoria",1,"bag1",60,0,1,16529],"ImmortalHomes":["amulet aardwolf (294217)",1,"bag1",1,0,1,13299],"ImperialNation":["dark crystal",1,"bag1",83,0,1,7925],"Insanitaria":["flower Cedria preserved portal",1,"bag1",85,0,1,40124],"Kearvek":["dark orb vampires",1,"bag1",160,0,1,6533],"KillingFields":["trip forbidden",1,"bag1",60,0,1,12795],"Knossos":["passport knossos portal",1,"bag1",61,0,1,13720],"Labyrinth":["yoke wooden",1,"bag1",15,0,1,13571],"LandofLegend":["portal apple press",1,"bag1",10,0,1,16252],"LostTime":["time capsule timegold interesting item",1,"bag1",80,0,1,12154],"MYST":["white page",1,"bag1",1,0,1,7360],"MarshlandsofAgroth":["chip willow bark portal",1,"bag1",105,0,1,16545],"MasqueradeIsland":["masquerade mask",1,"bag1",100,0,1,41459],"Mossflower":["joseph bell",1,"bag1",150,0,1,12221],"Nanjiki":["magic banana",1,"bag1",140,0,1,12651],"Pompeii":["pompeii black volcanic glass",1,"bag1",85,0,1,16206],"Qong":["Wok Qong",1,"bag1",201,0,1,41592],"Reme":["mirror two",1,"bag1",30,0,1,1862],"STTNGHotel":["share ownership royale",1,"bag1",100,0,1,7805],"STTNGLock":["transporter lock brooch",1,"bag1",100,0,1,7827],"STTNGTasha":["tasha hologram device button sasha",1,"bag1",100,0,1,7816],"SchoolofHorror":["book demon school handbook",1,"bag1",150,0,1,1441],"SchoolofHorrorBox":["jewelry box",1,"bag1",190,0,1,1440],"ShadarLogoth":["mists mashadar portal misty",1,"bag1",99,0,1,6433],"ShadarLogothSwords":["book crown swords",1,"bag1",190,0,1,6528],"ShayolGhul":["ivory horn valere",1,"bag1",140,0,1,10970],"SnucklesVillage":["Enchanted Spellbook",1,"bag1",80,0,1,17062],"SoulbladeCheat":["computer disk cheat code",1,"bag1",150,0,1,2216],"TakedasWarcamp":["tiger kai ivory",1,"bag1",182,0,1,9827],"TalsaCosmic":["cosmic calling",1,"bag1",150,0,1,45179],"TalsaEvil":["evil intentions",1,"bag1",100,0,1,2643],"TalsaIrresistible":["irresistible calling",1,"bag1",60,0,1,2697],"TheLabyrinth":["yoke wooden",1,"bag1",15,0,1,13571],"TirnanOg":["fairy ring portal pale mushrooms",1,"bag1",100,0,1,13496],"TreeOfLife":["starburst",1,"bag1",170,0,1,12326],"UnearthlyBonds":["DIS badge",1,"bag1",130,0,1,13769],"Verdure":["holy well clay figurine wellfigurine",1,"bag1",120,0,1,13897],"WaroftheWizards":["honeycomb",1,"bag1",15,0,1,14651],"XylsMosaic":["Envelope xyl_mosaic_item",1,"bag1",100,0,1,41177],"Yggdrasil":["tree crystal yggdrasil",1,"bag1",185,0,1,11505],"YurgachDomain":["kali's kalis necklace pendant chain silver",1,"bag1",85,0,1,7963],"Zyian":["Medallion Daemon Zyian",1,"bag1",110,0,1,12374]}</var>
</cmud>


Charneus
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Sat Jun 05, 2010 7:55 pm   
 
Umm, well, you'll notice in the first line:

sorted="true"

so yes, obviously it was set to be sorted at some point. So it's doing what it should. If you can come up with a procedure where this is happening without turning on the sort flag, then definitely post a procedure.
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Sat Jun 05, 2010 8:04 pm   
 
Erm, tell me why the VALUES should be sorted, not just the records? As far as I know, the values should not be affected by sort (as this has never happened in the past - it's just always been the records, which in this case, I wanted sorted in alphabetical order).

Charneus
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Sun Jun 06, 2010 2:29 am   
 
With nested tables, sorting the top-level table will cause all nested tables to be sorted too. Sorry, that's just how it works.
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Sun Jun 06, 2010 3:07 am   
 
Well, that's unfortunate because it never did that before... *sigh* Oh well. Guess I'll remove the sort function. Thanks anyway.

Charneus
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Sun Jun 06, 2010 3:18 am   
 
Ah, it appears that copying, it sorts both the keys and the values, but if you have it in the settings editor and sort it, it only sorts the records. I suppose I can deal with that.

Charneus
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Mon Jun 07, 2010 4:59 pm   
 
Actually, I think I found a way to fix this. So I'll give it a try in the next version so that it only sorts the top-level data structure and not the nested structures.
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Mon Jun 07, 2010 5:11 pm   
 
Greatly appreciated! It just doesn't make sense to sort everything... :P

Charneus
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net