codecat / tm-better-chat

A better chat for Trackmania using Openplanet.

Home Page:https://openplanet.nl/files/134

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

In json format, player name not displayed when player is not connected

AmazingBeu opened this issue · comments

For TFH 24h, the chat are synchronized between multiple servers, so the player can receive chat messages from players that are connected on another servers.

For messages received in json format, the player name will not be displayed because better chat can't find the player, even if the nickname is given in the json. It's due of these code part:

@m_authorPlayer = FindPlayerByLogin(m_authorLogin);
if (m_authorPlayer !is null) {
@m_authorPlayerInfo = m_authorPlayer.User;
} else {
@m_authorPlayerInfo = FindPlayerInfoByLogin(m_authorLogin);
}
if (m_authorPlayerInfo !is null) {
m_authorName = m_authorPlayerInfo.Name;
}

if (info.m_authorName != "") {
// Add author name
AddColorableElement(ElementPlayerName(
info.m_authorName,
info.m_authorNickname,
info.m_authorLogin,
info.m_authorId,
info.m_authorClubTag
), info);
}