From: Carsten W. <ca...@us...> - 2004-10-17 21:31:42
|
Update of /cvsroot/jake2/jake2/src/jake2/sys In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20259/src/jake2/sys Modified Files: NET.java Log Message: NET methods refactored (name cleanup) Index: NET.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/sys/NET.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** NET.java 17 Oct 2004 20:33:17 -0000 1.4 --- NET.java 17 Oct 2004 21:31:32 -0000 1.5 *************** *** 83,87 **** * Compares without the port =================== */ ! public static boolean NET_CompareBaseAdr(netadr_t a, netadr_t b) { if (a.type != b.type) return false; --- 83,87 ---- * Compares without the port =================== */ ! public static boolean CompareBaseAdr(netadr_t a, netadr_t b) { if (a.type != b.type) return false; *************** *** 102,106 **** } ! public static String NET_BaseAdrToString(netadr_t a) { return "" + (a.ip[0] & 0xff) + "." + (a.ip[1] & 0xff) + "." + (a.ip[2] & 0xff) + "." + (a.ip[3] & 0xff); --- 102,106 ---- } ! public static String BaseAdrToString(netadr_t a) { return "" + (a.ip[0] & 0xff) + "." + (a.ip[1] & 0xff) + "." + (a.ip[2] & 0xff) + "." + (a.ip[3] & 0xff); *************** *** 138,142 **** */ ! public static boolean NET_GetLoopPacket(int sock, netadr_t net_from, sizebuf_t net_message) { loopback_t loop; --- 138,142 ---- */ ! public static boolean GetLoopPacket(int sock, netadr_t net_from, sizebuf_t net_message) { loopback_t loop; *************** *** 160,164 **** } ! public static void NET_SendLoopPacket(int sock, int length, byte[] data, netadr_t to) { int i; --- 160,164 ---- } ! public static void SendLoopPacket(int sock, int length, byte[] data, netadr_t to) { int i; *************** *** 179,183 **** sizebuf_t net_message) { ! if (NET_GetLoopPacket(sock, net_from, net_message)) { return true; } --- 179,183 ---- sizebuf_t net_message) { ! if (GetLoopPacket(sock, net_from, net_message)) { return true; } *************** *** 222,226 **** public static void SendPacket(int sock, int length, byte[] data, netadr_t to) { if (to.type == Defines.NA_LOOPBACK) { ! NET_SendLoopPacket(sock, length, data, to); return; } --- 222,226 ---- public static void SendPacket(int sock, int length, byte[] data, netadr_t to) { if (to.type == Defines.NA_LOOPBACK) { ! SendLoopPacket(sock, length, data, to); return; } *************** *** 250,254 **** * ==================== NET_OpenIP ==================== */ ! public static void NET_OpenIP() { cvar_t port, ip; --- 250,254 ---- * ==================== NET_OpenIP ==================== */ ! public static void OpenIP() { cvar_t port, ip; *************** *** 257,265 **** if (ip_sockets[Defines.NS_SERVER] == null) ! ip_sockets[Defines.NS_SERVER] = NET_Socket(Defines.NS_SERVER, ip.string, (int) port.value); if (ip_sockets[Defines.NS_CLIENT] == null) ! ip_sockets[Defines.NS_CLIENT] = NET_Socket(Defines.NS_CLIENT, ip.string, Defines.PORT_ANY); } --- 257,265 ---- if (ip_sockets[Defines.NS_SERVER] == null) ! ip_sockets[Defines.NS_SERVER] = Socket(Defines.NS_SERVER, ip.string, (int) port.value); if (ip_sockets[Defines.NS_CLIENT] == null) ! ip_sockets[Defines.NS_CLIENT] = Socket(Defines.NS_CLIENT, ip.string, Defines.PORT_ANY); } *************** *** 281,285 **** } else { // open sockets ! NET_OpenIP(); } } --- 281,285 ---- } else { // open sockets ! OpenIP(); } } *************** *** 290,294 **** * ==================== NET_Init ==================== */ ! public static void NET_Init() { //empty } --- 290,294 ---- * ==================== NET_Init ==================== */ ! public static void Init() { //empty } *************** *** 297,301 **** * ==================== NET_Socket ==================== */ ! public static DatagramSocket NET_Socket(int sock, String ip, int port) { DatagramSocket newsocket = null; --- 297,301 ---- * ==================== NET_Socket ==================== */ ! public static DatagramSocket Socket(int sock, String ip, int port) { DatagramSocket newsocket = null; *************** *** 332,336 **** * ==================== NET_Shutdown ==================== */ ! public static void NET_Shutdown() { // close sockets Config(false); --- 332,336 ---- * ==================== NET_Shutdown ==================== */ ! public static void Shutdown() { // close sockets Config(false); *************** *** 338,342 **** // sleeps msec or until net socket is ready ! public static void NET_Sleep(int msec) { if (ip_sockets[Defines.NS_SERVER] == null || (Globals.dedicated != null && Globals.dedicated.value == 0)) --- 338,342 ---- // sleeps msec or until net socket is ready ! public static void Sleep(int msec) { if (ip_sockets[Defines.NS_SERVER] == null || (Globals.dedicated != null && Globals.dedicated.value == 0)) |