From 96e486ad8b183582ce3566d63694f1eaabafba21 Mon Sep 17 00:00:00 2001 From: ultramage Date: Sun, 30 Sep 2007 21:56:07 +0000 Subject: Removed redundant 'subnet' s_subnet structure variable. Removed duplicate code from the sql charserver that somehow appeared after the tmpsql merge. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11333 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/login/login.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/login') diff --git a/src/login/login.c b/src/login/login.c index 61d9bbf1f..0a06dcb75 100644 --- a/src/login/login.c +++ b/src/login/login.c @@ -54,7 +54,6 @@ struct mmo_char_server server[MAX_SERVERS]; // char server data // Advanced subnet check [LuzZza] struct s_subnet { - uint32 subnet; uint32 mask; uint32 char_ip; uint32 map_ip; @@ -2935,7 +2934,7 @@ int parse_admin(int fd) int lan_subnetcheck(uint32 ip) { int i; - ARR_FIND( 0, subnet_count, i, subnet[i].subnet == (ip & subnet[i].mask) ); + ARR_FIND( 0, subnet_count, i, (subnet[i].char_ip & subnet[i].mask) == (ip & subnet[i].mask) ); return ( i < subnet_count ) ? subnet[i].char_ip : 0; } @@ -3423,13 +3422,14 @@ int login_lan_config_read(const char *lancfgName) remove_control_chars(w3); remove_control_chars(w4); - if(strcmpi(w1, "subnet") == 0) { - + if( strcmpi(w1, "subnet") == 0 ) + { subnet[subnet_count].mask = str2ip(w2); subnet[subnet_count].char_ip = str2ip(w3); subnet[subnet_count].map_ip = str2ip(w4); - subnet[subnet_count].subnet = subnet[subnet_count].char_ip&subnet[subnet_count].mask; - if (subnet[subnet_count].subnet != (subnet[subnet_count].map_ip&subnet[subnet_count].mask)) { + + if( (subnet[subnet_count].char_ip & subnet[subnet_count].mask) != (subnet[subnet_count].map_ip&subnet[subnet_count].mask) ) + { ShowError("%s: Configuration Error: The char server (%s) and map server (%s) belong to different subnetworks!\n", lancfgName, w3, w4); continue; } -- cgit v1.2.3-70-g09d2