Fixed:
-> !wants -> !orgs info -> special cmd's -> !assist -> "afk" for players without active account -> !loot add <item_ref> <count> => nolonger breaks !account Changes: -> grouped !tara, !gaunt, .. into !wb -> Display the most recent news entry on logon (default: enabled) -> improved grouping of !items -> Added the option to authentificate WS connections (Datanet module). This is used in special cases, where the Websocket Server requires the clien tto authentificate itself. (Server sends "#auth", client responds with the auth string) -> Add main name to relaying (priv <-> org) [default: disabled] -> Added logon/logoff messages back -> restricted default access to "dangerous" commands to moderator -> Added optional logging (Private Channel, Org Channel, Tells, ... disabled by default) Rewrite of the Tower Module. -> More verbosity, if enabled in config. by default, GAS and Hot timer only. -> !hot displays currently hot (and in penalty) sites, and these which go hot in < 60 minutes -> !attacks filterable by PF and Site -> display current contract QL's grouped by org: !contracts (requires managed cache)
This commit is contained in:
@@ -10,13 +10,13 @@ from core.db import DB
|
||||
from core.decorators import instance, event, command
|
||||
from core.dict_object import DictObject
|
||||
from core.fifo_queue import FifoQueue
|
||||
from core.igncore import IgnCore
|
||||
from core.logger import Logger
|
||||
from core.lookup.character_service import CharacterService
|
||||
from core.private_channel_service import PrivateChannelService
|
||||
from core.public_channel_service import PublicChannelService
|
||||
from core.setting_service import SettingService
|
||||
from core.text import Text
|
||||
from core.igncore import IgnCore
|
||||
from core.util import Util
|
||||
from modules.core.accounting.services.account_service import AccountService
|
||||
from modules.standard.online.online_display import OnlineDisplay
|
||||
@@ -163,6 +163,8 @@ class OnlineController:
|
||||
alts = self.account_service.get_alts(char_id)
|
||||
for alt in alts:
|
||||
self.afk_list[alt.char_id] = DictObject({"message": message, "time": time.time()})
|
||||
# Dirty fix for players without account
|
||||
self.afk_list[char_id] = DictObject({"message": message, "time": time.time()})
|
||||
elif char_id in self.afk_list.keys():
|
||||
# TODO handle multiple rows
|
||||
|
||||
@@ -173,7 +175,8 @@ class OnlineController:
|
||||
if data:
|
||||
continue
|
||||
data = out
|
||||
if not alts:
|
||||
data = self.afk_list.pop(char_id)
|
||||
char_name = self.character_service.resolve_char_to_name(char_id)
|
||||
time_string = self.util.time_to_readable(int(time.time()) - data.time)
|
||||
channel_reply(f"<highlight>{char_name}</highlight> is back after {time_string}.")
|
||||
|
||||
|
||||
@@ -55,6 +55,9 @@ class OnlineDisplay:
|
||||
org, priv, notify = 0, 0, 0
|
||||
previous = DictObject({'char_id': 0})
|
||||
for player in players:
|
||||
if player.faction == "":
|
||||
player.faction = "unknown"
|
||||
|
||||
rank = ""
|
||||
|
||||
if 'rank' in player:
|
||||
@@ -74,7 +77,8 @@ class OnlineDisplay:
|
||||
if main_id != player.main_id:
|
||||
main_id = player.main_id
|
||||
afk = "" if not afk else f" [<notice>{afk.message} - since {self.util.time_to_readable(int(time.time() - afk.time))}</notice>]"
|
||||
blob += f"\n<highlight>{player.main_name}</highlight>{rank}:{afk}\n"
|
||||
style = "style='text-decoration:none'"
|
||||
blob += f"\n<highlight>{self.text.make_tellcmd(player.main_name, f'alts {player.main_name}', style=style)}</highlight>{rank}:{afk}\n"
|
||||
if channel_id == 1:
|
||||
org += 1
|
||||
elif channel_id == 2:
|
||||
@@ -99,6 +103,8 @@ class OnlineDisplay:
|
||||
org, priv, notify = 0, 0, 0
|
||||
previous = DictObject({'char_id': 0})
|
||||
for player in players:
|
||||
if player.faction == "":
|
||||
player.faction = "unknown"
|
||||
rank = ""
|
||||
if player.char_id in in_org_priv:
|
||||
continue
|
||||
@@ -139,6 +145,8 @@ class OnlineDisplay:
|
||||
}
|
||||
last = 0
|
||||
for user in query:
|
||||
if user.faction == "":
|
||||
user.faction = "unknown"
|
||||
if last == user.char_id:
|
||||
continue
|
||||
last = user.char_id
|
||||
@@ -168,23 +176,26 @@ class OnlineDisplay:
|
||||
|
||||
def format_org(self, player, rank="", afk="", main_order=False):
|
||||
main = f"[{self.text.make_tellcmd(player.main_name, f'alts {player.main_name}')}]" if main_order else ""
|
||||
org = f"({player.org_rank_name}) " if player.org_rank_name else "(Applicant)"
|
||||
return f" {self.util.get_prof_icon(player.profession)} {rank}" \
|
||||
f"{self.text.zfill(player.level, 220)}/<green>{self.text.zfill(player.ai_level, 30)}</green> " \
|
||||
f"<{player.faction.lower()}>{player.name}</{player.faction.lower()}> ({player.org_rank_name}){afk} {main}\n"
|
||||
f"<{player.faction.lower()}>{player.name}</{player.faction.lower()}> {org}{afk} {main}\n"
|
||||
|
||||
def format_priv(self, player, rank="", afk="", main_order=False):
|
||||
main = f"[{self.text.make_tellcmd(player.main_name, f'alts {player.main_name}')}]" if main_order else ""
|
||||
org = f"({player.org_name}|{player.org_rank_name}) " if player.org_name else ""
|
||||
return f" {self.util.get_prof_icon(player.profession)} {rank}" \
|
||||
f"{self.text.zfill(player.level, 220)}/<green>{self.text.zfill(player.ai_level, 30)}</green> " \
|
||||
f"<{player.faction.lower()}>{player.name}</{player.faction.lower()}> " \
|
||||
f"({player.org_name}|{player.org_rank_name}){afk} {main}\n"
|
||||
f"{org}{afk} {main}\n"
|
||||
|
||||
def format_notify(self, player, rank="", afk="", main_order=False):
|
||||
main = f"[{self.text.make_tellcmd(player.main_name, f'alts {player.main_name}')}]" if main_order else ""
|
||||
org = f"({player.org_name}|{player.org_rank_name}) " if player.org_name else ""
|
||||
return f" {self.util.get_prof_icon(player.profession)} {rank}" \
|
||||
f"{self.text.zfill(player.level, 220)}/<green>{self.text.zfill(player.ai_level, 30)}</green> " \
|
||||
f"<{player.faction.lower()}>{player.name}</{player.faction.lower()}> " \
|
||||
f"({player.org_name}|{player.org_rank_name}){afk} {main}\n"
|
||||
f"{org}{afk} {main}\n"
|
||||
|
||||
def count_prof(self, query, params, filters):
|
||||
if filters:
|
||||
|
||||
Reference in New Issue
Block a user