Merge remote-tracking branch 'refs/remotes/origin/master' into zones

This commit is contained in:
shavitush 2016-07-16 08:41:37 +03:00
commit f02fa98646
2 changed files with 46 additions and 69 deletions

View File

@ -98,6 +98,11 @@ public void OnPluginStart()
RegConsoleCmd("sm_ranks", Command_ChatRanks, "Shows a list of all the possible chat ranks. Alias for sm_chatranks."); RegConsoleCmd("sm_ranks", Command_ChatRanks, "Shows a list of all the possible chat ranks. Alias for sm_chatranks.");
} }
public void OnPluginEnd()
{
ResetCache();
}
public void OnMapStart() public void OnMapStart()
{ {
LoadConfig(); LoadConfig();
@ -195,6 +200,19 @@ public void LoadChatCache(int client)
} }
} }
public void ResetCache()
{
for(int i = 0; i < 64; i++)
{
if(gD_ChatRanks[i].IsValid)
{
gD_ChatRanks[i].Dispose();
}
}
gI_TotalChatRanks = 0;
}
public void LoadConfig() public void LoadConfig()
{ {
delete gSM_Custom_Prefix; delete gSM_Custom_Prefix;
@ -205,15 +223,7 @@ public void LoadConfig()
gSM_Custom_Name = new StringMap(); gSM_Custom_Name = new StringMap();
gSM_Custom_Message = new StringMap(); gSM_Custom_Message = new StringMap();
for(int i = 0; i < 64; i++) ResetCache();
{
if(gD_ChatRanks[i].IsValid)
{
gD_ChatRanks[i].Dispose();
}
}
gI_TotalChatRanks = 0;
KeyValues kvConfig = new KeyValues("Chat"); KeyValues kvConfig = new KeyValues("Chat");

View File

@ -92,12 +92,9 @@ $rr = isset($_REQUEST['rr']);
<select name="style" class="form-control"> <select name="style" class="form-control">
<?php <?php
for ($i = 0; $i < count($styles); $i++) { for ($i = 0; $i < count($styles); $i++) {
?> <option value="<?php echo $i; ?> <option value="<?php echo $i; ?>" <?php if ($i == DEFAULT_STYLE || $style == $i) {
?>" <?php if ($i == DEFAULT_STYLE || $style == $i) {
echo 'selected="selected"'; echo 'selected="selected"';
} } ?>><?php echo $styles[$i]; ?></option> <?php
?>><?php echo $styles[$i];
?></option> <?php
} }
?> ?>
@ -113,12 +110,9 @@ $rr = isset($_REQUEST['rr']);
while ($row = $result->fetch_assoc()) { while ($row = $result->fetch_assoc()) {
// $row["map"] - including workshop // $row["map"] - including workshop
// removeworkshop($row["map"]) - no workshop // removeworkshop($row["map"]) - no workshop
?> <option value="<?php echo $row['map']; ?> <option value="<?php echo $row['map']; ?>" <?php if ($row['map'] == $map) {
?>" <?php if ($row['map'] == $map) {
echo 'selected="selected"'; echo 'selected="selected"';
} } ?>><?php echo removeworkshop($row['map']); ?></option> <?php
?>><?php echo removeworkshop($row['map']);
?></option> <?php
} }
} }
@ -143,15 +137,13 @@ $rr = isset($_REQUEST['rr']);
<?php <?php
if (!isset($_REQUEST['map']) && !$rr) { if (!isset($_REQUEST['map']) && !$rr) {
?> ?>
<h1><?php echo HEADER_TITLE; <h1><?php echo HEADER_TITLE; ?></h1>
?></h1>
<p> <p>
To view the records of any map, please select it using the menu at the top right of this page.<br/> To view the records of any map, please select it using the menu at the top right of this page.<br/>
Don't forget to select a style if you wish, and then tap 'Submit'!</p> Don't forget to select a style if you wish, and then tap 'Submit'!</p>
<p> <p>
Alternatively, you may click <a href="index.php?rr=1">Recent Records</a> to view the latest <?php echo RECORD_LIMIT_LATEST; Alternatively, you may click <a href="index.php?rr=1">Recent Records</a> to view the latest <?php echo RECORD_LIMIT_LATEST; ?> records.
?> records.
</p> </p>
<?php <?php
@ -196,34 +188,24 @@ $rr = isset($_REQUEST['rr']);
<?php <?php
$first = false; $first = false;
} } ?>
?>
<tr> <tr>
<td><?php echo removeworkshop($map); <td><?php echo removeworkshop($map); ?></td>
?></td> <td><?php echo $name; ?></td>
<td><?php echo $name; <td><?php echo $styles[$style]; ?></td>
?></td> <td><?php echo formattoseconds($time); ?></td>
<td><?php echo $styles[$style]; <td><?php echo number_format($jumps); ?></td>
?></td>
<td><?php echo formattoseconds($time);
?></td>
<td><?php echo number_format($jumps);
?></td>
<td><?php if (USES_RANKINGS == '1') { <td><?php if (USES_RANKINGS == '1') {
echo number_format($pp, 2); echo number_format($pp, 2);
} else { } else {
echo '---'; echo '---';
} } ?></td>
?></td>
<td><?php <td><?php
$steamid = SteamID::Parse($auth, SteamID::FORMAT_STEAMID3); $steamid = SteamID::Parse($auth, SteamID::FORMAT_STEAMID3);
echo '<a href="https://steamcommunity.com/profiles/'.$steamid->Format(SteamID::FORMAT_STEAMID64).'/" target="_blank">'.$auth.'</a>'; echo '<a href="https://steamcommunity.com/profiles/'.$steamid->Format(SteamID::FORMAT_STEAMID64).'/" target="_blank">'.$auth.'</a>'; ?></td>
?></td>
<td><?php echo $date; <td><?php echo $date; ?></td>
?></td>
</tr> </tr>
<?php <?php
@ -254,10 +236,7 @@ $rr = isset($_REQUEST['rr']);
while ($row = $stmt->fetch()) { while ($row = $stmt->fetch()) {
if ($first) { if ($first) {
?> ?>
<p><span class="mark"><?php echo $styles[$style]; <p><span class="mark"><?php echo $styles[$style]; ?></span> Records (<?php echo number_format($rows); ?>) for <i><?php echo removeworkshop($map); ?></i>:</p>
?></span> Records (<?php echo number_format($rows);
?>) for <i><?php echo removeworkshop($map);
?></i>:</p>
<table class="table table-striped table-hover"> <table class="table table-striped table-hover">
<thead id="ignore"><th>Rank</th> <thead id="ignore"><th>Rank</th>
@ -272,8 +251,7 @@ $rr = isset($_REQUEST['rr']);
<?php <?php
$first = false; $first = false;
} } ?>
?>
<?php if ($rank == 1) { <?php if ($rank == 1) {
?> ?>
@ -285,8 +263,7 @@ $rr = isset($_REQUEST['rr']);
<tr class="default"> <tr class="default">
<?php <?php
} } ?>
?>
<td> <td>
<?php switch ($rank) { <?php switch ($rank) {
case 1: case 1:
@ -312,40 +289,30 @@ $rr = isset($_REQUEST['rr']);
echo '#'.$rank; echo '#'.$rank;
break; break;
} }
} } ?></td>
?></td> <td><?php echo $id; ?></td>
<td><?php echo $id;
?></td>
<td><?php <td><?php
$steamid = SteamID::Parse($auth, SteamID::FORMAT_STEAMID3); $steamid = SteamID::Parse($auth, SteamID::FORMAT_STEAMID3);
echo '<a href="http://steamcommunity.com/profiles/'.$steamid->Format(SteamID::FORMAT_STEAMID64).'/" target="_blank">'.$auth.'</a>'; echo '<a href="http://steamcommunity.com/profiles/'.$steamid->Format(SteamID::FORMAT_STEAMID64).'/" target="_blank">'.$auth.'</a>'; ?></td>
?></td> <td><?php echo $name; ?></td>
<td><?php echo $name;
?></td>
<td> <td>
<?php <?php
echo formattoseconds($time); echo formattoseconds($time); ?></td>
?></td> <td><?php echo number_format($jumps); ?></td>
<td><?php echo number_format($jumps);
?></td>
<td><?php if (USES_RANKINGS == '1') { <td><?php if (USES_RANKINGS == '1') {
echo number_format($pp, 2); echo number_format($pp, 2);
} else { } else {
echo '---'; echo '---';
} } ?></td>
?></td> <td><?php echo $date; ?></td></tr>
<td><?php echo $date;
?></td></tr>
<?php <?php
if (++$rank > RECORD_LIMIT) { if (++$rank > RECORD_LIMIT) {
break; break;
} }
} } ?> </table> <?php
?> </table> <?php
} }
} }