- 0
dúvida Online-List Nicaw
-
Quem Está Navegando 0 membros estão online
- Nenhum usuário registrado visualizando esta página.
-
Conteúdo Similar
-
- 0 respostas
- 3204 visualizações
-
- 1 resposta
- 1707 visualizações
-
- 1 resposta
- 1603 visualizações
-
- 2 respostas
- 2579 visualizações
-
- 1 resposta
- 2266 visualizações
-

Pergunta
Flahvia 0
Olá Pessoal,
Eu utilizo o site da Nicaw Acc para meu ot (7.72/Avesta) e estou com um problema no Players online (online-list.php). Ele não esta se atualizando e quando se atualiza, fica um 'lixo' com alguns players que não logam há dias. No status do site, por exemplo, está mostrando 30 players online e na página de players online mostra mais de 100 nomes :S
*Obs.: O status é fiel aos players online, sempre comparo com o GM (!online).
O Código do online.php é este:
<?php /* Copyright (C) 2007-2008 Nicaw This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ include ("include.inc.php"); $ptitle="Online Players - $cfg[server_name]"; include ("header.inc.php"); ?> <div id="content"> <div class="top">Online Players</div> <div class="mid"> <?php $SQL = AAC::$SQL; try { $SQL->myQuery('SELECT name, vocation, level FROM players WHERE status = 1 ORDER BY name ASC'); } catch(DatabaseQueryException $e) { try { $SQL->myQuery('SELECT name, vocation, level FROM players WHERE lastlogin > lastlogout ORDER BY name ASC'); } catch(DatabaseQueryException $e) { throw new DatabaseException('Your server does not store information on players online state.'); } } if ($SQL->num_rows() == 0) { echo 'There is no players online on OldSchool Ots.'; } else { $i = 0; echo '<table><tr class="color0"><td style="width:150px"><b>Name</b></td><td style="width:150px"><b>Vocation</b></td><td style="width:60px"><b>Level</b></td></tr>'; while ($player = $SQL->fetch_array()) { $i++; echo '<tr '.getStyle($i).'><td><a href="characters.php?player_name='.urlencode($player['name']).'">'.htmlspecialchars($player['name']).'</a></td><td>'.htmlspecialchars($cfg['vocations'][$player['vocation']]['name']).'</td><td>'.$player['level'].'</td></tr>'."\n"; } } ?> </table> </div> <div class="bot"></div> </div> <?php include ("footer.inc.php");?>Agora aqui vou por os códigos que atualizam os status também:
em playerdeath.lua
function onDie(cid, corpse) --Online List (Website) mysqlQuery("UPDATE `players` SET `status` = '0' WHERE `name` = \"" .. getPlayerName(cid) .. "\"", "SET") --Bless System if getPlayerStorageValue(cid, 30006) == 1 then setPlayerStorageValue(cid, 30007,1) end endem login.lua
function onLogin(cid) --Online List (Website) if isGameMaster(cid) == FALSE then mysqlQuery("UPDATE `players` SET `status` = '1' WHERE `name` = \"" .. getPlayerName(cid) .. "\"", "SET") end return TRUE endem logout.lua
function onLogout(cid) -- Online List (Website) mysqlQuery("UPDATE `players` SET `status` = '0' WHERE `name` = \"" .. getPlayerName(cid) .. "\"", "SET") return TRUE endEu ainda estou trabalhando em cima disso para tentar resolver, fazendo testes e tentando alterar algumas coisas para ver se dá certo. E também estou googlando por ai, mas até agora não achei nada que resovlesse meu caso.
Se alguém tiver uma idéia do que pode estar errado eu agradeço
Link para o comentário
https://xtibia.com/forum/topic/197392-online-list-nicaw/Compartilhar em outros sites
5 respostass a esta questão
Posts Recomendados