discord: Update activity message while playing PVP or DMM (#11522)

This commit is contained in:
Rangvaldr
2020-05-12 15:11:03 -04:00
committed by GitHub
parent 34158ebc99
commit 4243dce1b1
2 changed files with 15 additions and 8 deletions

View File

@@ -43,6 +43,8 @@ enum DiscordGameEventType
IN_GAME("In Game", -3),
IN_MENU("In Menu", -3),
PLAYING_DEADMAN("Playing Deadman Mode", -3),
PLAYING_PVP("Playing in a PVP world", -3),
TRAINING_ATTACK(Skill.ATTACK),
TRAINING_DEFENCE(Skill.DEFENCE),
TRAINING_STRENGTH(Skill.STRENGTH),

View File

@@ -381,6 +381,19 @@ public class DiscordPlugin extends Plugin
return;
}
final EnumSet<WorldType> worldType = client.getWorldType();
if (worldType.contains(WorldType.DEADMAN))
{
discordState.triggerEvent(DiscordGameEventType.PLAYING_DEADMAN);
return;
}
else if (WorldType.isPvpWorld(worldType))
{
discordState.triggerEvent(DiscordGameEventType.PLAYING_PVP);
return;
}
DiscordGameEventType discordGameEventType = DiscordGameEventType.fromRegion(playerRegionID);
// NMZ uses the same region ID as KBD. KBD is always on plane 0 and NMZ is always above plane 0
@@ -413,14 +426,6 @@ public class DiscordPlugin extends Plugin
return false;
}
final EnumSet<WorldType> worldType = client.getWorldType();
// Do not show location in PVP activities
if (WorldType.isPvpWorld(worldType))
{
return false;
}
switch (event.getDiscordAreaType())
{
case BOSSES: return config.showBossActivity();