Jump to content
  • 0

Where do i find Guild Chat in source?


Shahin
Go to solution Solved by VegaS™,

Question

I would like to modify the Guild chat format, to have the Level beside his name as an example. Where should i look? Source/Client?

I have looked in UiChat.py but without success

 

 

Thanks

Link to post

4 answers to this question

Recommended Posts

  • 1
  • 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:

		case CHAT_TYPE_GUILD:
			{
				if (!ch->GetGuild())
					ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("길드에 가입하지 않았습니다."));
				else
				{
					char cGuildChat[CHAT_MAX_LEN + 1];
					snprintf(cGuildChat, sizeof(cGuildChat), "%s : %s", ch->GetName(), buf);
					ch->GetGuild()->Chat(cGuildChat);
				}
			}
			break;

 

 

  • Love 1
Link to post
  • 1

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 post
  • 0

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..

Link to post
  • 0
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 post
Guest
This topic is now closed to further replies.


×
×
  • 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.