Skip to content

Commit

Permalink
admin: Обновление PP, время, фикс related by (ss220-space#6473)
Browse files Browse the repository at this point in the history
* admin: Обновление PP, время, фикс related by

* bug
  • Loading branch information
BeebBeebBoob authored Jan 28, 2025
1 parent 08d22e7 commit 58952f3
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 14 deletions.
12 changes: 7 additions & 5 deletions code/modules/admin/player_options_panel.dm
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@
/datum/vuap_personal/ui_data(mob/user)
var/list/player_data = list(
"characterName" = "No Character",
"ckey" = selected_ckey || "Unknown",
"ckey" = selected_ckey || "NO CKEY",
"ipAddress" = "0.0.0.0",
"CID" = "NO_CID",
"CID" = "NO CID",
"discord" = "No Discord",
"gameState" = "Unknown", // cliented or clientless
"playtime" = "No client",
"rank" = "Player",
"byondVersion" = "0.0.0",
"mobType" = "null",
Expand All @@ -55,7 +55,7 @@
if(selected_ckey[1] == "@" || selected_ckey == "" || selected_ckey == null)
var/mob/player = selected_mob
player_data["characterName"] = player.name || "No Character"
player_data["gameState"] = "Inactive"
player_data["playtime"] = "No client"
player_data["mobType"] = "[initial(player.type)]" || "null"
else
var/mob/player = get_mob_by_ckey(selected_ckey)
Expand All @@ -65,7 +65,7 @@
player_data["ipAddress"] = client_info.address || "0.0.0.0"
player_data["CID"] = client_info.computer_id || "NO_CID"
player_data["discord"] = client_info.prefs.discord_id || "No Discord"
player_data["gameState"] = "Active"
player_data["playtime"] = client_info.get_exp_type(EXP_TYPE_CREW) || "none"
player_data["rank"] = client_info.holder?.rank || "Player"
player_data["byondVersion"] = "[client_info.byond_version || 0].[client_info.byond_build || 0]"
player_data["mobType"] = "[initial(player.type)]" || "null"
Expand Down Expand Up @@ -113,6 +113,8 @@
if("old_pp")
usr.client.holder.show_old_player_panel(M)
return
if("playtime")
usr.client.holder.Topic(null, list("getplaytimewindow" = M.UID()))
if("relatedbycid")
usr.client.holder.Topic(null, list("showrelatedacc" = "cid", "client" = M.client.UID()))
if("relatedbyip")
Expand Down
5 changes: 2 additions & 3 deletions code/modules/admin/topic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3874,10 +3874,9 @@
var/client/C = locate(href_list["client"]) in GLOB.clients
var/thing_to_check
if(href_list["showrelatedacc"] == "cid")
thing_to_check = C.related_accounts_cid
thing_to_check = jointext(C.related_accounts_cid, "<br>")
else
thing_to_check = C.related_accounts_ip
thing_to_check = splittext(thing_to_check, ", ")
thing_to_check = jointext(C.related_accounts_ip, "<br>")


var/list/dat = list("Related accounts by [uppertext(href_list["showrelatedacc"])]:")
Expand Down
15 changes: 10 additions & 5 deletions tgui/packages/tgui/interfaces/PlayerPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ interface playerData {
ipAddress: string;
CID: string;
discord: string;
gameState: string;
playtime: string;
rank: string;
byondVersion: string;
mobType: string;
Expand Down Expand Up @@ -129,8 +129,13 @@ const PlayerInformation = (props, context) => {
<Table.Row>
<Table.Cell bold>Account Registered:</Table.Cell>
<Table.Cell>{data.accountRegistered}</Table.Cell>
<Table.Cell bold>Byond Version:</Table.Cell>
<Table.Cell>{data.byondVersion}</Table.Cell>
<Table.Cell bold>Playtime as Crew:</Table.Cell>
<Table.Cell>
<Button
content={data.playtime}
onClick={() => handleAction('playtime')}
/>
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell bold>CID:</Table.Cell>
Expand All @@ -151,8 +156,8 @@ const PlayerInformation = (props, context) => {
<Table.Row>
<Table.Cell bold>Mob Type:</Table.Cell>
<Table.Cell>{data.mobType}</Table.Cell>
<Table.Cell bold>Game State:</Table.Cell>
<Table.Cell>{data.gameState}</Table.Cell>
<Table.Cell bold>Byond Version:</Table.Cell>
<Table.Cell>{data.byondVersion}</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell bold>Related By CID:</Table.Cell>
Expand Down
2 changes: 1 addition & 1 deletion tgui/public/tgui.bundle.js

Large diffs are not rendered by default.

0 comments on commit 58952f3

Please sign in to comment.