1
0
mirror of synced 2024-11-27 23:50:47 +01:00

Only enable ealink for IIDX/Pop'n if there is something to broadcast scores to.

This commit is contained in:
Jennifer Taylor 2021-09-06 19:42:38 +00:00
parent 351a55a934
commit beb818f42b
9 changed files with 28 additions and 14 deletions

View File

@ -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:

View File

@ -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:

View File

@ -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:

View File

@ -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

View File

@ -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:

View File

@ -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:

View File

@ -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')

View File

@ -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')

View File

@ -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: