<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">


<meta name=Generator content="Microsoft Word 10 (filtered)">

<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
span.EmailStyle17
        {font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

<body bgcolor=white lang=EN-US link=blue vlink=blue>

<div class=Section1>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Way to go Shockwave.&nbsp; Hopefully we will
have an excellent tool for us MOH:AA admins to use.&nbsp; Look forward to testing it
out.........I probably speak for the group too!... </span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Firewalker</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Tahoma><span
style='font-size:10.0pt;font-family:Tahoma'>-----Original Message-----<br>
<b><span style='font-weight:bold'>From:</span></b> [-SF-]Shockwave
[mailto:shockwave@clanshortfuse.com] <br>
<b><span style='font-weight:bold'>Sent:</span></b> Saturday, September 07, 2002
10:41 AM<br>
<b><span style='font-weight:bold'>To:</span></b> mohaa@icculus.org<br>
<b><span style='font-weight:bold'>Subject:</span></b> [mohaa] MOHAA Linux admin
tool - UPDATE</span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;</span></font></p>

<div>

<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>Hello everyone!</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>I have been working on the programs
and&nbsp;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.&nbsp; 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.&nbsp; In the
meantime, I figured it might be a good idea to let everyone know some more of
the technical details.&nbsp; This way if anyone has any ideas, comments,
questions, or criticisms I can address them before I release the code.&nbsp;
Hopefully this will make it a better utility in the long run.&nbsp; Having said
that, here is a list of the loader's features:</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>-&nbsp;Configuration file</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp; On startup, a
configuration file is read to provide the loader with information needed to
operate the game server and the loader itself.&nbsp; This is where the command
to launch MOHAA is located along with several other settings that adjust how
the loader operates.&nbsp; If you are running more than one server on a system,
they should each have their own config file specified on the command
line.&nbsp; Below is a copy of the configuration file I am currently using:</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>#<br>
#&nbsp; MOHAA Loader Configuration File<br>
#<br>
#&nbsp; - All characters after a &quot;#&quot; on a line are comments and will
be ignored.<br>
#&nbsp; - All blank lines will be ignored.<br>
#&nbsp; - The only option that must be specified in this file is PROGRAM.&nbsp;
Without<br>
#&nbsp;&nbsp;&nbsp; it, the loader cannot operate.&nbsp; All other settings
have defaults already<br>
#&nbsp;&nbsp;&nbsp; specified within the loader itself.<br>
#</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>#<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</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>#<br>
# Specify message broadcast interval in seconds.<br>
#<br>
MSG_INTERVAL = 300</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>#<br>
# Specify if messages are to be printed.&nbsp; Setting this to anything other
than<br>
# &quot;Y&quot; will suppress message output to the server.&nbsp; Normal
processing will<br>
# continue regardless of how this is set.<br>
#<br>
MSG_PRINT = Y</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>#<br>
# Specify limit of how many lines of the total message to print during each<br>
# broadcast.&nbsp; Setting this to any value less than &quot;1&quot; will not
impose any limit<br>
# at all.&nbsp; Values of &quot;1&quot; 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</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>#<br>
# Specify the amount of time to wait between printing each line in seconds.<br>
#<br>
MSG_LINE_DELAY = 0</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>#<br>
# Specify server broadcast message content.&nbsp; Each line of text must begin
with<br>
# the text &quot;MSG_LINE&quot; and will be broadcast in the order it appears
here.&nbsp; 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>
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; e.g.&nbsp; MSG_LINE = NULL<br>
# The line will count towards the limit, but not be printed.<br>
#<br>
MSG_LINE = Welcome to RAGNAROK!&nbsp; 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.&nbsp; Friendly Fire OFF.&nbsp; Have fun and fight
honorably.</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>#<br>
# Ban messages can be tailored by using the BAN_MSG_START and BAN_MSG_END<br>
# config variables.&nbsp; The START component will be printed before the
player's<br>
# name and the END component will be printed after the player's name.&nbsp;
After<br>
# the player has been kicked, the message will be assembled and sent to the<br>
# console.<br>
#</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>#<br>
# Specify start text of ban message.<br>
#<br>
BAN_MSG_START =</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>#<br>
# Specify end text of ban message.<br>
#<br>
BAN_MSG_END =</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'><br>
#####################<br>
#<br>
# E O F<br>
#</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>&nbsp;</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp; 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.&nbsp; Simply use
a text editor and make whatever changes you require and they will be picked
up&nbsp;during the next message cycle, whether you have opted to broadcast
anything or not.</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp; 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.&nbsp; I have tested
every combination I could think of and everything runs smoothly.&nbsp; If the
explanation given in the configuration file of how it all works&nbsp;still
leaves anyone with questions,&nbsp;please let me know.&nbsp; Also, if anyone
requires message handling that this system doesn't support I'd like to hear the
specifics.</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>- Command line overrides</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp; Options can be
placed on the command line to override program defaults not handled by the
configuration file.&nbsp; Here is the output generated by invoking the loader's
--help option:</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>Usage: mohaa_loader [--host host]
[--port port] [--cfg filename] [--log filename] [--ban filename]<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mohaa_loader --defaults<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mohaa_loader --help</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
--host&nbsp;&nbsp; IP address or host name: name must resolve to an IP address<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
(e.g. localhost&nbsp; or&nbsp; 192.168.1.1&nbsp; or&nbsp; <a
href="http://www.myserver.com">www.myserver.com</a>)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --port&nbsp;&nbsp; port number<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --cfg&nbsp;&nbsp;&nbsp; path to
configuration file, including filename itself<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
(e.g.&nbsp; /usr/local/games/MOHAA/yourconfig.cfg)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --log&nbsp;&nbsp;&nbsp; path to game
server log file, including filename itself<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
(e.g.&nbsp; /usr/local/games/MOHAA/server.log)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --ban&nbsp;&nbsp;&nbsp; path to
banned IP file, including filename itself<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
(e.g.&nbsp; /usr/local/games/MOHAA/badboys.cfg)</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
--defaults<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; prints
current program defaults and exits<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --help<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; prints this
usage information and exits</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp; As you can see,
you have the ability to either share or specify&nbsp;different files for banned
IP addresses.&nbsp; 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.&nbsp; 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.</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp; I also want to
take a moment and discuss the --host and --port options, specifically as they
relate to system security.&nbsp; I have set the program default for&nbsp;--host
to &nbsp;&quot;localhost&quot; because I didn't employ any encryption on the
socket connections.&nbsp; Specifying an Internet address means that the socket
will be exposed externally and that might not be the best idea.&nbsp; Personally,
I use PuTTY&nbsp;(a free utility found here:&nbsp; <a
href="http://www.chiark.greenend.org.uk/~sgtatham/putty/">http://www.chiark.greenend.org.uk/~sgtatham/putty/</a>&nbsp;)&nbsp;to
connect to the game server if I'm using a Windows system or &quot;ssh&quot;
from the Linux shell prompt if I'm on a Linux system because the connection is
encrypted.&nbsp; Once connected, I invoke the program I want to run by using
the &quot;screen&quot; program (e.g. screen
batch_file_that_starts_loader).&nbsp; This allows me to &lt;Ctrl&gt;&lt;A&gt;&lt;Ctrl&gt;&lt;D&gt;
to detach from the process and keep it running.&nbsp; I can then disconnect and
go about my business.&nbsp; To regain control, I ssh back into the server and
issue the command &quot;screen -r&quot; to pick up the process.&nbsp; I can
&lt;Ctrl&gt;&lt;C&gt; at any time while connected to the process to kill it entirely.&nbsp;
I apologize if this is review for any of you, but I want to be sure I explain
the situation thoroughly.</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>- Game server by clients via sockets</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp; The loader starts
the game server using a piped open in order to feed input to the server
process.&nbsp; 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.&nbsp; If the client connection process receives a
connection request, it forks two processes to handle input and output from the
client respectively.&nbsp; Each additional client that connects will receive
its own set of I/O processes as well.&nbsp; So far I have connected with two
clients at the same time and everything worked well.&nbsp; The client program
operates similarly and forks to accommodate I/O on separate processes.&nbsp;
The result is&nbsp;smooth traffic flow without&nbsp;devouring large amounts of
server resources.&nbsp;Unfortunately, I was unable to latch onto the output
from the game server itself directly.&nbsp; 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.&nbsp; Therefore, server output is
processed by opening filehandles to the server log and tailing it.&nbsp; The
data&nbsp;is fed&nbsp;to the loader's input channel&nbsp;and subsequently out
via sockets to each client connected.</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>- Banned IP file handling</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp; As I stated
earlier, there is a process running whose job is solely to monitor server
output and react accordingly.&nbsp; This is the process that watches for banned
players.&nbsp; When a player connects, it re-reads the banned IP file and
checks it against the players currently connected to the server.&nbsp; Upon
getting a match, the player in question is kicked and a ban message is output
to the server.</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>======</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>Well, that's about all I have for
now.&nbsp; I've been a little short on sleep lately, so I apologize in advance
for anything I may have omitted.&nbsp; 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.&nbsp; Any feedback, technical or otherwise, is
solicited.&nbsp; I want to make this a viable tool for all of us who are
responsible for&nbsp;administrating Linux MOHAA game servers and the best way
to do that is to maintain an open forum.&nbsp; Thanks for your time and I'll
let everyone know when the client is finished.&nbsp; With any luck it will be
either today or tomorrow.</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>Shockwave</span></font></p>

</div>

</div>

</body>

</html>