diff options
-rw-r--r-- | Changelog-Trunk.txt | 4 | ||||
-rw-r--r-- | conf-tmpl/battle/skill.conf | 3 | ||||
-rw-r--r-- | conf-tmpl/subnet_athena.conf | 6 | ||||
-rw-r--r-- | src/char/char.c | 21 | ||||
-rw-r--r-- | src/char_sql/char.c | 2 | ||||
-rw-r--r-- | src/login/login.c | 23 | ||||
-rw-r--r-- | src/login_sql/login.c | 21 | ||||
-rw-r--r-- | src/map/map.c | 2 |
8 files changed, 47 insertions, 35 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index 71e0fe227..53315aa8e 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -3,6 +3,10 @@ Date Added AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
+2006/04/10
+ - Updated the subnet support to not require specifying the subnet mask, it
+ is auto-acquired from the char/map IP and the subnet-mask. [Skotlex]
+ - skill_wall_check defaults to yes now. [Skotlex]
2006/04/09
* Added the missing last_thinktime initialization to pets. [Skotlex]
* Reverted the change in skill_wall_check to let skills go over pits.
diff --git a/conf-tmpl/battle/skill.conf b/conf-tmpl/battle/skill.conf index 4f80bbf04..55d92509b 100644 --- a/conf-tmpl/battle/skill.conf +++ b/conf-tmpl/battle/skill.conf @@ -115,8 +115,7 @@ gvg_traps_target_all: 1 // Whether placed down skills will check walls (Note 1)
// (Makes it so that Storm Gust/Lord of Vermillion/etc when casted next to a wall, won't hit on the other side)
-// NOTE: It may degrade performance to enable this.
-skill_wall_check: no
+skill_wall_check: yes
// When a player is cloaking, Whether the wall is checked or not. (Note 1)
// Note: When set to no players can always cloak away from walls and move around
diff --git a/conf-tmpl/subnet_athena.conf b/conf-tmpl/subnet_athena.conf index 39855d991..5308ffbda 100644 --- a/conf-tmpl/subnet_athena.conf +++ b/conf-tmpl/subnet_athena.conf @@ -1,6 +1,6 @@ // Subnet support file
// Format is:
-// subnet: subnet/mask:char_ip:map_ip
-// you can add more than one that line
+// subnet: net-submask:char_ip:map_ip
+// you can add more than one subnet
-subnet: 127.0.0.1/255.255.255.0:127.0.0.1:127.0.0.1
+subnet: 255.0.0.0:127.0.0.1:127.0.0.1
diff --git a/src/char/char.c b/src/char/char.c index 8afd7c5af..3ca461610 100644 --- a/src/char/char.c +++ b/src/char/char.c @@ -3051,7 +3051,7 @@ int lan_subnetcheck(long *p) { for(i=0; i<subnet_count; i++) {
- if((subnet[i].subnet & subnet[i].mask) == (*p & subnet[i].mask)) {
+ if(subnet[i].subnet == (*p & subnet[i].mask)) {
sbn = (unsigned char *)&subnet[i].subnet;
msk = (unsigned char *)&subnet[i].mask;
@@ -3817,7 +3817,7 @@ int char_lan_config_read(const char *lancfgName) { FILE *fp;
int line_num = 0;
- char line[1024], w1[64], w2[64], w3[64], w4[64], w5[64];
+ char line[1024], w1[64], w2[64], w3[64], w4[64];
if((fp = fopen(lancfgName, "r")) == NULL) {
ShowWarning("LAN Support configuration file is not found: %s\n", lancfgName);
@@ -3833,7 +3833,7 @@ int char_lan_config_read(const char *lancfgName) { continue;
line[sizeof(line)-1] = '\0';
- if(sscanf(line,"%[^:]: %[^/]/%[^:]:%[^:]:%[^\r\n]", w1, w2, w3, w4, w5) != 5) {
+ if(sscanf(line,"%[^:]: %[^:]:%[^:]:%[^\r\n]", w1, w2, w3, w4) != 4) {
ShowWarning("Error syntax of configuration file %s in line %d.\n", lancfgName, line_num);
continue;
@@ -3843,19 +3843,22 @@ int char_lan_config_read(const char *lancfgName) { remove_control_chars((unsigned char *)w2);
remove_control_chars((unsigned char *)w3);
remove_control_chars((unsigned char *)w4);
- remove_control_chars((unsigned char *)w5);
if(strcmpi(w1, "subnet") == 0) {
- subnet[subnet_count].subnet = inet_addr(w2);
- subnet[subnet_count].mask = inet_addr(w3);
- subnet[subnet_count].char_ip = inet_addr(w4);
- subnet[subnet_count].map_ip = inet_addr(w5);
+ subnet[subnet_count].mask = inet_addr(w2);
+ subnet[subnet_count].char_ip = inet_addr(w3);
+ subnet[subnet_count].map_ip = inet_addr(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)) {
+ ShowError("%s: Configuration Error: The char server (%s) and map server (%s) belong to different subnetworks!\n", lancfgName, w3, w4);
+ continue;
+ }
subnet_count++;
}
- ShowStatus("Information about %d subnetworks readen.\n", subnet_count);
+ ShowStatus("Read information about %d subnetworks.\n", subnet_count);
}
fclose(fp);
diff --git a/src/char_sql/char.c b/src/char_sql/char.c index 4a17a3679..9b2aef2c9 100644 --- a/src/char_sql/char.c +++ b/src/char_sql/char.c @@ -3761,7 +3761,7 @@ int char_lan_config_read(const char *lancfgName) { subnet_count++;
}
- ShowStatus("Information about %d subnetworks readen.\n", subnet_count);
+ ShowStatus("Read information about %d subnetworks.\n", subnet_count);
}
fclose(fp);
diff --git a/src/login/login.c b/src/login/login.c index 4ecdd2b80..1c75a2469 100644 --- a/src/login/login.c +++ b/src/login/login.c @@ -2992,7 +2992,7 @@ int lan_subnetcheck(long *p) { for(i=0; i<subnet_count; i++) {
- if((subnet[i].subnet & subnet[i].mask) == (*p & subnet[i].mask)) {
+ if(subnet[i].subnet == (*p & subnet[i].mask)) {
sbn = (char *)&subnet[i].subnet;
msk = (char *)&subnet[i].mask;
@@ -3470,7 +3470,7 @@ int login_lan_config_read(const char *lancfgName) { FILE *fp;
int line_num = 0;
- char line[1024], w1[64], w2[64], w3[64], w4[64], w5[64];
+ char line[1024], w1[64], w2[64], w3[64], w4[64];
if((fp = fopen(lancfgName, "r")) == NULL) {
ShowWarning("LAN Support configuration file is not found: %s\n", lancfgName);
@@ -3486,7 +3486,7 @@ int login_lan_config_read(const char *lancfgName) { continue;
line[sizeof(line)-1] = '\0';
- if(sscanf(line,"%[^:]: %[^/]/%[^:]:%[^:]:%[^\r\n]", w1, w2, w3, w4, w5) != 5) {
+ if(sscanf(line,"%[^:]: %[^:]:%[^:]:%[^\r\n]", w1, w2, w3, w4) != 4) {
ShowWarning("Error syntax of configuration file %s in line %d.\n", lancfgName, line_num);
continue;
@@ -3496,19 +3496,22 @@ int login_lan_config_read(const char *lancfgName) { remove_control_chars((unsigned char *)w2);
remove_control_chars((unsigned char *)w3);
remove_control_chars((unsigned char *)w4);
- remove_control_chars((unsigned char *)w5);
if(strcmpi(w1, "subnet") == 0) {
- subnet[subnet_count].subnet = inet_addr(w2);
- subnet[subnet_count].mask = inet_addr(w3);
- subnet[subnet_count].char_ip = inet_addr(w4);
- subnet[subnet_count].map_ip = inet_addr(w5);
-
+ subnet[subnet_count].mask = inet_addr(w2);
+ subnet[subnet_count].char_ip = inet_addr(w3);
+ subnet[subnet_count].map_ip = inet_addr(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)) {
+ ShowError("%s: Configuration Error: The char server (%s) and map server (%s) belong to different subnetworks!\n", lancfgName, w3, w4);
+ continue;
+ }
+
subnet_count++;
}
- ShowStatus("Information about %d subnetworks readen.\n", subnet_count);
+ ShowStatus("Read information about %d subnetworks.\n", subnet_count);
}
fclose(fp);
diff --git a/src/login_sql/login.c b/src/login_sql/login.c index d464cf2b0..1ed41ca27 100644 --- a/src/login_sql/login.c +++ b/src/login_sql/login.c @@ -1398,7 +1398,7 @@ int lan_subnetcheck(long *p) { for(i=0; i<subnet_count; i++) {
- if((subnet[i].subnet & subnet[i].mask) == (*p & subnet[i].mask)) {
+ if(subnet[i].subnet == (*p & subnet[i].mask)) {
sbn = (unsigned char *)&subnet[i].subnet;
msk = (unsigned char *)&subnet[i].mask;
@@ -1933,7 +1933,7 @@ int login_lan_config_read(const char *lancfgName) { FILE *fp;
int line_num = 0;
- char line[1024], w1[64], w2[64], w3[64], w4[64], w5[64];
+ char line[1024], w1[64], w2[64], w3[64], w4[64];
if((fp = fopen(lancfgName, "r")) == NULL) {
ShowWarning("LAN Support configuration file is not found: %s\n", lancfgName);
@@ -1949,7 +1949,7 @@ int login_lan_config_read(const char *lancfgName) { continue;
line[sizeof(line)-1] = '\0';
- if(sscanf(line,"%[^:]: %[^/]/%[^:]:%[^:]:%[^\r\n]", w1, w2, w3, w4, w5) != 5) {
+ if(sscanf(line,"%[^:]: %[^:]:%[^:]:%[^\r\n]", w1, w2, w3, w4) != 4) {
ShowWarning("Error syntax of configuration file %s in line %d.\n", lancfgName, line_num);
continue;
@@ -1959,19 +1959,22 @@ int login_lan_config_read(const char *lancfgName) { remove_control_chars((unsigned char *)w2);
remove_control_chars((unsigned char *)w3);
remove_control_chars((unsigned char *)w4);
- remove_control_chars((unsigned char *)w5);
if(strcmpi(w1, "subnet") == 0) {
- subnet[subnet_count].subnet = inet_addr(w2);
- subnet[subnet_count].mask = inet_addr(w3);
- subnet[subnet_count].char_ip = inet_addr(w4);
- subnet[subnet_count].map_ip = inet_addr(w5);
+ subnet[subnet_count].mask = inet_addr(w2);
+ subnet[subnet_count].char_ip = inet_addr(w3);
+ subnet[subnet_count].map_ip = inet_addr(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)) {
+ ShowError("%s: Configuration Error: The char server (%s) and map server (%s) belong to different subnetworks!\n", lancfgName, w3, w4);
+ continue;
+ }
subnet_count++;
}
- ShowStatus("Information about %d subnetworks readen.\n", subnet_count);
+ ShowStatus("Read information about %d subnetworks.\n", subnet_count);
}
fclose(fp);
diff --git a/src/map/map.c b/src/map/map.c index a6702c3cc..156ae7b1c 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -3840,7 +3840,7 @@ int do_init(int argc, char *argv[]) { if (char_ip_set_ == 0)
chrif_setip(buf);
if (ptr[0] == 192 && ptr[1] == 168)
- ShowError("\nFirewall detected.. \n edit subnet_athena.conf and map_athena.conf\n\n");
+ ShowNotice("\nFirewall detected.. \n edit subnet_athena.conf and map_athena.conf\n\n");
}
if (SHOW_DEBUG_MSG)
|