Page 1 of 1

sendto_one() question

Posted: Sun Aug 28, 2011 7:00 pm
by chevyman2002
Using the function as the following, is this sending a message to the end user or would the end user's client interpret it as a command?

Code: Select all

sendto_one(acptr, ":FURL %s", somestring);
In mIRC it simply shows what's in the text (without the colon) in the status window, however, other clients see garbage and then the message. Just curious.

Re: sendto_one() question

Posted: Sun Aug 28, 2011 8:50 pm
by Stealth
Different clients interpret things differently. When you send things to clients you need to make sure the commands meets the following format: ":<source> <command|numeric> <target> [parameters]". You cannot send commands to clients the same way clients send commands to servers! The only exception to this format is PING, which does not require a target.

To make your command have the source as the server, do:

Code: Select all

sendto_one(sptr, ":%s FURL %s %s", me.name, sptr->name, something);
For more information about sending text to clients in the proper format, please see RFC1459 where it is all fully explained. Sending random garbage to clients will create problems for your users if not sent in the proper format.

Re: sendto_one() question

Posted: Sun Aug 28, 2011 11:30 pm
by chevyman2002
Thanks for your prompt response, it was very informational. I've been fighting with the pJIRC client attempting to copy the old FURL command from ConferenceRoom to force-open a web url. I'm honestly just bored and it wouldn't _seem_ overly difficult to deal with, even though I don't see any real need for it. I wanted to make sure that I was doing it at least semi-correctly on the Unreal side as I can't get the client to trigger a response when received. I tried it the way you posted and a few other ways and had no success, so I blame pJIRC :wink:. I appreciate the explanation of the command, though, that will help me tremendously.