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

Issues with "servers" page/tab in latest SourceQuery update #368

Closed
pyro1g opened this Issue Nov 11, 2017 · 1 comment

Comments

Projects
None yet
2 participants
@pyro1g
Copy link

pyro1g commented Nov 11, 2017

First thing when you load the page of the servers tab and you click the server to view it's status, the time of everyone is "broken" (it's just formatted by seconds and it looks really dumb that way). Normally, it'll look something like this in this format: x hr, x min, x sec. After this update: it's formatted by how many seconds the client has been on for, which just looks really dumb. Also, when you right click on a person's name, it doesn't target the specific person that you clicked on, it targets the very last person on the list (unknown whether this is caused by the SourceQuery update).

Also, when you click the server refresh button, the dialog "Refreshing the ServerData" never disappears. It used to disappear on it's own. The player list also seems to be categorized through most play time rather than the score, as the old query method used to categorize people like that. Just a few nit-picky issues, nothing major.

Expected Behavior

The layout for the servers page should correctly display the time as formatted above (x hr, x min, x sec). The dropdown list for a server listed on the servers page should also be targeting the correct people you right click on. When you click the "Refresh" button, the dialog should pop-up and then promptly disappear, and the players should be categorized from the highest to the lowest score.

Current Behavior

The layout for the servers page incorrectly displays the total time that each player has been on for (ex: a bunch numbers, such as 12220). If you also want to kick a person from a server or view their profile from the dropdown list by right clicking their names, it targets the very last person on the list by default despite you clicking on a completely different person. The "Refreshing the ServerDialog" button never disappears after you click the "Refresh" button, and the players are categorized from longest time on the server to shortest time on the server.

Steps to Reproduce (for bugs)

For time format bug:

  1. Navigate to the servers page (example.com/sb/index.php?p=servers)
  2. Click on the server and look at the total time a person's been on

For incorrect targetting on the server list:

  1. Navigate to the servers page (example.com/sb/index.php?p=servers)
  2. Click on a server
  3. Right click on any person's name except the bottom one
  4. Click any of the options (ex. view their profile)
  5. The person you choose will always be the very last person

For the refresh server dialog never disappearing:

  1. Navigate to the servers page (example.com/sb/index.php?p=servers)
  2. Click on a server
  3. Click "Refresh", and the dialog should pop up and not disappear

Solution

For time bug (it puts it in a sort of readable format):
includes/sb-callback.php: Line 1347
Replace with var txt = document.createTextNode("'.$player["TimeF"].'");

OR (this puts the format back to it's original working state, and in my opinion, it looks way better this way):
includes/SourceQuery/SourceQuery.php: Line 395
Replace with $Player[ 'Time' ] = SecondsToString( ( int )$Buffer->GetFloat( ), true );
Comment out line 396:
// $Player[ 'TimeF' ] = GMDate( ( $Player[ 'Time' ] > 3600 ? "H:i:s" : "i:s" ), $Player[ 'Time' ] );

Categorize players with most score rather than play time:
includes/SourceQuery/SourceQuery.php: Line 401
Paste this above this line: return $Players; (which should be line 401 anyway)
array_qsort( $Players, 'Frags', SORT_DESC );

I don't have a fix for the improper targeting, if I did then I would've pushed an edit already and deleted this since I fixed 3/4th's of the problem already.

Your Environment

  • Version used: commit 577 (technically 579) (I also updated my theme for this version, I only modified the CSS for the theme)
  • PHP version: PHP 5.6.32-1
  • MySQL version: mysql 14.14 Distrib 5.7.20
  • Operating System and version: Ubuntu 16.04 (64 bit)

Screenshots

image

ezgif-1-d0963a5f25

Here's a gyazo in case you can't see the gif: https://i.gyazo.com/aaaa93ba2647bbeb9bca08005ae3b8da.mp4 / https://gyazo.com/aaaa93ba2647bbeb9bca08005ae3b8da

@Alicebnd

This comment has been minimized.

Copy link

Alicebnd commented Dec 5, 2017

i have same bug.

@Groruk Groruk referenced this issue Jan 19, 2018

Merged

1.6.3-PRE #387

@Groruk Groruk closed this in #387 Jan 19, 2018

sneak-it pushed a commit to sneak-it/sourcebans-pp that referenced this issue Sep 24, 2018

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