The Mud Connector

Author Topic: GUI snippet  (Read 9905 times)

KaVir

  • Jr. Member
  • **
  • Posts: 95
  • God Wars II
    • View Profile
    • God Wars II
RE: GUI snippet
« Reply #15 on: April 03, 2011, 4:17 PM »
> GetInfo (66) returns the home directory of MushClient.

Ah good point, thanks - actually the plugin was pretty hastily thrown together at the last minute, it was really just intended to help get people started.  It could definitely be written better, and I'm hoping we'll see a lot more activity in this direction in the near future.

What I'm really promoting here is the snippet, because once that's installed anyone can create their own GUIs if they want to.

But people tend to react much more enthusiastically towards sexy screenshots than clever code, and I wanted to grab people's attention ;)
KaVir at God Wars II: godwars2.org 3000
Roomless world. Manual combat. Endless possibilities.


Gatz

  • Posts: 0
    • View Profile
RE: GUI snippet
« Reply #16 on: April 03, 2011, 5:02 PM »
Thanks for releasing this kaVir! I've been following your posts on MUD Bytes on this and was getting super excited. I can't wait to take a stab and putting this in my MUD. Thanks for taking the time to snippet-ize this!

Sombalance

  • New to TMC
  • *
  • Posts: 14
    • View Profile
RE: GUI snippet
« Reply #17 on: April 06, 2011, 8:56 PM »
So, I've been porting this snippet over to java and when I was testing it, I noticed that mushclient was sending NAWS info around 20+ times (compared to less than 5 for putty, telnet and mudlet).  MUSHClient seemed to behave the same way regardless of having plugins installed.

I was wondering if anyone else noticed that.


Sombalance

KaVir

  • Jr. Member
  • **
  • Posts: 95
  • God Wars II
    • View Profile
    • God Wars II
RE: GUI snippet
« Reply #18 on: April 07, 2011, 7:10 AM »
> So, I've been porting this snippet over to java and when
> I was testing it, I noticed that mushclient was sending
> NAWS info around 20+ times (compared to less than 5 for
> putty, telnet and mudlet). MUSHClient seemed to behave
> the same way regardless of having plugins installed.
>
> I was wondering if anyone else noticed that.

It should send NAWS every time the screen size changes.  Were you changing the window size at the time?
KaVir at God Wars II: godwars2.org 3000
Roomless world. Manual combat. Endless possibilities.


MECHFrost

  • Posts: 0
    • View Profile
RE: GUI snippet
« Reply #19 on: April 07, 2011, 9:21 AM »
Hey, do you mind sharing your Java port?

(Comment added by MECHFrost on Thu Apr  7  6:22:16 2011)

Edit: talking to Somnolance.

Sombalance

  • New to TMC
  • *
  • Posts: 14
    • View Profile
RE: GUI snippet
« Reply #20 on: April 07, 2011, 9:34 AM »
Nope, I wasn't changing the window size.

I'll play around with it more today.  The only reason I
noticed it was that the first time I connect with a plugin,
there is a noticeable delay in sending/receiving text to the
screen. After about three or four commands, the delay is gone
and doesn't appear again unless I completely close MushClient
before attempting to login again.  I thought I might have been
spamming a negotiation sequence.  That doesn't seem to be the
case though, although I haven't ruled out something goofy in
my stuff.

Sombalance

Sombalance

  • New to TMC
  • *
  • Posts: 14
    • View Profile
RE: GUI snippet
« Reply #21 on: April 07, 2011, 9:41 AM »
Nope, I don't mind sharing it, but you should be aware I've
only been programming in Java for about 3 weeks now.  I got
the urge to learn Java and decided that a simple hello world
tutorial wouldn't cut it.  I'll post it somewhere this weekend
with an appropriate "use at own risk" type warning.  I am
still testing it out to see that I haven't wrecked it.

Sombalance

KaVir

  • Jr. Member
  • **
  • Posts: 95
  • God Wars II
    • View Profile
    • God Wars II
RE: GUI snippet
« Reply #22 on: April 07, 2011, 11:12 AM »
> Nope, I wasn't changing the window size.

Was the value different each time, or was it always the same?  If it's changing then it sounds like a MUSHclient issue - what version are you using?

If it's not changing, check whether it does the same in my snippet or just in your ported version.  If the latter, it could be you're not clearing the buffer after receiving the sequence.

The delay with the plugin is probably because it's redrawing everything each time it receives new data.  It should ideally be changed to only redraw the things that change, and not draw anything initially until all of the data has arrived.  As I said before, the plugin could really do with a rewrite.
KaVir at God Wars II: godwars2.org 3000
Roomless world. Manual combat. Endless possibilities.


jbrianclar

  • Posts: 0
    • View Profile
RE: GUI snippet
« Reply #23 on: April 20, 2011, 3:30 AM »
Hey,

Using the plugin on tbaMUD I am getting the below crash
every time a zmud 4.62 client connects...

Program received signal SIGSEGV, Segmentation fault.
0x080a3639 in process_input (local_mother_desc=5) at
comm.c:1922
1922        *(read_point + bytes_read) = '\0';  /* terminate
the string */
(gdb) bt
#0  0x080a3639 in process_input (local_mother_desc=5) at
comm.c:1922
#1  game_loop (local_mother_desc=5) at comm.c:820
#2  0x080a4878 in init_game (argc=2, argv=0xbffff7e4) at
comm.c:512
#3  main (argc=2, argv=0xbffff7e4) at comm.c:353
(gdb)

any ideas or ways I can go about debugging this. It has
happened once before when I just connected with putty. It
never has issues with wintin or MUSHClient.

