Browse Source

changed origin to dataset, makes more immediate sense

reorganized enter_password trigger and made an extra action for the
actual authentication. this way we can authenticate by different means
TODO: do the same for creating players and locations
pull/1/head
Christian Voigt 1 year ago
parent
commit
79e61d9cf6
18 changed files with 157 additions and 100 deletions
  1. +1
    -1
      LICENSE
  2. +1
    -1
      bot/modules/dom_management/__init__.py
  3. +1
    -1
      bot/modules/dom_management/actions/sed.py
  4. +1
    -1
      bot/modules/dom_management/templates/control_edit_link.html
  5. +2
    -2
      bot/modules/dom_management/templates/control_enabled_link.html
  6. +3
    -3
      bot/modules/dom_management/templates/control_select_link.html
  7. +1
    -1
      bot/modules/environment/actions/getentities.py
  8. +1
    -1
      bot/modules/locations/actions/manage_locations.py
  9. +1
    -1
      bot/modules/locations/templates/locations_widget/control_edit_link.html
  10. +11
    -11
      bot/modules/locations/templates/locations_widget/table_row.html
  11. +3
    -3
      bot/modules/locations/widgets/manage_locations_widget.py
  12. +73
    -0
      bot/modules/permissions/actions/manage_permissions.py
  13. +12
    -28
      bot/modules/permissions/triggers/enter_password.py
  14. +1
    -1
      bot/modules/players/actions/getplayers.py
  15. +14
    -14
      bot/modules/players/templates/player_table_widget/table_row.html
  16. +27
    -27
      bot/modules/players/templates/player_table_widget/view_info.html
  17. +1
    -1
      bot/modules/players/triggers/entered_telnet.py
  18. +3
    -3
      bot/modules/players/widgets/manage_players_widget.py

+ 1
- 1
LICENSE View File

@ -369,7 +369,7 @@ that material) supplement the terms of this License with terms:
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
c) Prohibiting misrepresentation of the dataset of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or


+ 1
- 1
bot/modules/dom_management/__init__.py View File

@ -81,7 +81,7 @@ class DomManagement(Module):
dom_element_select_root = kwargs.get("dom_element_select_root", ["selected_by"])
dom_element_id = kwargs.get("dom_element_id", None)
dom_element_origin = updated_values_dict["origin"]
dom_element_origin = updated_values_dict["dataset"]
dom_element_owner = updated_values_dict["owner"]
dispatchers_steamid = kwargs.get("dispatchers_steamid", None)


+ 1
- 1
bot/modules/dom_management/actions/sed.py View File

@ -42,7 +42,7 @@ def main_function(module, event_data, dispatchers_steamid):
if max_discovered_level == 0:
selected_by_dict = {
path_fragment: selected_by_dict_element,
"origin": dom_element_origin,
"dataset": dom_element_origin,
"owner": dom_element_owner,
"identifier": dom_element_identifier
}


+ 1
- 1
bot/modules/dom_management/templates/control_edit_link.html View File

@ -4,7 +4,7 @@
"edit", ['widget_event', ['locations', ['toggle_locations_view', {
"dom_element_owner": location.owner,
"dom_element_identifier": location.identifier,
"dom_element_origin": location.origin,
"dom_element_origin": location.dataset,
"action": "edit_location_entry"
}]]]
) }}

+ 2
- 2
bot/modules/dom_management/templates/control_enabled_link.html View File

@ -4,13 +4,13 @@
"enabled", ['widget_event', ['locations', ['management_tools', {
"dom_element_owner": location.owner,
"dom_element_identifier": location.identifier,
"dom_element_origin": location.origin,
"dom_element_origin": location.dataset,
"action": "disable_location_entry"
}]]],
"enabled", ['widget_event', ['locations', ['management_tools', {
"dom_element_owner": location.owner,
"dom_element_identifier": location.identifier,
"dom_element_origin": location.origin,
"dom_element_origin": location.dataset,
"action": "enable_location_entry"
}]]]
) }}

+ 3
- 3
bot/modules/dom_management/templates/control_select_link.html View File

@ -1,7 +1,7 @@
{%- from 'jinja2_macros.html' import construct_toggle_link with context -%}
{% set owner = dom_element.owner|default("null") %}
{% set identifier = dom_element.identifier|default("null") %}
{% set origin = dom_element.origin|default("null") %}
{% set dataset = dom_element.dataset|default("null") %}
{{ construct_toggle_link(
dom_element_entry_selected,
"☑", ['widget_event', ['dom_management', ['sed', {
@ -9,7 +9,7 @@
"target_module": target_module,
"dom_element_owner": owner,
"dom_element_identifier": identifier,
"dom_element_origin": origin,
"dom_element_origin": dataset,
'action': dom_action_active
}]]],
"☐", ['widget_event', ['dom_management', ['sed', {
@ -17,7 +17,7 @@
"target_module": target_module,
"dom_element_owner": owner,
"dom_element_identifier": identifier,
"dom_element_origin": origin,
"dom_element_origin": dataset,
"action": dom_action_inactive
}]]]
) }}

+ 1
- 1
bot/modules/environment/actions/getentities.py View File

@ -86,7 +86,7 @@ def callback_success(module, event_data, dispatchers_steamid, match=None):
"remote": bool(m.group("remote")),
"dead": bool(m.group("dead")),
"health": int(m.group("health")),
"origin": current_map_identifier,
"dataset": current_map_identifier,
"last_seen_gametime": last_recorded_gametime
}
entities_to_update_dict[m.group("id")] = entity_dict


+ 1
- 1
bot/modules/locations/actions/manage_locations.py View File

@ -36,7 +36,7 @@ def main_function(module, event_data, dispatchers_steamid):
location_identifier: {
"name": location_name,
"identifier": location_identifier,
"origin": current_map_identifier,
"dataset": current_map_identifier,
"shape": location_shape,
"coordinates": location_coordinates,
"dimensions": location_dimensions,


+ 1
- 1
bot/modules/locations/templates/locations_widget/control_edit_link.html View File

@ -4,7 +4,7 @@
"edit", ['widget_event', ['locations', ['toggle_locations_view', {
"location_owner": location.owner,
"location_identifier": location.identifier,
"location_origin": location.origin,
"location_origin": location.dataset,
"action": "edit_location_entry"
}]]]
) }}

+ 11
- 11
bot/modules/locations/templates/locations_widget/table_row.html View File

@ -1,20 +1,20 @@
{%- from 'jinja2_macros.html' import construct_toggle_link with context -%}
{%- set location_is_enabled = location.is_enabled|default(false) -%}
{%- set location_entry_selected = false -%}
<tr id="manage_locations_table_row_{{ location.origin }}_{{ location.owner}}_{{ location.identifier }}"{%- if css_class %} class="{{ css_class }}"{%- endif -%}>
<tr id="manage_locations_table_row_{{ location.dataset }}_{{ location.owner}}_{{ location.identifier }}"{%- if css_class %} class="{{ css_class }}"{%- endif -%}>
<td>
<span id="manage_locations_table_row_{{ location.origin }}_{{ location.owner}}_{{ location.identifier }}_control_select_link" class="select_button">{{ control_select_link }}</span>
<span id="manage_locations_table_row_{{ location.dataset }}_{{ location.owner}}_{{ location.identifier }}_control_select_link" class="select_button">{{ control_select_link }}</span>
</td>
<td class="right" id="manage_locations_table_row_{{ location.origin }}_{{ location.owner}}_{{ location.identifier }}_actions">
<span id="manage_locations_table_row_{{ location.origin }}_{{ location.owner}}_{{ location.identifier }}_control_edit_link" class="toggle_button">{{ control_edit_link }}</span>
<span id="manage_locations_table_row_{{ location.origin }}_{{ location.owner}}_{{ location.identifier }}_control_enabled_link" class="toggle_button">{{ control_enabled_link }}</span>
<td class="right" id="manage_locations_table_row_{{ location.dataset }}_{{ location.owner}}_{{ location.identifier }}_actions">
<span id="manage_locations_table_row_{{ location.dataset }}_{{ location.owner}}_{{ location.identifier }}_control_edit_link" class="toggle_button">{{ control_edit_link }}</span>
<span id="manage_locations_table_row_{{ location.dataset }}_{{ location.owner}}_{{ location.identifier }}_control_enabled_link" class="toggle_button">{{ control_enabled_link }}</span>
</td>
<td id="manage_locations_table_row_{{ location.origin }}_{{ location.owner}}_{{ location.identifier }}_name" onclick="$(this).selectText();">{{ location.name }}</td>
<td id="manage_locations_table_row_{{ location.origin }}_{{ location.owner}}_{{ location.identifier }}_id" onclick="$(this).selectText();">{{ location.identifier }}</td>
<td id="manage_locations_table_row_{{ location.origin }}_{{ location.owner}}_{{ location.identifier }}_owner_name" onclick="$(this).selectText();">{{ player_dict.name }}</td>
<td id="manage_locations_table_row_{{ location.origin }}_{{ location.owner}}_{{ location.identifier }}_owner" onclick="$(this).selectText();">{{ location.owner }}</td>
<td class="right" id="manage_locations_table_row_{{ location.origin }}_{{ location.owner}}_{{ location.identifier }}_last_changed">{{ location.last_changed }}</td>
<td class="right" id="manage_locations_table_row_{{ location.origin }}_{{ location.owner}}_{{ location.identifier }}_coordinates" onclick="$(this).selectText();">
<td id="manage_locations_table_row_{{ location.dataset }}_{{ location.owner}}_{{ location.identifier }}_name" onclick="$(this).selectText();">{{ location.name }}</td>
<td id="manage_locations_table_row_{{ location.dataset }}_{{ location.owner}}_{{ location.identifier }}_id" onclick="$(this).selectText();">{{ location.identifier }}</td>
<td id="manage_locations_table_row_{{ location.dataset }}_{{ location.owner}}_{{ location.identifier }}_owner_name" onclick="$(this).selectText();">{{ player_dict.name }}</td>
<td id="manage_locations_table_row_{{ location.dataset }}_{{ location.owner}}_{{ location.identifier }}_owner" onclick="$(this).selectText();">{{ location.owner }}</td>
<td class="right" id="manage_locations_table_row_{{ location.dataset }}_{{ location.owner}}_{{ location.identifier }}_last_changed">{{ location.last_changed }}</td>
<td class="right" id="manage_locations_table_row_{{ location.dataset }}_{{ location.owner}}_{{ location.identifier }}_coordinates" onclick="$(this).selectText();">
{{ ((location | default({})).coordinates | default({}) ).x }}
{{ ((location | default({})).coordinates | default({}) ).y }}
{{ ((location | default({})).coordinates | default({}) ).z }}


+ 3
- 3
bot/modules/locations/widgets/manage_locations_widget.py View File

