RustCord not broadcasting all Death Notes.Solved

I've noticed that RustCord hasn't been broadcasting newer Death Notes. So, 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));
                            });
                        }
                    }

                }
        }​

DeathNotes dev here. Thanks to CPanopolyd for posting this and their efforts. I made a few revisions to the above to reflect some omitted NPCs. It would be wonderful if this were included in the next Rustcord release.

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)); });
}
}

}
}

plugin will get a patch soon im busy

Would it be possible to merge the changes between the two to have the Death Notes push the type used by RustCord? As in adding the 4 layers RustCord uses into the Death Notes hook and push something like PvP, NPC, Vehicle, Animal out including the ENUM to keep compatibility? That way, Death Notes can continuously change and add things, but it doesn't break the notes in other plugins.

That's the plan. We're still working on the specifics, but I'll probably implement a few (4?) new DeathNotes functions that Rustcord will invoke so that Rustcord will not need to be updated every time the DeathNotes enum changes. That will all otherwise be handled from within DeathNotes.

Don't hate me....  In RustCord, line 3361 has:  if (entity is BaseHelicopter ) that needs to change to if (Entity is PatrolHelicopter)
The "BaseHelicopter" triggers the PatrolHelicopter message for every minicopter on the server during reboots.

Locked automatically