コード例 #1
0
//============================================================================


/*
 * ==============
 * =
 * = HSendPacket
 * =
 * ==============
 */

        void HSendPacket(int node, int flags)
        {
            netbuffer.checksum = NetbufferChecksum() | flags;

            if (!node)
            {
                reboundstore  = *netbuffer;
                reboundpacket = true;
                return;
            }

            if (demoplayback)
            {
                return;
            }

            if (!netgame)
            {
                I_Error("Tried to transmit to another node");
            }

            doomcom.command    = CMD_SEND;
            doomcom.remotenode = node;
            doomcom.datalength = NetbufferSize();

            if (debugfile)
            {
                int i;
                int realretrans;
                if (netbuffer.checksum & NCMD_RETRANSMIT)
                {
                    realretrans = ExpandTics(netbuffer.retransmitfrom);
                }
                else
                {
                    realretrans = -1;
                }
                fprintf(debugfile, "send (%i + %i, R %i) [%i] "
                        , ExpandTics(netbuffer.starttic), netbuffer.numtics, realretrans, doomcom.datalength);
                for (i = 0; i < doomcom.datalength; i++)
                {
                    fprintf(debugfile, "%i ", ((byte *)netbuffer)[i]);
                }
                fprintf(debugfile, "\n");
            }

            I_NetCmd();
        }
コード例 #2
0
 public doomcom_t()
 {
     data = new doomdata_t();
 }