Jump to content

Official Mailbox


Recommended Posts

  • Honorable Member

M2 Download Center

This is the hidden content, please
( Internal )

This is the hidden content, please

Video:

Spoiler

 

Images:

Spoiler

11090368747470733a2f2f696d672e796f757475

111658132902160-cde7cea1-90e8-4da4-9996-

111658132902173-68a63a53-2cae-483b-bb72-

111658132902224-3682cbeb-fea3-4d0f-bd2f-

114329132949217-d3c32169-8e69-4300-89e5-

Client Side is from 2018 official root. 

Of course I've made minor changes for slot marking and cheque(if app. checks)

You have to add slot marking too.

Mysql used to retrieve data during game launch, and to backup(default 1 hour, you can change at conf.txt)

  • Metin2 Dev 137
  • kekw 1
  • Dislove 1
  • Think 1
  • Confused 1
  • Scream 1
  • Lmao 1
  • Good 63
  • Love 10
  • Love 86

 

Link to comment
Share on other sites

  • Management

Your contributions to the Metin2 community are a real pleasure.
Keep it up, you're a good man. 👌

  • Metin2 Dev 1
  • Good 2
  • Love 1
Link to comment
Share on other sites

  • Honorable Member
12 hours ago, Goof said:

works with Transmutation?

Of course it works if you edit it.

