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 Goto page 1, 2  Next
Arde
Enchanter


Joined: 09 Sep 2007
Posts: 605

PostPosted: Thu Nov 22, 2007 10:15 pm   

[2.13 - 2.14a] Button states wiped out from the package
 
This is really driving me insane. I have a problem with button states in my primary package.
After installing 2.13 I opened my session offline, checked what's new in it, closed CMUD, ran it again and opened my session. All buttons that had any additional states have lost them completely. That includes state info, associated script - everything within <state> tags in xml view. Here is an example.
Before:
Code:
<button name="btnActAutoTgt" type="Toggle" variable="valActAutoTgt" transparent="false" color="white" priority="2100" id="192">
  <caption>Auto Target: OFF</caption>
  <tooltip>How scripts will handle commands without a target</tooltip>
  <state caption="Auto Target: ON" color="lime"></state>
</button>

After:
Code:
<button name="btnActAutoTgt" type="Toggle" variable="valActAutoTgt" transparent="false" color="white" priority="2100" id="192">
  <caption>Auto Target: OFF</caption>
  <tooltip>How scripts will handle commands without a target</tooltip>
</button>


Another clean install did not helps me.

I tried to figure out what is goin on here and after several tries and restores I found that if I change some options in the Preferences window (for ex., turn off and turn back on Pueblo emulation) while having my session opened, after CMUD restart all buttons will lose their state info.

UPDATE: Well, it happening even if I do not change anything in the Preference window. So I take my words back about changing an option in preference window causing this bug to occur.


Last edited by Arde on Sat Dec 01, 2007 11:07 pm; edited 3 times in total
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Fri Nov 23, 2007 3:34 am   
 
I tried this with an empty session and it works just fine for me. Is it only happening in one package file?
_________________
Asati di tempari!
Reply with quote
Arde
Enchanter


Joined: 09 Sep 2007
Posts: 605

PostPosted: Fri Nov 23, 2007 4:55 am   
 
Yes, it is only happening with my package.

Firstly I wrote that this happening while 2.13 is saving settings from 2.12 and never happens with newly created states. But after I found that even new states not get saved every time in my package.
_________________
My personal bug|wish list:
-Wrong Priority when copy-paste setting
-1 prompt trigger for Mapper, Session and General Options, not 3 different!
-#SECTION can terminate threads
-Buttons can't start threads
Reply with quote
Arde
Enchanter


Joined: 09 Sep 2007
Posts: 605

PostPosted: Fri Nov 23, 2007 8:34 pm   
 
I can add that if I use "Export to XML" command of PE before closing of CMUD, my package saved properly. I tried 6 times in a row (and even got 1 crash while trying) but nothing happened.
Next, I tried closing CMUD without exporting to xml and "successfully" lost buttons state info from the second try.
Something is definitely happening with settings saving on CMUD exit.
_________________
My personal bug|wish list:
-Wrong Priority when copy-paste setting
-1 prompt trigger for Mapper, Session and General Options, not 3 different!
-#SECTION can terminate threads
-Buttons can't start threads
Reply with quote
Zugg
MASTER


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

PostPosted: Mon Nov 26, 2007 4:54 pm   
 
If it's only happening in one of your packages, please email me the *.PKG file to sales@zuggsoft.com so that I can try to reproduce this.
Reply with quote
Arde
Enchanter


Joined: 09 Sep 2007
Posts: 605

PostPosted: Mon Nov 26, 2007 6:11 pm   
 
I sent it.
_________________
My personal bug|wish list:
-Wrong Priority when copy-paste setting
-1 prompt trigger for Mapper, Session and General Options, not 3 different!
-#SECTION can terminate threads
-Buttons can't start threads
Reply with quote
Zugg
MASTER


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

PostPosted: Mon Nov 26, 2007 6:21 pm   
 
OK, thanks, I got it.
Reply with quote
Arde
Enchanter


