Death Notes and RustCordSolved

I took a look at what both are doing and I had to add the ENUM numbers into RustCord for the new things to be captured. I'd like to suggest a collaboration on the two mods to make it more update friendly. I don't really know how to code but I think it the Death Notes hook needs to include one of the catgories that RustCord is splitting the notes into the RustCord permissions of plugin_deathnotes_pvp/animal/vehicle/npc. Then RustCord can use that to determine its logic instead of having to add all the ENUM numbers from the combatEntity Enum.

If anyone's interested, this is the change I made to RustCord to make it report the new Death Notes starting on line 4026:

            if (_DeathNotes != null)
                if ((victimType == 5 && (killerType == 26 || killerType == 5 || killerType == 6 || killerType == 7 || killerType == 8 || killerType == 9 || killerType == 10 || killerType == 11 || killerType == 12 || killerType == 14 || killerType == 15)))
                {
                    for (int i = 0; i < _channelCount; i++)
                    {
                        if (_settings.Channels[i].perms.Contains("plugin_deathnotes_pvp"))
                        {
                            GetChannel(Client, _settings.Channels[i].Channelid, chan =>
                            {
                                chan.CreateMessage(Client, Translate("PLUGIN_DeathNotes_Death", dict));
                            });
                        }
                    }

                }
//                else if ((victimType == 2 && killerType == 5) || (victimType == 5 && killerType == 2))
                else if (((victimType == 2 || victimType == 25 || victimType ==27) && killerType == 5) || (victimType == 5 && (killerType == 2 || killerType ==25 || killerType ==27)))
                {
                    for (int i = 0; i < _channelCount; i++)
                    {
                        if (_settings.Channels[i].perms.Contains("plugin_deathnotes_animal"))
                        {
                            GetChannel(Client, _settings.Channels[i].Channelid, chan =>
                            {
                                chan.CreateMessage(Client, Translate("PLUGIN_DeathNotes_Death", dict));
                            });
                        }
                    }

                }
//                else if ((victimType == 5 && (killerType == 0 || killerType == 1)) || ((victimType == 0 || victimType == 1) && (killerType == 5)))
                else if ((victimType == 5 && (killerType == 0 || killerType == 1 || killerType == 22 || killerType == 23 || killerType == 24 || killerType == 29)) || ((victimType == 22 || victimType == 23 || victimType == 24 || victimType == 29 || victimType == 0 || victimType == 1) && (killerType == 5)))
                {
                    message = (string)_DeathNotes.Call("StripRichText", message);

                    for (int i = 0; i < _channelCount; i++)
                    {
                        if (_settings.Channels[i].perms.Contains("plugin_deathnotes_vehicle"))
                        {
                            GetChannel(Client, _settings.Channels[i].Channelid, chan =>
                            {
                                chan.CreateMessage(Client, Translate("PLUGIN_DeathNotes_Death", dict));
                            });
                        }
                    }
                }
                else if ((victimType == 5 && (killerType == 3 || killerType == 4 || killerType == 16 || killerType == 17 || killerType == 18)) || ((victimType == 3 || victimType == 4 || victimType == 16 || victimType == 17 || victimType == 18) && (killerType == 5)))
                {
                    message = (string)_DeathNotes.Call("StripRichText", message);

                    for (int i = 0; i < _channelCount; i++)
                    {
                        if (_settings.Channels[i].perms.Contains("plugin_deathnotes_npc"))
                        {
                            GetChannel(Client, _settings.Channels[i].Channelid, chan =>
                            {
                                chan.CreateMessage(Client, Translate("PLUGIN_DeathNotes_Death", dict));
                            });
                        }
                    }

                }
        }​

Rustcord indeed needs to be updated to reflect the DeathNotes changes. Please post this note in the Rustcord help. Thanks!

Merged post

