Skip to content

Conversation

@baltinerdist
Copy link

@baltinerdist baltinerdist commented Feb 8, 2026

Currently, a user must scroll down to the attendance section to identify the last time a given player signed in. This adds last sign-in date as a common function and displays it in the Player Details box.

This also adds last sign-in date as a sorting mechanism for the Player Heraldry report.

Copy link
Member

@esdraelon esdraelon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's collapse this logic back without the branch and simply output the lastsignin if it exists or null otherwise.

Comment on lines 22 to 59

// Special handling for Mundane (Player) type with last attendance sorting
if ($request['Type'] == 'Mundane') {
$heraldry_clause = '';
if ($request['WithMissingHeraldries'] == 'No')
$heraldry_clause = ' and m.has_heraldry = 1';
if ($request['WithMissingHeraldries'] == 'Only')
$heraldry_clause = ' and m.has_heraldry = 0';

$kingdom_clause = '';
if (valid_id($request['KingdomId'])) {
$kingdom_clause = " and m.kingdom_id = " . $request['KingdomId'];
}

$park_clause = '';
if (valid_id($request['ParkId'])) {
$park_clause = " and m.park_id = " . $request['ParkId'];
}

$last_attendance = "(SELECT max(att.date) FROM " . DB_PREFIX . "attendance att WHERE att.mundane_id = m.mundane_id)";

$sql = "SELECT m.mundane_id, m.persona, m.has_heraldry, $last_attendance as last_signin
FROM " . DB_PREFIX . "mundane m
WHERE 1 = 1
$heraldry_clause
$kingdom_clause
$park_clause
ORDER BY last_signin DESC, m.persona ASC";

$r = $this->db->query($sql);
if ($r !== false && $r->size() > 0) {
while ($r->next()) {
$response[] = array(
'HasHeraldry' => $r->has_heraldry,
'HeraldryUrl' => Ork3::$Lib->heraldry->GetHeraldryUrl(array('Type' => 'Player', 'Id' => $r->mundane_id)),
'Name' => $r->persona,
'Url' => UIR . 'Player/index/' . $r->mundane_id,
'LastSignin' => $r->last_signin
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need a branch to handle this use-case. Since the output is JSON and consumers should be tolerant of missing or null fields, we can simply output LastSignin with every output and let the consumers handle the missing case.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@esdraelon Updated with a new commit to do that. Let me know if that resolves your concern.

@@ -0,0 +1,129 @@
# ORK3 Copilot Instructions
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this file and folder need to be at the root level? Would it be possible to put them into an agent-instructions/ folder?

For instance, I'm using chat gpt and gemini. If we have several agent instructions at the root level, it will create additional clutter in an already cluttered space.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would imagine this could go into an agent instructions folder. I'll move to do that.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants