Jump to content

Where do i find Guild Chat in source?


Go to solution Solved by VegaS™,

Recommended Posts

  • Developer

By searching into the source server, i ve found where the chat packet is received from the player, and sent to the guild members.

int CInputMain::Chat(LPCHARACTER ch, const char * data, size_t uiBytes)

here is where it is adding the name of the player to the chat text before to send it to guild members.
You might not find the chat color system part.
 


	char chatbuf[CHAT_MAX_LEN + 1];
#ifdef ENABLE_CHAT_COLOR_SYSTEM
	// static const char* colorbuf[] = {" |h|r[ãÑÇÞÈ]|cFFffa200|h", " |h|r[ÔíäÓæ]|cFFff0000|h", " |h|r[ÔæäÌæ]|cFFffc700|h", " |h|r[Ìíäæ]|cFF000bff|h"}; // Arab
	static const char* colorbuf[] = {"|cFFffa200|H|h[Staff]|h|r", "|cFFff0000|H|h[Shinsoo]|h|r", "|cFFffc700|H|h[Chunjo]|h|r", "|cFF000bff|H|h[Jinno]|h|r"};
	int len = snprintf(chatbuf, sizeof(chatbuf), "%s %s : %s", (ch->IsGM()?colorbuf[0]:colorbuf[MINMAX(0, ch->GetEmpire(), 3)]), ch->GetName(), buf);
#else
	int len = snprintf(chatbuf, sizeof(chatbuf), "%s : %s", ch->GetName(), buf);
#endif

 

Warning : Here it is adding the name of the character independently on the chat type, so take care of check the type of chat before to add the level of the player (if you really want to add it only on guild chat).

  • Love 1

My youtube channel  on which you can see my works here

Link to comment
Share on other sites

Thank you for your feedback, but i have an issue..

 

I have changed only the line below (as you pointed) in input_main.cpp and here is the Outcome:

int len = snprintf(chatbuf, sizeof(chatbuf), "%s : %s", ch->GetName(), buf);

b2d875eebc2ec9cdcde69f540b374762.png

 

The guild chat Layout is the same as normal chat layout... The Guild char % is copying the normal chat layout... 

Is there a way to modify only GUILD CHAT ? 

 

I want to see only the guild chat with that layout, normal chat being default as usual..

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

  • Forum Moderator
  • Solution

Search for:

		case CHAT_TYPE_GUILD:
			{
				if (!ch->GetGuild())
					ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("길드에 가입하지 않았습니다."));
				else
					ch->GetGuild()->Chat(chatbuf);
			}
			break;

Replace with:

This is the hidden content, please

 

 

Edited by VegaS™
  • Love 7
Link to comment
Share on other sites

  • Developer
On 10/27/2020 at 1:11 PM, Ikarus_ said:

Warning : Here it is adding the name of the character independently on the chat type, so take care of check the type of chat before to add the level of the player (if you really want to add it only on guild chat).

As you can see here, i ve explained you right here to warn you about your issue kek

You may just add a if else like this:

 

if (CHAT_TYPE_GUILD == pinfo->type)
{
	// do stuff for guild chat
}

else
{
	// do stuff as default
}

 

 

  • Love 1

My youtube channel  on which you can see my works here

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

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.