|
alluran Adept
Joined: 14 Sep 2005 Posts: 223 Location: Sydney, Australia
|
Posted: Fri Dec 22, 2006 11:01 am
Bug? With Database Variables + Certain Characters |
ok, heres the data you need to replicate the bug and toy around to see how it affects the value of the variable (currently this bug takes my portalscript offline for shared works because it's too random from a scripting point of view to work around and i dont want to write a hack that could cause other issues)
Quote: |
Variable: + Portals (Record) Amulet"amulet aardwolf (245361)|1|Dead Mans Chest|1|0|1|23213"UltimaTrivia Portal Moongate Ultima|1|Dead Man Chest|1|0|1|30508
|
Now the problem is this: i never stored any " marks in the database.
The (245361) is what causes the marks to appear, if i dont include the items unique serial it works fine.
I then tested it by adding a fake serial to the second entry, expecting a fairly similar result as the first entry in the database, but no, here's what i got:
Quote: |
Variable: + Portals (Record) Amulet""amulet aardwolf (245361)|1|Dead Mans Chest|1|0|1|23213""Ultima"Trivia Portal (12345) Moongate Ultima|1|Dead Man Chest|1|0|1|30508"
|
Notice it double quotes the first entry now, and single quotes the second
That pretty much wraps up the bug, and how to simulate it.
Have fun :) and nice work, i hope, with cMud (only just trying to code for it) |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Wed Jan 17, 2007 7:52 pm |
I don't see the commands that you used to create this variable. You should not be trying to create a database variable or string list yourself. You should be using #ADDITEM (for string lists) or #ADDKEY (for database variables). zMUD and CMUD will insert quotes as needed when you try to use special characters in these variables. zMUD/CMUD also use parenthesis to store "sublists" so that you can store a string list within another string list.
But without the exact commands that you used to create the variables, I can't really test this very much. |
|
|
|
alluran Adept
Joined: 14 Sep 2005 Posts: 223 Location: Sydney, Australia
|
Posted: Wed Jan 17, 2007 10:58 pm |
The portal script is actually located in the packages library, will try and pin the exact code down later. And i agree, manually creating database variables can be messy because of the special characters it uses, but string lists have never really been a problem for me in zmud
|
|
_________________ The Drake Forestseer |
|
|
|
alluran Adept
Joined: 14 Sep 2005 Posts: 223 Location: Sydney, Australia
|
Posted: Wed Jan 17, 2007 11:03 pm |
Code: |
#var Portals {%addkey( @Portals/Data/Portals, $keyWord, $portalName|%if( %pos( ., $bagName), %left( $bagName, %pos( ., $bagName)-1), 1)|%char( 34)%if( %pos( ., $bagName), %right( $bagName, %pos( ., $bagName)), $bagName)%char( 34)|%if( %len( $level), $level, 1)|%if( %len( $isChaos), $isChaos, 0)|1|%roomvnum( ))} _nodef {Portals|Data} |
Ok, so i'm forming the string list manually, but i still think you're missing the real bug here, assume i create 2 entries and neither of them have a number surrounded by (these) as a keyword, but i then open up the editor, and add (12345) to the first one, save, and close the editor. When i go back, it will have automatically added quotes (in the wrong spots), and if i add the same thing to the second entry, it adds even more quotes |
|
_________________ The Drake Forestseer |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Wed Jan 17, 2007 11:33 pm |
Ahh, ok, I misunderstood that you were adding the (12345) in the settings editor itself. I'll add this to the bug list and take a look at it.
|
|
|
|
|
|
|
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
|
|