summaryrefslogtreecommitdiff
path: root/src/char_sql
diff options
context:
space:
mode:
Diffstat (limited to 'src/char_sql')
-rw-r--r--src/char_sql/int_mail.c36
-rw-r--r--src/char_sql/inter.c4
2 files changed, 9 insertions, 31 deletions
diff --git a/src/char_sql/int_mail.c b/src/char_sql/int_mail.c
index e3c47583c..1a49f787f 100644
--- a/src/char_sql/int_mail.c
+++ b/src/char_sql/int_mail.c
@@ -384,11 +384,13 @@ static void mapif_parse_Mail_return(int fd)
*------------------------------------------*/
static void mapif_Mail_send(int fd, struct mail_message* msg)
{
- WFIFOHEAD(fd,10);
+ int len = sizeof(struct mail_message) + 4;
+
+ WFIFOHEAD(fd,len);
WFIFOW(fd,0) = 0x384d;
- WFIFOL(fd,2) = msg->send_id;
- WFIFOL(fd,6) = msg->id;
- WFIFOSET(fd,10);
+ WFIFOW(fd,2) = len;
+ memcpy(WFIFOP(fd,4), msg, sizeof(struct mail_message));
+ WFIFOSET(fd,len);
}
static void mapif_parse_Mail_send(int fd)
@@ -419,37 +421,14 @@ static void mapif_parse_Mail_send(int fd)
}
}
Sql_FreeResult(sql_handle);
+ msg.status = MAIL_NEW;
if( msg.dest_id > 0 )
- {
- msg.status = MAIL_UNVERIFIED;
msg.id = mail_savemessage(&msg);
- }
- else
- msg.id = 0;
mapif_Mail_send(fd, &msg);
}
-static void mapif_parse_Mail_confirmation(int fd)
-{
- int mail_id = RFIFOL(fd,2);
- bool fail = RFIFOB(fd,6);
-
- if( fail )
- {
- if( SQL_ERROR == Sql_Query(sql_handle, "UPDATE `%s` SET `status` = '%d' WHERE `id` = '%d'", mail_db, MAIL_INVALID, mail_id) )
- Sql_ShowDebug(sql_handle);
- }
- else
- {
- if( SQL_ERROR == Sql_Query(sql_handle, "UPDATE `%s` SET `status` = '%d' WHERE `id` = '%d'", mail_db, MAIL_NEW, mail_id) )
- Sql_ShowDebug(sql_handle);
- else
- mapif_Mail_new(mail_id);
- }
-}
-
/*==========================================
* Packets From Map Server
*------------------------------------------*/
@@ -463,7 +442,6 @@ int inter_mail_parse_frommap(int fd)
case 0x304b: mapif_parse_Mail_delete(fd); break;
case 0x304c: mapif_parse_Mail_return(fd); break;
case 0x304d: mapif_parse_Mail_send(fd); break;
- case 0x304e: mapif_parse_Mail_confirmation(fd); break;
default:
return 0;
}
diff --git a/src/char_sql/inter.c b/src/char_sql/inter.c
index e595324b6..a472018b8 100644
--- a/src/char_sql/inter.c
+++ b/src/char_sql/inter.c
@@ -54,7 +54,7 @@ int inter_send_packet_length[] = {
-1, 7, 0, 0, 0, 0, 0, 0, -1,11, 0, 0, 0, 0, 0, 0, // 3810-
35,-1,11,15, 34,29, 7,-1, 0, 0, 0, 0, 0, 0, 0, 0, // 3820-
10,-1,15, 0, 79,19, 7,-1, 0,-1,-1,-1, 14,67,186,-1, // 3830-
- 9, 9,-1, 0, 0, 0, 0, 0, -1,74,-1,11, 11,10, 0, 0, // 3840-
+ 9, 9,-1, 0, 0, 0, 0, 0, -1,74,-1,11, 11,-1, 0, 0, // 3840-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 3850-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 3860-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 3870-
@@ -66,7 +66,7 @@ int inter_recv_packet_length[] = {
6,-1, 0, 0, 0, 0, 0, 0, 10,-1, 0, 0, 0, 0, 0, 0, // 3010-
-1, 6,-1,14, 14,19, 6,-1, 14,14, 0, 0, 0, 0, 0, 0, // 3020-
-1, 6,-1,-1, 55,19, 6,-1, 14,-1,-1,-1, 14,19,186,-1, // 3030-
- 5, 9, 0, 0, 0, 0, 0, 0, 7, 6,10,10, 10,-1, 7, 0, // 3040-
+ 5, 9, 0, 0, 0, 0, 0, 0, 7, 6,10,10, 10,-1, 0, 0, // 3040-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 3050-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 3060-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 3070-