[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Suggestions
. . -> [Subject]  Preventing save.
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Preventing save.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Poromenos   Greece  (1,037 posts)  [Biography] bio
Date Wed 26 Oct 2005 12:20 AM (UTC)
Message
Right now, MUSHclient saves my worlds (I have set it to save on close) even though nothing has changed. This changes the dates and messes up my repository (I keep the files in an SVN repository to update between clients easily). Is there a way I can prevent this, or can an option be implemented to not save if nothing has changed (or follow the option that already exists if only variables have changed). It is far more important for me to not get a message box asking me to save than getting dates changed, though.

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
[Go to top] top

Posted by Nick Gammon   Australia  (21,386 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Wed 26 Oct 2005 01:26 AM (UTC)
Message
The auto-save only saves if it thinks the world is modified. See:

http://www.gammon.com.au/scripts/doc.php?function=GetInfo

You can do a GetInfo (111) to see if this flag is set, and by doing it from time-to-time see when it was set.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Poromenos   Greece  (1,037 posts)  [Biography] bio
Date Reply #2 on Wed 26 Oct 2005 01:46 AM (UTC)
Message
Hmm, you're right. It doesn't seem to always save the world, but I did a diff on a world that has changed and all that changed was the dates. What's up with that? I can't see why it would save with nothing changing.

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
[Go to top] top

Posted by Nick Gammon   Australia  (21,386 posts)  [Biography] bio   Forum Administrator
Date Reply #3 on Wed 26 Oct 2005 11:08 PM (UTC)
Message
Well it doesn't keep an entire copy of the "before" and "after" and compare them at the last moment. What it does is set a "document is modified" flag whenever it thinks you have changed something (eg. modified a trigger). It tries to be smart and compare the before and after of each field, even if you just look at a trigger and click OK.

However if you change something, eg. the note colour from blue to green, and then (later) from green back to blue, that counts as 2 changes, not zero changes, even though the net effect is that the colour is back to how it was.

There is possibly a bug in MUSHclient, or possibly you are changing things that don't really count (eg. in a plugin). I think a while ago there was a bug where changes (eg. to triggers) in plugins counted as changes when they weren't really a change to the main document.

In fact, a quick browse of the code seems to indicate that is still a problem. Can you isolate it down a bit? By checking GetInfo (111) can you confirm that the problem crops up (ie. the world modified flag is set) after you do something like add a trigger in a plugin?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Poromenos   Greece  (1,037 posts)  [Biography] bio
Date Reply #4 on Wed 26 Oct 2005 11:12 PM (UTC)

Amended on Wed 26 Oct 2005 11:13 PM (UTC) by Poromenos

Message
I'll try. I'm not the type to look at a trigger and press OK, I always press cancel everywhere unless I need to save the changes. I'll do GetInfo from time to time and keep you posted.

Also, I meant that the flag should have been set only if something changed, and I'm not usually reverting the changes I made in a world, so MUSHclient must be setting it erroneously. Not even the variables are changing.

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
[Go to top] top

Posted by Nick Gammon   Australia  (21,386 posts)  [Biography] bio   Forum Administrator
Date Reply #5 on Thu 27 Oct 2005 12:15 AM (UTC)
Message
Something like this (this is in Lua) that will notify you shortly after the document becomes changed. This is simple and doesn't keep a flag to stop doing it multiple times, you would need to disable the timer after the message appears.


<timers>
  <timer enabled="y" second="10.00"    send_to="12"
>
  <send>if GetInfo (111) ~= 0 then
  ColourNote ("white", "red", "Document has changed")
end</send>

  </timer>
</timers>


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (21,386 posts)  [Biography] bio   Forum Administrator
Date Reply #6 on Thu 27 Oct 2005 12:32 AM (UTC)
Message
I think it is one of these 4 routines:

AddAlias
AddTrigger
AddTriggerEx
EnableTrigger

They were not checking to see if they were executing in a plugin, the other ones were (eg. DeleteTrigger and so on).

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Poromenos   Greece  (1,037 posts)  [Biography] bio
Date Reply #7 on Thu 27 Oct 2005 01:16 AM (UTC)
Message
Yep, it's EnableTrigger. My plugins make heavy use of this and it results in the world getting saved.

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


4,862 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]