Where items attached to mail are stored?
Forum rules
READ NOW: L2j Forums Rules of Conduct
READ NOW: L2j Forums Rules of Conduct
-
- Posts: 80
- Joined: Fri May 06, 2011 11:17 am
Where items attached to mail are stored?
If you want to receive support we need this info to help you properly.
» Find Revision
L2J Revision Number:
L2JDP Revision Number:
as the title says... Where items attached to mail are stored?
Table 'messages' only stores basic info. Where does message and items attached are stored?
» Find Revision
L2J Revision Number:
L2JDP Revision Number:
as the title says... Where items attached to mail are stored?
Table 'messages' only stores basic info. Where does message and items attached are stored?
- jurchiks
- Posts: 6769
- Joined: Sat Sep 19, 2009 4:16 pm
- Location: Eastern Europe
Re: Where items attached to mail are stored?
Search in l2j code where `hasAttachments` is used and check what code is executed when the value is true.
If you have problems, FIRST TRY SOLVING THEM YOURSELF, and if you get errors, TRY TO ANALYZE THEM, and ONLY if you can't help it, THEN ask here.
Otherwise you will never learn anything if all you do is copy-paste!
Discussion breeds innovation.
Otherwise you will never learn anything if all you do is copy-paste!
Discussion breeds innovation.
-
- Posts: 80
- Joined: Fri May 06, 2011 11:17 am
Re: Where items attached to mail are stored?
aparently I don't know how to do that, because all I find is sql file for messages table..
- jurchiks
- Posts: 6769
- Joined: Sat Sep 19, 2009 4:16 pm
- Location: Eastern Europe
Re: Where items attached to mail are stored?
Well then it's time to download the source code.
If you have problems, FIRST TRY SOLVING THEM YOURSELF, and if you get errors, TRY TO ANALYZE THEM, and ONLY if you can't help it, THEN ask here.
Otherwise you will never learn anything if all you do is copy-paste!
Discussion breeds innovation.
Otherwise you will never learn anything if all you do is copy-paste!
Discussion breeds innovation.
- lucan
- Posts: 590
- Joined: Wed Mar 16, 2011 10:39 pm
- Location: Brazil
Re: Where items attached to mail are stored?
The email attachments are in the table items but the LOC = MAIL in sender character.
The items change their place of LOC = INVENTORY to LOC = MAIL, even be RECEIVED by the other player or return to sender player and switch back to LOC = INVENTORY.
The items change their place of LOC = INVENTORY to LOC = MAIL, even be RECEIVED by the other player or return to sender player and switch back to LOC = INVENTORY.
-
- Posts: 80
- Joined: Fri May 06, 2011 11:17 am
Re: Where items attached to mail are stored?
well the problem with the source code is that for some reason it gets stuck on file serverlistener.java and never gets pats it. tried to download it many times in last few weeks, still the same.jurchiks wrote:Well then it's time to download the source code.
-
- Posts: 80
- Joined: Fri May 06, 2011 11:17 am
Re: Where items attached to mail are stored?
thanks. but there's no ID for mail, so still, the message text and items attached to certain message should be described somewhere besides items list.lucan wrote:The email attachments are in the table items but the LOC = MAIL in sender character.
The items change their place of LOC = INVENTORY to LOC = MAIL, even be RECEIVED by the other player or return to sender player and switch back to LOC = INVENTORY.
- lucan
- Posts: 590
- Joined: Wed Mar 16, 2011 10:39 pm
- Location: Brazil
Re: Where items attached to mail are stored?
The attachment is linked to the ID of the player that sent it.
In table messages not need be described the attachments in messages, the server should look for items in the table items with the Sender ID and field LOC = MAIL when the player A sent an email to player B and the message is mark to have an attachment.
If you want to find an attachment to an email, search for the ID of the player sender in the messages table and look for items in the table items that have the ID of this sender and field LOC = MAIL.
select * from items where owner_id = xxxx and loc = 'MAIL'
xxxx = ID of the player who sent the e-mail.Take the xxxx in table messages in senderID of the message that you want.
ofc, if the receiver has not yet received the message!
In table messages not need be described the attachments in messages, the server should look for items in the table items with the Sender ID and field LOC = MAIL when the player A sent an email to player B and the message is mark to have an attachment.
If you want to find an attachment to an email, search for the ID of the player sender in the messages table and look for items in the table items that have the ID of this sender and field LOC = MAIL.
select * from items where owner_id = xxxx and loc = 'MAIL'
xxxx = ID of the player who sent the e-mail.Take the xxxx in table messages in senderID of the message that you want.
ofc, if the receiver has not yet received the message!
- jurchiks
- Posts: 6769
- Joined: Sat Sep 19, 2009 4:16 pm
- Location: Eastern Europe
Re: Where items attached to mail are stored?
If it's like that then there might be a problem; what happens when a single player has sent multiple items to multiple people? They will all have the same owner_id and same loc="MAIL" until the letters+attachments have been retrieved by the recipients. So there must be some separate place that stores the actual item IDs+count to be sent.
If you have problems, FIRST TRY SOLVING THEM YOURSELF, and if you get errors, TRY TO ANALYZE THEM, and ONLY if you can't help it, THEN ask here.
Otherwise you will never learn anything if all you do is copy-paste!
Discussion breeds innovation.
Otherwise you will never learn anything if all you do is copy-paste!
Discussion breeds innovation.
- lucan
- Posts: 590
- Joined: Wed Mar 16, 2011 10:39 pm
- Location: Brazil
Re: Where items attached to mail are stored?
The recipients of emails are in table items in field LOC_DATA when item is for MAIL.
I f you send three different emails with attach to three differents players, in table items at field LOC_DATA you see the 3 IDs of the 3 recipient players and no more the location of inventory or warehouse, the same ID of receiverID of table messages.
So an item that is part of an email, the field OWNER_ID = Sender, LOC = MAIL and LOC_DATA= ID of the recipient player.
Many items, you have a unique ID sender and many IDs recipient!
I f you send three different emails with attach to three differents players, in table items at field LOC_DATA you see the 3 IDs of the 3 recipient players and no more the location of inventory or warehouse, the same ID of receiverID of table messages.
So an item that is part of an email, the field OWNER_ID = Sender, LOC = MAIL and LOC_DATA= ID of the recipient player.
Many items, you have a unique ID sender and many IDs recipient!
- ShinichiYao
- Advanced User
- Posts: 262
- Joined: Tue Jan 12, 2016 3:53 am
Re: Where items attached to mail are stored?
Then what about stackable items? they share same id but they can send to different people.
As I know somehow mail system cause item objectid duplicate, see this Issue:
https://bitbucket.org/l2jserver/l2j_ser ... -disappear
As I know somehow mail system cause item objectid duplicate, see this Issue:
https://bitbucket.org/l2jserver/l2j_ser ... -disappear
-
- Advanced User
- Posts: 1026
- Joined: Thu Aug 14, 2014 6:31 am
Re: Where items attached to mail are stored?
Seems to be impossible due to this... in items table
Its impossible to do dulicated items or similar broking the primary key of a table. Till I know...
Code: Select all
PRIMARY KEY (`object_id`),
KEY `owner_id` (`owner_id`),
KEY `item_id` (`item_id`),
KEY `loc` (`loc`),
KEY `time_of_use` (`time_of_use`)
- ShinichiYao
- Advanced User
- Posts: 262
- Joined: Tue Jan 12, 2016 3:53 am
Re: Where items attached to mail are stored?
But it could cause objectid of exist item release in idfactory on player delete mail.
Next time idfactory could generate an objectid of new item using this exist item's id that cause problem.
-
- Advanced User
- Posts: 1026
- Joined: Thu Aug 14, 2014 6:31 am
Re: Where items attached to mail are stored?
Then its aprotection to... nots the normal function of the server... obviously. I understood the issue perfectly.
Then as the block of code tells in the issue comment...
gameserver/model/itemcontainer/Mail.java
Then as the block of code tells in the issue comment...
gameserver/model/itemcontainer/Mail.java
Code: Select all
@Override
public void deleteMe()
{
_items.forEach(i ->
{
i.updateDatabase(true);
i.deleteMe();
L2World.getInstance().removeObject(i);
// Could cause exist item's ObjectId release?
// IdFactory.getInstance().releaseId(i.getObjectId());
});
_items.clear();
}