get data like as GMCP for aardwolf in Smaug

Posted by Virgoir on Mon 07 Nov 2011 03:14 PM — 10 posts, 43,075 views.

#0
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



Australia Forum Administrator #1
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:



Amended on Tue 26 Nov 2013 03:33 AM by Nick Gammon
Germany #2
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
#3
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

Amended on Tue 08 Nov 2011 09:40 PM by Virgoir
Germany #4
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
#5
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.
#6
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?



Germany #7
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/
Amended on Sat 19 Nov 2011 01:21 AM by KaVir
Australia Forum Administrator #8
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!
Germany #9
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.