Gammon Forum
Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to "verify" your details, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Entire forum
SMAUG
SMAUG coding
get data like as GMCP for aardwolf in Smaug
get data like as GMCP for aardwolf in Smaug
|
It is now over 60 days since the last post. This thread is closed.
  Refresh page
Posted by
| Virgoir
(10 posts) bio
|
Date
| Mon 07 Nov 2011 03:14 PM (UTC) |
Message
| Hi all,
in smaug codebase how I can get some data like as hp, mana, str, dex, ... without echo (behind the scene)?
I think that I must read prompt for hp, mana and move, but I need more data.
I want to make a client like as Revelation (www.kaldana.com), please anybody say me that is possible with SMAUG codebase or not?
Thanks in advanced
| top |
|
Posted by
| Nick Gammon
Australia (23,042 posts) bio
Forum Administrator |
Date
| Reply #1 on Mon 07 Nov 2011 07:43 PM (UTC) Amended on Tue 26 Nov 2013 03:33 AM (UTC) by Nick Gammon
|
Message
| It's possible. There was a lengthy discussion here:
http://www.gammon.com.au/forum/?id=10043
In that I posted example code of modifying Smaug to do what you suggest.
I did a video showing the results:
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|
Posted by
| KaVir
Germany (117 posts) bio
|
Date
| Reply #2 on Tue 08 Nov 2011 09:28 AM (UTC) |
Message
| My protocol snippet adds support for MSDP, which works in a similar way to GMCP. It comes with installation instructions for SMAUG, and takes about 10 minutes to add. You can download it from here:
http://www.mudbytes.net/file-2811
Here are some screenshots of my MUSHclient plugin in action, using the above snippet:
http://www.godwars2.org/images/plugin_v115_3.png
http://www.godwars2.org/images/plugin_v115_4.png
http://www.godwars2.org/images/plugin_v115_5.png
| top |
|
Posted by
| Virgoir
(10 posts) bio
|
Date
| Reply #3 on Tue 08 Nov 2011 09:39 PM (UTC) Amended on Tue 08 Nov 2011 09:40 PM (UTC) by Virgoir
|
Message
| Thanks a lot for your reply,
KaVir I get the protocol snippet and add it to smaug 1.4 with MXP support.
but in VC++ 6 when I want to build compiler give me these errors:
--------------------Configuration: smaug140 - Win32 Debug--------------------
Compiling...
update.c
i:\games\smaug1.4a.sce - copy\update.c(3001) : error C2065: 'eMSDP_BLOOD' : undeclared identifier
i:\games\smaug1.4a.sce - copy\update.c(3010) : error C2065: 'eMSDP_CHA' : undeclared identifier
i:\games\smaug1.4a.sce - copy\update.c(3011) : error C2065: 'eMSDP_LCK' : undeclared identifier
i:\games\smaug1.4a.sce - copy\update.c(3017) : error C2065: 'eMSDP_CHA_PERM' : undeclared identifier
i:\games\smaug1.4a.sce - copy\update.c(3018) : error C2065: 'eMSDP_LCK_PERM' : undeclared identifier
protocol.c
i:\games\smaug1.4a.sce - copy\protocol.c(798) : error C2065: 'DoTTYPE' : undeclared identifier
i:\games\smaug1.4a.sce - copy\protocol.c(798) : warning C4047: 'function' : 'const char *' differs in levels of indirection from 'int '
i:\games\smaug1.4a.sce - copy\protocol.c(798) : warning C4024: 'Write' : different types for formal and actual parameter 2
i:\games\smaug1.4a.sce - copy\protocol.c(1409) : error C2065: 'TELOPT_TTYPE' : undeclared identifier
i:\games\smaug1.4a.sce - copy\protocol.c(1410) : error C2065: 'TELOPT_NAWS' : undeclared identifier
i:\games\smaug1.4a.sce - copy\protocol.c(1448) : error C2051: case expression not constant
i:\games\smaug1.4a.sce - copy\protocol.c(1476) : error C2051: case expression not constant
i:\games\smaug1.4a.sce - copy\protocol.c(1621) : error C2051: case expression not constant
i:\games\smaug1.4a.sce - copy\protocol.c(1758) : error C2051: case expression not constant
Error executing cl.exe.
Creating browse info file...
smaug.exe - 12 error(s), 2 warning(s)
excuse me, I have some experience in Delphi /Pascal, but I hate form C and C++ in University till now ;-)
Thanks in advanced
| top |
|
Posted by
| KaVir
Germany (117 posts) bio
|
Date
| Reply #4 on Wed 09 Nov 2011 08:21 AM (UTC) |
Message
| The snippet is written in C, I've not tried compiling it as C++, let alone VC++ - it may require some tweaking.
The eMSDP_BLOOD, eMSDP_CHA, eMSDP_LCK, eMSDP_CHA_PERM and eMSDP_LCK_PERM are specific to SMAUG, just comment them out in update.c for now - it's because I created the SMAUG installation instructions along with a customised version of the snippet for Realms of Despair. I should really update the installation instructions to fit the generic snippet. Alternatively you could just add the variables to protocol.h and protocol.c - see the section in the README.TXT entitled "How do I add a new MSDP variable?"
TELOPT_TTYPE and TELOPT_NAWS should already be defined in telnet.h, but if you need to add them manually you could just put them in protocol.h:
#define TELOPT_TTYPE 24
#define TELOPT_NAWS 31
| top |
|
Posted by
| Virgoir
(10 posts) bio
|
Date
| Reply #5 on Fri 18 Nov 2011 11:02 PM (UTC) |
Message
| Thanks KaVir,
I build smaug with all changes, but now in my client application how I can get the MSDP data?
I check your plugin and I think that in line 2099 you send the packet to Mud Server with this syntax:
-- IAC SB MSDP response IAC SE
But when I send this string to mud server by my client app server just response with "Huh?" and nothing else.
I just traced the InputBuffer in Server and the string that I send by client exactly is in buffer, and after it I didn't check.
please explain me more about MSDP and other related things.
Thanks a lot. | top |
|
Posted by
| Virgoir
(10 posts) bio
|
Date
| Reply #6 on Fri 18 Nov 2011 11:04 PM (UTC) |
Message
|
Nick Gammon said:
It's possible. There was a lengthy discussion here:
http://www.gammon.com.au/forum/?id=10043
In that I posted example code of modifying Smaug to do what you suggest.
I did a YouTube video showing the results:
http://www.youtube.com/watch?v=KSAmAa_VN6k
Thank you Nick,
I want to make a custom client for it, and I think that article which you posted is for MUSHClient, right?
| top |
|
Posted by
| KaVir
Germany (117 posts) bio
|
Date
| Reply #7 on Sat 19 Nov 2011 01:20 AM (UTC) Amended on Sat 19 Nov 2011 01:21 AM (UTC) by KaVir
|
Message
|
Virgoir said: Thanks KaVir,
I build smaug with all changes, but now in my client application how I can get the MSDP data?
I check your plugin and I think that in line 2099 you send the packet to Mud Server with this syntax:
-- IAC SB MSDP response IAC SE
But when I send this string to mud server by my client app server just response with "Huh?" and nothing else.
When you say "client app", do you mean your own MUSHclient plugin? Or is this some other client you're using?
Have you tested it with the generic MUSHclient plugin I provided? That should at least confirm that it's working properly. You can download it from here: http://www.godwars2.org/download/Generic_Plugin.zip
The mud should send IAC WILL MSDP when you connect, and the client should reply with IAC DO MSDP - that indicates that negotiation has succeeded. After that you can use subnegotiation to ask for specific variations. This is described in more detail in the MSDP specification: http://tintin.sourceforge.net/msdp/
| top |
|
Posted by
| Nick Gammon
Australia (23,042 posts) bio
Forum Administrator |
Date
| Reply #8 on Sat 19 Nov 2011 04:08 AM (UTC) |
Message
|
Virgoir said:
Thank you Nick,
I want to make a custom client for it, and I think that article which you posted is for MUSHClient, right?
Well, no. The ideas were intended to be generic. Any client that can parse telnet protocols should be able to intercept such messages. I think a number of other clients, other than MUSHclient, have some such support.
Some of my examples at the client end were for MUSHclient, but that was illustrating how the whole thing could come together at both the client and server end.
Be warned that writing your own client is no trivial task, but best of luck with it! |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|
Posted by
| KaVir
Germany (117 posts) bio
|
Date
| Reply #9 on Sat 19 Nov 2011 11:04 AM (UTC) |
Message
|
Nick Gammon said: Any client that can parse telnet protocols should be able to intercept such messages. I think a number of other clients, other than MUSHclient, have some such support.
They do, but (and this comment is aimed at the OP) I'd like to stress that the sort of interface we're discussing here will also require decent graphical support, and MUSHclient is the clear leader in that field (outside of custom clients for graphical muds).
Just in case my earlier messages may have been misinterpreted, I'd like to clarify that my snippet only provides an interface between mud and client. It's a way to let muds take advantage of modern client features - but it can only use what the client offers.
| 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.
29,601 views.
It is now over 60 days since the last post. This thread is closed.
  Refresh page
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.