[Help] Accounts is Online

NoFeaR

Well-Known Member
Joined
Feb 1, 2009
Messages
738
Reaction score
291
Здравейте имам един проблем когато някой се опита да ресне пише че акаунта е Онлай а всъщност не е ако може някой да помогне ще бъде страхотно.

Code:
<? 
if(!isset($_SESSION['username_login'])){
header('Location: index.html');
die('access denied');
}

?>
<script language="Javascript" type="text/javascript">
function check_reset_character_form()
{
if (document.reset_character_form.character.value.length<4)
{
alert("Please enter minim 4 digits on Character field!");
return false;
}
//return false;
document.reset_character_form.submit();
}
</script>
<? echo ('<script language="Javascript" type="text/javascript">seconds='.$muweb_counting_seconds.'</script>'); ?>
<script language="Javascript" type="text/javascript">
seconds2 = seconds*1000

var c=seconds
var t
function timedMsg(){
var t=setTimeout("clearTimeout(t); document.getElementById('register').innerHTML = '<input type=\"image\" src=\"buttons/Reset.png\" value=\"Reset Character\" onClick=\"return check_reset_character_form()\">&nbsp;<input type=\"image\" src=\"buttons/cancel.png\" value=\"Cancel\" >'",seconds2)
}


 var milisec=0 
 var seconds=seconds


function display(){ 
 if (milisec<=0){ 
    milisec=9 
    seconds-=1 
 } 
 if (seconds<=-1){ 
    milisec=0 
    seconds+=1 
 } 
 else 
    milisec-=1 
    document.getElementById("count_time").value=seconds+"."+milisec 
    setTimeout("display()",100) 
} 
</script>
<div align="center">
  <table border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td><div align="center" class="text_result">
          <?
if(isset($_POST['reset_character'])){
sql_connect($muweb_dbhost,$muweb_dbuser,$muweb_dbpassword,$muweb_database);
#update_ban();

$character = stripslashes($_POST["character"]);
$acc = stripslashes($_SESSION['username_login']);
$pwd = stripslashes($_POST['pwd']);

$acc = clean_var($acc);
$pwd = clean_var($pwd);

$character = str_replace("'","",$character);
$character = str_replace(";","",$character);
$character = str_replace("Drop","",$character);
$character = str_replace("drop","",$character);
$character = str_replace("Delete","",$character);
$character = str_replace("delete","",$character);

require_once "sql_inject.php"; 
require_once "sql_check.php";
check_inject();
$bDestroy_session = TRUE; 
$url_redirect = 'index.php'; 
$sqlinject = new sql_inject('./log_file_sql_332438a6e23604bdcba294ce43caaa9b1.php',$bDestroy_session,$url_redirect)  ;  


/*
$acc_check = mssql_query("SELECT memb___id FROM MEMB_INFO WHERE memb___id='$acc' AND memb__pwd= [dbo].[fn_md5]('$pwd','$acc')"); 
$acc_check = mssql_num_rows($acc_check); 
if($acc_check <= 0 ){
echo error('Account / Password is invalid!');
}else{*/
$character_check = mssql_query("Select name from character where name='$character' AND AccountID='$acc'");
$character_check = mssql_num_rows($character_check);
if($character_check <= 0){
echo error('Character is invalid!');
}else{
$online_check = mssql_query("SELECT ConnectStat FROM MEMB_STAT WHERE memb___id='$acc' AND ConnectStat='0'");
$online_check = mssql_num_rows($online_check); 
if($online_check <= 1){
echo error('Account '.$acc.' Is Online!');
}else{
$character_data = mssql_query("Select cLeveL,Resets,Money,LevelUpPoint from character where name='$character' AND AccountID='$acc'");
$character_data = mssql_fetch_row($character_data);
$new_resets = $character_data[1] + (1);
$reset_zen = $character_data[2]-($muweb_reset_zen);
$new_leveluopoint = $character_data[3] + ($muweb_reset_bonus_points);
$new_leveluopoint2 = $muweb_reset_bonus_points * ($character_data[1] + 1);
if($character_data[0] < $muweb_reset_level){
echo error('Character '.$character.' need level '.$muweb_reset_level.' to reset!');
}else{
if($reset_zen < 0){
echo error('Character '.$character.' need '.$muweb_reset_zen.' zen to reset!');
}else{
if(($muweb_reset_stats_mode=='keep') AND ($muweb_reset_bonus_points_mode=='normal')){
$sql_reset_script="Update character set [clevel]='1',[experience]='0',[money]='$reset_zen',[LevelUpPoint]='$new_leveluopoint',[resets]='$new_resets' where name='$character'";}
elseif(($muweb_reset_stats_mode=='reset') AND ($muweb_reset_bonus_points_mode=='extra')){
$sql_reset_script="Update character set [strength]='25',[dexterity]='25',[vitality]='25',[energy]='25',[clevel]='1',[experience]='0',[money]='$reset_zen',[LevelUpPoint]='$new_leveluopoint2',[resets]='$new_resets' where name='$character'";}
elseif(($muweb_reset_stats_mode=='keep') AND ($muweb_reset_bonus_points_mode=='extra')){
$sql_reset_script="Update character set [clevel]='1',[experience]='0',[money]='$reset_zen',[LevelUpPoint]='$new_leveluopoint2',[resets]='$new_resets' where name='$character'";}
elseif(($muweb_reset_stats_mode=='reset') AND ($muweb_reset_bonus_points_mode=='normal')){
$sql_reset_script="Update character set [strength]='25',[dexterity]='25',[vitality]='25',[energy]='25',[clevel]='1',[experience]='0',[money]='$reset_zen,[LevelUpPoint]='$new_leveluopoint',[resets]='$new_resets' where name='$character'";}
if($muweb_reset_clean_inventory=='yes' && $muweb_reset_clean_skills=='yes'){
$sql_reset_script2="UPDATE character Set [inventory]=CONVERT(varbinary(1080), null),[magiclist]= CONVERT(varbinary(180), null) Where name='$character'";}
elseif($muweb_reset_clean_inventory=='no' && $muweb_reset_clean_skills=='no'){
$sql_reset_script2="Select name from character where name='$character'";}
elseif($muweb_reset_clean_inventory=='yes' && $muweb_reset_clean_skills=='no'){
$sql_reset_script2="UPDATE character Set [inventory]=CONVERT(varbinary(1080), null) Where name='$character'";}
elseif($muweb_reset_clean_inventory=='no' && $muweb_reset_clean_skills=='yes'){
$sql_reset_script2="UPDATE character Set [magiclist]= CONVERT(varbinary(180), null) Where name='$character'";}

$sqlinject->test($sql_reset_script);
$sqlinject->test($sql_reset_script2);
$sql_reset_exec = mssql_query($sql_reset_script);
$sql_reset_exec2 = mssql_query($sql_reset_script2);
echo ("<span class=success>Character $character successfully reseted and <br>has total of <b><font color='#FF0000'>$new_resets</font></b> resets.</span>");
}}}}} 
?>
      </div></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
    </tr>
  </table><table width="490" height="33" border="0" cellpadding="00" cellspacing="0">
  <tr>
    <td width="490" background="template-nopersia/news.gif" style="background-repeat:no-repeat">&nbsp;&nbsp;&nbsp;<a href="<?=$muweb_servername; ?>-<? if(!isset($_GET['op'])){ echo ucfirst('News'); }else{ echo ucfirst($_GET['op']); } ?>.html">
      <? if(!isset($_GET['op'])){ echo ucfirst(News); }else{ echo ucfirst($_GET['op']); }?>
    </a></td>
  </tr>
