[TEST] Response time DB

12/18/2010 09:28 janvier123#1
Ok, iam gonna make a new topic to see how fast the Db updates, i cant do it myself becuz i don have a server

This is a test, that i manually changed in the DB

Quote:
Time Now: 09:29:57
STOP
337-216-09:29:58
337-216-09:29:59
337-216-09:30:00
337-216-09:30:01
337-216-09:30:02
337-216-09:30:03
337-216-09:30:04
337-216-09:30:05
337-216-09:30:06
337-216-09:30:07
337-216-09:30:08
337-216-09:30:09
337-216-09:30:10
377 is the current wPosX
216 is the current wPowY
09:30:10 is the time

-> 09 = hour
-> 30 = min
-> 10 = sec

so we know that i takes 1sec to update, right ?

Player did not move - 2010-12-18 09:11:01
Player moved! - 2010-12-18 09:11:02
thats 1 sec

ok here is the very buggy script, but it works

call this "dbtime.php"
PHP Code:

<?php

    $mssql 
= array( 
      
'host' => "localhost"
      
'user' => "sa"
      
'pass' => "pass" 
    
);
    
        switch(
$_POST['task']){
            case 
"getxy":
            
                
$mslink mssql_connect($mssql['host'],$mssql['user'],$mssql['pass']);
            
                
$name "Knork";
                
$time date("H:i:s");
                
                
$result1 mssql_query("SELECT * FROM character.dbo.user_character WHERE character_name = '".$name."' ",$mslink);
                
$array mssql_fetch_array($result1);
                     
                    echo 
$array['wPosX'] . "-" $array['wPosY'] . "-" $time "<br>";

                    
                
                break;
    
                
            default:
                break;
        }

    
?>
Call this "index.php"
PHP Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
            <title>Live Users</title>
            <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
            <script>
                    $(document).ready(function()
                    {
                       //dbtime.php is called every second to get X and Y from db
                       var refreshId = setInterval(function()
                       {
                         $('#timeval').load('dbtime.php');
                              $.post("dbtime.php",{task:"getxy"},function(data) {
                                $("#status").append("<div>"+data+"<\/div>");
                            });
                       }, 1000);
                    
                       //stop the script when this button is pressed
                       $("#stop").click(function()
                       {
                         clearInterval(refreshId);
                       });
                    });
            </script>

        </head>
    <body>
        <div>Time Now: <?php echo date("H:i:s"); ?></div>
        <button id="stop">STOP</button>
        <div id="timeval">--:--:--</div>
        <div id="status"></div>
    </body>
</html>

Ok so change you mssql info
now in ths dbtime.php

$name = "Knork";

Set you name your gonna play with in the dbtime.php
now run the index.php in your browser, start the game and move around with the character that you just wrote in dbtime.php

after a while you can minimize your game and press the STOP button

Now post the info here



PS: this run 1 query each second, so turn the script OFF when your dont
12/18/2010 09:50 gedimazs#2
Quote:
Originally Posted by janvier123 View Post

PS: this run 1 query each second, so turn the script OFF when your dont
How to turn script OFF ? do you mean with STOP button?

here you go janvier you will find what you need in spoiler. DB refreshes after 25 min
12/18/2010 10:43 janvier123#3
are you kidding me ?
this cant be true
12/18/2010 10:44 gedimazs#4
Quote:
Originally Posted by janvier123 View Post
are you kidding me ?
this cant be true
I gave you what you asked.
12/18/2010 10:51 janvier123#5
Quote:
Originally Posted by gedimazs View Post
I gave you what you asked.
maybe we need a longer one?

you can change it yourself if you want

1000 = ms
so 1000 = 1sec
On index.php look for

PHP Code:
}, 1000); 
and change it to:

PHP Code:
}, 60000); 
if my math is right, it should only print out 1 query every 60sec
let it run for a while

you can copy and paste it them in a TXT file and send it as attachment
12/18/2010 11:44 gedimazs#6
Quote:
Originally Posted by janvier123 View Post
maybe we need a longer one?

you can change it yourself if you want

1000 = ms
so 1000 = 1sec
On index.php look for

PHP Code:
}, 1000); 
and change it to:

PHP Code:
}, 60000); 
if my math is right, it should only print out 1 query every 60sec
let it run for a while

you can copy and paste it them in a TXT file and send it as attachment
Here you go janvier. Was going through maps, was killing mobs, upgrading weapons, buying from Dshop, teleporting, picking items from the ground, throwing items from inventory
12/18/2010 18:37 janvier123#7
ok here is what i think ....
It updates on:

- map change
- after 20min
- login / logout

Its possible

- on trade
- on sell
- on storage
- ....
12/18/2010 21:14 gedimazs#8
Quote:
Originally Posted by janvier123 View Post
ok here is what i think ....
It updates on:

- map change
- after 20min
- login / logout

Its possible

- on trade
- on sell
- on storage
- ....
It updates on:

- map change = NO
- after 20min = YES (sometimes faster ~15 min)
- login / logout = definetely YES

Its possible

- on trade = NO
- on sell = NO
- on storage = NO
12/18/2010 22:40 janvier123#9
on map change yes look:

419-356-12:06:03
63-278-12:07:03

48-257-12:41:03
263-266-12:42:03


it did update in less or equals then 60sec
12/19/2010 07:18 gedimazs#10
Quote:
Originally Posted by janvier123 View Post
on map change yes look:

419-356-12:06:03
63-278-12:07:03

48-257-12:41:03
263-266-12:42:03


it did update in less or equals then 60sec
Believe me no :) I was in window mode when palying and was looking at working script. If you dont believe you can joins to tv session and look :) You have my msn. ;)
12/21/2010 15:02 janvier123#11
ok, there is a HUGE load of info send to the DB, but all are SP

What i did notice is that NOTHING is updated while its happening
so if you buy something ... nothing

But all i can say is that it does NOT update if your idle
but it does updater after +-20min
and the SP for that is called: SP_CHAR_CHECK_IN