Anope IRC Services
Anope Development => Modules => Topic started by: capitaine on February 23, 2007, 02:24:56 PM
-
Hello
I have made new custom chanmode & usermode for my ircd (Unreal + Anope 1.7)
and I would like to set them with Mlock.
But it keep saying "unknown char".
How can I do ?
Spotted a thread here, but nothing more
http://forum.anope.org/viewthread.php?tid=68
[Edite le 23-2-2007 par capitaine]
[Edite le 23-2-2007 par capitaine]
-
What mode did you make? Is the module that you written for Unreal actually loaded? You can find out by typing /module. If you altered the Unreal source to create the mode then you should return to a default Unreal install and write it as a module.
-
Hello SpaceDog
I have created new +X modes, with an Unreal module.
Users have also +X, but no there's no point to mlock them of course.
This is to register channels as adult channels, so minors can get warnings.
-
Windows or linux?
[EDIT]The only way I know of to allow ChanServ to do that is by modifying the source which is NOT supported.[/EDIT].
[Edited on 23-2-2007 by SpaceDoG]
-
Linux
Ok then no way to make a module for custom modes ?
That's quite bad. ;(
Is there much code to change to add a new mode in sources ?
I have spotted a line to put in src/protocol/unreal32.c
CBModeInfo myCbmodeinfos[] = {
{'X', CMODE_X, 0, NULL, NULL}
}
but i'm afraid there is more to do....?
[Edite le 23-2-2007 par capitaine]
-
im pretty sure you could do this with an anope module, would just mean messing about with the protocol stuff :)
the whole of unreal32.c is a module in anope, if you can do it in there, you can do it in a module....
[Edited on 23-2-2007 by Rob]
-
i thought there was no more free space in mlock to add aditional modes... hence why several standard unreal modes can't be mlock'ed either...
-
to be honest with you i've never looked, but a module wouldnt be constrained by such a trivial limitation, you could simply use a whole new db file.
-
omg a new db file ?
you mean if there is actually no more space, i have to switch to a new chan.db ?....
It seems the cmode is on 4 bytes and the last is
0x04000000
So if it's signed, there's only one mode free... pheww :P
[Edite le 23-2-2007 par capitaine]
-
he meant storing the modes in a seperate database through a module to get around the limitations of anope's db.
and yeah, though there may be place for one mode or so, that would be up to the anope devs to decide what it s gonna be used for... if they would decide to use it in the next version for some mode and you have a module that uses the same spot in the same variable you are going to get weird things.... modules shouldn't use the space that s reserved to be used by/for the core...
and i thought unsigned btw :)
-
Just a quick note for some who would add modes in the last bits left.
The function db_mysql_save_cs_info must updated so positive numbers are dumped.
ret = db_mysql_try("UPDATE anope_cs_info "
"SET founder = '%s', successor = '%s', founderpass = %s, descr = '%s', url = '%s', email = '%s', time_registered = %d, "
" last_used = %d, last_topic = '%s', last_topic_setter = '%s', last_topic_time = %d, flags = %d, forbidby = '%s', "
" forbidreason = '%s', bantype = %d, accesscount = %d, akickcount = %d, mlock_on = %u, mlock_off = %u, mlock_limit = %d, "
" mlock_key = '%s', mlock_flood = '%s', mlock_redirect = '%s', entry_message = '%s', memomax = %d, botnick = '%s', botflags = %d, "
" bwcount = %d, capsmin = %d, capspercent = %d, floodlines = %d, floodsecs = %d, repeattimes = %d, active = 1 "
"WHERE name = '%s'",
....
ret = db_mysql_try("INSERT DELAYED INTO anope_cs_info "
"(name, founder, successor, founderpass, descr, url, email, time_registered, last_used, last_topic, last_topic_setter, "
" last_topic_time, flags, forbidby, forbidreason, bantype, accesscount, akickcount, mlock_on, mlock_off, mlock_limit, "
" mlock_key, mlock_flood, mlock_redirect, entry_message, botnick, botflags, bwcount, capsmin, capspercent, floodlines, "
" floodsecs, repeattimes, active) "
"VALUES ('%s', '%s', '%s', %s, '%s', '%s', '%s', %d, %d, '%s', '%s', %d, %d, '%s', '%s', %d, %d, %d, %u, %u, %d, '%s', '%s', "
" '%s', '%s', '%s', %d, %d, %d, %d, %d, %d, %d, 1)",
....
-
we are aware of the limitation. It hasn't been changed due to it breaking compatibility with 1.6 databases and would require a new db version and update. This will not happen for Anope 1.8 either as it will also be 1.6 compatible. So if you want additional space you will need to write a module and have it write to it's own database.
-
Ok thanks for the notice ;)