diff options
author | celest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2005-03-30 17:47:54 +0000 |
---|---|---|
committer | celest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2005-03-30 17:47:54 +0000 |
commit | 327439273a8addb07b4e05908ba5e931b2f679ea (patch) | |
tree | 6931405dc488b786fbbe288b97808f0140d13e6d /src | |
parent | 56f8c49f065831c21156dd88bd5397b6ba355813 (diff) | |
download | hercules-327439273a8addb07b4e05908ba5e931b2f679ea.tar.gz hercules-327439273a8addb07b4e05908ba5e931b2f679ea.tar.bz2 hercules-327439273a8addb07b4e05908ba5e931b2f679ea.tar.xz hercules-327439273a8addb07b4e05908ba5e931b2f679ea.zip |
* Fixed @reloadgmdb in SQL
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1344 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r-- | src/char_sql/char.c | 15 | ||||
-rw-r--r-- | src/char_sql/char.h | 2 | ||||
-rw-r--r-- | src/char_sql/inter.c | 21 | ||||
-rw-r--r-- | src/char_sql/inter.h | 1 |
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); |