accidentally overwrote !shout with !lft...
This commit is contained in:
@@ -78,7 +78,7 @@ class PrivateChannelController:
|
|||||||
return hjson.load(f)
|
return hjson.load(f)
|
||||||
|
|
||||||
def handle_incoming_relay_message(self, ctx):
|
def handle_incoming_relay_message(self, ctx):
|
||||||
if self.display_main().get_value() and ctx.source == "private_channel" and ctx.sender:
|
if self.display_main().get_value() and ctx.source == "org_channel" and ctx.sender:
|
||||||
name = f"{OrgChannelController.ORG_CHANNEL_PREFIX} <yellow>{ctx.sender.name}</yellow>"
|
name = f"{OrgChannelController.ORG_CHANNEL_PREFIX} <yellow>{ctx.sender.name}</yellow>"
|
||||||
if account := self.account_service.get_account(ctx.sender.char_id):
|
if account := self.account_service.get_account(ctx.sender.char_id):
|
||||||
if account.main != ctx.sender.char_id:
|
if account.main != ctx.sender.char_id:
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ class ChatController:
|
|||||||
|
|
||||||
@command(command="lft", params=[Any("message", is_optional=True)], access_level="member",
|
@command(command="lft", params=[Any("message", is_optional=True)], access_level="member",
|
||||||
description="Show a highly visible message")
|
description="Show a highly visible message")
|
||||||
def shout_command(self, _, message):
|
def lft_command(self, _, message):
|
||||||
lft = f"<a href='chatcmd:///lft <font color=#FFFF00>» {message or '<myname>'}<end>'>/lft {message or '<myname>'}</a>"
|
lft = f"<a href='chatcmd:///lft <font color=#FFFF00>» {message or '<myname>'}<end>'>/lft {message or '<myname>'}</a>"
|
||||||
return self.text.format_page("Use this command for going LFT", "<yellow>────────────────</yellow>\n"
|
return self.text.format_page("Use this command for going LFT", "<yellow>────────────────</yellow>\n"
|
||||||
f"<highlight>{lft}</highlight>\n"
|
f"<highlight>{lft}</highlight>\n"
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ class TowerEventController:
|
|||||||
victory = self.get_victory_event(packet)
|
victory = self.get_victory_event(packet)
|
||||||
|
|
||||||
if victory:
|
if victory:
|
||||||
self.logger.info("tower victory packet: %s" % str(packet))
|
# self.logger.info("tower victory packet: %s" % str(packet))
|
||||||
|
|
||||||
# lookup playfield
|
# lookup playfield
|
||||||
playfield_name = victory.location.playfield.long_name
|
playfield_name = victory.location.playfield.long_name
|
||||||
@@ -80,7 +80,8 @@ class TowerEventController:
|
|||||||
attack = self.get_attack_event(packet)
|
attack = self.get_attack_event(packet)
|
||||||
|
|
||||||
if attack:
|
if attack:
|
||||||
self.logger.info("tower attack packet: %s" % str(packet))
|
# self.logger.info("tower attack packet: %s" % str(packet))
|
||||||
|
# ServerPacket(65): [42949672960, 0, "Kletka just attacked the clan organization Lex Noctis's tower in Athen Shire at location (2606, 2022).\n", ''], ExtendedMessage: None
|
||||||
|
|
||||||
# lookup playfield
|
# lookup playfield
|
||||||
playfield_name = attack.location.playfield.long_name
|
playfield_name = attack.location.playfield.long_name
|
||||||
@@ -93,13 +94,18 @@ class TowerEventController:
|
|||||||
faction = attack.attacker.faction
|
faction = attack.attacker.faction
|
||||||
org_name = attack.attacker.org_name
|
org_name = attack.attacker.org_name
|
||||||
char_info = self.pork_service.get_character_info(name)
|
char_info = self.pork_service.get_character_info(name)
|
||||||
|
print(attack, name, faction, org_name)
|
||||||
|
print(char_info)
|
||||||
attack.attacker = char_info or DictObject()
|
attack.attacker = char_info or DictObject()
|
||||||
attack.attacker.name = name
|
attack.attacker.name = name
|
||||||
attack.attacker.faction = faction or attack.attacker.get("faction", "Unknown")
|
attack.attacker.faction = faction or attack.attacker.get("faction", "Unknown")
|
||||||
attack.attacker.org_name = org_name
|
attack.attacker.org_name = org_name
|
||||||
# print("ATTK", attack)
|
if char_info:
|
||||||
|
print("ATTK", attack)
|
||||||
|
|
||||||
self.event_service.fire_event(self.TOWER_ATTACK_EVENT, attack)
|
self.event_service.fire_event(self.TOWER_ATTACK_EVENT, attack)
|
||||||
|
else:
|
||||||
|
print("WARNING", attack)
|
||||||
|
|
||||||
def get_attack_event(self, packet: server_packets.PublicChannelMessage):
|
def get_attack_event(self, packet: server_packets.PublicChannelMessage):
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user