summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-07-05 01:57:52 +0300
committerAndrei Karas <akaras@inbox.ru>2015-07-05 01:57:52 +0300
commit7eaba97f02e18d8610ea004851ab2ec8b8edeebb (patch)
tree12bf9a8e1cd1b2e5813bb8985b70febf463dfc53 /src
parentebff0ef78313b1090b2efa3a8d64d5493a9a5aed (diff)
downloadplugin-7eaba97f02e18d8610ea004851ab2ec8b8edeebb.tar.gz
plugin-7eaba97f02e18d8610ea004851ab2ec8b8edeebb.tar.bz2
plugin-7eaba97f02e18d8610ea004851ab2ec8b8edeebb.tar.xz
plugin-7eaba97f02e18d8610ea004851ab2ec8b8edeebb.zip
Remove inter server ip check because it moving to upstream.
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am8
-rw-r--r--src/echar/char.c17
-rw-r--r--src/echar/char.h2
-rw-r--r--src/echar/config.c16
-rw-r--r--src/echar/config.h2
-rw-r--r--src/echar/init.c3
-rw-r--r--src/ecommon/ip.c25
-rw-r--r--src/ecommon/ip.h9
-rw-r--r--src/elogin/config.c16
-rw-r--r--src/elogin/config.h2
-rw-r--r--src/elogin/init.c2
-rw-r--r--src/elogin/parse.c13
-rw-r--r--src/elogin/parse.h1
13 files changed, 2 insertions, 114 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index ad1597b..04c76a5 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -8,9 +8,7 @@ CHAR_SRC = echar/char.c \
ecommon/config.c \
ecommon/config.h \
ecommon/init.c \
- ecommon/init.h \
- ecommon/ip.c \
- ecommon/ip.h
+ ecommon/init.h
LOGIN_SRC = elogin/config.c \
elogin/config.h \
@@ -28,9 +26,7 @@ LOGIN_SRC = elogin/config.c \
ecommon/config.c \
ecommon/config.h \
ecommon/init.c \
- ecommon/init.h \
- ecommon/ip.c \
- ecommon/ip.h
+ ecommon/init.h
MAP_SRC = emap/atcommand.c \
emap/atcommand.h \
diff --git a/src/echar/char.c b/src/echar/char.c
index fc0fb6d..85c890c 100644
--- a/src/echar/char.c
+++ b/src/echar/char.c
@@ -13,26 +13,9 @@
#include "common/timer.h"
#include "char/char.h"
-#include "ecommon/ip.h"
#include "echar/char.h"
#include "echar/config.h"
-void echar_parse_char_login_map_server(int *fd)
-{
- if (!inter_server_ip)
- return;
-
- const uint32 ipl = session[*fd]->client_addr;
-
- const char *const ip = ip2str(ipl, NULL);
- if (!checkAllowedIp(inter_server_ip, ip))
- {
- ShowNotice("Connection of the map-server from ip %s REFUSED.\n", ip);
- chr->login_map_server_ack(*fd, 3);
- hookStop();
- }
-}
-
void echar_parse_char_create_new_char(int *fdPtr, struct char_session_data* sd)
{
// ignore char creation disable option
diff --git a/src/echar/char.h b/src/echar/char.h
index b013f44..60cf223 100644
--- a/src/echar/char.h
+++ b/src/echar/char.h
@@ -4,8 +4,6 @@
#ifndef EVOL_CHAR_CHAR
#define EVOL_CHAR_CHAR
-void echar_parse_char_login_map_server(int *fd);
-
void echar_parse_char_create_new_char(int *fdPtr, struct char_session_data* sd);
void echar_creation_failed(int *fdPtr, int *result);
diff --git a/src/echar/config.c b/src/echar/config.c
index f8cff5f..83bfba0 100644
--- a/src/echar/config.c
+++ b/src/echar/config.c
@@ -13,25 +13,11 @@
#include "echar/config.h"
-char *inter_server_ip = NULL;
int min_char_class = 0;
int max_char_class = 0;
int min_look = 0;
int max_look = 0;
-void config_inter_server_ip(const char *val)
-{
- char buf[1000];
-
- if (strlen(val) > 900)
- return;
-
- strcpy(buf, ",");
- strcat(buf, val);
- strcat(buf, ",");
- inter_server_ip = aStrdup(buf);
-}
-
void config_min_char_class(const char *val)
{
min_char_class = atoi(val);
@@ -54,6 +40,4 @@ void config_max_look(const char *val)
void config_final(void)
{
- if (inter_server_ip)
- aFree(inter_server_ip);
}
diff --git a/src/echar/config.h b/src/echar/config.h
index d60abc0..475a371 100644
--- a/src/echar/config.h
+++ b/src/echar/config.h
@@ -5,13 +5,11 @@
#define EVOL_CHAR_CONFIG
void config_final(void);
-void config_inter_server_ip(const char *val);
void config_min_char_class(const char *val);
void config_max_char_class(const char *val);
void config_min_look(const char *val);
void config_max_look(const char *val);
-extern char *inter_server_ip;
extern int min_char_class;
extern int max_char_class;
extern int min_look;
diff --git a/src/echar/init.c b/src/echar/init.c
index a167636..4083d17 100644
--- a/src/echar/init.c
+++ b/src/echar/init.c
@@ -63,9 +63,7 @@ HPExport void plugin_init (void)
addPacket(0x0061, 50, echar_parse_change_paassword, hpParse_Char);
addPacket(0x5001, 7, echar_parse_login_password_change_ack, hpParse_FromLogin);
- addHookPre("chr->parse_char_login_map_server", echar_parse_char_login_map_server);
addHookPre("chr->parse_char_create_new_char", echar_parse_char_create_new_char);
- //addHookPre("chr->parse_char_ping", echar_parse_char_ping);
addHookPre("chr->creation_failed", echar_creation_failed);
}
@@ -79,7 +77,6 @@ HPExport void server_preinit (void)
addMapInterConf("default_x", config_default_x);
addMapInterConf("default_y", config_default_y);
- addCharInterConf("inter_server_ip", config_inter_server_ip);
addCharConf("min_char_class", config_min_char_class);
addCharConf("max_char_class", config_max_char_class);
addCharConf("min_cloth_color", config_min_look);
diff --git a/src/ecommon/ip.c b/src/ecommon/ip.c
deleted file mode 100644
index eb6d792..0000000
--- a/src/ecommon/ip.c
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright (c) Copyright (c) Hercules Dev Team, licensed under GNU GPL.
-// Copyright (c) 2014 Evol developers
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "common/HPMi.h"
-#include "common/malloc.h"
-#include "common/mmo.h"
-#include "common/socket.h"
-#include "common/strlib.h"
-
-#include "ecommon/ip.h"
-
-bool checkAllowedIp(const char* const mask, const char* const ip)
-{
- char buf[1000];
-
- strcpy(buf, ",");
- strcat(buf, ip);
- strcat(buf, ",");
-
- return strstr(mask, buf) != NULL;
-}
diff --git a/src/ecommon/ip.h b/src/ecommon/ip.h
deleted file mode 100644
index 1b0ba18..0000000
--- a/src/ecommon/ip.h
+++ /dev/null
@@ -1,9 +0,0 @@
-// Copyright (c) Copyright (c) Hercules Dev Team, licensed under GNU GPL.
-// Copyright (c) 2014 Evol developers
-
-#ifndef EVOL_COMMON_IP
-#define EVOL_COMMON_IP
-
-bool checkAllowedIp(const char* const mask, const char* const ip);
-
-#endif // EVOL_COMMON_IP
diff --git a/src/elogin/config.c b/src/elogin/config.c
index 83c3c4f..6abaa6c 100644
--- a/src/elogin/config.c
+++ b/src/elogin/config.c
@@ -14,30 +14,14 @@
#include "elogin/config.h"
char *update_server = NULL;
-char *inter_server_ip = NULL;
void config_update_server(const char *val)
{
update_server = aStrdup(val);
}
-void config_inter_server_ip(const char *val)
-{
- char buf[1000];
-
- if (strlen(val) > 900)
- return;
-
- strcpy(buf, ",");
- strcat(buf, val);
- strcat(buf, ",");
- inter_server_ip = aStrdup(buf);
-}
-
void config_final(void)
{
if (update_server)
aFree(update_server);
- if (inter_server_ip)
- aFree(inter_server_ip);
}
diff --git a/src/elogin/config.h b/src/elogin/config.h
index ad63371..a491e1e 100644
--- a/src/elogin/config.h
+++ b/src/elogin/config.h
@@ -6,9 +6,7 @@
void config_update_server(const char *val);
void config_final(void);
-void config_inter_server_ip(const char *val);
extern char *update_server;
-extern char *inter_server_ip;
#endif // EVOL_LOGIN_CONFIG
diff --git a/src/elogin/init.c b/src/elogin/init.c
index 6105b3b..e0411bd 100644
--- a/src/elogin/init.c
+++ b/src/elogin/init.c
@@ -37,7 +37,6 @@ HPExport void plugin_init (void)
addPacket(0x027c, 95, elogin_parse_client_login2, hpParse_Login);
addPacket(0x5000, 54, elogin_parse_change_paassword, hpParse_FromChar);
addHookPre("login->parse_client_login", elogin_parse_client_login_pre);
- addHookPre("login->parse_request_connection", elogin_parse_request_connection);
addHookPre("login->check_password", elogin_check_password);
addHookPre("login->parse_ping", elogin_parse_ping);
}
@@ -46,7 +45,6 @@ HPExport void server_preinit (void)
{
iMalloc = GET_SYMBOL("iMalloc");
addLoginConf("update_server", config_update_server);
- addLoginConf("inter_server_ip", config_inter_server_ip);
}
HPExport void server_online (void)
diff --git a/src/elogin/parse.c b/src/elogin/parse.c
index 8f62e9f..3a015d1 100644
--- a/src/elogin/parse.c
+++ b/src/elogin/parse.c
@@ -14,7 +14,6 @@
#include "login/account.h"
#include "login/login.h"
-#include "ecommon/ip.h"
#include "elogin/config.h"
#include "elogin/md5calc.h"
#include "elogin/parse.h"
@@ -141,18 +140,6 @@ void elogin_parse_client_login2(int fd)
return;
}
-void elogin_parse_request_connection(int *fd, struct login_session_data* sd, const char *const ip)
-{
- if (!inter_server_ip || !ip)
- return;
- if (!checkAllowedIp(inter_server_ip, ip))
- {
- hookStop();
- login->char_server_connection_status(*fd, sd, 3);
- ShowNotice("Connection of the char-server from ip %s REFUSED.\n", ip);
- }
-}
-
void elogin_parse_ping(int *fd, struct login_session_data* sd)
{
RFIFOSKIP(*fd, 26);
diff --git a/src/elogin/parse.h b/src/elogin/parse.h
index b5c2418..ad76331 100644
--- a/src/elogin/parse.h
+++ b/src/elogin/parse.h
@@ -7,7 +7,6 @@
void login_parse_version(int fd);
int elogin_parse_client_login_pre(int *fd, struct login_session_data* sd, const char *const ip);
void elogin_parse_client_login2(int fd);
-void elogin_parse_request_connection(int *fd, struct login_session_data* sd, const char *const ip);
void elogin_parse_ping(int *fd, struct login_session_data* sd);
void elogin_parse_change_paassword(int fd);