Issue information

Issue ID
#1651
Status
Fixed
Severity
Low
Started
Hercules Elf Bot
Jun 9, 2008 17:17
Last Post
Hercules Elf Bot
Apr 19, 2012 18:35
Confirmation
N/A

Hercules Elf Bot - Jun 9, 2008 17:17

Originally posted by [b]Meyraw[/b]
http://www.eathena.ws/board/index.php?autocom=bugtracker&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

Hercules Elf Bot - Mar 13, 2012 19:01

Originally posted by [b]Gepard[/b]
Fixed in [rev=15684].