diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-03-04 05:40:06 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-03-04 05:40:06 +0000 |
commit | 9e340c8961d0168c12e4eca5af93025357d00f9e (patch) | |
tree | 2e47611fbfbb5a2a6eee8fdc17f4fce96902fc30 | |
parent | e27cd1c1b31aa3cecf2006de64f2b95f90bcd7cb (diff) | |
download | hercules-9e340c8961d0168c12e4eca5af93025357d00f9e.tar.gz hercules-9e340c8961d0168c12e4eca5af93025357d00f9e.tar.bz2 hercules-9e340c8961d0168c12e4eca5af93025357d00f9e.tar.xz hercules-9e340c8961d0168c12e4eca5af93025357d00f9e.zip |
- Fixed subnet checking being broken in the login txt server.
- Changed a bit the information of the subnet checking to include the ip that is being checked.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5458 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r-- | Changelog-Trunk.txt | 3 | ||||
-rw-r--r-- | src/char/char.c | 8 | ||||
-rw-r--r-- | src/char_sql/char.c | 8 | ||||
-rw-r--r-- | src/login/login.c | 10 | ||||
-rw-r--r-- | src/login_sql/login.c | 8 |
5 files changed, 20 insertions, 17 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index 88e4b269e..78ba2a076 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -4,6 +4,9 @@ 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. EVERYTHING ELSE
GOES INTO TRUNK AND WILL BE MERGED INTO STABLE BY VALARIS AND WIZPUTER. -- VALARIS
+2006/03/04
+ * Fixed a bug in the subnet checking function, login-TXT server. Also
+ changed the messages to be a bit more informative. [Skotlex]
2006/03/03
* Added function battle_set_walkdelay in charge of updating walkdelays of
characters based on two criterias: when the delay is induced by damage, if
diff --git a/src/char/char.c b/src/char/char.c index 92fe33f88..a0286250a 100644 --- a/src/char/char.c +++ b/src/char/char.c @@ -3022,7 +3022,7 @@ static int char_mapif_init(int fd) { int lan_subnetcheck(long *p) {
int i;
- unsigned char *sbn, *msk;
+ unsigned char *sbn, *msk, *src = (unsigned char *)p;
for(i=0; i<subnet_count; i++) {
@@ -3031,14 +3031,14 @@ int lan_subnetcheck(long *p) { sbn = (unsigned char *)&subnet[i].subnet;
msk = (unsigned char *)&subnet[i].mask;
- ShowStatus("Subnet check result: "CL_CYAN"%u.%u.%u.%u/%u.%u.%u.%u"CL_RESET"\n",
- sbn[0], sbn[1], sbn[2], sbn[3], msk[0], msk[1], msk[2], msk[3]);
+ ShowInfo("Subnet check [%u.%u.%u.%u]: Matches "CL_CYAN"%u.%u.%u.%u/%u.%u.%u.%u"CL_RESET"\n",
+ src[0], src[1], src[2], src[3], sbn[0], sbn[1], sbn[2], sbn[3], msk[0], msk[1], msk[2], msk[3]);
return subnet[i].map_ip;
}
}
- ShowStatus("Subnet check result: "CL_CYAN"no matches."CL_RESET"\n");
+ ShowInfo("Subnet check [%u.%u.%u.%u]: "CL_CYAN"WAN"CL_RESET"\n", src[0], src[1], src[2], src[3]);
return 0;
}
diff --git a/src/char_sql/char.c b/src/char_sql/char.c index 6d1ea1959..bb826e258 100644 --- a/src/char_sql/char.c +++ b/src/char_sql/char.c @@ -2907,7 +2907,7 @@ int char_mapif_init(int fd) { int lan_subnetcheck(long *p) {
int i;
- unsigned char *sbn, *msk;
+ unsigned char *sbn, *msk, *src = (unsigned char *)p;
for(i=0; i<subnet_count; i++) {
@@ -2916,14 +2916,14 @@ int lan_subnetcheck(long *p) { sbn = (unsigned char *)&subnet[i].subnet;
msk = (unsigned char *)&subnet[i].mask;
- ShowStatus("Subnet check result: "CL_CYAN"%u.%u.%u.%u/%u.%u.%u.%u"CL_RESET"\n",
- sbn[0], sbn[1], sbn[2], sbn[3], msk[0], msk[1], msk[2], msk[3]);
+ ShowInfo("Subnet check [%u.%u.%u.%u]: Matches "CL_CYAN"%u.%u.%u.%u/%u.%u.%u.%u"CL_RESET"\n",
+ src[0], src[1], src[2], src[3], sbn[0], sbn[1], sbn[2], sbn[3], msk[0], msk[1], msk[2], msk[3]);
return subnet[i].char_ip;
}
}
- ShowStatus("Subnet check result: "CL_CYAN"no matches."CL_RESET"\n");
+ ShowInfo("Subnet check [%u.%u.%u.%u]: "CL_CYAN"WAN"CL_RESET"\n", src[0], src[1], src[2], src[3]);
return 0;
}
diff --git a/src/login/login.c b/src/login/login.c index a1aabc9e8..cb7f1980c 100644 --- a/src/login/login.c +++ b/src/login/login.c @@ -2984,23 +2984,23 @@ int parse_admin(int fd) { int lan_subnetcheck(unsigned char *p) {
int i;
- unsigned char *sbn, *msk;
+ unsigned char *sbn, *msk, *src = (unsigned char *)p;
for(i=0; i<subnet_count; i++) {
- if((subnet[i].subnet & subnet[i].mask) == ((long)p & subnet[i].mask)) {
+ if((subnet[i].subnet & subnet[i].mask) == (*p & subnet[i].mask)) {
sbn = (char *)&subnet[i].subnet;
msk = (char *)&subnet[i].mask;
- ShowMessage("Subnet check result: "CL_CYAN"%u.%u.%u.%u/%u.%u.%u.%u"CL_RESET"\n",
- sbn[0], sbn[1], sbn[2], sbn[3], msk[0], msk[1], msk[2], msk[3]);
+ ShowInfo("Subnet check [%u.%u.%u.%u]: Matches "CL_CYAN"%u.%u.%u.%u/%u.%u.%u.%u"CL_RESET"\n",
+ src[0], src[1], src[2], src[3], sbn[0], sbn[1], sbn[2], sbn[3], msk[0], msk[1], msk[2], msk[3]);
return subnet[i].char_ip;
}
}
- ShowMessage("Subnet check result: "CL_CYAN"no matches."CL_RESET"\n");
+ ShowInfo("Subnet check [%u.%u.%u.%u]: "CL_CYAN"WAN"CL_RESET"\n", src[0], src[1], src[2], src[3]);
return 0;
}
diff --git a/src/login_sql/login.c b/src/login_sql/login.c index e2924b1de..b9b79940f 100644 --- a/src/login_sql/login.c +++ b/src/login_sql/login.c @@ -1368,7 +1368,7 @@ int parse_fromchar(int fd){ int lan_subnetcheck(long *p) {
int i;
- unsigned char *sbn, *msk;
+ unsigned char *sbn, *msk, *src = (unsigned char *)p;
for(i=0; i<subnet_count; i++) {
@@ -1377,14 +1377,14 @@ int lan_subnetcheck(long *p) { sbn = (unsigned char *)&subnet[i].subnet;
msk = (unsigned char *)&subnet[i].mask;
- ShowStatus("Subnet check result: "CL_CYAN"%u.%u.%u.%u/%u.%u.%u.%u"CL_RESET"\n",
- sbn[0], sbn[1], sbn[2], sbn[3], msk[0], msk[1], msk[2], msk[3]);
+ ShowInfo("Subnet check [%u.%u.%u.%u]: Matches "CL_CYAN"%u.%u.%u.%u/%u.%u.%u.%u"CL_RESET"\n",
+ src[0], src[1], src[2], src[3], sbn[0], sbn[1], sbn[2], sbn[3], msk[0], msk[1], msk[2], msk[3]);
return subnet[i].char_ip;
}
}
- ShowStatus("Subnet check result: "CL_CYAN"no matches."CL_RESET"\n");
+ ShowInfo("Subnet check [%u.%u.%u.%u]: "CL_CYAN"WAN"CL_RESET"\n", src[0], src[1], src[2], src[3]);
return 0;
}
|