Jump to content
×
×
  • Create New...

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)

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

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:

IT s în Pastebin în The first com

 

Did you add service.h:#define ENABLE_MESSENGER_BLOCK

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

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 :

This is the hidden content, please

 

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

Check out system I edited

  • Metin2 Dev 1
Link to comment
Share on other sites

When a player write from channel 1 to 99(example) core drops. 

input_main.cpp

else if (MessengerManager::instance().IsBlocked_Target(ch->GetName(), pkChr->GetName()))

change to

else if (pkChr && MessengerManager::instance().IsBlocked_Target(ch->GetName(), pkChr->GetName()))

 

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.


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.