Max Usermodes ??

These are old archives. They are kept for historic purposes only.
Post Reply
Fussi
Posts: 33
Joined: Fri Sep 24, 2004 9:46 pm
Location: At Home
Contact:

Max Usermodes ??

Post by Fussi »

Is there such a limit somewhere? So like a module can only register 5 new usermodes?
I've written a custom module for our irc server, and this one registers 17 (yes, 17.) usermodes. They're all free (unused) atm, but when load this module on my testserver, it only gives me the first 5 modes, the rest is ignored without any reason...

Any idea?
Fussi
Posts: 33
Joined: Fri Sep 24, 2004 9:46 pm
Location: At Home
Contact:

Post by Fussi »

i thought i should show you how i add these modes:

Code: Select all

#define FACTION_SUBSCRIBER 'Y'
.....
static long L_UMODE_SUBSCRIBER = 0L;
.....
static Umode *umode_subscriber = NULL;
.....
    umode_subscriber = UmodeAdd(modinfo->handle, FACTION_SUBSCRIBER , UMODE_GLOBAL, umode_allow_all, &L_UMODE_SUBSCRIBER);
	if (!umode_subscriber)
	{
		config_error("m_customerchanel: Could not add usermode '%s': %s",FACTION_SUBSCRIBER, ModuleGetErrorStr(modinfo->handle));
		MOD_UNLOAD(m_customerchannel)(0);
		return MOD_FAILED;
	}
As you can see, the module returns FAILED status if something goes wrong. But when i connect to the server, and type /module, it appears on that list; So i assume there are no errors while loading.

But why are then 12 modes missing?
*confused*

[Edit] Ok, it seems that either there is a limitation to a max of 5 usermodes per module OR there is a bug within Unreal, that all usermodes are added succesfully (The var is large enough,

Code: Select all

#define UMODETABLESZ (sizeof(long) * 8)
gets 8*8 = 64. The max nr of umodes possible are 26*26 = 56)
but that unreal only processes the first 32 modes. (Yeah, 32.. odd isnt it?)

I will continue my search for this "bug", would be nice if someone can verify this and search a solution too.

[Edit 2] For some reason, sizeof(long) is 4 instead of 8. I changed it to

Code: Select all

#define UMODETABLESZ 64
and now i can see all modes i added.
But i still can set only the first 32, must be something else somewhere in the /mode function. I'm too tired to continue my search -.-
Maybe someone can find out now what's going on


Thanks
aquanight
Official supporter
Posts: 862
Joined: Tue Mar 09, 2004 10:47 pm
Location: Boise, ID

Post by aquanight »

Because long is a 32-bit integer on 32-bit (ie: x86) systems. IIRC, there is no ANSI C type that is 64-bit on a 32-bit system.

So yes, unreal is limited to 32 usermodes on 32-bit systems. Not having a 64-bit system myself, I could not tell you what the limit is on a 64-bit platform.
Post Reply