|
@@ -56,7 +56,7 @@ uint32 party_share_level = 10;
|
|
|
|
|
|
/// Received packet Lengths from map-server
|
|
|
int32 inter_recv_packet_length[] = {
|
|
|
- -1,-1, 7,-1, -1,13,36, (2+4+4+4+1+NAME_LENGTH), 0,-1, 0, 0, 0, 0, 0, 0, // 3000-
|
|
|
+ -1,-1, 7,-1, -1,13,36, (2+4+4+4+NAME_LENGTH), 0,-1, 0, 0, 0, 0, 0, 0, // 3000-
|
|
|
6,-1, 0, 0, 0, 0, 0, 0, 10,-1, 0, 0, 0, 0, 0, 0, // 3010-
|
|
|
-1,10,-1,14, 15+NAME_LENGTH,17+MAP_NAME_LENGTH_EXT, 6,-1, 14,14, 6, 0, 0, 0, 0, 0, // 3020- Party
|
|
|
-1, 6,-1,-1, 55,19, 6,-1, 14,-1,-1,-1, 18,19,186,-1, // 3030-
|
|
@@ -488,12 +488,11 @@ void mapif_acc_info_ack(int32 fd, int32 u_fd, int32 acc_id, const char* acc_name
|
|
|
*/
|
|
|
void mapif_parse_accinfo(int32 fd) {
|
|
|
int32 u_fd = RFIFOL(fd,2), u_aid = RFIFOL(fd,6), u_group = RFIFOL(fd,10);
|
|
|
- char type= RFIFOB(fd,14);
|
|
|
char query[NAME_LENGTH], query_esq[NAME_LENGTH*2+1];
|
|
|
uint32 account_id = 0;
|
|
|
char *data;
|
|
|
|
|
|
- safestrncpy(query, RFIFOCP(fd,15), NAME_LENGTH);
|
|
|
+ safestrncpy(query, RFIFOCP(fd,14), NAME_LENGTH);
|
|
|
Sql_EscapeString(sql_handle, query_esq, query);
|
|
|
|
|
|
account_id = atoi(query);
|
|
@@ -502,10 +501,10 @@ void mapif_parse_accinfo(int32 fd) {
|
|
|
if ( SQL_ERROR == Sql_Query(sql_handle, "SELECT `account_id`,`name`,`class`,`base_level`,`job_level`,`online` FROM `%s` WHERE `name` LIKE '%s' LIMIT 10", schema_config.char_db, query_esq)
|
|
|
|| Sql_NumRows(sql_handle) == 0 ) {
|
|
|
if( Sql_NumRows(sql_handle) == 0 ) {
|
|
|
- inter_to_fd(fd, u_fd, u_aid, (char *)msg_txt(212) ,query);
|
|
|
+ inter_to_fd(fd, u_fd, u_aid, (char *)msg_txt(212) ,query); // No matches were found for your criteria, '%s'
|
|
|
} else {
|
|
|
Sql_ShowDebug(sql_handle);
|
|
|
- inter_to_fd(fd, u_fd, u_aid, (char *)msg_txt(213));
|
|
|
+ inter_to_fd(fd, u_fd, u_aid, (char *)msg_txt(213)); // An error occured, bother your admin about it.
|
|
|
}
|
|
|
Sql_FreeResult(sql_handle);
|
|
|
return;
|
|
@@ -515,7 +514,7 @@ void mapif_parse_accinfo(int32 fd) {
|
|
|
Sql_GetData(sql_handle, 0, &data, nullptr); account_id = atoi(data);
|
|
|
Sql_FreeResult(sql_handle);
|
|
|
} else {// more than one, listing... [Dekamaster/Nightroad]
|
|
|
- inter_to_fd(fd, u_fd, u_aid, (char *)msg_txt(214),(int32)Sql_NumRows(sql_handle));
|
|
|
+ inter_to_fd(fd, u_fd, u_aid, (char *)msg_txt(214),(int32)Sql_NumRows(sql_handle)); // Your query returned the following %d results, please be more specific...
|
|
|
while ( SQL_SUCCESS == Sql_NextRow(sql_handle) ) {
|
|
|
int32 class_;
|
|
|
short base_level, job_level, online;
|
|
@@ -528,7 +527,7 @@ void mapif_parse_accinfo(int32 fd) {
|
|
|
Sql_GetData(sql_handle, 4, &data, nullptr); job_level = atoi(data);
|
|
|
Sql_GetData(sql_handle, 5, &data, nullptr); online = atoi(data);
|
|
|
|
|
|
- inter_to_fd(fd, u_fd, u_aid, (char *)msg_txt(215), account_id, name, job_name(class_), base_level, job_level, online?"Online":"Offline");
|
|
|
+ inter_to_fd(fd, u_fd, u_aid, (char *)msg_txt(215), account_id, name, job_name(class_), base_level, job_level, online?"Online":"Offline"); // [AID: %d] %s | %s | Level: %d/%d | %s
|
|
|
}
|
|
|
Sql_FreeResult(sql_handle);
|
|
|
return;
|
|
@@ -537,8 +536,8 @@ void mapif_parse_accinfo(int32 fd) {
|
|
|
}
|
|
|
|
|
|
/* it will only get here if we have a single match then ask login-server to fetch the `login` record */
|
|
|
- if (!account_id || chlogif_req_accinfo(fd, u_fd, u_aid, account_id, type) != 1) {
|
|
|
- inter_to_fd(fd, u_fd, u_aid, (char *)msg_txt(213));
|
|
|
+ if (!account_id || chlogif_req_accinfo(fd, u_fd, u_aid, account_id) != 1) {
|
|
|
+ inter_to_fd(fd, u_fd, u_aid, (char *)msg_txt(213)); // An error occured, bother your admin about it.
|
|
|
}
|
|
|
return;
|
|
|
}
|
|
@@ -546,38 +545,30 @@ void mapif_parse_accinfo(int32 fd) {
|
|
|
/**
|
|
|
* Show account info from login-server to user
|
|
|
*/
|
|
|
-void mapif_accinfo_ack(bool success, int32 map_fd, int32 u_fd, int32 u_aid, int32 account_id, int8 type,
|
|
|
- int32 group_id, int32 logincount, int32 state, const char *email, const char *last_ip, const char *lastlogin,
|
|
|
- const char *birthdate, const char *userid)
|
|
|
-{
|
|
|
+void mapif_accinfo_ack( bool success, int32 map_fd, int32 u_fd, int32 u_aid, int32 account_id, int32 group_id, int32 logincount, int32 state, const char *email, const char *last_ip, const char *lastlogin, const char *birthdate, const char *userid ){
|
|
|
|
|
|
if (map_fd <= 0 || !session_isActive(map_fd))
|
|
|
return; // check if we have a valid fd
|
|
|
|
|
|
if (!success) {
|
|
|
- inter_to_fd(map_fd, u_fd, u_aid, (char *)msg_txt(216), account_id);
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- if (type == 1) { //type 1 we don't want all the info [lighta] @CHECKME
|
|
|
- mapif_acc_info_ack(map_fd, u_fd, account_id, userid);
|
|
|
+ inter_to_fd(map_fd, u_fd, u_aid, (char *)msg_txt(216), account_id); // No account with ID '%d' was found.
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- inter_to_fd(map_fd, u_fd, u_aid, (char *)msg_txt(217), account_id);
|
|
|
- inter_to_fd(map_fd, u_fd, u_aid, (char *)msg_txt(218), userid, group_id, state);
|
|
|
- inter_to_fd(map_fd, u_fd, u_aid, (char *)msg_txt(221), email, birthdate);
|
|
|
- inter_to_fd(map_fd, u_fd, u_aid, (char *)msg_txt(222), last_ip, geoip_getcountry(str2ip(last_ip)));
|
|
|
- inter_to_fd(map_fd, u_fd, u_aid, (char *)msg_txt(223), logincount, lastlogin);
|
|
|
- inter_to_fd(map_fd, u_fd, u_aid, (char *)msg_txt(224));
|
|
|
+ inter_to_fd(map_fd, u_fd, u_aid, (char *)msg_txt(217), account_id); // -- Account %d --
|
|
|
+ inter_to_fd(map_fd, u_fd, u_aid, (char *)msg_txt(218), userid, group_id, state); // User: %s | GM Group: %d | State: %d
|
|
|
+ inter_to_fd(map_fd, u_fd, u_aid, (char *)msg_txt(221), email, birthdate); // Account e-mail: %s | Birthdate: %s
|
|
|
+ inter_to_fd(map_fd, u_fd, u_aid, (char *)msg_txt(222), last_ip, geoip_getcountry(str2ip(last_ip))); // Last IP: %s (%s)
|
|
|
+ inter_to_fd(map_fd, u_fd, u_aid, (char *)msg_txt(223), logincount, lastlogin); // This user has logged in %d times, the last time was at %s
|
|
|
+ inter_to_fd(map_fd, u_fd, u_aid, (char *)msg_txt(224)); // -- Character Details --
|
|
|
|
|
|
if ( SQL_ERROR == Sql_Query(sql_handle, "SELECT `char_id`, `name`, `char_num`, `class`, `base_level`, `job_level`, `online` FROM `%s` WHERE `account_id` = '%d' ORDER BY `char_num` LIMIT %d", schema_config.char_db, account_id, MAX_CHARS)
|
|
|
|| Sql_NumRows(sql_handle) == 0 )
|
|
|
{
|
|
|
if( Sql_NumRows(sql_handle) == 0 )
|
|
|
- inter_to_fd(map_fd, u_fd, u_aid, (char *)msg_txt(226));
|
|
|
+ inter_to_fd(map_fd, u_fd, u_aid, (char *)msg_txt(226)); // This account doesn't have characters.
|
|
|
else {
|
|
|
- inter_to_fd(map_fd, u_fd, u_aid, (char *)msg_txt(213));
|
|
|
+ inter_to_fd(map_fd, u_fd, u_aid, (char *)msg_txt(213)); // An error occured, bother your admin about it.
|
|
|
Sql_ShowDebug(sql_handle);
|
|
|
}
|
|
|
} else {
|
|
@@ -595,7 +586,7 @@ void mapif_accinfo_ack(bool success, int32 map_fd, int32 u_fd, int32 u_aid, int3
|
|
|
Sql_GetData(sql_handle, 5, &data, nullptr); job_level = atoi(data);
|
|
|
Sql_GetData(sql_handle, 6, &data, nullptr); online = atoi(data);
|
|
|
|
|
|
- inter_to_fd(map_fd, u_fd, u_aid, (char *)msg_txt(225), char_num, char_id, name, job_name(class_), base_level, job_level, online?"Online":"Offline");
|
|
|
+ inter_to_fd(map_fd, u_fd, u_aid, (char *)msg_txt(225), char_num, char_id, name, job_name(class_), base_level, job_level, online?"Online":"Offline"); // [Slot/CID: %d/%d] %s | %s | Level: %d/%d | %s
|
|
|
}
|
|
|
}
|
|
|
Sql_FreeResult(sql_handle);
|