Joined: 09 Sep 2007
Posts: 605

PostPosted: Mon Nov 26, 2007 6:42 pm   
 
I just tried it once more and I've got partial states loss. Some buttons lost their info on other states while others keep it intact.
_________________
My personal bug|wish list:
-Wrong Priority when copy-paste setting
-1 prompt trigger for Mapper, Session and General Options, not 3 different!
-#SECTION can terminate threads
-Buttons can't start threads
Reply with quote
Arde
Enchanter


Joined: 09 Sep 2007
Posts: 605

PostPosted: Sat Dec 01, 2007 11:06 pm   
 
Still the issue in 2.14a. At least for me.
_________________
My personal bug|wish list:
-Wrong Priority when copy-paste setting
-1 prompt trigger for Mapper, Session and General Options, not 3 different!
-#SECTION can terminate threads
-Buttons can't start threads
Reply with quote
Zugg
MASTER


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

PostPosted: Mon Dec 03, 2007 5:50 pm   
 
Yep, sorry Arde, but I didn't have time to get to this bug yet in 2.14. Hopefully this week.
Reply with quote
Arde
Enchanter


Joined: 09 Sep 2007
Posts: 605

PostPosted: Mon Dec 03, 2007 5:54 pm   
 
Zugg
Heh, you have answered while I upload images for this thread. Smile Anyway, I hope this will help:

=====

I've got pissed off with this bug preventing me from writing any scripts for several weeks now, so I decided to go and check something else, for example, my old bug report for v. 2.03 that Editor does something wrong while edit button states. But right after I've start with the Editor, I find what I believewas a relative bug, now in the untitled package. The procedure is quite long because we need to create 2 multistate buttons with several states (one regular and one bugged for comparision) and make them from the Editor.

Originally the main objective of my test was to check this Zugg reply:
Quote:
I'll take a look at the order in which button states are added in the future, but this is still a fairly low priority right now. It is supposed to add a new state after the currently selected state, unless the main button is selected in which case it adds a new state to the end.


1) Start CMUD, hit Esc.
2) Open the Editor

Creation of a regular button:
3) New->Button (Name: TestButton, Script:#SAY TestButton), Save Changes
4) Change button type to Multistate. Click Save Changes now!
5) New->Add Button State (Name: State 1, Script: #SAY Hello from State 1!), Save Changes
6) New->Add Button State (Name: State 2, Script: #SAY Hello from State 2!), Save Changes
N.B. Sometimes I receive wrong states order even here (state 2 get inserted before State 1, not to the end).

Note that state captions in the tree view are empty, although I used literals, not @var syntax

Creation of a bugged button.
(a short break in the procedure in order to let you understand what type of bug you may see)
I don't know what you will see at this point, although I did my best trying to figure out exact procedure steps. In my tests I saw 2 types of bugs:
a) New states get inserted in the beginning of current button states list, not to the end (pretty common and annoying bug)


b) New states has been shown in the tree with wrong indention as if they would belong to the package itself (serious bug, this one also cause all states info getting lost, right as it was in my package. The xml tab shows no <state> tags, only "value" tag, but replaces its value with currently selected state info) AND new states gets strange state number (not starting from 1). Look like states counter does not reset after previous button.


Steps to see bug type a:
7) New->Button (Name: Test, Script:#SAY TestButton2)
8) Change button type to Multistate. Save Changes now!.
9) New->Add Button State (Name: State 1a, Script: #SAY Hello from State 1a!), Save Changes
10) New->Add Button State (Name: State 2a, Script: #SAY Hello from State 2a!), Save Changes

Steps to see bug type b:
7) New->Button (Name: TestButton2, Script:#SAY BuggedButton) Note that this button name alphabetically must goes *after* the regular button name, i.e. sorting order matters. Save Changes.
8) Change button type to Multistate. DO NOT Save Changes now! Instead, click on the package name ('untitled'). Click back on the TestButton2 in the tree.
9) New->Add Button State (Name: State 1b, Script: #SAY Hello from State 1b!), Save Changes. Note state indention in the tree and the number that this state received (not 1)
10) New->Add Button State (Name: State 2b, Script: #SAY Hello from State 2b!), Save Changes. Again, note state indention in the tree and the number that this state received (not 1)
11) Close the Editor and try to click on both buttons. See the difference.

