<?xml version="1.0" encoding="utf-8" ?> 
        
<!-- This script is run as long as the user is connected to
    the server over the network. It is loaded by ServerConnect.xml -->
<!-- This handles server stuff, like responding to pings,
    disconnect messages, etc.  -->
<sector name="ServerSysCode">
    
    <!-- Server Code -->
    <!-- This sector is all about reacting to packet data. -->
    <tServerSysCode prototype="Entity">
        
        <!-- REACTION SECTION -->
        <tNetReceive prototype="ReactionNetworkReceive">
            <iCond>0</iCond>
            <expr>"iCond = ( sMsgType == "PING" )"</expr>
            <if>
                <rCondition>iCond</rCondition>
                <then>
                    <!-- We must respond to PING messages with a PONG. -->
                    <sMsg>"PONG;"</sMsg>
                    <iMsgLength>-1</iMsgLength>
                    <fTimePrevRcvd>0</fTimePrevRcvd>
                    <fLocalTimePrevRcvd>0</fLocalTimePrevRcvd>
                    <iSeqNum>0</iSeqNum>
                    <expr>"sMsg = "PONG;" + sFName + ";""</expr>
                    <expr>iMsgLength = - 1</expr>
                    <tSendNameRequest prototype="ActionNetworkSend">
                        <rTimePrevRcvd>fTimePrevRcvd</rTimePrevRcvd>
                        <rLocalTimePrevRcvd>fLocalTimePrevRcvd</rLocalTimePrevRcvd>
                        <rSeqNum>iSeqNum</rSeqNum>
                        <rMsgData>sMsg</rMsgData>
                        <rMsgLengths>iMsgLength</rMsgLengths>
                        <rSocket>iSocket</rSocket>
                        <rPeerPortNum>iPeerPort</rPeerPortNum>
                        <rPeerIPAddr>iChosenIPAddress</rPeerIPAddr>
                    </tSendNameRequest>
                </then>
            </if>
        </tNetReceive>
        <!-- END REACTION SECTION -->
        
    </tServerSysCode>
    
</sector>