Jump to content

Official Mailbox


Recommended Posts

  • Honorable Member
6 minutes ago, zsoltiabeka10 said:

@ Mali A small thing that I've found out with the InitializeMailBoxTable() function:
If you have it like in the repo, whenever you try /reload the mailbox table will fail and you can't reload your protos and stuff because it returns false if the table isn't empty.

I changed it to skip loading it into the pointer if it already has data (from booting up the server).
Because clearing the memory and inserting into it again caused me attachments reappear so that method didn't work for me.

Maybe that could be a solution if anyone else having a problem like that.

//repo
bool CClientManager::InitializeMailBoxTable()
{
	if (m_map_mailbox.empty() == false)
		return false;

	.....

}

// change ?
bool CClientManager::InitializeMailBoxTable()
{
	//if (m_map_mailbox.empty() == false)
		//return false;

	if (!m_map_mailbox.empty())
		return true;

	....
 }

 

Reload?

That function for only boot. Why are you reloading?

edit: I get it, for protos. I will change thanks

Edited by Mali
  • Metin2 Dev 1
  • muscle 1
  • Love 1

 

Link to comment
Share on other sites

  • 2 weeks later...
  • Active+ Member

@ Mali do you know the cause of this error (while compiling DB Source)? Can you help me please?

'unordered_set' in namespace 'std' does not name a template type
  static std::unordered_set<std::string> NameSet;

and

'NameSet' was not declared in this scope
  bool bFound = NameSet.find(p->szName) != NameSet.end();


SOLVED, FIX:

#include <unordered_set>

 

Edited by SCOOB
  • muscle 1

spacer.png

Link to comment
Share on other sites

  • Active+ Member

When I receive a normal mail (not from a GM) the time is still 7 Days. Even though in tables.h is set to be 30 days.

Edit: Sometimes it shows 7 or 30 days, randomly.

I had messages from GM that were 30 days and messages from players that were 7 days. And the other way around.

So something is wrong with these:

    MAILBOX_REMAIN_DAY = 30,
    MAILBOX_REMAIN_DAY_GM = 7,

 

Spoiler

Edited by Metin2 Dev
Core X - External 2 Internal
  • kekw 1

spacer.png

Link to comment
Share on other sites

  • 3 weeks later...
  • Active+ Member
On 10/2/2021 at 11:50 PM, SCOOB said:

When I receive a normal mail (not from a GM) the time is still 7 Days. Even though in tables.h is set to be 30 days.

Edit: Sometimes it shows 7 or 30 days, randomly.

I had messages from GM that were 30 days and messages from players that were 7 days. And the other way around.

So something is wrong with these:

    MAILBOX_REMAIN_DAY = 30,
    MAILBOX_REMAIN_DAY_GM = 7,

 

 

Still have this issue, how to fix?

Spoiler

Edited by Metin2 Dev
Core X - External 2 Internal

spacer.png

Link to comment
Share on other sites

  • 4 months later...
  • 2 months later...
Spoiler

spacer.png

Hello guys. I have a problem, if i get a message on the minimap don't show up the mailbox icon until character change or logout, and if i read the message don't disappear until log out or character change, what i do wrong?

Thank you in advance for your help.

@ Mali

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
Share on other sites

  • 2 months later...
  • 9 months later...
  • 4 months later...
  • Active+ Member
On 10/19/2021 at 1:20 PM, SCOOB said:

 

Still have this issue, how to fix?

  Hide contents

.png

still have this issue, did anyone find a fix?

 

This is the only issue: Both GM and normal mail have the same time duration. it should be different.

Edited by SCOOB

spacer.png

Link to comment
Share on other sites

  • Active+ Member
On 10/2/2021 at 11:50 PM, SCOOB said:

When I receive a normal mail (not from a GM) the time is still 7 Days. Even though in tables.h is set to be 30 days.

 

Edit: Sometimes it shows 7 or 30 days, randomly.

I had messages from GM that were 30 days and messages from players that were 7 days. And the other way around.

So something is wrong with these:

    MAILBOX_REMAIN_DAY = 30,
    MAILBOX_REMAIN_DAY_GM = 7,

 

  Reveal hidden contents

.png

FIXED!

 

I've added a separate check for bIsGMPost

    if (p.Message.bIsGMPost == true) {
        p.Message.DeleteTime = p.Message.SendTime + EMAILBOX::MAILBOX_REMAIN_DAY_GM * 60 * 60 * 24;
    } else {
        p.Message.DeleteTime = p.Message.SendTime + EMAILBOX::MAILBOX_REMAIN_DAY * 60 * 60 * 24;
    }

and a check for if owner is GM

    if (Owner->IsGM())
    {
        p.Message.bIsGMPost = true;
    }

this fixed my issue 🙂 

GIF: 

spacer.png

Edited by Metin2 Dev International
Core X - External 2 Internal
  • Love 1

spacer.png

Link to comment
Share on other sites

  • 2 weeks later...

Someone could help with this? 

 

Quote

compile MailBox.cpp
MailBox.cpp:473:112: error: cannot initialize a parameter of type 'LPITEM' (aka'CItem *') with an rvalue of type 'BYTE' (aka 'unsigned char')
                const DWORD pos = item->IsDragonSoul() ? Owner->GetEmptyDragonSulInventory(item) : Owner->GetEmptyInventory(item->GetSize());
                                                                                                                                                                                                                       ^~~~~~~~~~~~~~~
./char.h:1172:35: note: passing argument to parameter 'item' here
                int                             GetEmptyInventory(LPITEM item) onst;
                                                                         ^
1 error generated.
gmake: *** [Makefile:104: OBJDIR/MailBox.o] Error 1

 

Link to comment
Share on other sites

  • Active+ Member
On 9/24/2023 at 8:08 PM, Ballads said:

I found a bug:

If you send a message to someone and accidentally enter an upper or lower case letter, the message is sent normally but does not reach the recipient.

Here's the FIX for this issue my friend @ Ballads

ClientManager.cpp find:

snprintf(s_szQuery, sizeof(s_szQuery), "SELECT * FROM player%s WHERE `name` = '%s' LIMIT 1", GetTablePostfix(), p->szName);

and replace with this:

snprintf(s_szQuery, sizeof(s_szQuery), "SELECT * FROM player%s WHERE `name` = convert('%s' using utf8mb4) collate utf8mb4_bin LIMIT 1", GetTablePostfix(), p->szName);

 

 now, the check name is case-sensitive. meaning:

 

If the player you want to send a message is named "Scoob" and you type "sCoob" the server will tell you that the player does not exist.

 

Have a great October! 🎃

Edited by SCOOB
found FIX
  • Love 1

spacer.png

Link to comment
Share on other sites

11 hours ago, SCOOB said:

Here's the FIX for this issue my friend @ Ballads

ClientManager.cpp find:

snprintf(s_szQuery, sizeof(s_szQuery), "SELECT * FROM player%s WHERE `name` = '%s' LIMIT 1", GetTablePostfix(), p->szName);

and replace with this:

snprintf(s_szQuery, sizeof(s_szQuery), "SELECT * FROM player%s WHERE `name` = convert('%s' using utf8mb4) collate utf8mb4_bin LIMIT 1", GetTablePostfix(), p->szName);

 

 now, the check name is case-sensitive. meaning:

 

If the player you want to send a message is named "Scoob" and you type "sCoob" the server will tell you that the player does not exist.

 

Have a great October! 🎃

Bro, i have no words to say how I'm happy with it. You are the best! have a great LIFE! ♥ 

Link to comment
Share on other sites

  • 2 weeks later...

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.