<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2719.2200" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hello everyone!</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I have been working on the programs and am
happy to report that the server component is finished and it appears to be
stable after the last batch of tests I have run. The client program is
also functional, but I am going to work on it a little more before I release
anything just to be sure I worked out most of the kinks. In the meantime,
I figured it might be a good idea to let everyone know some more of the
technical details. This way if anyone has any ideas, comments, questions,
or criticisms I can address them before I release the code. Hopefully this
will make it a better utility in the long run. Having said that, here is a
list of the loader's features:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>- Configuration file</FONT></DIV>
<DIV><FONT face=Arial size=2> On startup, a configuration file
is read to provide the loader with information needed to operate the game server
and the loader itself. This is where the command to launch MOHAA is
located along with several other settings that adjust how the loader
operates. If you are running more than one server on a system, they should
each have their own config file specified on the command line. Below is a
copy of the configuration file I am currently using:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>#<BR># MOHAA Loader Configuration
File<BR>#<BR># - All characters after a "#" on a line are comments and
will be ignored.<BR># - All blank lines will be ignored.<BR># - The
only option that must be specified in this file is PROGRAM.
Without<BR># it, the loader cannot operate. All other
settings have defaults already<BR># specified within the
loader itself.<BR>#</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>#<BR># Specify the fully qualified path to the game
server program including all<BR># command line options.<BR>#<BR>PROGRAM =
/usr/local/games/MOHAA/mohaa_lnxded +set dedicated 1 +set cheats 0 +set
ui_console 1 +set g_gametype 2 +set sv_maxclients 18 +set developer 2 +map
dm/mohdm1 +exec server.cfg</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>#<BR># Specify message broadcast interval in
seconds.<BR>#<BR>MSG_INTERVAL = 300<BR></FONT></DIV>
<DIV><FONT face=Arial size=2>#<BR># Specify if messages are to be printed.
Setting this to anything other than<BR># "Y" will suppress message output to the
server. Normal processing will<BR># continue regardless of how this is
set.<BR>#<BR>MSG_PRINT = Y</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>#<BR># Specify limit of how many lines of the total
message to print during each<BR># broadcast. Setting this to any value
less than "1" will not impose any limit<BR># at all. Values of "1" or
greater will cause the number of lines specified by<BR># this value to print
with the appropriate MSG_LINE_DELAY between each line.<BR># Once the limit has
been reached, the program will pause for the number of<BR># seconds indicated by
MSG_INTERVAL.<BR>#<BR>MSG_LINE_LIMIT = 0</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>#<BR># Specify the amount of time to wait between
printing each line in seconds.<BR>#<BR>MSG_LINE_DELAY = 0<BR></FONT></DIV>
<DIV><FONT face=Arial size=2>#<BR># Specify server broadcast message
content. Each line of text must begin with<BR># the text "MSG_LINE" and
will be broadcast in the order it appears here. If<BR># you want to split
broadcasts into logical groups using the MSG_LINE_LIMIT<BR># setting but don't
want to print content for all possible lines in a given<BR># grouping, use a
null line:<BR># e.g. MSG_LINE =
NULL<BR># The line will count towards the limit, but not be
printed.<BR>#<BR>MSG_LINE = Welcome to RAGNAROK! Server IP:
216.42.80.176<BR>MSG_LINE = Server Admin email: <A
href="mailto:shockwave@clanshortfuse.com">shockwave@clanshortfuse.com</A><BR>MSG_LINE
= No Realism. Friendly Fire OFF. Have fun and fight
honorably.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>#<BR># Ban messages can be tailored by using the
BAN_MSG_START and BAN_MSG_END<BR># config variables. The START component
will be printed before the player's<BR># name and the END component will be
printed after the player's name. After<BR># the player has been kicked,
the message will be assembled and sent to the<BR>#
console.<BR>#<BR></DIV></FONT>
<DIV><FONT face=Arial size=2>#<BR># Specify start text of ban
message.<BR>#<BR>BAN_MSG_START =</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>#<BR># Specify end text of ban
message.<BR>#<BR>BAN_MSG_END =</FONT></DIV>
<DIV> </DIV><FONT face=Arial size=2>
<DIV><BR>#####################<BR>#<BR># E O F<BR>#</DIV>
<DIV> </DIV>
<DIV> The configuration file is re-read after each message
interval has elapsed to provide for the ability to change every setting with the
exception of PROGRAM. Simply use a text editor and make whatever changes
you require and they will be picked up during the next message cycle,
whether you have opted to broadcast anything or not.</DIV>
<DIV> I spent some time thinking about how to handle server
message broadcasts and I tried to develop a structure that would be both easy to
use and flexible. I have tested every combination I could think of and
everything runs smoothly. If the explanation given in the configuration
file of how it all works still leaves anyone with questions, please
let me know. Also, if anyone requires message handling that this system
doesn't support I'd like to hear the specifics.</DIV>
<DIV></FONT> </DIV>
<DIV><FONT face=Arial size=2>- Command line overrides</FONT></DIV>
<DIV><FONT face=Arial size=2> Options can be placed on the
command line to override program defaults not handled by the configuration
file. Here is the output generated by invoking the loader's --help
option:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Usage: mohaa_loader [--host host] [--port port]
[--cfg filename] [--log filename] [--ban
filename]<BR> mohaa_loader
--defaults<BR> mohaa_loader
--help</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>
--host IP address or host name: name must resolve to an IP
address<BR>
(e.g. localhost or 192.168.1.1 or <A
href="http://www.myserver.com">www.myserver.com</A>)<BR>
--port port number<BR>
--cfg path to configuration file, including filename
itself<BR>
(e.g.
/usr/local/games/MOHAA/yourconfig.cfg)<BR>
--log path to game server log file, including filename
itself<BR>
(e.g.
/usr/local/games/MOHAA/server.log)<BR>
--ban path to banned IP file, including filename
itself<BR>
(e.g. /usr/local/games/MOHAA/badboys.cfg)</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>
--defaults<BR>
prints current program defaults and
exits<BR>
--help<BR>
prints this usage information and exits</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> As you can see, you have the
ability to either share or specify different files for banned IP
addresses. However, it is important to note that the log files and
configuration files for each server you are running be separate and properly
specified on the command line. Running the command with the --defaults
option will dump the internal program defaults so you can see what the settings
will be if they are not overridden either on the command line or in the
configuration file.</FONT></DIV>
<DIV><FONT face=Arial size=2> I also want to take a moment and
discuss the --host and --port options, specifically as they relate to system
security. I have set the program default for --host to
"localhost" because I didn't employ any encryption on the socket
connections. Specifying an Internet address means that the socket will be
exposed externally and that might not be the best idea. Personally, I use
PuTTY (a free utility found here: <A
href="http://www.chiark.greenend.org.uk/~sgtatham/putty/">http://www.chiark.greenend.org.uk/~sgtatham/putty/</A> ) to
connect to the game server if I'm using a Windows system or "ssh" from the Linux
shell prompt if I'm on a Linux system because the connection is encrypted.
Once connected, I invoke the program I want to run by using the "screen" program
(e.g. screen batch_file_that_starts_loader). This allows me to
<Ctrl><A><Ctrl><D> to detach from the process and keep
it running. I can then disconnect and go about my business. To
regain control, I ssh back into the server and issue the command "screen -r" to
pick up the process. I can <Ctrl><C> at any time while
connected to the process to kill it entirely. I apologize if this is
review for any of you, but I want to be sure I explain the situation
thoroughly.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>- Game server by clients via sockets</FONT></DIV>
<DIV><FONT face=Arial size=2> The loader starts the game
server using a piped open in order to feed input to the server process.
Once the server is running, the loader forks processes to handle server
messaging, monitoring output for kicking banned IP's, and servicing incoming
client connections. If the client connection process receives a connection
request, it forks two processes to handle input and output from the client
respectively. Each additional client that connects will receive its own
set of I/O processes as well. So far I have connected with two clients at
the same time and everything worked well. The client program operates
similarly and forks to accommodate I/O on separate processes. The result
is smooth traffic flow without devouring large amounts of server
resources. Unfortunately, I was unable to latch onto the output from the
game server itself directly. Piped opens, IPC::Open2, and named pipes
didn't seem to allow it much less facilitate good communications with clients
attempting to connect to the loader. Therefore, server output is processed
by opening filehandles to the server log and tailing it. The data is
fed to the loader's input channel and subsequently out via sockets to
each client connected.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>- Banned IP file handling</FONT></DIV>
<DIV><FONT face=Arial size=2> As I stated earlier, there is a
process running whose job is solely to monitor server output and react
accordingly. This is the process that watches for banned players.
When a player connects, it re-reads the banned IP file and checks it against the
players currently connected to the server. Upon getting a match, the
player in question is kicked and a ban message is output to the
server.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>======</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Well, that's about all I have for now. I've
been a little short on sleep lately, so I apologize in advance for anything I
may have omitted. Next on the list will be finishing off the client
program so I can release everything to those who have expressed an interest in
testing. Any feedback, technical or otherwise, is solicited. I want
to make this a viable tool for all of us who are responsible
for administrating Linux MOHAA game servers and the best way to do that is
to maintain an open forum. Thanks for your time and I'll let everyone know
when the client is finished. With any luck it will be either today or
tomorrow.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Shockwave</FONT></DIV></BODY></HTML>