summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/char_sql/char.c15
-rw-r--r--src/char_sql/char.h2
-rw-r--r--src/char_sql/inter.c21
-rw-r--r--src/char_sql/inter.h1
4 files changed, 27 insertions, 12 deletions
diff --git a/src/char_sql/char.c b/src/char_sql/char.c
index f8f083e85..673065fe5 100644
--- a/src/char_sql/char.c
+++ b/src/char_sql/char.c
@@ -267,6 +267,7 @@ void read_gm_account(void) {
}
mysql_free_result(lsql_res);
+ mapif_send_gmaccounts();
}
// Insert friends list
@@ -1750,7 +1751,6 @@ int parse_tologin(int fd) {
if (RFIFOREST(fd) < 7)
return 0;
{
- unsigned char buf[32000];
int new_level = 0;
for(i = 0; i < GM_num; i++)
if (gm_account[i].account_id == RFIFOL(fd,2)) {
@@ -1779,20 +1779,11 @@ int parse_tologin(int fd) {
}
}
if (new_level == 1) {
- int len;
printf("From login-server: receiving a GM account information (%d: level %d).\n", RFIFOL(fd,2), (int)RFIFOB(fd,6));
+ mapif_send_gmaccounts();
+
//create_online_files(); // not change online file for only 1 player (in next timer, that will be done
// send gm acccounts level to map-servers
- len = 4;
- WBUFW(buf,0) = 0x2b15;
-
- for(i = 0; i < GM_num; i++) {
- WBUFL(buf, len) = gm_account[i].account_id;
- WBUFB(buf, len+4) = (unsigned char)gm_account[i].level;
- len += 5;
- }
- WBUFW(buf, 2) = len;
- mapif_sendall(buf, len);
}
}
RFIFOSKIP(fd,7);
diff --git a/src/char_sql/char.h b/src/char_sql/char.h
index ddd873374..6ade96c36 100644
--- a/src/char_sql/char.h
+++ b/src/char_sql/char.h
@@ -76,6 +76,8 @@ extern char login_db_level[32];
extern char login_db_account_id[32];
extern int lowest_gm_level;
+extern int GM_num;
+extern struct gm_account *gm_account;
extern int debug_mysql_query(char *file, int line, void *mysql, const char *q);
diff --git a/src/char_sql/inter.c b/src/char_sql/inter.c
index 1a2a2d751..83fcc967f 100644
--- a/src/char_sql/inter.c
+++ b/src/char_sql/inter.c
@@ -395,6 +395,27 @@ int mapif_account_reg_reply(int fd,int account_id)
return 0;
}
+int mapif_send_gmaccounts()
+{
+ int i, len = 4;
+ unsigned char buf[32000];
+
+ // forward the gm accounts to the map server
+ len = 4;
+ WBUFW(buf,0) = 0x2b15;
+
+ for(i = 0; i < GM_num; i++) {
+ WBUFL(buf, len) = gm_account[i].account_id;
+ WBUFB(buf, len+4) = (unsigned char)gm_account[i].level;
+ len += 5;
+ }
+ WBUFW(buf, 2) = len;
+ mapif_sendall(buf, len);
+
+ return 0;
+}
+
+
//--------------------------------------------------------
// Existence check of WISP data
diff --git a/src/char_sql/inter.h b/src/char_sql/inter.h
index 1e6a26dce..9265a8d82 100644
--- a/src/char_sql/inter.h
+++ b/src/char_sql/inter.h
@@ -5,6 +5,7 @@ int inter_init(const char *file);
void inter_final();
int inter_parse_frommap(int fd);
int inter_mapif_init(int fd);
+int mapif_send_gmaccounts();
int inter_check_length(int fd,int length);