summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-04-16 21:44:30 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-04-16 21:44:30 +0000
commit29390f511f5b6340a11c2f33ba5746e91f94616e (patch)
tree6a4eb9c2c9a7ae94361785257cea4e05a67354e7
parent86bec8005a78e4fe482962a45cb1048edd4ee881 (diff)
downloadhercules-29390f511f5b6340a11c2f33ba5746e91f94616e.tar.gz
hercules-29390f511f5b6340a11c2f33ba5746e91f94616e.tar.bz2
hercules-29390f511f5b6340a11c2f33ba5746e91f94616e.tar.xz
hercules-29390f511f5b6340a11c2f33ba5746e91f94616e.zip
- Fixed char-sql server still reading the old lanconfig format rather than the new one.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6123 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog-Trunk.txt2
-rw-r--r--src/char_sql/char.c17
2 files changed, 12 insertions, 7 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index fe8435c46..8d9a9105e 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -4,6 +4,8 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
2006/04/16
+ * Fixed char-sql server still reading the old lanconfig format rather than
+ the new one. [Skotlex]
* Removed water_height.txt reading (since it is always done from the rsw
now) [Skotlex]
* Fixed a possible crash in grfio_find_file [Skotlex]
diff --git a/src/char_sql/char.c b/src/char_sql/char.c
index 9b2aef2c9..c5ddc9790 100644
--- a/src/char_sql/char.c
+++ b/src/char_sql/char.c
@@ -3723,7 +3723,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);
@@ -3739,7 +3739,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;
@@ -3749,14 +3749,17 @@ 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++;
}