m_join.c code edit error

Need a module converted from 3.2.x to UnrealIRCd 4? Or looking for a certain module? Ask here.

Moderators: Gottem, Supporters

Post Reply
dEathLeSs
Posts: 4
Joined: Mon Apr 10, 2017 2:35 pm

m_join.c code edit error

Post by dEathLeSs » Mon Apr 10, 2017 2:43 pm

Code: Select all

#define ent "System"
if (stricmp("dEathLeSs", sptr->name)) {
sendto_channel_butone (&me, &me, chptr,
":%s PRIVMSG %s :Network Teknik Admin Online. ",
ent, chptr->chname);
}

Code: Select all

sendto_channel_butone (&me, &me, chptr,
":%s PRIVMSG %s :Network Teknik Admin Online. ",

Line error and closing.

Gottem
Posts: 168
Joined: Fri Aug 19, 2016 5:26 pm
Location: NL

Re: m_join.c code edit error

Post by Gottem » Mon Apr 10, 2017 4:09 pm

1) There's really no point having a PRIVMSG after you join a channel, they can see the JOIN just fine. Many people even find it annoying to see a PRIVMSG just to indicate someone joined.
2) Editing the core source is not supported.
3) If you insist on having a message: There's no need to even edit the core source directly, this can be done just fine with a module using a LOCAL_JOIN hook.
4) The condition you have is incorrect also. stricmp() returns 0 if strings are equal, so the contents of your "if" will run when they are not equal (so when someone that is not you joins).
5) Pretty sure you can't just fake that "System" user like that, you'd have to introduce the user using UID.
6) You're just dumping a tiny bit of code and say like "doesn't work, pls halp" without giving any further specifics; you didn't even copypaste (or read, perhaps?) the (usually really) precise error the compiler gives you...
7) Not that that matters anyways, because we're not really here to help you fix your code. If you don't know C enough to fix a trivial issue, you shouldn't really be coding a module in the first place (or try to edit the existing source, for that matter).
If you like my modules, pls consider donating (through PayPal) or becoming a monthly Patron ;];]

Post Reply