summaryrefslogtreecommitdiff
path: root/src/login/login.c
diff options
context:
space:
mode:
authorshennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-05-31 18:50:59 +0000
committershennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-05-31 18:50:59 +0000
commit99ce33003b10e75388370e6a3e9fe931dc79d8e5 (patch)
treebfb7c829dfefacb3056505910685debe89d7cc1f /src/login/login.c
parent0b06ef049e6d16b3288548190c110e947e664cbf (diff)
downloadhercules-99ce33003b10e75388370e6a3e9fe931dc79d8e5.tar.gz
hercules-99ce33003b10e75388370e6a3e9fe931dc79d8e5.tar.bz2
hercules-99ce33003b10e75388370e6a3e9fe931dc79d8e5.tar.xz
hercules-99ce33003b10e75388370e6a3e9fe931dc79d8e5.zip
Fixed bugreport:5828 Added missing min_group_id_to_connect functionality to login server (presumably removed by accident in r15572).
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16185 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/login/login.c')
-rw-r--r--src/login/login.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/login/login.c b/src/login/login.c
index 6b4e8948e..687dd172c 100644
--- a/src/login/login.c
+++ b/src/login/login.c
@@ -1112,14 +1112,20 @@ void login_auth_ok(struct login_session_data* sd)
return;
}
- if( login_config.group_id_to_connect >= 0 && sd->group_id != login_config.group_id_to_connect )
- {
+ if( login_config.group_id_to_connect >= 0 && sd->group_id != login_config.group_id_to_connect ) {
ShowStatus("Connection refused: the required group id for connection is %d (account: %s, group: %d).\n", login_config.group_id_to_connect, sd->userid, sd->group_id);
WFIFOHEAD(fd,3);
WFIFOW(fd,0) = 0x81;
WFIFOB(fd,2) = 1; // 01 = Server closed
WFIFOSET(fd,3);
return;
+ } else if( login_config.min_group_id_to_connect >= 0 && login_config.group_id_to_connect == -1 && sd->group_id < login_config.min_group_id_to_connect ) {
+ ShowStatus("Connection refused: the minium group id required for connection is %d (account: %s, group: %d).\n", login_config.min_group_id_to_connect, sd->userid, sd->group_id);
+ WFIFOHEAD(fd,3);
+ WFIFOW(fd,0) = 0x81;
+ WFIFOB(fd,2) = 1; // 01 = Server closed
+ WFIFOSET(fd,3);
+ return;
}
server_num = 0;
@@ -1538,6 +1544,7 @@ void login_set_defaults()
login_config.new_acc_length_limit = true;
login_config.use_md5_passwds = false;
login_config.group_id_to_connect = -1;
+ login_config.min_group_id_to_connect = -1;
login_config.check_client_version = false;
login_config.client_version_to_connect = 20;
@@ -1606,6 +1613,8 @@ int login_config_read(const char* cfgName)
login_config.use_md5_passwds = (bool)config_switch(w2);
else if(!strcmpi(w1, "group_id_to_connect"))
login_config.group_id_to_connect = atoi(w2);
+ else if(!strcmpi(w1, "min_group_id_to_connect"))
+ login_config.min_group_id_to_connect = atoi(w2);
else if(!strcmpi(w1, "date_format"))
safestrncpy(login_config.date_format, w2, sizeof(login_config.date_format));
else if(!strcmpi(w1, "console"))