The creator of these plugins has not shown activity in a while. Posting in this board may not result in a fast reply or a reply at all. [ Read the full Support Disclaimer here ]

Pages: [1]   Go Down
  Print  
Author Topic: Console Commands  (Read 6492 times) Bookmark and Share
Moderator
*
OS: Linux
Type: Owner dedicated server(s)
Gameservers: COD4
Posts: 228
Offline Offline
WWW
« on: January 04, 2009, 02:51:50 AM »

Hi
sometimes there is a must to launch some console commands at desired time to perform some maintenance (or smth) on the server when there are no players connected, mostly at night. However, probably we're sleeping at this time as well. Because of that we're updating our PB ban lists at night there is a must to launch two commands: pb_sv_banempty - to empty current ban list, and pb_sv_banload - to load a new list again. I've developed new plugin which is able to call defined list of commands at desired time. Config file looks like this:
Code:
<configuration plugin="consolecommand">
  <settings name="settings">
    <set name="hour">5</set>
    <set name="minute">0</set>    
  </settings>
  <commands>
    <command>pb_sv_banempty</command>
    <command>pb_sv_banload</command>
  </commands>
</configuration>
At commands section you can define as many commands as you like, not only those two. The result of executed commands are stored in the log file:

Code:
090104 05:00:02 DEBUG ConsolecommandPlugin: Command started: pb_sv_banempty
090104 05:00:03 DEBUG ConsolecommandPlugin: Command response: ^3GV Protected Server: Ban List (in Memory) has been Emptied
090104 05:00:03 DEBUG ConsolecommandPlugin: Command started: pb_sv_banload
090104 05:00:04 DEBUG ConsolecommandPlugin: Command response: ^3GV Protected Server: xxxxx Bans loaded from .....cod4/pb/pbbans.dat

Download:
http://anoobis.republika.pl/b3/consolecommand/consolecommand.zip

I hope it will be usefull for you Wink

HF

regards

Anubis
« Last Edit: June 08, 2009, 08:49:31 AM by xlr8or » Logged


Senior Dev.
*
OS: Linux
Type: Home user
Posts: 3347
Offline Offline
WWW
Support Specialty: B3-Core, UrT/SmG/BFBC2 parsers, Plugin development
« Reply #1 on: January 04, 2009, 08:33:52 AM »

N1  Wink

An idea for futur versions : allowing to define different <commands> groups in the config with different times.
Maybe something like :
Code:
<configuration plugin="consolecommand">

  <commands hour="5" minute="0">
    <command>pb_sv_banempty</command>
    <command>pb_sv_banload</command>
  </commands>

  <commands hour="6" minute="30">
    <command>bigtext go to bed kids !</command>
  </commands>

  <commands day="1" month="1" hour="0" minute="0">
    <command>bigtext Happy new year !</command>
  </commands>

</configuration>
Logged

Moderator
*
OS: Linux
Type: Owner dedicated server(s)
Gameservers: COD4
Posts: 228
Offline Offline
WWW
« Reply #2 on: January 04, 2009, 11:34:14 PM »

yeah... good point. Thanks for feedback.
Logged

Full Member
***
Posts: 59
Offline Offline
« Reply #3 on: January 07, 2009, 02:44:47 PM »

I have each of my game servers installed under their own user accounts and I have a copy of B3 installed along side each of those servers.

So for instance I have a cod4 server installed at /home/cod4-1 and I have b3 installed at /home/cod4-1/b3  the user on the account is cod4-1 and the group is "servers". Could there be a way to make this plugin interact in the linux environment. Maybe shutdown the game server and rotate out the game logs at a given time and then restart the server?

Be a good way of cleaning up large log files before they reach 2gb and crash the server.
Logged
Senior Dev.
*
OS: Linux
Type: Home user
Posts: 3347
Offline Offline
WWW
Support Specialty: B3-Core, UrT/SmG/BFBC2 parsers, Plugin development
« Reply #4 on: January 07, 2009, 02:49:47 PM »

@fistfght: a plugin can indeed run shell commands, but as the user used to run b3.
Also, if you want to rotate your logs, look at http://linuxcommand.gds.tuwien.ac.at/man_pages/logrotate8.html
Logged

Full Member
***
Posts: 59
Offline Offline
« Reply #5 on: January 07, 2009, 04:31:13 PM »

@fistfght: a plugin can indeed run shell commands, but as the user used to run b3.
Also, if you want to rotate your logs, look at http://linuxcommand.gds.tuwien.ac.at/man_pages/logrotate8.html
@Courgette: I looked into that once and had issues with it because if the game server was running still then the log file was open for writing. If the log was rotated out a new file was never created until the game server was restarted.

I use scinterface to run my servers and I use a script on it now that allows me to stop, delete and restart the server (thus creating a new log) but I have to run the script from the interface manually.

Be nice to automate the process. Guess I need to keep experimenting.

Logged
Former Dev. (senate)
*****
OS: Linux
Type: Owner dedicated server(s)
Gameservers: OpenArena
Posts: 258
Offline Offline
« Reply #6 on: August 28, 2010, 02:29:22 AM »

I use scinterface to run my servers and I use a script on it now that allows me to stop, delete and restart the server (thus creating a new log) but I have to run the script from the interface manually.

Be nice to automate the process. Guess I need to keep experimenting.

2 options :

- After logrotate rotated the logs, touch a new empty file :

Code:
       # sample logrotate configuration file
       compress

       /home/user/yourgame/some.log {
           rotate 5
           daily
           postrotate
                                     touch /home/user/yourgame/some.log
           endscript
       }

- Use a script Ive made to work on any q3a based game, called OpenArena Multi-Purpose Server Launcher. It has the capability to rotate logs based on size limit, before launching the game server. It has many other features as well.

More infos :

http://www.superbots.org/modules.php?name=Downloads&op=getit&lid=28
Logged
Tags:
Pages: [1]   Go Up
  Print  
 
Jump to:  


Rate this page +1 at Google Search


SimplePortal 2.3.1 © 2008-2009, SimplePortal