All bugs in one place:
Reply with quote
ardwick
Novice


Joined: 31 May 2007
Posts: 32

PostPosted: Mon Dec 03, 2007 6:36 pm   Re: [2.13 - 2.14a] Button states wiped out from the package
 
My button states have not come over perfectly clean either. However, they all work properly and when you are in your main window and click a multi-state
button, the drop down list shows everything correctly. Within the editor it is different.

Here's an example:

<button type="Multistate" autosize="false" toolbar="3" priority="3" id="771">
<caption>Corpse Options</caption>
<state caption="Sacrifice">#t- auto_decap
#t+ auto_sac
#t- auto_skin
#t- auto_butcher
#variable corpse SACRIFICE</state>
<state caption="Skin">#t- auto_decap
#t- auto_sac
#t+ auto_skin
#t- auto_butcher
#variable corpse SKIN</state>
<state caption="Butcher">#t- auto_decap
#t- auto_sac
#t- auto_skin
#t+ auto_butcher
#variable corpse BUTCHER</state>
<state caption="Nothing">#t- auto_decap
#t- auto_sac
#t- auto_skin
#t- auto_butcher
#variable corpse NOTHING</state>
<state caption="Decapitate">#t+ auto_decap
#t- auto_sac
#t- auto_skin
#t- auto_butcher
#variable corpse DECAP</state>
</button>

Should show up like (and does in the main window):

Corpse Options
Sacrifice
Skin
Butcher
Nothing
Decapitate


However, in the editor window, it shows up like:

Corpse Options
1:Decap ON
2:Decap ON
3:Decap ON
4:Decap ON
5:Decapitate

But, each option executes the proper code. And the Caption box for each selection shows the correct "state name" that I want. It just doesn't
show up in the tree on the left when you expand the multi-state button.

When I loaded 2.14, I uninstalled 1.34 and 2.13 (was running side by side). Installed 2.14 into main CMUD directory and started.
The sessions showed up as is and I ran from there.

After I discovered this issue, I deleted the sessions, created new sessions and imported the XML that I created before I installed 2.14.
The button states did not import very well from that XML file. None of the button states were attached to the main button. Instead,
it created individual buttons for each multi-state option. And again, in my editor, they showed up like above.


Creating a new multi-state button creates it like it should.
Reply with quote
Zugg
MASTER


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

PostPosted: Mon Dec 03, 2007 11:04 pm   
 
Arde: I'm having a problem with your procedure:

3) New->Button (Name: TestButton, Script:#SAY TestButton), Save Changes
4) Change button type to Multistate. Click Save Changes now!

As soon as I click Save Changes in step 4, CMUD properly creates the first state of the button and shows "1:" in the tree. So you don't need to select Add Button State here. If you select Add Button State, then you get a second "2:" button state.

So, I cannot reproduce your steps for button bug type a.

I *did* reproduce your "bug type b" and have added that to the bug list.

Ardwick: I reproduced the display bug in the tree view using your button XML and I have that fixed for v2.15.
Reply with quote
Zugg
MASTER


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

PostPosted: Mon Dec 03, 2007 11:11 pm   
 
OK, bug type "b" should be fixed now in 2.15.

Edited: OK, I have also found the problem with getting the new child state added first instead of last.

Several of these bugs required that the package editor be "filtered" by clicking the Buttons button in the main toolbar, rather than just pressing Ctrl-G to open the settings editor. So it's always important to note exactly how you open the settings editor.
Reply with quote
Arde
Enchanter


