diff --git a/bemani/backend/iidx/cannonballers.py b/bemani/backend/iidx/cannonballers.py index 82f778f..38d240c 100644 --- a/bemani/backend/iidx/cannonballers.py +++ b/bemani/backend/iidx/cannonballers.py @@ -1855,10 +1855,11 @@ class IIDXCannonBallers(IIDXCourse, IIDXBase): root.add_child(nostalgia) # Ea app features - root.add_child(Node.void('bind_eaappli')) - pay_per_use = Node.void('pay_per_use') - root.add_child(pay_per_use) - pay_per_use.set_attribute('item_num', '99') + if self.data.triggers.has_broadcast_destination(self.game): + root.add_child(Node.void('bind_eaappli')) + pay_per_use = Node.void('pay_per_use') + root.add_child(pay_per_use) + pay_per_use.set_attribute('item_num', '99') return root def unformat_profile(self, userid: UserID, request: Node, oldprofile: Profile) -> Profile: diff --git a/bemani/backend/iidx/copula.py b/bemani/backend/iidx/copula.py index e7e0dee..d9118a5 100644 --- a/bemani/backend/iidx/copula.py +++ b/bemani/backend/iidx/copula.py @@ -1867,7 +1867,8 @@ class IIDXCopula(IIDXCourse, IIDXBase): onemore_data.set_attribute('challenge_num_a', str(onemore_dict.get_int('challenge_num_a'))) # Ea app features - root.add_child(Node.void('bind_eaappli')) + if self.data.triggers.has_broadcast_destination(self.game): + root.add_child(Node.void('bind_eaappli')) return root def unformat_profile(self, userid: UserID, request: Node, oldprofile: Profile) -> Profile: diff --git a/bemani/backend/iidx/pendual.py b/bemani/backend/iidx/pendual.py index a489386..75eef93 100644 --- a/bemani/backend/iidx/pendual.py +++ b/bemani/backend/iidx/pendual.py @@ -1713,7 +1713,8 @@ class IIDXPendual(IIDXCourse, IIDXBase): orb_data.set_attribute('rest_orb', str(profile.get_int('orbs'))) # Ea app features - root.add_child(Node.void('bind_eaappli')) + if self.data.triggers.has_broadcast_destination(self.game): + root.add_child(Node.void('bind_eaappli')) return root def unformat_profile(self, userid: UserID, request: Node, oldprofile: Profile) -> Profile: diff --git a/bemani/backend/iidx/rootage.py b/bemani/backend/iidx/rootage.py index ca2a8b7..0cdc24c 100644 --- a/bemani/backend/iidx/rootage.py +++ b/bemani/backend/iidx/rootage.py @@ -1566,10 +1566,11 @@ class IIDXRootage(IIDXCourse, IIDXBase): root.add_child(nostalgia) # Ea app features - root.add_child(Node.void('bind_eaappli')) - pay_per_use = Node.void('pay_per_use') - root.add_child(pay_per_use) - pay_per_use.set_attribute('item_num', '99') + if self.data.triggers.has_broadcast_destination(self.game): + root.add_child(Node.void('bind_eaappli')) + pay_per_use = Node.void('pay_per_use') + root.add_child(pay_per_use) + pay_per_use.set_attribute('item_num', '99') return root diff --git a/bemani/backend/iidx/sinobuz.py b/bemani/backend/iidx/sinobuz.py index 6ab93e4..2650d26 100644 --- a/bemani/backend/iidx/sinobuz.py +++ b/bemani/backend/iidx/sinobuz.py @@ -1878,7 +1878,8 @@ class IIDXSinobuz(IIDXCourse, IIDXBase): root.add_child(nostalgia) # Ea app features - root.add_child(Node.void('bind_eaappli')) + if self.data.triggers.has_broadcast_destination(self.game): + root.add_child(Node.void('bind_eaappli')) return root def unformat_profile(self, userid: UserID, request: Node, oldprofile: Profile) -> Profile: diff --git a/bemani/backend/iidx/spada.py b/bemani/backend/iidx/spada.py index d7d4031..149b0af 100644 --- a/bemani/backend/iidx/spada.py +++ b/bemani/backend/iidx/spada.py @@ -1462,7 +1462,8 @@ class IIDXSpada(IIDXBase): boss1.add_child(Node.binary('durability', boss1_dict.get_bytes('durability'))) # Ea app features - root.add_child(Node.void('bind_eaappli')) + if self.data.triggers.has_broadcast_destination(self.game): + root.add_child(Node.void('bind_eaappli')) return root def unformat_profile(self, userid: UserID, request: Node, oldprofile: Profile) -> Profile: diff --git a/bemani/backend/popn/common.py b/bemani/backend/popn/common.py index 6d4b094..51ca73d 100644 --- a/bemani/backend/popn/common.py +++ b/bemani/backend/popn/common.py @@ -899,7 +899,7 @@ class PopnMusicModernBase(PopnMusicBase, metaclass=ABCMeta): # eAmuse account link eaappli = Node.void('eaappli') root.add_child(eaappli) - eaappli.add_child(Node.s8('relation', 1)) + eaappli.add_child(Node.s8('relation', 1 if self.data.triggers.has_broadcast_destination(self.game) else -1)) # Player info info = Node.void('info') diff --git a/bemani/backend/popn/eclale.py b/bemani/backend/popn/eclale.py index cc55160..d47b491 100644 --- a/bemani/backend/popn/eclale.py +++ b/bemani/backend/popn/eclale.py @@ -564,7 +564,7 @@ class PopnMusicEclale(PopnMusicBase): # eAmuse account link eaappli = Node.void('eaappli') root.add_child(eaappli) - eaappli.add_child(Node.s8('relation', 1)) + eaappli.add_child(Node.s8('relation', 1 if self.data.triggers.has_broadcast_destination(self.game) else -1)) # Set up info node info = Node.void('info') diff --git a/bemani/data/triggers.py b/bemani/data/triggers.py index a2467ff..08041ea 100644 --- a/bemani/data/triggers.py +++ b/bemani/data/triggers.py @@ -28,6 +28,14 @@ class Triggers: GameConstants.SDVX: 'Sound Voltex', }.get(game, 'Unknown') + def has_broadcast_destination(self, game: GameConstants) -> bool: + # For now we only support discord + if self.config.webhooks.discord[game] is not None: + return True + + # Nothing is hooked up for this game, so there is no destination. + return False + def broadcast_score(self, data: Dict[BroadcastConstants, str], game: GameConstants, song: Song) -> None: # For now we only support discord if self.config.webhooks.discord[game] is not None: