-
Notifications
You must be signed in to change notification settings - Fork 15
Enhancement: Adding last sign-in date to the player profile for quick reference. #384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
esdraelon
left a comment
There was a problem hiding this 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.
system/lib/ork3/class.Report.php
Outdated
|
|
||
| // 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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 | |||
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
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.