Server Help

ASSS Custom Projects - <c> motd (Staff Message of the Day)

JoWie - Sun Sep 30, 2007 2:26 pm
Post subject: <c> motd (Staff Message of the Day)
Staff Message Of The Day.



Adds two commands:
?motd
?setmod

if you have access to ?motd, you also get the message whenever you join the zone.
Bak - Sun Sep 30, 2007 6:52 pm
Post subject:
you seem to have two cfg's everywhere:

Quote:
// Interfaces
local Imodman *mm;
local Ichat *chat;
local Icapman *capman;
local Iconfig *cfg;
local Icmdman *cmd;
local Iconfig *cfg;
local Iplayerdata *pd;


Quote:
chat = mm->GetInterface(I_CHAT,ALLARENAS);
capman = mm->GetInterface(I_CAPMAN,ALLARENAS);
cfg = mm->GetInterface(I_CONFIG,ALLARENAS);
cmd = mm->GetInterface(I_CMDMAN, ALLARENAS);
cfg = mm->GetInterface(I_CONFIG, ALLARENAS);
pd = mm->GetInterface(I_PLAYERDATA, ALLARENAS);

if (!chat || !capman || !cfg || !cmd || !cfg || !pd) {
printf("<motd> Missing Interface\n");
return MM_FAIL;
} else {


which isn't too big of a deal; I'm not sure how you got it to compile with two variables with the same name though.

also, in MM_LOAD, if getting one of the interfaces fails, you return MM_FAIL without releasing the rest of the interfaces. This isn't a problem if the module is in modules.conf because the server won't start if any of the modules fail to load, however if the module is inserted with *insmod and fails to load, the reference count for the interfaces that did load will be incorrect and other modules will not be able to unload. Mostly only a problem if the server uses dynamic loading and unloading of modules... other than that looks good!
JoWie - Mon Oct 01, 2007 3:59 pm
Post subject:
ah thanks,

it is a bit odd GCC didn't show any warning or error about the variable.

anyways, I uploaded a new version
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group