plamzi

  • Sr. Member
  • ****
  • Posts: 325
    • View Profile
    • The MUD Portal
RE: GUI snippet
« Reply #24 on: April 20, 2011, 11:21 AM »
What are the lines in the earlier frames? What does the input string it crashes on look like?

Also, do I understand you correctly that you've had this happen to you once before you had the snippet installed?

jbrianclar

  • Posts: 0
    • View Profile
RE: GUI snippet
« Reply #25 on: April 20, 2011, 12:06 PM »
the input string crashing is after the user enters in a
correct password.

This never happened before adding the snippet. I just stated
it happened after the snippet with putty (once) although I
cannot repeat it with putty. I can repeat the crash with
almost every old version of zmud until the 7.x line of zmud
clients -- which work perfectly.

KaVir

  • Jr. Member
  • **
  • Posts: 95
  • God Wars II
    • View Profile
    • God Wars II
RE: GUI snippet
« Reply #26 on: April 20, 2011, 4:39 PM »
I'm not really familiar with TBA (which is why I'd been hoping someone else would write up the instructions), but from a cursory glance you could try changing this:
    if ( bytes_read >= 0 )
    {
      read_buf[bytes_read] = '\0';
      ProtocolInput( t, read_buf, bytes_read, t->inbuf );
      bytes_read = strlen(t->inbuf);
    }
To this:
    if ( bytes_read >= 0 )
    {
      read_buf[bytes_read] = '\0';
      ProtocolInput( t, read_buf, bytes_read, read_point );
      bytes_read = strlen(read_point);
    }

KaVir at God Wars II: godwars2.org 3000
Roomless world. Manual combat. Endless possibilities.


jbrianclar

  • Posts: 0
    • View Profile
RE: GUI snippet
« Reply #27 on: April 20, 2011, 5:49 PM »
As always, you rock! This fixed the problem!

There are still a few other oddities, but at least they are
cosmetic and not causing any problems.

Thanks again!

jbrianclar

  • Posts: 0
    • View Profile
RE: GUI snippet
« Reply #28 on: April 21, 2011, 1:34 AM »
Hey All,

There is another issue I have run into now. I was testing
out the functionality by writing the ability to click on a
vnum to stat an object and the object name to load the
object when an immortal searches for objects. This works
fine when I use MUSHClient or a recent version of zmud that
supports MXP. If I use putty and connect and issue the
command the mud crashes.


Program received signal SIGSEGV, Segmentation fault.
0xb7e8bb33 in vfprintf () from /lib/libc.so.6
(gdb) bt
#0  0xb7e8bb33 in vfprintf () from /lib/libc.so.6
#1  0xb7f2f194 in __vsnprintf_chk () from /lib/libc.so.6
#2  0x0809f706 in vsnprintf (t=0x83a91e8,
    format=0x8166018 "%3d. \t<send href=\"vstat obj %d\">
[%5d]@n \t<send href=\"load obj %d\">%-40s@n %s\r\n",
args=0xbfffe6b8 "\001")
    at /usr/include/bits/stdio2.h:78
#3  vwrite_to_output (t=0x83a91e8,
    format=0x8166018 "%3d. \t<send href=\"vstat obj %d\">
[%5d]@n \t<send href=\"load obj %d\">%-40s@n %s\r\n",
args=0xbfffe6b8 "\001") at comm.c:1356
#4  0x0809fca1 in send_to_char (ch=0x15,
    messg=0x8166018 "%3d. \t<send href=\"vstat obj %d\">
[%5d]@n \t<send href=\"load obj %d\">%-40s@n %s\r\n") at
comm.c:2393
#5  0x080a8055 in vnum_object (searchname=0xbfffe72c
"sword", ch=0x83b05e0)
    at db.c:2374
#6  0x0808baa4 in do_vnum (ch=0x83b05e0, argument=0xbffff4b0
" obj sword",
    cmd=716, subcmd=0) at act.wizard.c:372
#7  0x080f63cc in command_interpreter (ch=0x83b05e0,
    argument=0xbffff4ac "vnum obj sword") at
interpreter.c:607
#8  0x080a40a5 in game_loop (local_mother_desc=5) at
comm.c:868
#9  0x080a4868 in init_game (argc=2, argv=0xbffff804) at
comm.c:512
#10 main (argc=2, argv=0xbffff804) at comm.c:353
(gdb)


As I have stated, I appreciate the assistance and I do not
mind paying to have you, or someone, work with me to get
these little issues resolved. This functionality is fairly
vital to my project if I am to try and attract as many
players as possible.

KaVir

  • Jr. Member
  • **
  • Posts: 95
  • God Wars II
    • View Profile
    • God Wars II
RE: GUI snippet
« Reply #29 on: April 21, 2011, 5:08 AM »
> There is another issue I have run into now. I was testing
> out the functionality by writing the ability to click on a
> vnum to stat an object and the object name to load the
> object when an immortal searches for objects.

You'll have to copy and paste the section of code so that I can see what it's doing - in particular, the part that calls this:

send_to_char (ch, "%3d. \t<send href=\"vstat obj %d\"> [%5d]@n \t<send href=\"load obj %d\">%-40s@n %s\r\n")

I need to see what 'ch' is initialised to, and what other arguments you're passing in with the ellipsis.

You've also forgotten to close the MXP tags, although that shouldn't cause a crash.  From the README.TXT: "As with the extended colour, MXP tags will be automatically removed if the user doesn't support MXP - but it's very important you remember to close the tags."
KaVir at God Wars II: godwars2.org 3000
Roomless world. Manual combat. Endless possibilities.