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

Gammon Software Solutions forum

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

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Helping Out

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Helping Out

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page


Pages: 1  2 3  

Posted by Nick Gammon   Australia  (18,769 posts)  [Biography] bio   Forum Administrator
Date Reply #15 on Thu 17 Sep 2009 09:36 AM (UTC)  quote  ]
Message
Can't do that for 2 weeks, sorry as I am on a train to Perth right now.

Technical support will be slightly limited during that time.

- Nick Gammon

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

Posted by Larkin   (278 posts)  [Biography] bio
Date Reply #16 on Thu 17 Sep 2009 11:32 AM (UTC)  quote  ]
Message
I, too, would love to see a full archive with each release of the source code. The diffs are much less convenient and have actually failed for me in a few instances, mostly because of the binary files.

It would be REALLY great to get an archive with projects for VS2005 and/or VS2008, since the newer versions of VS don't open and convert the old workspaces well at all. Best I could come up with was to track down all intermediate versions of VS between 6.0 and 2008 to convert the workspace in a sort of cascading method, and that's not very ideal. Failing that, though, we have to make a brand new project and fiddle with a lot of things until it finally compiles... and maybe it'll run.

I've been using the MUSHclient code as a great reference for things I'm working on myself, so I'd really like to take this opportunity to just thank you, Nick, for all the work you've done on this and for sharing it all with us! Thanks!
[Go to top] top

Posted by Twisol   USA  (2,229 posts)  [Biography] bio
Date Reply #17 on Thu 17 Sep 2009 11:52 PM (UTC)  quote  ]
Message
Alright... With a fresh codebase, and after re-following the original compiling-from-source thread, I re-tested by running MUSH, connecting, and disconnecting, and.... it crashed.

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Twisol   USA  (2,229 posts)  [Biography] bio
Date Reply #18 on Fri 25 Sep 2009 12:01 AM (UTC)  quote  ]
Message
Just an update (as I see we still have a week to go before you're back ;) ), but I've been trying to get it to work properly with no success. I also tried compiling a Release build, but that died at the linker stage because of some duplicate-definition problem with a __PreCom__ identifier, in accelerators.cpp.

Any advice from anyone would be appreciated. I'm excited to hack around in the source, but it's hard to do that when everything's unstable.

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Twisol   USA  (2,229 posts)  [Biography] bio
Date Reply #19 on Fri 25 Sep 2009 09:38 AM (UTC)  quote  ]
Message
In the interest of getting at least one helpful fix in, I commented out the offending TString() call so I could at least test my changes. The only line I changed is in methods.cpp, within the body of CMUSHclientDoc::DoAfterSpecial():


timer_item->bActiveWhenClosed = !IsConnected();


The !IsConnected() value will cause DoAfter()s made while disconnected to fire properly, yet maintain the previous behavior of DoAfter()s made while connected. This might not be the best way to make this change, but it does work to solve the problem I had initially mentioned.

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Nick Gammon   Australia  (18,769 posts)  [Biography] bio   Forum Administrator
Date Reply #20 on Sat 26 Sep 2009 01:23 AM (UTC)  quote  ]
Message
If that code is from where I think it is, I would just change it to:



timer_item->bActiveWhenClosed = true;


Otherwise, it is likely to cause unintended effects, that if the DoAfter is done when you are not connected, it won't fire if it switches to when you are connected. (For example, you might want to save the world file every hour, connected or not).

- Nick Gammon

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

Posted by Twisol   USA  (2,229 posts)  [Biography] bio
Date Reply #21 on Sat 26 Sep 2009 06:43 AM (UTC)  quote  ]
Message
*nod* My change was intended to maintain compatibility (where timers created while connected wouldn't actually fire when disconnected), but if you think it would be beneficial to make DoAfter timers work always, then I have no further reservations. :)

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Nick Gammon   Australia  (18,769 posts)  [Biography] bio   Forum Administrator
Date Reply #22 on Tue 29 Sep 2009 10:45 PM (UTC)  quote  ]
Message
OK, here is the latest source in one package:

Download
http://www.gammon.com.au/files/mushclient/src/mushclient_4.43_src.zip

I didn't include sqlite3.c because it is so big, and virtually identical to the official release.

Grab SQLite3 source from:

http://www.sqlite.org/sqlite-amalgamation-3_6_16.zip

Unzip and copy sqlite3.c to the MUSHclient directory. Then edit sqlite3.c and add these lines at the start:


// These first few lines added by NJG
// version 3.6.16
#  pragma warning(disable: 4244)
#  pragma warning(disable: 4018)
#  pragma warning(disable: 4049)
#  pragma warning(disable: 4761)
#define SQLITE_SOUNDEX 1


Then it should compile, bearing in mind the issues with line endings.

- Nick Gammon

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

Posted by Nick Gammon   Australia  (18,769 posts)  [Biography] bio   Forum Administrator
Date Reply #23 on Wed 30 Sep 2009 04:55 AM (UTC)  quote  ]
Message
I had a look at what it would take to get the latest Visual Studio. Apart from the cost of about $US 199, which I don't particularly want to pay, there is a 6 Gb download. This seems ridiculous to me, to have to download 6 Gb to get a C++ compiler. Previously the Visual Studio I had fitted on a single CDROM.

I thought someone had got MUSHclient to work under Visual Studio 2005, or whatever it is called?

- Nick Gammon

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

Posted by Larkin   (278 posts)  [Biography] bio
Date Reply #24 on Wed 30 Sep 2009 10:54 AM (UTC)  quote  ]
Message
I had MUSHclient somewhat working under Visual Studio 2005, after converting the workspace and fixing up the projects to compile with the newer options. Some of that broke down when things like DirectSound and SQLite were added, mostly because I haven't taken the time to make it work again.

I'm using the source now as a reference for my own sort of client, which I'm developing using Visual Studio 2008. I decided to use 2008 to gain access to the new MFC Feature Pack, with the Office 2007 look-and-feel and all that fun stuff.

It would still be very nice to have a copy of MUSHclient that runs under 2005 or 2008, just for doing run-time comparisons and tracing through the functions and variables in the debugger.
[Go to top] top

Posted by Twisol   USA  (2,229 posts)  [Biography] bio
Date Reply #25 on Thu 01 Oct 2009 01:57 AM (UTC)  quote  ]
Message
@Nick - Well, Visual Studio these days is packed (you might even say bloated) with extra tools and features, which might account for the size... I can't blame you at all, though!

@Larkin - Did you ever have a problem with MUSHclient where disconnecting would crash MUSH within a GetFormatLength() call? I haven't been able to figure out what in the world is going on.

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Larkin   (278 posts)  [Biography] bio
Date Reply #26 on Thu 01 Oct 2009 02:00 AM (UTC)  quote  ]
Message
Can't say I ever saw that one, no.
[Go to top] top

Posted by Twisol   USA  (2,229 posts)  [Biography] bio
Date Reply #27 on Fri 09 Oct 2009 05:14 AM (UTC)  quote  ]
Message
Tried it out with the above source dump, and also converted the project file properly (having converted the line endings first). That weird crash still persists. I have no idea what's causing it.

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Twisol   USA  (2,229 posts)  [Biography] bio
Date Reply #28 on Fri 09 Oct 2009 06:28 AM (UTC)  quote  ]

Amended on Fri 09 Oct 2009 06:39 AM (UTC) by Twisol

Message
I SOLVED IT!!!!!!!! Excuse the excess, but holy cow, this was annoying.

Basically, in the newer MFC, it seems that CTimeSpan's get*() methods return a LONGLONG type - a 64-bit int. The format specifier, however, expects a relatively measly long (32-bit). This type mismatch corrupts the rest of the arguments, because the va_arg() call retrieves only 32 bits, when the argument is actually 64 bits.

After a LOT of debugging to figure this out - I will have a lifelong hatred of varargs because of this! - it's as simple as casting the ts.Get*() return values to longs.



    CString strDuration = TFormat("--- Connected for %i day%s, %i hour%s, %i minute%s, %i second%s. ---",
                  PLURAL((long)ts.GetDays()),
                  PLURAL((long)ts.GetHours()),
                  PLURAL((long)ts.GetMinutes()),
                  PLURAL((long)ts.GetSeconds()));


The above code is in worldsock.cpp, in the CWorldSocket::OnClose method.


EDIT: As you can see from this cached page[1], all of the Get*() functions utilized in that code return 'int's, except for GetDays() which is a long. No wonder it worked flawlessly in VC6.

[1] http://74.125.155.132/search?q=cache:http://www.cppdoc.com/example/mfc/classdoc/MFC/CTimeSpan.html

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Twisol   USA  (2,229 posts)  [Biography] bio
Date Reply #29 on Fri 09 Oct 2009 09:10 AM (UTC)  quote  ]

Amended on Fri 09 Oct 2009 09:13 AM (UTC) by Twisol

Message
In the time since I fixed the disconnecting crash, I wrote some new functionality into my local MUSHclient build. I don't know if anyone else cares about it (although I know at least one person who inspired me to write it), but I've added functionality to store MUSHclient arrays between sessions.

This means that if I run the following code, save the world, and restart MUSHclient, the array will be loaded right back into the world data just as before:


ArrayCreate("foo")
ArraySet("foo", "42", "It's the Answer")
ArraySet("foo", "43", "It's the Answer, Plus One")


It's saved with the following XML format:


<arrays
   muclient_version="4.40"
   world_file_version="15"
   date_saved="2009-10-09 01:49:48"
  >
  <array name="foo">
    <key name="42">It's the Answer</key>
    <key name="43">It's the Answer, Plus One</key>
  </array>
</arrays>



If anyone's interested please let me know, I'd be glad to post the sources. (Also, I'm sure I missed something or could have done it better, so I'd be glad to have a critical eye scan over it as well.)

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[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.


10,547 views.

This is page 2, subject is 3 pages long:  [Previous page]  1  2 3  [Next page]

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

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

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]