summaryrefslogtreecommitdiff
path: root/src/login/login.c
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-11-16 03:03:45 -0200
committershennetsind <ind@henn.et>2013-11-16 03:03:45 -0200
commitee281a26174c68e4de3a5afe32e0232e2c832570 (patch)
treee058914538738148e38a3a4113dac6ebc5c1125d /src/login/login.c
parent7120b55ce40a6a0c4086da49d57c74baa72609d6 (diff)
downloadhercules-ee281a26174c68e4de3a5afe32e0232e2c832570.tar.gz
hercules-ee281a26174c68e4de3a5afe32e0232e2c832570.tar.bz2
hercules-ee281a26174c68e4de3a5afe32e0232e2c832570.tar.xz
hercules-ee281a26174c68e4de3a5afe32e0232e2c832570.zip
Fixed char server's maintenance mode
Enabling the maintenance mode will now restrict login based on group id (previously maintenance mode was merely cosmetic and would allow all accounts to access). Renamed char-server.conf setting char_maintenance to char_server_type, added char_maintenance_min_group_id to be used in conjunction with char_server_type:1 Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/login/login.c')
-rw-r--r--src/login/login.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/login/login.c b/src/login/login.c
index 73e89d4ff..3da592ebc 100644
--- a/src/login/login.c
+++ b/src/login/login.c
@@ -65,6 +65,7 @@ struct auth_node {
char sex;
uint32 version;
uint8 clienttype;
+ int group_id;
};
static DBMap* auth_db; // int account_id -> struct auth_node*
@@ -408,7 +409,7 @@ int parse_fromchar(int fd)
//ShowStatus("Char-server '%s': authentication of the account %d accepted (ip: %s).\n", server[id].name, account_id, ip);
// send ack
- WFIFOHEAD(fd,25);
+ WFIFOHEAD(fd,29);
WFIFOW(fd,0) = 0x2713;
WFIFOL(fd,2) = account_id;
WFIFOL(fd,6) = login_id1;
@@ -418,7 +419,8 @@ int parse_fromchar(int fd)
WFIFOL(fd,16) = request_id;
WFIFOL(fd,20) = node->version;
WFIFOB(fd,24) = node->clienttype;
- WFIFOSET(fd,25);
+ WFIFOL(fd,25) = node->group_id;
+ WFIFOSET(fd,29);
// each auth entry can only be used once
idb_remove(auth_db, account_id);
@@ -426,7 +428,7 @@ int parse_fromchar(int fd)
else
{// authentication not found
ShowStatus("Char-server '%s': authentication of the account %d REFUSED (ip: %s).\n", server[id].name, account_id, ip);
- WFIFOHEAD(fd,25);
+ WFIFOHEAD(fd,29);
WFIFOW(fd,0) = 0x2713;
WFIFOL(fd,2) = account_id;
WFIFOL(fd,6) = login_id1;
@@ -436,7 +438,8 @@ int parse_fromchar(int fd)
WFIFOL(fd,16) = request_id;
WFIFOL(fd,20) = 0;
WFIFOB(fd,24) = 0;
- WFIFOSET(fd,25);
+ WFIFOL(fd,25) = 0;
+ WFIFOSET(fd,29);
}
}
break;
@@ -1206,6 +1209,7 @@ void login_auth_ok(struct login_session_data* sd)
node->ip = ip;
node->version = sd->version;
node->clienttype = sd->clienttype;
+ node->group_id = sd->group_id;
idb_put(auth_db, sd->account_id, node);
{