AnnieRuru
~~Cute~Cute~Scripter~~
- Messages
- 1,677
- Points
- 0
- Location
- your next door ~
- Discord
- AnnieRuru#1609
- Github
- AnnieRuru
- Emulator
- Client Version
- 2019-05-30aRagexeRE
Download: 1.5
plugin
create table maintenance (
id int primary key auto_increment,
account_id int,
name varchar(23),
reason varchar(99),
minlv2connect tinyint,
order_time datetime,
start_time datetime,
end_time datetime
) engine = innodb;
.
remember to enable HPMHooking to enable this modification
.
.
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
then you come to the right place
.
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 it times up ( `end_time` field ), or manually do `@maintenanceoff`
Note:
you can't generate a new line using 'INSERT INTO' Sql syntax when server is online
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.
.
.
.
if you have already finished fixing the script/source code, and there's still a lot of time left
you 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 ?
.
.
this will make an announcement on Monday, 2:55AM that the server will have a regular server maintenance starts 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 not
return 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
plugin
create table maintenance (
id int primary key auto_increment,
account_id int,
name varchar(23),
reason varchar(99),
minlv2connect tinyint,
order_time datetime,
start_time datetime,
end_time datetime
) engine = innodb;
.
remember to enable HPMHooking to enable this modification
Code:
plugins_list: [
/* Enable HPMHooking when plugins in use rely on Hooking */
"HPMHooking",
.
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
then you come to the right place
.
Code:
@maintenance <Group ID can stay 1~99> <duration to kick in minute> <maintenance duration in minute> <reason>
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 it times up ( `end_time` field ), or manually do `@maintenanceoff`
Note:
you can't generate a new line using 'INSERT INTO' Sql syntax when server is online
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.
.
.
.
Code:
@maintenanceoff
you 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 ?
.
Code:
- script jsdfksdj FAKE_NPC,{
OnMon0255:
maintenance 40, 5, 60;
end;
}
this will make an announcement on Monday, 2:55AM that the server will have a regular server maintenance starts 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 not
return 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
1.2
plugin
patch
--- initialize all short/inf variable because of st*p*d compiler problem
--- change intif-broadcast into intif-broadcast2 to allow changing announcement color
1.3
plugin
patch
nothing much change other than increase readability
--- fix all misleading aaa[255] into output[CHAT_SIZE_MAX]
--- move the config value to battle folder for the patch
1.4
plugin
- nothing change much, other than fixing to the new format
1.5
plugin
- update to latest revision, but nothing else is change
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
1.2
plugin
patch
--- initialize all short/inf variable because of st*p*d compiler problem
--- change intif-broadcast into intif-broadcast2 to allow changing announcement color
1.3
plugin
patch
nothing much change other than increase readability
--- fix all misleading aaa[255] into output[CHAT_SIZE_MAX]
--- move the config value to battle folder for the patch
1.4
plugin
- nothing change much, other than fixing to the new format
1.5
plugin
- update to latest revision, but nothing else is change
Last edited by a moderator:

