Jump to content

Official Block System - Messenger


Recommended Posts

  • Honorable Member

#Big update Don't forget

50e8f3fb99.jpg

50f0b13d1b.jpg

V2:
Fix:When do you block anyone with target, messenger list doesn't update
Fix:Disconnect
Fix:If player2 blocked you, player1 can't block player2

Function(You can use IsBlocked);
IsBlocked_Me
IsBlocked_Target

Change;
Whisper  Block(input_main.cpp), now warning type: CHAT_TYPE_INFO->WHISPER_TYPE_SYSTEM
Locale_string.txt

Added;
#Trade      Block(exchange.cpp)
#Emotion Block(cmd_emotion.cpp)
#Party     Block(input_main.cpp)
#Duel     Block(cmd_general.cpp)
#Unblock button to target(uitarget.py&&locale_game&Python_messenger.cpp,h&&constInfo,uimessenger.py)

Edited by Metin2 Dev
Core X - External 2 Internal

 

Link to comment
Share on other sites

  • Honorable Member
1 minute ago, Krusty said:

Where is the download for v2?

Wait me 1 minute i remove i'll update v3 for messenger icon

#Updated for icon @xP3NG3Rx Thanks!

583bb831ee.jpg

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

 

Link to comment
Share on other sites

Quote

bool MessengerManager::IsBlocked(MessengerManager::keyA account, MessengerManager::keyA companion)
{	
	if (m_BlockRelation[account].find(companion) != m_BlockRelation[account].end() || m_BlockRelation[companion].find(account) != m_BlockRelation[companion].end())
		return true;
	else
		return false;
}

 

bool MessengerManager::IsBlocked(MessengerManager::keyA account, MessengerManager::keyA companion)
{	
	return (m_BlockRelation[account].find(companion) != m_BlockRelation[account].end() || m_BlockRelation[companion].find(account) != m_BlockRelation[companion].end());
}

There are more things like this what you can do, also there not need a "else" you can do it like this too:

	if (something)
		return true;
	return false;

 

Link to comment
Share on other sites

  • Honorable Member

#Update

Added:Guild Block

Fix:You can't block your guild friend now

Changes:

input_main.cpp & locale_string.txt

774521cff0.jpg

Edited by Metin2 Dev
Core X - External 2 Internal

 

Link to comment
Share on other sites

  • Bronze

What i did wrong?


input_main.cpp:832: warning: unused variable 'len_global'
input_main.cpp: In member function 'int CInputMain::Messenger(CHARACTER*, const             char*, size_t)':
input_main.cpp:1170: error: 'class MessengerManager' has no member named 'IsFriend'
input_main.cpp:1176: error: 'class MessengerManager' has no member named 'IsBlocked'
input_main.cpp:1216: error: 'class MessengerManager' has no member named 'IsFriend'
input_main.cpp:1222: error: 'class MessengerManager' has no member named 'IsBlocked'
input_main.cpp:1242: error: 'class MessengerManager' has no member named 'IsFriend'
 

 

https://pastebin.com/ZjkqirLR

 

https://pastebin.com/98tVyv4w

 

https://pastebin.com/38YxJEQa

Link to comment
Share on other sites

  • Honorable Member
1 hour ago, SergiuAndreiM said:

What i did wrong?


input_main.cpp:832: warning: unused variable 'len_global'
input_main.cpp: In member function 'int CInputMain::Messenger(CHARACTER*, const             char*, size_t)':
input_main.cpp:1170: error: 'class MessengerManager' has no member named 'IsFriend'
input_main.cpp:1176: error: 'class MessengerManager' has no member named 'IsBlocked'
input_main.cpp:1216: error: 'class MessengerManager' has no member named 'IsFriend'
input_main.cpp:1222: error: 'class MessengerManager' has no member named 'IsBlocked'
input_main.cpp:1242: error: 'class MessengerManager' has no member named 'IsFriend'
 

 

https://pastebin.com/ZjkqirLR

 

https://pastebin.com/98tVyv4w

 

https://pastebin.com/38YxJEQa

Send your messenger_manager.h

 

Link to comment
Share on other sites

  • Honorable Member
1 hour ago, SergiuAndreiM said:

The errors are from compile i don t think that IT s cheking The service.h.. 

 

2 hours ago, Mali61 said:

Did you add service.h:#define ENABLE_MESSENGER_BLOCK

??

 

Link to comment
Share on other sites

  • Bronze

in cmd_general.cpp

    #ifdef ENABLE_MESSENGER_BLOCK
    if (MessengerManager::instance().IsBlocked_Target(ch->GetName(), pkVictim->GetName()))
    {
        //ben blokladım hacı
        ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("%s blokkk"), pkVictim->GetName());
        return;
    }
    if (MessengerManager::instance().IsBlocked_Target(ch->GetName(), pkVictim->GetName()))
    {
        //o blokladı hacı
        ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("%s blokkk_me"), pkVictim->GetName());
        return;
    }
    #endif

the second must be IsBlocked_me

same thing for exchange.cpp

same thing for imput_main.cpp : partyInvite

cmd_emotion.cpp

Link to comment
Share on other sites

  • Honorable Member
On 03.07.2017 at 1:03 PM, SergiuAndreiM said:

in cmd_general.cpp

    #ifdef ENABLE_MESSENGER_BLOCK
    if (MessengerManager::instance().IsBlocked_Target(ch->GetName(), pkVictim->GetName()))
    {
        //ben blokladım hacı
        ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("%s blokkk"), pkVictim->GetName());
        return;
    }
    if (MessengerManager::instance().IsBlocked_Target(ch->GetName(), pkVictim->GetName()))
    {
        //o blokladı hacı
        ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("%s blokkk_me"), pkVictim->GetName());
        return;
    }
    #endif

the second must be IsBlocked_me

same thing for exchange.cpp

same thing for imput_main.cpp : partyInvite

cmd_emotion.cpp

Thanks dude, my mistake.

On 06.07.2017 at 0:11 AM, changemylife said:

Can anyone say me what's exactly the Problem here :

cd55b50c09.jpg

 

Player 1 blocks Player 2 but Player 2 can write a message and player 1 receive it.

Check out system I edited

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

 

Link to comment
Share on other sites

2 hours ago, .T4Ump said:

add anywhere where HEADER_GG

Thanks, i added it under:

HEADER_GG_CHECK_AWAKENESS		= 29,

but now client crashed in loading and in sysser is

 Unknown packet header: 176, last: 255 255

Here is my packet.h https://pastebin.com/9XutxZyq   i added it at line 333. I tried:

	HEADER_GG_MESSENGER_BLOCK_ADD                     = 31,
	HEADER_GG_MESSENGER_BLOCK_REMOVE                  = 32,

but some problem.

Thanks.

Link to comment
Share on other sites

7 minutes ago, Dimitar said:

Thanks, i added it under:


HEADER_GG_CHECK_AWAKENESS		= 29,

but now client crashed in loading and in sysser is


 Unknown packet header: 176, last: 255 255

Here is my packet.h https://pastebin.com/9XutxZyq   i added it at line 333. I tried:


	HEADER_GG_MESSENGER_BLOCK_ADD                     = 31,
	HEADER_GG_MESSENGER_BLOCK_REMOVE                  = 32,

but some problem.

Thanks.

Did you add at both serverside and clientside packets?

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.