UPDATE: So, I use and love Rustcord myself, and made similar changes to the above a few months ago. I tried to reach out to the Rustcord dev about this and received no response. In any case, I looked at the above posted code more closely and compared it to mine and noticed a few small issues. The above is great work, but there are a few omissions in the NPC section. I highly recommend using the below, and I added some comments to assist the reader in understanding which enum value points to what entity type.

if (_DeathNotes != null)
{
//5 is player, 6 is trap, 7 is turret, 8 is barricade, 9 is externalwall, 10 is heatsource, 11 is fire,
//12 is lock, 14 is other, 15 is none, 26 is SAM site
if ((victimType == 5 && (killerType == 5 || killerType == 6 || killerType == 7 || killerType == 8 ||
killerType == 9 || killerType == 10 || killerType == 11 || killerType == 12 ||
killerType == 14 || killerType == 15 || killerType == 26)))
{
for (int i = 0; i < _channelCount; i++)
{
if (_settings.Channels[i].perms.Contains("plugin_deathnotes_pvp"))
{
GetChannel(Client, _settings.Channels[i].Channelid,
chan => { chan.CreateMessage(Client, Translate("PLUGIN_DeathNotes_Death", dict)); });
}
}

}
//2 is animal, 25 is BeeSwarm, 27 is Shark
else if (((victimType == 2 || victimType == 25 || victimType == 27) && killerType == 5) ||
(victimType == 5 && (killerType == 2 || killerType == 25 || killerType == 27)))
{
for (int i = 0; i < _channelCount; i++)
{
if (_settings.Channels[i].perms.Contains("plugin_deathnotes_animal"))
{
GetChannel(Client, _settings.Channels[i].Channelid,
chan => { chan.CreateMessage(Client, Translate("PLUGIN_DeathNotes_Death", dict)); });
}
}

}
//5 is player, 0 is patrol heli, 1 is bradley apc, 22 is minicopter, 23 is scrappy, 24 is attack heli,
//29 is excavatorarm
else if ((victimType == 5 && (killerType == 0 || killerType == 1 || killerType == 22 ||
killerType == 23 || killerType == 24 || killerType == 29)) ||
((victimType == 22 || victimType == 23 || victimType == 24 || victimType == 29 ||
victimType == 0 || victimType == 1) && (killerType == 5)))
{
message = (string)_DeathNotes.Call("StripRichText", message);

for (int i = 0; i < _channelCount; i++)
{
if (_settings.Channels[i].perms.Contains("plugin_deathnotes_vehicle"))
{
GetChannel(Client, _settings.Channels[i].Channelid,
chan => { chan.CreateMessage(Client, Translate("PLUGIN_DeathNotes_Death", dict)); });
}
}
}
//5 is player, 3 is murderer, 4 is scientist, 13 is sentry, 16 is scarecrownpc, 17 is tunneldweller,
//18 is underwaterdweller, 19 is zombienpc, 20 is gingerbreadnpc, 21 is heavyscientist, 28 is npcshopkeeper
else if ((victimType == 5 && (killerType == 3 || killerType == 4 || killerType == 13 ||
killerType == 16 || killerType == 17 || killerType == 18 ||
killerType == 19 || killerType == 20 || killerType == 21 ||
killerType == 28)) || ((victimType == 3 || victimType == 4 ||
victimType == 13 || victimType == 16 ||
victimType == 17 || victimType == 18 ||
victimType == 19 || victimType == 20 ||
victimType == 21 || victimType == 28) &&
(killerType == 5)))
{
message = (string)_DeathNotes.Call("StripRichText", message);

for (int i = 0; i < _channelCount; i++)
{
if (_settings.Channels[i].perms.Contains("plugin_deathnotes_npc"))
{
GetChannel(Client, _settings.Channels[i].Channelid,
chan => { chan.CreateMessage(Client, Translate("PLUGIN_DeathNotes_Death", dict)); });
}
}

}
}


Merged post

Just to close the loop, I talked to OuTSMoKE and we're coordinating resolution of this in an upcoming release of Rustcord (and probably DeathNotes to futureproof this issue).
Locked automatically