Closed KlaasT closed 3 years ago
cc: @CyberBotX
I'll look into it this weekend most likely. If not this weekend, though, I'm not sure when, my free time is in flux lately.
That would be really great. Thanks.
So I've only taken a cursory look at this, but the first error that comes up (maybe the only one?) is that it seems that the WriteChannelWithServ
function no longer exists on the Channel
class. I don't know what to replace that with.
Assuming you're sending a PRIVMSG:
ClientProtocol::Messages::Privmsg privmsg(ServerInstance->FakeClient, chan, "your message here", MSG_PRIVMSG);
Write(ServerInstance->GetRFCEvents().privmsg, privmsg);
ServerInstance->PI->SendMessage(channel, prefixChar, "your message here");
Stupid question. How would I create that FakeClient which is referenced here?
ServerInstance->FakeClient
Stupid question. How would I create that FakeClient which is referenced here?
ServerInstance->FakeClient
You don't, it will already exist as it's used for a few other server messages already. Are you getting an error related to this (that'd be strange)? If you're just looking into creating fake clients, I'm not sure at the moment on that. I think I looked into it before for an old module and it seemed not so nice to handle.
I haven't had a chance to try it yet. The reason I'm asking is that the module actually sends messages to the channel with fake Nicknames such as "Ambiance" or "NPC-1". Currently I don't understand how to set these fake names.
Ah okay. I haven't had to use much of these myself yet but looking at the available ClientProtocol::Messages::Privmsg
constructors, there is one available for a string source (instead of User) and channel target. Should be able to use what @SaberUK said above but replace the ServerInstance->FakeClient
User with a string, just like the original Write()
was using.
I did a total rewrite of this module in pull #244.
It would be really great if the m_rpg modules would be ported to version 3. I tried it myself but I'm not getting them to compile.
Thanks very much.