diff options
author | Rene Stoeckel <[email protected]> | 2004-09-22 19:22:16 +0000 |
---|---|---|
committer | Rene Stoeckel <[email protected]> | 2004-09-22 19:22:16 +0000 |
commit | c4fcffe436fbfb5b0f3b7be2e5ee103ec74932f7 (patch) | |
tree | 7c9439ab1d9f5a4fd61bd57c755069007b23e0b6 /src/jake2/qcommon/netchan_t.java | |
parent | bcb4ac6eefb425d5b0a90009da506361d5739e75 (diff) |
major refactoring in game, server and client package
Diffstat (limited to 'src/jake2/qcommon/netchan_t.java')
-rw-r--r-- | src/jake2/qcommon/netchan_t.java | 122 |
1 files changed, 65 insertions, 57 deletions
diff --git a/src/jake2/qcommon/netchan_t.java b/src/jake2/qcommon/netchan_t.java index 06a283a..77022d6 100644 --- a/src/jake2/qcommon/netchan_t.java +++ b/src/jake2/qcommon/netchan_t.java @@ -1,79 +1,87 @@ /* -Copyright (C) 1997-2001 Id Software, Inc. + * Copyright (C) 1997-2001 Id Software, Inc. + * + * This program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. + * + * See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place - Suite 330, Boston, MA 02111-1307, USA. + * + */ -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. +// Created on 27.11.2003 by RST. +// $Id: netchan_t.java,v 1.2 2004-09-22 19:22:09 salomo Exp $ +package jake2.qcommon; -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +import jake2.*; -See the GNU General Public License for more details. +public class netchan_t { -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + public boolean fatal_error; -*/ + // was enum {NS_CLIENT, NS_SERVER} + public int sock; -// Created on 27.11.2003 by RST. -// $Id: netchan_t.java,v 1.1 2004-07-07 19:59:34 hzi Exp $ + public int dropped; // between last packet and previous -package jake2.qcommon; + public int last_received; // for timeouts -import jake2.*; + public int last_sent; // for retransmits -public class netchan_t { + public netadr_t remote_address = new netadr_t(); + + public int qport; // qport value to write when transmitting + + // sequencing variables + public int incoming_sequence; + + public int incoming_acknowledged; + + public int incoming_reliable_acknowledged; // single bit + public int incoming_reliable_sequence; // single bit, maintained local - public boolean fatal_error; + public int outgoing_sequence; - // was enum {NS_CLIENT, NS_SERVER} - public int sock; + public int reliable_sequence; // single bit - public int dropped; // between last packet and previous + public int last_reliable_sequence; // sequence number of last send - public int last_received; // for timeouts - public int last_sent; // for retransmits + // reliable staging and holding areas + public sizebuf_t message = new sizebuf_t(); // writing buffer to send to + // server - public netadr_t remote_address = new netadr_t(); - public int qport; // qport value to write when transmitting + public byte message_buf[] = new byte[Defines.MAX_MSGLEN - 16]; // leave + // space for + // header - // sequencing variables - public int incoming_sequence; - public int incoming_acknowledged; - public int incoming_reliable_acknowledged; // single bit + // message is copied to this buffer when it is first transfered + public int reliable_length; - public int incoming_reliable_sequence; // single bit, maintained local + public byte reliable_buf[] = new byte[Defines.MAX_MSGLEN - 16]; // unpcked + // reliable + // message - public int outgoing_sequence; - public int reliable_sequence; // single bit - public int last_reliable_sequence; // sequence number of last send + //ok. + public void clear() { + sock = dropped = last_received = last_sent = 0; + remote_address = new netadr_t(); + qport = incoming_sequence = incoming_acknowledged = incoming_reliable_acknowledged = incoming_reliable_sequence = outgoing_sequence = reliable_sequence = last_reliable_sequence = 0; + message = new sizebuf_t(); - // reliable staging and holding areas - public sizebuf_t message = new sizebuf_t(); // writing buffer to send to server - public byte message_buf[] = new byte[Defines.MAX_MSGLEN - 16]; // leave space for header + message_buf = new byte[Defines.MAX_MSGLEN - 16]; - // message is copied to this buffer when it is first transfered - int reliable_length; - - byte reliable_buf[] = new byte[Defines.MAX_MSGLEN - 16]; // unpcked reliable message + reliable_length = 0; + reliable_buf = new byte[Defines.MAX_MSGLEN - 16]; + } - //ok. - public void clear() - { - sock=dropped=last_received=last_sent=0; - remote_address = new netadr_t(); - qport = incoming_sequence = incoming_acknowledged = incoming_reliable_acknowledged = incoming_reliable_sequence - = outgoing_sequence = reliable_sequence = last_reliable_sequence =0; - message = new sizebuf_t(); - - message_buf = new byte[Defines.MAX_MSGLEN - 16]; - - reliable_length =0; - reliable_buf = new byte[Defines.MAX_MSGLEN - 16]; - } - -} +}
\ No newline at end of file |