ID:2401338
 
Code:
proc/view_rep()

var/LOG = {"<STYLE TYPE="text/css"><!--
BODY {margin: 0; padding: 8; background-color: #0c1e3a}
.vtext {font-size: 12px; font-family: Tahoma, Geneva, sans-serif ; color: white }
.vtitle {font-size: 12px; font-family: Tahoma, Geneva, sans-serif; font-weight: bold ; color: white }
a { color: #FFFFFF; }
--></STYLE><head><title>Player Reports</title></head>

<table border="1" bordercolor="#75787a" style="background-color:#515354" width="100%" cellpadding="3" cellspacing="3">

<tr>
<td width="10%" bordercolor="#3a565b" bgcolor="#2a61ba"><span class="vtitle">User</span></td>
<td width="90%" bordercolor="#3a565b" bgcolor="#2a61ba"><span class="vtitle">Report</span></td>
</tr>"}


var/ustats = world.GetScores(5000, "Report")

var/list/params = params2list(ustats)

var/i = 0
while(i < params.len)
i++

var/username = params[i]

LOG += "<tr>"
LOG += {"<td width="10%" bgcolor="#547d84"><a href=byond://?src=\ref[usr];action=rep_edit;uname=[username]>[username]</a></span></td>"}
LOG += {"<td width="90%" bgcolor="#547d84"><span class="vtext">[params[username]]</span></td>"}
LOG += "</tr>"

LOG += "</table>"

usr << browse(LOG,"window=LOG;size=705x675;border=0;can_close=1;can_resize=1;can_minimize=1;titlebar=1")

return


Problem description:

So im using a hidden field on my hub to let players post a direct report to myself. I have a forum but my players tend to be jerks that like to complain about things in-game but are too lazy to log in on the forum to actually make a note of it.

They use their command, type out their report. It gets saved to their "Report" score on the hub. That way if the server crashes, if they change servers, whatever, I can see see the reports until I clear them.

The above code is for my end to view said reports. I'm not happy with the...
var/ustats = world.GetScores(5000, "Report")

Line but it's the only way I could find to get all values of a single score for every player in the game. I made a developer forum post about it but nobody responded.

What I'm suppose to get is a list of all of the reports in a table with the user's name on the left, and their report on the right, with the user's name being a clickable link that lets me manipulate their report via a different proc.

However, I've noticed that when I only have a single report, I'm not getting any results. If I have 2 or more reports, the list works fine.

I'm currently just using a stopgap of having a report in myself and not erasing it so if a player does submit one, there's always at least 2 reports in place.

Anyone know what's going wrong here?
It's entirely possible this a hub or site bug. Scores aren't really meant to be used for this purpose, and you could be running into some behavior that only happens because this situation was never anticipated.