Joined: 09 Sep 2007
Posts: 605

PostPosted: Tue Dec 04, 2007 4:50 am   
 
Zugg wrote:
Edited: OK, I have also found the problem with getting the new child state added first instead of last.

Several of these bugs required that the package editor be "filtered" by clicking the Buttons button in the main toolbar, rather than just pressing Ctrl-G to open the settings editor. So it's always important to note exactly how you open the settings editor.


I'm not using filters, thats why I did not mention them. May be there is something else that triggers this bug to appear. Even with my procedure you have a chance that state will be inserted in correct order, as on my first screenshot (state 4b goes correctly after 3b, although I did the same action for all of them)

***UPDATE***
I just noticed that on my first screenshot in the tree view state 4b goes after 3b while in the xml view 4b goes before 3b! There is a syncronisation bug as well!
Same thing and on the last screenshot, see states 2a and 3a.
***

***UPDATE 2***
BTW, why did you named xml tag "packages"???
***

But please, check my package anyway, because these bugs may be different even they looks similar.
Reply with quote
Zugg
MASTER


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

PostPosted: Tue Dec 04, 2007 10:58 pm   
 
OK, I tried your Sloth.pkg file in v2.15 and I cannot get it to fail. Everytime I load it all of the buttons (including the btnActAutoTgt shown at the beginning of this post) look and work fine. I tried going into the Prefs and changing the Pueblo flag on and off and then exited CMUD. When CMUD was reloaded, the buttons were still all fine.

Unfortunately I cannot reproduce the data loss that you are getting. Even though I've fixed the various bugs with the Package Editor and how it displays the button states, I don't think any of those really have any effect on the button state loss (because the settings editor is never even opened in my tests).

So, I either need a more complete, step-by-step procedure for getting this to fail, or I'm probably not going to be able to fix it.
Quote:
BTW, why did you named xml tag "packages"???

The "packages" tag is used in Windows/Modules to list the packages that should be enabled for the given Window/Module. Is there a problem with that?
Reply with quote
Arde
Enchanter


Joined: 09 Sep 2007
Posts: 605

PostPosted: Wed Dec 05, 2007 5:50 am   
 
There is no procedure, Zugg. Or, the procedure is:
1) Open CMUD
2) Load the package (open session offline)
3) Close CMUD with red cross

This is the shortest procedure that may cause the buttons to loose their state info. I have no instruments to catch what is happening. If someone can suggest how I can track changes in real-time - you welcomed.

Next, if buttons don't want to loose their states from the first or second try, I usually perform very simple activity while in offline session. That includes clicking on different buttons (push, toggle, multistate) 10-20 times, opening of the Editor window, opening of the Debugger window. That's all. I left at least 1 toggle button in pressed position, multistates in some state (I have variables to track button states between sessions). Then I close CMUD. I need no more than 2 CMUD restarts to get buttons with lost states. So again, I can't determine what causing this bug to appear. Sorry, Zugg. Sad

===
About packages tag - I just wondered why you are using "window", "button", "module", but "packageS". There is no problem with it. I've forget that there is a list of several packages should be.
Reply with quote
Arde
Enchanter


Joined: 09 Sep 2007
Posts: 605

PostPosted: Wed Dec 05, 2007 12:37 pm   
 
Does buttons info forced to save at the session close (CMUD exit)? I've see that buttons with changing captions recompiles each time I press them, therefore CMUD considers them as "edited", therefore CMUD must save all changes to settings in the end. How it handles the case when a button left in pressed position? Does state info actually gets to database or lost somewhere?

What I can suggest else is to send you 2 packages: original package and the package after this bug has happened. May be there is everything fine with the package, but CMUD somehow fails to read it?

My last suggestion for you to make a quick release 2.14b with fixed bugs for buttons editor. May be they are related, after all...
Reply with quote
Zugg
MASTER


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

PostPosted: Wed Dec 05, 2007 6:35 pm   
 