@ -381,7 +381,7 @@ def table_row(*args, **kwargs):
try:
table_row_id = "manage_locations_table_row_{}_{}_{}".format(
str(updated_values_dict[player_steamid][identifier]["origin"]),
str(updated_values_dict[player_steamid][identifier]["dataset"]),
str(player_steamid),
str(identifier)
)
@ -502,7 +502,7 @@ def update_selection_status(*args, **kwargs):
dom_action_inactive="select_dom_element",
dom_element_id={
"id": "manage_locations_table_row_{}_{}_{}_control_select_link".format(
updated_values_dict["origin"],
updated_values_dict["dataset"],
updated_values_dict["owner"],
updated_values_dict["identifier"]
)
@ -518,7 +518,7 @@ def update_enabled_flag(*args, **kwargs):
control_enable_link = module.dom_management.templates.get_template('control_enabled_link.html')
location_origin = original_values_dict.get("origin", None)
location_origin = original_values_dict.get("dataset", None)
location_owner = original_values_dict.get("owner", None)
location_identifier = original_values_dict.get("identifier", None)


+ 73
- 0
bot/modules/permissions/actions/manage_permissions.py View File

@ -0,0 +1,73 @@
from bot import loaded_modules_dict
from os import path, pardir
module_name = path.basename(path.normpath(path.join(path.abspath(__file__), pardir, pardir)))
action_name = path.basename(path.abspath(__file__))[:-3]
def main_function(module, event_data, dispatchers_steamid):
action = event_data[1].get("action", None)
player_steamid = event_data[1].get("player_steamid", None)
dataset = event_data[1].get("dataset", None)
entered_password = event_data[1].get("entered_password", False)
if module.default_options.get("player_password", None) == entered_password:
is_authenticated = True
else:
is_authenticated = False
if all([
dataset is not None,
player_steamid is not None,
action is not None
]):
if action == "add authentication":
module.dom.data.upsert({
"module_players": {
"elements": {
dataset: {
player_steamid: {
"is_authenticated": is_authenticated
}
}
}
}
})
if is_authenticated is True:
module.callback_success(callback_success, module, event_data, dispatchers_steamid)
else:
module.callback_fail(callback_fail, module, event_data, dispatchers_steamid)
def callback_success(module, event_data, dispatchers_steamid, match=None):
player_steamid = event_data[1].get("player_steamid", None)
if player_steamid is not None:
event_data = ['say_to_player', {
'steamid': player_steamid,
'message': '[66FF66]Thank you for playing along[-][FFFFFF], you may now leave the Crater[-]'
}]
module.trigger_action_hook(module.players, event_data, player_steamid)
def callback_fail(module, event_data, dispatchers_steamid):
player_steamid = event_data[1].get("player_steamid", None)
if player_steamid is not None:
event_data = ['say_to_player', {
'steamid': player_steamid,
'message': '[FF6666]Something went wrong there[-][FFFFFF], wrong password perhaps?[-]'
}]
module.trigger_action_hook(module.players, event_data, player_steamid)
pass
action_meta = {
"description": "tools to help managing permissions",
"main_function": main_function,
"callback_success": callback_success,
"callback_fail": callback_fail,
"requires_telnet_connection": False,
"enabled": True
}
loaded_modules_dict["module_" + module_name].register_action(action_name, action_meta)

+ 12
- 28
bot/modules/permissions/triggers/enter_password.py View File

@ -16,37 +16,21 @@ def main_function(origin_module, module, regex_result):
else:
return
if origin_module.default_options.get("player_password", None) == entered_password:
is_authenticated = True
event_data = ['say_to_player', {
'steamid': steamid,
'message': '[66FF66]Thank you for playing along[-][FFFFFF], you may now leave the Crater[-]'
}]
module.trigger_action_hook(origin_module.players, event_data, steamid)
else:
is_authenticated = False
current_map_identifier = module.dom.data.get("module_environment", {}).get("current_game_name", None)
module.dom.data.upsert({
"module_players": {
"elements": {
current_map_identifier: {
steamid: {
"is_authenticated": is_authenticated
}
}
}
}
})
event_data = ['manage_permissions', {
'dataset': module.dom.data.get("module_environment", {}).get("current_game_name", None),
'player_steamid': steamid,
'entered_password': entered_password,
'action': 'add authentication'
}]
module.trigger_action_hook(origin_module, event_data, steamid)
trigger_meta = {
"description": "sends player to the location of their choosing",
"description": "validates a players password",
"main_function": main_function,
"triggers": [
{
"identifier": "add location (Alloc)",
"identifier": "password (Alloc)",
"regex": (
r"(?P<datetime>.+?)\s(?P<stardate>[-+]?\d*\.\d+|\d+)\sINF\s"
r"Chat\s\(from \'(?P<player_steamid>.*)\',\sentity\sid\s\'(?P<entity_id>.*)\',\s"
@ -56,11 +40,11 @@ trigger_meta = {
"callback": main_function
},
{
"identifier": "add location (BCM)",
"identifier": "password (BCM)",
"regex": (
r"(?P<datetime>.+?)\s(?P<stardate>[-+]?\d*\.\d+|\d+)\sINF\s"
r"Chat\shandled\sby\smod\s\'(?P<used_mod>.*?)\':\sChat\s\(from\s\'(?P<player_steamid>.*?)\',\sentity\sid\s\'(?P<entity_id>.*?)\',\s"
r"Chat\shandled\sby\smod\s\'(?P<used_mod>.*?)\':\s"
r"Chat\s\(from\s\'(?P<player_steamid>.*?)\',\sentity\sid\s\'(?P<entity_id>.*?)\',\s"
r"to\s\'(?P<target_room>.*)\'\)\:\s"
r"\'(?P<player_name>.*)\'\:\s(?P<command>\/password.*)"
),


+ 1
- 1
bot/modules/players/actions/getplayers.py View File

@ -91,7 +91,7 @@ def callback_success(module, event_data, dispatchers_steamid, match=None):
"is_initialized": True,
"last_updated_servertime": telnet_datetime,
"last_seen_gametime": last_seen_gametime_string,
"origin": current_map_identifier,
"dataset": current_map_identifier,
"owner": m.group("steamid")
}


+ 14
- 14
bot/modules/players/templates/player_table_widget/table_row.html View File

@ -1,31 +1,31 @@
{%- from 'jinja2_macros.html' import construct_toggle_link with context -%}
<tr id="player_table_row_{{ player.origin }}_{{ player.steamid }}"{%- if css_class %} class="{{ css_class }}"{%- endif -%}>
<tr id="player_table_row_{{ player.dataset }}_{{ player.steamid }}"{%- if css_class %} class="{{ css_class }}"{%- endif -%}>
<td>
<span id="player_table_row_{{ player.origin }}_{{ player.steamid }}_control_select_link" class="select_button">{{ control_select_link }}</span>
<span id="player_table_row_{{ player.dataset }}_{{ player.steamid }}_control_select_link" class="select_button">{{ control_select_link }}</span>
</td>
<td class="nobr" id="player_table_row_{{ player.origin }}_{{ player.steamid }}_actions">
<span id="player_table_row_{{ player.origin }}_{{ player.steamid }}_control_info_link" class="info">{{ control_info_link }}</span>
<td class="nobr" id="player_table_row_{{ player.dataset }}_{{ player.steamid }}_actions">
<span id="player_table_row_{{ player.dataset }}_{{ player.steamid }}_control_info_link" class="info">{{ control_info_link }}</span>
</td>
<td id="player_table_row_{{ player.origin }}_{{ player.steamid }}_name" onclick="$(this).selectText();">{{ player.name }}</td>
<td id="player_table_row_{{ player.origin }}_{{ player.steamid }}_id" onclick="$(this).selectText();">{{ player.id }}</td>
<td id="player_table_row_{{ player.origin }}_{{ player.steamid }}_steamid" onclick="$(this).selectText();">{{ player.steamid }}</td>
<td id="player_table_row_{{ player.dataset }}_{{ player.steamid }}_name" onclick="$(this).selectText();">{{ player.name }}</td>
<td id="player_table_row_{{ player.dataset }}_{{ player.steamid }}_id" onclick="$(this).selectText();">{{ player.id }}</td>
<td id="player_table_row_{{ player.dataset }}_{{ player.steamid }}_steamid" onclick="$(this).selectText();">{{ player.steamid }}</td>
<td class="position right" onclick="$(this).selectText();">
<span id="player_table_row_{{ player.origin }}_{{ player.steamid }}_pos_x">
<span id="player_table_row_{{ player.dataset }}_{{ player.steamid }}_pos_x">
{{ ((player | default({})).pos | default({}) ).x | default('0') }}
</span>
<span id="player_table_row_{{ player.origin }}_{{ player.steamid }}_pos_y">
<span id="player_table_row_{{ player.dataset }}_{{ player.steamid }}_pos_y">
{{ ((player | default({})).pos | default({}) ).y | default('0') }}
</span>
<span id="player_table_row_{{ player.origin }}_{{ player.steamid }}_pos_z">
<span id="player_table_row_{{ player.dataset }}_{{ player.steamid }}_pos_z">
{{ ((player | default({})).pos | default({}) ).z | default('0') }}
</span>
</td>
<td class="center" id="player_table_row_{{ player.origin }}_{{ player.steamid }}_level">{{ player.level }}</td>
<td class="center" id="player_table_row_{{ player.origin }}_{{ player.steamid }}_ping">{{ player.zombies }}</td>
<td class="nobr right" id="player_table_row_{{ player.origin }}_{{ player.steamid }}_last_updated_servertime">
<td class="center" id="player_table_row_{{ player.dataset }}_{{ player.steamid }}_level">{{ player.level }}</td>
<td class="center" id="player_table_row_{{ player.dataset }}_{{ player.steamid }}_ping">{{ player.zombies }}</td>
<td class="nobr right" id="player_table_row_{{ player.dataset }}_{{ player.steamid }}_last_updated_servertime">
{{ player.last_updated_servertime }}
</td>
<td class="nobr right" id="player_table_row_{{ player.origin }}_{{ player.steamid }}_last_seen_gametime">
<td class="nobr right" id="player_table_row_{{ player.dataset }}_{{ player.steamid }}_last_seen_gametime">
{{ player.last_seen_gametime }}
</td>
</tr>

+ 27
- 27
bot/modules/players/templates/player_table_widget/view_info.html View File

@ -13,125 +13,125 @@
<th colspan="3">player-info ({{ player.steamid }})</th>
</tr>
</thead>
<tbody id="player_table_row_{{ player.origin }}_{{ player.steamid }}">
<tbody id="player_table_row_{{ player.dataset }}_{{ player.steamid }}">
<tr>
<td>Name</td>
<td id="player_table_row_{{ player.origin }}_{{ player.steamid }}_name" onclick="$(this).selectText();">{{ player.name }}</td>
<td id="player_table_row_{{ player.dataset }}_{{ player.steamid }}_name" onclick="$(this).selectText();">{{ player.name }}</td>
<td>the players steam-name</td>
</tr>
<tr>
<td>ID</td>
<td id="player_table_row_{{ player.origin }}_{{ player.steamid }}_id" onclick="$(this).selectText();">{{ player.id }}</td>
<td id="player_table_row_{{ player.dataset }}_{{ player.steamid }}_id" onclick="$(this).selectText();">{{ player.id }}</td>
<td></td>
</tr>
<tr>
<td>SteamID</td>
<td id="player_table_row_{{ player.origin }}_{{ player.steamid }}_steamid" onclick="$(this).selectText();">{{ player.steamid }}</td>
<td id="player_table_row_{{ player.dataset }}_{{ player.steamid }}_steamid" onclick="$(this).selectText();">{{ player.steamid }}</td>
<td></td>
</tr>
<tr>
<td>Health</td>
<td id="player_table_row_{{ player.origin }}_{{ player.steamid }}_health">{{ player.health }}</td>
<td id="player_table_row_{{ player.dataset }}_{{ player.steamid }}_health">{{ player.health }}</td>
<td></td>
</tr>
<tr>
<td>Position</td>
<td class="position" onclick="$(this).selectText();">
<span id="player_table_row_{{ player.origin }}_{{ player.steamid }}_pos_x">{{ ((player | default({})).pos | default({}) ).x | default('0') }}</span>
<span id="player_table_row_{{ player.origin }}_{{ player.steamid }}_pos_y">{{ ((player | default({})).pos | default({}) ).y | default('0') }}</span>
<span id="player_table_row_{{ player.origin }}_{{ player.steamid }}_pos_z">{{ ((player | default({})).pos | default({}) ).z | default('0') }}</span>
<span id="player_table_row_{{ player.dataset }}_{{ player.steamid }}_pos_x">{{ ((player | default({})).pos | default({}) ).x | default('0') }}</span>
<span id="player_table_row_{{ player.dataset }}_{{ player.steamid }}_pos_y">{{ ((player | default({})).pos | default({}) ).y | default('0') }}</span>
<span id="player_table_row_{{ player.dataset }}_{{ player.steamid }}_pos_z">{{ ((player | default({})).pos | default({}) ).z | default('0') }}</span>
</td>
<td></td>
</tr>
<tr>
<td>Rotation</td>
<td class="position">
<span id="player_table_row_{{ player.origin }}_{{ player.steamid }}_rot_x">{{ ((player | default({})).rot | default({}) ).x | default('0') }}</span>
<span id="player_table_row_{{ player.origin }}_{{ player.steamid }}_rot_y">{{ ((player | default({})).rot | default({}) ).y | default('0') }}</span>
<span id="player_table_row_{{ player.origin }}_{{ player.steamid }}_rot_z">{{ ((player | default({})).rot | default({}) ).z | default('0') }}</span>
<span id="player_table_row_{{ player.dataset }}_{{ player.steamid }}_rot_x">{{ ((player | default({})).rot | default({}) ).x | default('0') }}</span>
<span id="player_table_row_{{ player.dataset }}_{{ player.steamid }}_rot_y">{{ ((player | default({})).rot | default({}) ).y | default('0') }}</span>
<span id="player_table_row_{{ player.dataset }}_{{ player.steamid }}_rot_z">{{ ((player | default({})).rot | default({}) ).z | default('0') }}</span>
</td>
<td></td>
</tr>
<tr>
<td>Level</td>
<td id="player_table_row_{{ player.origin }}_{{ player.steamid }}_level">{{ player.level }}</td>
<td id="player_table_row_{{ player.dataset }}_{{ player.steamid }}_level">{{ player.level }}</td>
<td></td>
</tr>
<tr>
<td>IP-Address</td>
<td onclick="$(this).selectText();" id="player_table_row_{{ player.origin }}_{{ player.steamid }}_ip">{{ player.ip }}</td>
<td onclick="$(this).selectText();" id="player_table_row_{{ player.dataset }}_{{ player.steamid }}_ip">{{ player.ip }}</td>
<td></td>
</tr>
<tr>
<td>Ping</td>
<td id="player_table_row_{{ player.origin }}_{{ player.steamid }}_ping">{{ player.ping }}</td>
<td id="player_table_row_{{ player.dataset }}_{{ player.steamid }}_ping">{{ player.ping }}</td>
<td></td>
</tr>
<tr>
<td>Deaths</td>
<td id="player_table_row_{{ player.origin }}_{{ player.steamid }}_deaths">{{ player.deaths }}</td>
<td id="player_table_row_{{ player.dataset }}_{{ player.steamid }}_deaths">{{ player.deaths }}</td>
<td></td>
</tr>
<tr>
<td>Zombie-Kills</td>
<td id="player_table_row_{{ player.origin }}_{{ player.steamid }}_zombies">{{ player.zombies }}</td>
<td id="player_table_row_{{ player.dataset }}_{{ player.steamid }}_zombies">{{ player.zombies }}</td>
<td></td>
</tr>
<tr>
<td>Player-Kills</td>
<td id="player_table_row_{{ player.origin }}_{{ player.steamid }}_players">{{ player.players }}</td>
<td id="player_table_row_{{ player.dataset }}_{{ player.steamid }}_players">{{ player.players }}</td>
<td></td>
</tr>
<tr>
<td>Score</td>
<td id="player_table_row_{{ player.origin }}_{{ player.steamid }}_score">{{ player.score }}</td>
<td id="player_table_row_{{ player.dataset }}_{{ player.steamid }}_score">{{ player.score }}</td>
<td></td>
</tr>
<tr>
<td>Last seen</td>
<td class="nobr" id="player_table_row_{{ player.origin }}_{{ player.steamid }}_last_updated_servertime">
<td class="nobr" id="player_table_row_{{ player.dataset }}_{{ player.steamid }}_last_updated_servertime">
{{ player.last_updated_servertime }}
</td>
<td></td>
</tr>
<tr>
<td>Last seen (gametime)</td>
<td class="nobr" id="player_table_row_{{ player.origin }}_{{ player.steamid }}_last_seen_gametime">
<td class="nobr" id="player_table_row_{{ player.dataset }}_{{ player.steamid }}_last_seen_gametime">
{{ player.last_seen_gametime }}
</td>
<td></td>
</tr>
<tr>
<td>origin</td>
<td class="nobr" id="player_table_row_{{ player.origin }}_{{ player.steamid }}_origin">
{{ player.origin }}
<td>dataset</td>
<td class="nobr" id="player_table_row_{{ player.dataset }}_{{ player.steamid }}_origin">
{{ player.dataset }}
</td>
<td>the server-instance this entry is from</td>
</tr>
<tr>
<td>is_authenticated</td>
<td class="nobr" id="player_table_row_{{ player.origin }}_{{ player.steamid }}_is_authenticated">
<td class="nobr" id="player_table_row_{{ player.dataset }}_{{ player.steamid }}_is_authenticated">
{{ player.is_authenticated }}
</td>
<td>has authenticated with the bot</td>
</tr>
<tr>
<td>in_limbo</td>
<td class="nobr" id="player_table_row_{{ player.origin }}_{{ player.steamid }}_in_limbo">
<td class="nobr" id="player_table_row_{{ player.dataset }}_{{ player.steamid }}_in_limbo">
{{ player.in_limbo }}
</td>
<td>hasn't got any health, is dead(ish)!</td>
</tr>
<tr>
<td>is_initialized</td>
<td class="nobr" id="player_table_row_{{ player.origin }}_{{ player.steamid }}_is_initialized">
<td class="nobr" id="player_table_row_{{ player.dataset }}_{{ player.steamid }}_is_initialized">
{{ player.is_initialized }}
</td>
<td>player is online, has health, is ready to go!</td>
</tr>
<tr>
<td>is_online</td>
<td class="nobr" id="player_table_row_{{ player.origin }}_{{ player.steamid }}_is_online">
<td class="nobr" id="player_table_row_{{ player.dataset }}_{{ player.steamid }}_is_online">
{{ player.is_online }}
</td>
<td>we can see you!</td>


+ 1
- 1
bot/modules/players/triggers/entered_telnet.py View File

@ -29,7 +29,7 @@ def main_function(origin_module, module, regex_result):
"y": 0,
"z": 0,
},
"origin": current_map_identifier,
"dataset": current_map_identifier,
"owner": player_steamid
}
player_dict["is_online"] = True


+ 3
- 3
bot/modules/players/widgets/manage_players_widget.py View File

@ -298,7 +298,7 @@ def table_rows(*args, ** kwargs):
for player_steamid, player_dict in updated_values_dict.items():
try:
table_row_id = "player_table_row_{}_{}".format(
str(player_dict["origin"]),
str(player_dict["dataset"]),
str(player_steamid)
)
except KeyError:
@ -394,7 +394,7 @@ def update_widget(*args, **kwargs):
.get("current_view", None)
)
table_row_id = "player_table_row_{}_{}".format(
str(player_dict.get("origin", None)),
str(player_dict.get("dataset", None)),
str(player_dict.get("steamid", None))
)
@ -448,7 +448,7 @@ def update_selection_status(*args, **kwargs):
dom_action_inactive="select_dom_element",
dom_element_id={
"id": "player_table_row_{}_{}_control_select_link".format(
updated_values_dict["origin"],
updated_values_dict["dataset"],
updated_values_dict["owner"]
)
}


Loading…
Cancel
Save