Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Tiberius
Newbie


Joined: 03 Nov 2002
Posts: 4
Location: Australia

PostPosted: Sun Nov 03, 2002 10:55 am   

BCB Plugin for ZMud
 
I seem to have hit another problem with using Zmud remotely. Where is the function that enables you to examine the text within the TRichEdit component? I’d like to have access to the information that is being sent from the Mud server.


void __fastcall TForm1::ClientSocket1Read(Tobject *Sender, TCustomWinSocket *Socket)

There doesn’t seem to be any methods, event handlers, or even properties of the derived class ZmudSession that enable you to handle the text streaming into the session itself? If this is the case the COM functionality of Zmud is quite limited.
Reply with quote
Castaway
GURU


Joined: 10 Oct 2000
Posts: 793
Location: Swindon, England

PostPosted: Sun Nov 03, 2002 11:36 am   
 
Hmm, good question, Im sure you can, but I forget how..

Its better if you ask these questions in the developer forum, where the plugin developers will hear you (in theory ;)

Lady C.
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Sun Nov 03, 2002 5:37 pm   
 
Previous, non-COM, plugins, could define these two functions:
function ParseMUDLine( H: THandle; P: PChar; var L: Integer; IsPrompt: Boolean; var DoGag: Integer; var DoUpdate: Boolean); stdcall;
function MUDInput( H: THandle; P: PChar; var L: Integer): PChar; stdcall;

The second one is very low level, and provides access to each buffer of data received from the MUD, while the first one gives you access to the text recived from the MUD but after zMUD has done some parsing of it's own.

I can't check right now, but a COM plugin that implements the IzMUDPlugin interface should have access to all of the functions that were available in non-COM plugins.

Kjata
Reply with quote
Tarn
GURU


Joined: 10 Oct 2000
Posts: 873
Location: USA

PostPosted: Sun Nov 03, 2002 7:25 pm   
 
Tiberius writes:
quote:

I’d like to have access to the information that is being sent from the Mud server.
...
There doesn’t seem to be any methods, event handlers, or even properties of the derived class ZmudSession that enable you to handle the text streaming into the session itself? If this is the case the COM functionality of Zmud is quite limited.



"Don't call me. I'll call you."

You don't pull this data out of the session; zMud calls plugin methods to pass it.

Take a look at the methods your plugin needs to implement. You get several opportunities to look at every chunk of data coming in from the mud. The lowest level one, which Kjata cited, almost gives you access to the raw socket data. (Not quite raw- if necessary, things like uncompressing the stream are done first, I believe.)

-Tarn
Reply with quote
Tiberius
Newbie


Joined: 03 Nov 2002
Posts: 4
Location: Australia

PostPosted: Mon Nov 04, 2002 10:33 am   
 
Thanks guys, found some excellent documentation in SamplePlugin.txt. I found that the following code snipet really helped me out.


STDMETHODIMP TTestPlugImpl::Parse(long H, BSTR* P, TOLEBOOL IsPrompt,
long* DoGag, TOLEBOOL* DoUpdate)
{
ofstream outfile( "MyOutput.txt", ios::app );
AnsiString buffer( *P );
outfile << buffer.c_str();
outfile.close();
}
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net