oh i see, thanks Garr. let me try it :3/* Enable HPMHooking when plugins in use rely on Hooking */ //"HPMHooking",
There's your problem. This plugin uses hooking.
Okay its working now, Thank you Garr
Last edited by a moderator:
oh i see, thanks Garr. let me try it :3/* Enable HPMHooking when plugins in use rely on Hooking */ //"HPMHooking",
There's your problem. This plugin uses hooking.
do you still have the warning despite its working correctly now ?got warning on make plugin.maintenance
Code:maintenance.c: In function ‘atcommand_maintenance’:maintenance.c:222: warning: ‘group_id’ may be used uninitialized in this functionmaintenance.c:222: warning: ‘kick_duration’ may be used uninitialized in this functionmaintenance.c:222: warning: ‘maintenance_duration’ may be used uninitialized in this functionmaintenance.c:224: warning: ‘weekday’ may be used uninitialized in this functionmaintenance.c:224: warning: ‘hour’ may be used uninitialized in this functionmaintenance.c:224: warning: ‘minute’ may be used uninitialized in this functionmaintenance.c: In function ‘buildin_maintenance’:maintenance.c:401: warning: ‘weekday’ may be used uninitialized in this functionmaintenance.c:401: warning: ‘hour’ may be used uninitialized in this functionmaintenance.c:401: warning: ‘minute’ may be used uninitialized in this functionmaintenance.c: In function ‘server_online’:maintenance.c:145: warning: ‘weekday’ may be used uninitialized in this functionmaintenance.c:145: warning: ‘hour’ may be used uninitialized in this functionmaintenance.c:145: warning: ‘minute’ may be used uninitialized in this function
example for warnings indo you still have the warning despite its working correctly now ?got warning on make plugin.maintenance
maintenance.c: In function ‘atcommand_maintenance’:maintenance.c:222: warning: ‘group_id’ may be used uninitialized in this functionmaintenance.c:222: warning: ‘kick_duration’ may be used uninitialized in this functionmaintenance.c:222: warning: ‘maintenance_duration’ may be used uninitialized in this functionmaintenance.c:224: warning: ‘weekday’ may be used uninitialized in this functionmaintenance.c:224: warning: ‘hour’ may be used uninitialized in this functionmaintenance.c:224: warning: ‘minute’ may be used uninitialized in this functionmaintenance.c: In function ‘buildin_maintenance’:maintenance.c:401: warning: ‘weekday’ may be used uninitialized in this functionmaintenance.c:401: warning: ‘hour’ may be used uninitialized in this functionmaintenance.c:401: warning: ‘minute’ may be used uninitialized in this functionmaintenance.c: In function ‘server_online’:maintenance.c:145: warning: ‘weekday’ may be used uninitialized in this functionmaintenance.c:145: warning: ‘hour’ may be used uninitialized in this functionmaintenance.c:145: warning: ‘minute’ may be used uninitialized in this function
maintenance.c: In function ‘server_online’:
Hi annie.. how can i change the announce color?Download: 1.1
plugin <-- for those who knows how to install plugin
or
patch <-- for those who thinks plugin is pain
create table maintenance (id int(11) primary key auto_increment,account_id int(11),name varchar(23),reason varchar(99),minlv2connect tinyint(4),order_time datetime,start_time datetime,end_time datetime) engine = innodb;..
Note : sometimes the server countdown jumps 1 second ahead
this is normal because the timetick from time->add is unstable,
so I use unix_time to synchronize the countdown to server time
.
so, if you found some script/source code having bugs and you need to shut down your server for a short while
this is the source code you need
@maintenance <Group ID can stay 1~99> <duration to kick in minute> <maintenance duration in minute> <reason>then a GM99 can commence the maintenance
Example : '@maintenance 40 5 10 need to fix announcer script'
every player with group ID 40 and below will be kick after 5 minutes
and the server will start counting down by an announcement,
during the maintenance of 10 minutes, group ID 40 and below will deny from login into the server
`maintenance` table will also generate a new line, with the `reason` field as 'need to fix announcer script'
which is useful to know when and how many times you did emergency server shutdown
though, the actual reason for using SQL is to persist the data after server shutdown
so the server will continue being in maintenance mode despite how many times you have shut down the server
until the times up ( `end_time` field ), or do @maintenanceoff
Note : you can't generate a new line using 'INSERT INTO' Sql syntax when server is on
because I declare a bunch of variables to for them, for the purpose of saving memory consumption
you have to login the game and type @maintenance to initiate the maintenance mode, otherwise it wont work.
.
.
@maintenanceoffif you have already finished fixing the script/source code, and there's still a lot of time leftyou can type '@maintenanceoff' to immediately turn off the maintenance mode so players can login before the schedule
-- Script commands --
*maintenance <Group ID can stay 1~99>, <duration to kick in minute>, <maintenance duration in minute> { , <reason> };actually I have no idea why I wanna make a script command ... maybe just for fun ?.
- script jsdfksdj -1,{OnMon0255: maintenance 40, 5, 60; end;}this will make an announcement on Monday, 2:55AM that the server will have a regular server maintenancestarts from 3AM to 4AM
during that time, player with group ID 40 will be kicked and blocked from entering the server
the `reason` field in `maintenance` table will be defaulted to '*Regular server maintenance*'
maintenance 40, 5, 60, "系统保养";
this will overwrite the `reason` field in `maintenance` table to '系统保养' instead of regular maintenance
.
.
*maintenanceoff { <reason> };uhh ... useless I think ....
.
*maintenancecheck( <type> );use 'maintenance()' to check the server is currently in maintenance mode or notreturn 0 if server is normal
return 1 if server is going to have maintenance
return 2 if server is having maintenance
all other types are meant to myself to debug this junk
1.0
plugin
patch
1.1
plugin
patch
--- change timer reset variable from 0 into INVALID_TIMER (-1)
--- fix plugin when GM type '@maintenance' blank, it mentioned group id 0, should be showing the correct syntax
--- also change 60-5-1 into 60-10-1 when announcing countdown
--- change maintainance into maintenance hahaha, 4 of them
atcommand.c: In function 'atcommand_maintenance':atcommand.c:9403: warning: format '%99[^' expects type 'char *', but argument 6 has type 'char (*)[99]'atcommand.c:9381: warning: 'weekday' may be used uninitialized in this functionatcommand.c:9381: warning: 'hour' may be used uninitialized in this functionatcommand.c:9381: warning: 'minute' may be used uninitialized in this functionchrif.c: In function 'chrif_connectack':chrif.c:511: warning: 'weekday' may be used uninitialized in this functionchrif.c:511: warning: 'hour' may be used uninitialized in this functionchrif.c:511: warning: 'minute' may be used uninitialized in this functionscript.c: In function 'buildin_maintenance':script.c:18851: warning: 'weekday' may be used uninitialized in this functionscript.c:18851: warning: 'hour' may be used uninitialized in this functionscript.c:18851: warning: 'minute' may be used uninitialized in this function
search around line 284 in the patchHi annie.. how can i change the announce color?
chrif->maintenance_color = 0xFFFF00;
Using old gcc that why im always got warningso only my compiler so super doesn't throw errors =/ (microsoft visual c++)
Its working now, its just that i didnt know we should activate the HPMHookingdo you still have the warning despite its working correctly now ?got warning on make plugin.maintenance
maintenance.c: In function ‘atcommand_maintenance’:maintenance.c:222: warning: ‘group_id’ may be used uninitialized in this functionmaintenance.c:222: warning: ‘kick_duration’ may be used uninitialized in this functionmaintenance.c:222: warning: ‘maintenance_duration’ may be used uninitialized in this functionmaintenance.c:224: warning: ‘weekday’ may be used uninitialized in this functionmaintenance.c:224: warning: ‘hour’ may be used uninitialized in this functionmaintenance.c:224: warning: ‘minute’ may be used uninitialized in this functionmaintenance.c: In function ‘buildin_maintenance’:maintenance.c:401: warning: ‘weekday’ may be used uninitialized in this functionmaintenance.c:401: warning: ‘hour’ may be used uninitialized in this functionmaintenance.c:401: warning: ‘minute’ may be used uninitialized in this functionmaintenance.c: In function ‘server_online’:maintenance.c:145: warning: ‘weekday’ may be used uninitialized in this functionmaintenance.c:145: warning: ‘hour’ may be used uninitialized in this functionmaintenance.c:145: warning: ‘minute’ may be used uninitialized in this function
#include "../common/malloc.h"
so only my compiler so super doesn't throw errors =/ (microsoft visual c++)
it just all short/int has to be initialize
up version 1.2 to initialize all short/int variable
also allows to change announcement color by changing intif->broadcast into intif->broadcast2
btw I broke 1st post ... jabote I share your pain now
version 1.2
patch -> http://upaste.me/1ee741
plugin -> http://upaste.me/84177a
.
.
.
search around line 284 in the patchchrif->maintenance_color = 0xFFFF00;change 0xFFFF00 into annie_is_stupidHi annie.. how can i change the announce color?
hi AnnieRuru im having errors like this using the plugin:
[Error]: HPM:AddHook Fail! 'maintenance' tried to hook to 'pc->authok' but HPMHooking is disabled!
[Error]: HPM:AddHook Fail! 'maintenance' tried to hook to 'clif->pLoadEndAck' but HPMHooking is disabled!
how can i enable HPMHooking?
Thank you.
this is so weird, I just copy paste the syntax from all other atcommand within that filebut how come only mine getting error ?Hadeszeus, on 15 Sept 2014 - 14:03, said:
@Annie can you help me why im getting this compile warning?
atcommand.c:9404: warning: format '[^
' expects type 'char *', but argument 6 has type 'char (*)[99]'
char reason[99], esc_reason[198], esc_name[46], min_display[3];
const char* reason; char esc_reason[198], esc_name[46], min_display[3];;
Annie, same.this is so weird, I just copy paste the syntax from all other atcommand within that filebut how come only mine getting error ?Hadeszeus, on 15 Sept 2014 - 14:03, said:
@Annie can you help me why im getting this compile warning?
atcommand.c:9404: warning: format '[^
' expects type 'char *', but argument 6 has type 'char (*)[99]'
try replace this line
char reason[99], esc_reason[198], esc_name[46], min_display[3];into thisdidn't testCode:const char* reason; char esc_reason[198], esc_name[46], min_display[3];;
atcommand.c: In function 'atcommand_maintenance':atcommand.c:9403: warning: format '%99[^' expects type 'char *', but argument 6 has type 'const char **'
dirty methodhttp://upaste.me/9e3531Annie, same.
atcommand.c: In function 'atcommand_maintenance':atcommand.c:9403: warning: format '[^' expects type 'char *', but argument 6 has type 'const char **'

We use essential cookies to make this site work, and optional cookies to enhance your experience.