Issue Information
-
#001651
-
1 - Low
-
Fixed
Issue Confirmations
-
Yes (0)No (0)
Originally posted by Meyraw
http://www.eathena.w...er&showbug=1651
Mail system works perfectly with MMS(multi-map-server) setup except one thing: when you send mail from one map-server to another, you
1) do not receive a notification
2) gotta relogin to receive a new mail
Why the problem occurs:
1. In the map-server, the new mail retrieval (from SQL) occurs ONLY if "sd->mail.inbox.changed == true"
2. The only place where we make it "true" is here:
intif.c:
<...>
static void intif_parse_Mail_new(int fd)
<...>
sd->mail.inbox.changed = true;
<...>
3. It is the function that parses a "new mail" notification from the char-server. So, our second problem is caused by the first one: once we receive notification, eA will know that we want to load a new mail from sql, not from internal map-server db.
Solution:
1. Make char-server(not the map-server) send notifications:
Char server already sends notifications in all cases but the ordinary mail sending. So...
Find and ADD (char-server)
int_mail.c:
<...>
static void mapif_parse_Mail_send(int fd)
<...>
mapif_Mail_send(fd, &msg); // we send the "mail sent" notification to the sender
+ mapif_Mail_new(&msg); // we send the "new mail" notification to the receiver
}
2. Remove the notification sending from the map-server
Find and REMOVE (map-server)
intif.c:
<...>
static void intif_parse_Mail_send(int fd)
<...>
- if( (sd = map_charid2sd(msg.dest_id)) )
- {
- sd->mail.inbox.changed = true;
- clif_Mail_new(sd->fd, msg.id, msg.send_name, msg.title);
- }
Now char-server sends mail notifications, and everything works fine.
Hope to see it fixed, thx.
This post has been edited by Meyraw: Jun 9 2008, 10:18 AM
http://www.eathena.w...er&showbug=1651
Mail system works perfectly with MMS(multi-map-server) setup except one thing: when you send mail from one map-server to another, you
1) do not receive a notification
2) gotta relogin to receive a new mail
Why the problem occurs:
1. In the map-server, the new mail retrieval (from SQL) occurs ONLY if "sd->mail.inbox.changed == true"
2. The only place where we make it "true" is here:
intif.c:
<...>
static void intif_parse_Mail_new(int fd)
<...>
sd->mail.inbox.changed = true;
<...>
3. It is the function that parses a "new mail" notification from the char-server. So, our second problem is caused by the first one: once we receive notification, eA will know that we want to load a new mail from sql, not from internal map-server db.
Solution:
1. Make char-server(not the map-server) send notifications:
Char server already sends notifications in all cases but the ordinary mail sending. So...
Find and ADD (char-server)
int_mail.c:
<...>
static void mapif_parse_Mail_send(int fd)
<...>
mapif_Mail_send(fd, &msg); // we send the "mail sent" notification to the sender
+ mapif_Mail_new(&msg); // we send the "new mail" notification to the receiver
}
2. Remove the notification sending from the map-server
Find and REMOVE (map-server)
intif.c:
<...>
static void intif_parse_Mail_send(int fd)
<...>
- if( (sd = map_charid2sd(msg.dest_id)) )
- {
- sd->mail.inbox.changed = true;
- clif_Mail_new(sd->fd, msg.id, msg.send_name, msg.title);
- }
Now char-server sends mail notifications, and everything works fine.
Hope to see it fixed, thx.
This post has been edited by Meyraw: Jun 9 2008, 10:18 AM