(I hope you don't expect me to edit this system so it's compatible with someone else's work.)

 

Link to comment
Share on other sites

For who want to save the backup on the shutdown of the server too, this code will work.

 

common/tables.h

// Search

	HEADER_GD_MAILBOX_UNREAD = 163,

// Add

	HEADER_GD_MAILBOX_BACKUP = 164,

db/ClientManager.cpp

// Search
			case HEADER_GD_MAILBOX_UNREAD:
				QUERY_MAILBOX_UNREAD(peer, dwHandle, (TMailBox*)data);
				break;
// Add after

			case HEADER_GD_MAILBOX_BACKUP:
				MAILBOX_BACKUP();
				break;

game/main.cpp

// Search

		DBManager::instance().FlushBilling(true);

// Add before

		sys_log(0, "<shutdown> Backup MailBox data...");
		db_clientdesc->DBPacket(HEADER_GD_MAILBOX_BACKUP, 0, NULL, 0);

 

I don't know if is the best way, but it's actually working.

Link to comment
Share on other sites

  • Honorable Member
9 minutes ago, PetePeter said:

For who want to save the backup on the shutdown of the server too, this code will work.

This is the hidden content, please

  • Metin2 Dev 73
  • Eyes 1
  • Good 15
  • Love 3
  • Love 22

 

Link to comment
Share on other sites

3 hours ago, Mali said:

hey, check the repo

Thanks it's good now!

p.s: you have a typo in the repo:

void initmail()
{
	static PyMethodDef s_methods[] =
	{
		{ "GetMailAddData",				mailGetMailAddData,						METH_VARARGS },
		{ "GetMailData",				mailGetMailData,						METH_VARARGS },
		{ "GetMailDict",				mailGetMailDict,						METH_VARARGS },
		{ "GetMailItemAttribute",		mailGetMailItemAttribute,				METH_VARARGS },
		{ "GetMailItemData",			mailGetMailItemData,					METH_VARARGS },
		{ "GetMailItemMetinSocket",		mailGetMailItemMetinSocket,				METH_VARARGS },
		{ NULL,							NULL,									NULL		 },
	};

	PyObject* poModule = Py_InitModule("mail", s_methods);

	void initmail()
{
	static PyMethodDef s_methods[] =
	{
		{ "GetMailAddData",				mailGetMailAddData,						METH_VARARGS },
		{ "GetMailData",				mailGetMailData,						METH_VARARGS },
		{ "GetMailDict",				mailGetMailDict,						METH_VARARGS },
		{ "GetMailItemAttribute",		mailGetMailItemAttribute,				METH_VARARGS },
		{ "GetMailItemData",			mailGetMailItemData,					METH_VARARGS },
		{ "GetMailItemMetinSocket",		mailGetMailItemMetinSocket,				METH_VARARGS },
		{ NULL,							NULL,									NULL		 },
	};

	PyObject* poModule = Py_InitModule("mail", s_methods);

Maybe fix it for others to don't get confused 😄

Link to comment
Share on other sites

perhaps a way for GMs(through some item) or NPCs to give quest rewards through mailbox(not needing to have any concerns regarding inventory/safebox space) to players so they can pick them up whenever they please, would be a nice addition to this system.

nevertheless, an amazing contribution, as always!

Edited by boaspessoal
Link to comment
Share on other sites

  • Honorable Member
53 minutes ago, boaspessoal said:

perhaps a way for GMs(through some item) or NPCs to give quest rewards through mailbox(not needing to have any concerns regarding inventory/safebox space) to players so they can pick them up whenever they please, would be a nice addition to this system.

nevertheless, an amazing contribution, as always!

In the official game, battle royale rewards are distributed through the mailbox 🙃

I will add a function for gm's. Can be good for ox event awards...

Edited by Mali
  • Metin2 Dev 1

 

Link to comment
Share on other sites

  • Honorable Member

# Update:

GM Message:

-- (name, title, message, vnum, count, yang, won)
game.send_gm_mail("Mali61", "Test", "We are testing GM mail!", 39068, 25, 1461, 61)

133398495-f372c11a-df66-43a8-8a33-17390c

and log...

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

 

Link to comment
Share on other sites

    __time32_t                        SendTime;
    __time32_t                        DeleteTime;

../../common/tables.h:851:2: error: '__time32_t' does not name a type; did you mean '__timer_t'?
  __time32_t      SendTime;
  ^~~~~~~~~~
  __timer_t
../../common/tables.h:852:2: error: '__time32_t' does not name a type; did you mean '__timer_t'?
  __time32_t      DeleteTime;
 

    static std::unordered_set<std::string> NameSet;
    bool bFound = NameSet.find(p->szName) != NameSet.end();

 

error

Link to comment
Share on other sites

Does anyone know why i'm experiencing a kick after each warp? Besides that everything works perfect.

 

I receive this error in game core: 

 

SYSERR: Sep 19 18:00:13 :: Analyze: login phase does not handle this packet! header 3
SYSERR: Sep 19 18:00:13 :: Process: UNKNOWN HEADER: 47, LAST HEADER: 3(109), REMAIN BYTES: 11, fd: 22
SYSERR: Sep 19 18:02:37 :: Analyze: login phase does not handle this packet! header 3
SYSERR: Sep 19 18:02:37 :: Process: UNKNOWN HEADER: 47, LAST HEADER: 3(104), REMAIN BYTES: 11, fd: 22
SYSERR: Sep 19 18:05:16 :: Analyze: login phase does not handle this packet! header 3
SYSERR: Sep 19 18:05:16 :: Process: UNKNOWN HEADER: 47, LAST HEADER: 3(100), REMAIN BYTES: 11, fd: 22

 

@ Mali I KNOW YOUR DOING PARTY AT THE MOMENT BRO BUT IS IT JUST ME ?  WHY I DO GET THIS ERROR 😞 ;( 

Link to comment
Share on other sites

  • Honorable Member
7 minutes ago, VegasForPresident said:

Does anyone know why i'm experiencing a kick after each warp? Besides that everything works perfect.

 

I receive this error in game core: 

 

SYSERR: Sep 19 18:00:13 :: Analyze: login phase does not handle this packet! header 3
SYSERR: Sep 19 18:00:13 :: Process: UNKNOWN HEADER: 47, LAST HEADER: 3(109), REMAIN BYTES: 11, fd: 22
SYSERR: Sep 19 18:02:37 :: Analyze: login phase does not handle this packet! header 3
SYSERR: Sep 19 18:02:37 :: Process: UNKNOWN HEADER: 47, LAST HEADER: 3(104), REMAIN BYTES: 11, fd: 22
SYSERR: Sep 19 18:05:16 :: Analyze: login phase does not handle this packet! header 3
SYSERR: Sep 19 18:05:16 :: Process: UNKNOWN HEADER: 47, LAST HEADER: 3(100), REMAIN BYTES: 11, fd: 22

 

@ Mali I KNOW YOUR DOING PARTY AT THE MOMENT BRO BUT IS IT JUST ME ?  WHY I DO GET THIS ERROR 😞 ;( 

hmm🤔

 

I think the problem is at your packets.

 

for better results add it to clean files and see what happens.

Edited by Mali

 

Link to comment
Share on other sites

@ 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;

	....
 }

 

Link to comment
Share on other sites

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.