Chat Icons 2.2

No permission to download

Zachar543

Member
Plugin Developer
Messages
46
Likes
10
Points
8
Zachar543 submitted a new resource:

Chat Icons - Allows Chat Icons by Permission Groups and/or Steam IDs

This plugin allows Overriding Chat Icons by Permission Groups and/or Steam IDs.

Example Configuration:
JSON:
{
  "Groups": { // Groups from the Permissions plugin
    "Admins": "/Game/PrimalEarth/UI/Textures/ServerAdminChat_Icon.ServerAdminChat_Icon", // Keep this line unless you want to override/remove the default ServerAdmin icon
    "Donor": "/Game/PrimalEarth/CoreBlueprints/StatusIcons/Mating_Icon.Mating_Icon"
  },
  "SteamIds": {
    "1234567890"...
Read more about this resource...
 
Advertisement

Monetise Your Game Server

Want to monetise your ARK Server? Create your own webstore at tebex.io

r2range

Member
Plugin Developer
Messages
105
Likes
11
Points
18
Just tried this out but there is a bug in here where you can read all the tribe chat message's even if youre not in the tribe.
 

Zachar543

Member
Plugin Developer
Messages
46
Likes
10
Points
8
Just tried this out but there is a bug in here where you can read all the tribe chat message's even if youre not in the tribe.
Thanks for the report. I missed a few things in my initial testing.
This has been fixed in v1.0.1.
 

r2range

Member
Plugin Developer
Messages
105
Likes
11
Points
18
Which version are you running? I'm currently waiting on moderator approval for the v1.0.1 upload.
oh i tough when you posted that you fixed it would be updated udner the download button :p mind pming me the updated version?
 

Zachar543

Member
Plugin Developer
Messages
46
Likes
10
Points
8
oh i tough when you posted that you fixed it would be updated udner the download button :p mind pming me the updated version?
Working better with the newest version?

v1.0.1 is approved now as well (same as what I sent you, though).
 

r2range

Member
Plugin Developer
Messages
105
Likes
11
Points
18
Working better with the newest version?

v1.0.1 is approved now as well (same as what I sent you, though).
No you need to fix youre config i get an json error.

C++:
void loadConfig() {
    auto& plugin = Plugin::Get();

    try {
        const std::string path = ArkApi::Tools::GetCurrentDir() + "/ArkApi/Plugins/ArkChatIcons/config.json";

        std::ifstream file{ path };
        if (!file.is_open()) {
            throw std::runtime_error("Failed to load config!");
        }

        file >> plugin.config;
    ---->    file.close();   <--- 

This part isnt filled so it crashed. 

        plugin.interceptGlobalChat = plugin.config.value("InterceptGlobalChat", true);
        plugin.interceptTribeChat = plugin.config.value("InterceptTribeChat", true);
        plugin.interceptAllianceChat = plugin.config.value("InterceptAllianceChat", true);
        plugin.interceptLocalChat = plugin.config.value("InterceptLocalChat", true);
        plugin.localChatDistance = plugin.config.value("LocalChatDistance", 1000);
    }
    catch (const std::exception& error) {
        Log::GetLog()->error(error.what());
        throw;
    }
}
 

Zachar543

Member
Plugin Developer
Messages
46
Likes
10
Points
8
No you need to fix youre config i get an json error.

C++:
void loadConfig() {
    auto& plugin = Plugin::Get();

    try {
        const std::string path = ArkApi::Tools::GetCurrentDir() + "/ArkApi/Plugins/ArkChatIcons/config.json";

        std::ifstream file{ path };
        if (!file.is_open()) {
            throw std::runtime_error("Failed to load config!");
        }

        file >> plugin.config;
    ---->    file.close();   <---

This part isnt filled so it crashed.

        plugin.interceptGlobalChat = plugin.config.value("InterceptGlobalChat", true);
        plugin.interceptTribeChat = plugin.config.value("InterceptTribeChat", true);
        plugin.interceptAllianceChat = plugin.config.value("InterceptAllianceChat", true);
        plugin.interceptLocalChat = plugin.config.value("InterceptLocalChat", true);
        plugin.localChatDistance = plugin.config.value("LocalChatDistance", 1000);
    }
    catch (const std::exception& error) {
        Log::GetLog()->error(error.what());
        throw;
    }
}
What was in your config file when the crash happened?

The original version's config file works for me and uses the defaults (the second argument to each .value() call) for all new properties:
JSON:
{
  "Groups": {
    "Admins": "/Game/PrimalEarth/UI/Textures/ServerAdminChat_Icon.ServerAdminChat_Icon",
    "AnotherGroup": "/Game/PrimalEarth/UI/Textures/StatsIcons/Fortitude_Icon.Fortitude_Icon"
  },
  "SteamIds": {
    "1234567890": "/Game/PrimalEarth/UI/Textures/StatsIcons/Fortitude_Icon.Fortitude_Icon"
  }
}
Any chance this is similar to the error you got, and were you using the reload config command when it happened?
Code:
08/05/18 11:53 [ArkChatIcons][error] [json.exception.parse_error.101] parse error at 17: syntax error - invalid literal; last read: '"Groups": { /'; expected string literal
08/05/18 11:53 [API][warning] Failed to load plugin - ArkChatIcons
Error code: 1114
If so, remove any comments from the config file as they aren't technically valid in json. To be extra safe, recreate your config.json from the one provided in the download (not the config example on the main page).
 

Zachar543

Member
Plugin Developer
Messages
46
Likes
10
Points
8
Ah, it's the PluginInfo.json file. I'll upload a new version.

In the mean time, replace your PluginInfo.json file with this (Version changed to 1.1 instead of 1.0.1):
JSON:
{
  "FullName":"ARK Chat Icons",
  "Description":"Allows changing player chat icons by group or steam id",
  "Version":1.1,
  "MinApiVersion":2.3
}
 

sirshaw

ArkBot Project Maintainer
Donators
Messages
23
Likes
2
Points
3
Website
ARK.KNIGHTSGG.COM
also a small glitch with this plugin is that if you have the crossark chat plugin enabled for the api, the global chat text is duplicated. One shows the correct icon but the duplicated text has the vanilla icon.
 

Zachar543

Member
Plugin Developer
Messages
46
Likes
10
Points
8
also a small glitch with this plugin is that if you have the crossark chat plugin enabled for the api, the global chat text is duplicated. One shows the correct icon but the duplicated text has the vanilla icon.
I'll look into this as well, but I'm not certain I can prevent (or even detect) the double message since the ArkCrossServerChat plugin is using a very similar method for intercepting/resending chat. If I had to guess, the second message (with the default icons) is coming from the ArkCrossServerChat plugin.

Chat-based plugins using the same method may not be compatible for this reason. So, either plugin devs need to work together to prevent this sort of thing or we'll need some API option for dealing with these kind of conflicts.

I'll try to work with the developer of ArkCrossServerChat to see if we can resolve this.
 

Zachar543

Member
Plugin Developer
Messages
46
Likes
10
Points
8
Sadly, I cannot prevent the duplicated global chat issue from my side when ArkCrossServerChat is also installed, but I did submit a code fix to their GitHub that is waiting to be reviewed (PR #7).

I've added a compatibility note on the main page for now, but we'll need to wait for @Tobias to check the PR.
 
Top