Quote:
Does state info actually gets to database or lost somewhere?

Only if you have a Variable assigned to the button. Then the variable value will get saved, which saves the button state. Otherwise the button state doesn't get saved.

And yes, Arde is correct: If you could send me a copy of the *.PKG file after it has lost the button info, then I can compare it with the existing file to try and figure out what might have happened.

I tried loading it and clicking on various buttons and still couldn't get it to fail.

I don't plan for any 2.14b release, but I will release the 2.15 version on Friday in the Beta forum and then allow the weekend for further testing before I "publish" the new version to the main forums. That will allow me to do any quick-fix that might be needed over the weekend.
Reply with quote
Arde
Enchanter


Joined: 09 Sep 2007
Posts: 605

PostPosted: Wed Dec 05, 2007 11:02 pm   
 
I can't force this bug to show up today! Confused Will try later again.
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Thu Dec 06, 2007 12:25 pm   
 
Well this bug is REALLY on my last nerve. I've exported and reimported XML and even reinstalled CMUD completely. Yet when I close CMUD after adding something and then the next time I reopen it the button states all vanished.

I can't wait for 2.15 tomorrow.
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Thu Dec 06, 2007 2:01 pm   
 
The bug looks to actually be an interaction between the XML view of a button and activation of the button. The also something specific about using a session versus the untitled with this bug.

Procedure
1. Launch CMud
2. Create new session with name of 'test'
3. Open 'test' session offline
4. Open Package Editor (CTRL-G)
5. Left click in tree panel
6. Paste button in
Code:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
  <button name="btnActAutoTgt" type="Toggle" variable="valActAutoTgt" transparent="false" color="white" priority="2100">
    <caption>Auto Target: OFF</caption>
    <tooltip>How scripts will handle commands without a target</tooltip>
    <state caption="Auto Target: ON" color="lime"></state>
  </button>
</cmud>

7. Click on the XML tab for the button
8. Close Package Editor with X
9. Click on button to toggle it to the second state
10. Close CMud with big X
At this point the button state is not saved to the package. There is a clear missing spot if you view the .pkg with a db editor.

Attempting the same procedure with adjustments to use the untitled session actually saved the toggle state into the untitled.pkg correctly. Definitely more going on with this than is obvious.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Zugg
MASTER


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

PostPosted: Thu Dec 06, 2007 2:57 pm   
 
Thanks for the procedure Vijilante!! I was able to reproduce the bug using your procedure. It really is a tricky one. After it failed to save, I added the button again and it *did* save the second time. Anyway, hopefully I'll be smart enough to figure out how to fix this today before 2.15 is released. If it wasn't for your procedure, I would have never found this one.
Reply with quote
Zugg
MASTER


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

PostPosted: Thu Dec 06, 2007 3:59 pm   
 
Found it!

OK, this was a really nasty one. When CMUD closes, it deletes all settings from memory. If the background SQL updater thread was still running, then it could detect these deletions and write them to the *.PKG database file. The timing had to be exactly right for this to happen. I'm not sure what exactly about Vjilante's procedure caused this timing to happen every time, but it did.

In 2.15 I properly terminate the background updater thread *before* clearing all of the settings from memory, and now this bug seems to be fixed.

The reason it only effected button states is that when settings are deleted from memory, most settings have already deleted the internal database cache first, and has marked it so that this doesn't propagate to the disk database file. But when a Button is deleted, it loops through it's button states and deletes them from the internal cache, and these deletions were not getting flagged as temporary, so these changes could get saved to the disk file.

So, very obscure...only effected button states and had to have the timing just right.
Reply with quote
Arde
Enchanter


Joined: 09 Sep 2007
Posts: 605

PostPosted: Thu Dec 06, 2007 5:33 pm   
 
Nice, Zugg!
And what a pity that Vijilante didn't drop in here earlier! Wink Thanks for excellent procedure!
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
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