</table>
  <p align="left"><strong></strong></p>
  <form name="reset_character_form" method="post" action="" id="reset_character_form">
    <table width="417" border="0" cellspacing="8" cellpadding="0">
      <tr>
        <td width="122"><div align="right" class="text_normal_white">Character</div></td>
        <td width="271">        <div align="left">
          <input name="character" class="buttons" type="text" id="character" size="15" maxlength="10">
        </div></td>
      </tr>
    </table>
    
    <table width="417" border="0" cellspacing="4" cellpadding="0">
      <tr>
        <td height="19">&nbsp;</td>
      </tr>
    </table>
    <table width="300" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td><div align="center">
          <input name="reset_character" type="hidden" id="reset_character" value="reset_character">
        </div></td>
      </tr>
    </table>
    <table border="0" cellspacing="4" cellpadding="0">
      <tr>
        <td><div align="right"> </div></td>
        <td><div align="center">
            <div id="register" class="text_normal_red">Please Wait&nbsp;
                <input class="buttons" type="text" id="count_time" name="count_time" size="3">
                <script>display();timedMsg();</script>
          Second(s) To Be Able To Reset Character </div>
        </div></td>
      </tr>
    </table>
  </form>
</div>
</body>
 
То проверка има. Просто малка редакция трябва на тези 3 реда.

PHP:
$online_check = mssql_query("SELECT ConnectStat FROM MEMB_STAT WHERE memb___id='$acc' AND ConnectStat='1'");
$online_check = mssql_num_rows($online_check); 
if($online_check > 0){
 
Не става опитах току що пише че е реснат героя а всъщност не е (headbang)
 
Bupyc ми каза че е от db-tata някой които им разбира.
 
Bupyc ми каза че е от db-tata някой които им разбира.

Ако е от DB тата направи тест бе :d сложи някои друг сайт и пробваи дали той ще ти ресне героя ако ресне значи не е от DB тата :)
 
от скрипта е но неможем да намерим грешката :#
 
Code:
CREATE PROCEDURE WZ_CONNECT_MEMB

@uid varchar(10),
@server varchar(15),
@uip varchar(15)
AS

Begin

BEGIN TRANSACTION

SET NOCOUNT ON

IF EXISTS ( SELECT memb___id FROM MEMB_STAT WITH (READUNCOMMITTED)
WHERE memb___id = @uid )

Begin
UPDATE MEMB_STAT
SET IP = @uip , ConnectStat = '1' , ServerName = @server , ConnectTM = (getdate())
WHERE memb___id = @uid
End
ELSE
Begin
INSERT INTO MEMB_STAT ( memb___id,ConnectStat,ServerName,IP,  ConnectTM) values (
@uid,
'1',
@server,
@uip,
(getdate())
)
End

IF(@@Error <> 0 )
ROLLBACK TRANSACTION
ELSE
COMMIT TRANSACTION

SET NOCOUNT OFF
End
GO

and

Code:
CREATE PROCEDURE WZ_DISCONNECT_MEMB

@uid varchar(10)
AS
Begin

BEGIN TRANSACTION

SET NOCOUNT ON

IF EXISTS ( SELECT memb___id FROM MEMB_STAT WITH (READUNCOMMITTED)
WHERE memb___id = @uid )

Begin
UPDATE MEMB_STAT
SET DisConnectTM = (getdate()), connectstat = '0'  WHERE memb___id = @uid
End
ELSE
Begin
INSERT INTO MEMB_STAT ( memb___id,ConnectStat,DisConnectTM) values (
@uid,
0,
(getdate())
)
End


IF(@@Error <> 0 )
ROLLBACK TRANSACTION
ELSE
COMMIT TRANSACTION

SET NOCOUNT OFF
End
GO
 
пробвай така
$online_check = mssql_query("SELECT * FROM MEMB_STAT WHERE memb___id='$acc'");
$online_checked = mssql_fetch_array($online_check);
и проверката
if($online_checked['ConnectStat'] != 0){ echo"Account is online, must be logged off!";}