Help - Search - Members - Calendar
Full Version: Aegis Interactive Control Panel
Aegis Support Board > Aegis Support > Script & Co > Aegis Tools/Programs
Pages: 1, 2, 3, 4
Twin-x
Echo you can find it in your sql database!

-------------------------------------------------

Does anyone know how to run this from a server that is not located near the sql server. e.g. my webserver.
xmarv
I won't do that, you would have to open your MsSQL port tongue.gif
Twin-x
QUOTE (xmarv @ Mar 25 2004, 11:22 PM)
I won't do that, you would have to open your MsSQL port tongue.gif

Ok thx.
Magnoon
It seems to be case sensitive, people with much case and lower chars in their name will get the msg that the login is invalid.

Can you fix this, or can anybody make a temprorary fix please?
xmarv
I made an itemlog decoder...
Just add the following below the line with "-- View Log Files" in footer.inc:

CODE

echo "<option value=\"view_itemlogs.php\">-- View Item Log";


And then put the next codebox in a file named view_itemlogs.php into your evil ro directory...
It should also work on older apache/php versions wink.gif
(I use XAMPP 1.3 -> www.apachefriends.org)

CODE
<?php
include('memory.php');
include('header.inc');

Authorize();

$CurrentUser = CurrentUser();

if (ReadAccess(CurrentUser(),"view_logs") == 0)
{
 DenyPrivs("index.php");
}

$itemlog_db = ConnectDatabase("Loger");

if ($GET_do == "del")
{
 @mssql_query("delete from itemLog where [index]=$GET_index",$itemlog_db);
}
if ($GET_do == "delall")
{
 @mssql_query("delete from itemLog",$itemlog_db);
}

$result = @mssql_query("select * from itemLog order by 'index'",$itemlog_db);

echo "<a href=\"view_itemlogs.php?do=delall\"><center><b>Delete all Entrys!</b></center></a>";

EchoHead();
echo "<table border=0 cellpadding=3 cellspacing=1 bgcolor=#000000>";
while ($result_array = @mssql_fetch_array($result))
{
 $faccount = $result_array['srcAccountName'];
 $fcharacter = $result_array['srcCharName'];
 $taccount = $result_array['desAccountName'];
 $tcharacter = $result_array['desCharName'];
 $item = $result_array['ItemName'];
 $count = $result_array['ItemCount'];
 $price = $result_array['price'];
 $map = $result_array['MapName'];
 $action = $result_array['Action'];
 $index = $result_array['index'];

 if($action == "0") {
  $data = "$fcharacter (Account: $faccount) dropped $count x $item.";
 }
 if($action == "1") {
  $data = "$fcharacter (Account: $faccount) picked up $count x $item.";
 }
 if($action == "3") {
  $data = "$fcharacter (Account: $faccount) traded $count x $item to $tcharacter (Account: $taccount).";
 }
 if($action == "4") {
  $data = "$fcharacter (Account: $faccount) bought $count x $item from $tcharacter (Account: $taccount) merchant shop.";
 }
 if($action == "5") {
  $data = "$fcharacter (Account: $faccount) bought $count x $item from an NPC on the map $map.";
 }
 if($action == "6") {
  $data = "$fcharacter (Account: $faccount) sold $count x $item in a shop for $price zeny.";
 }
 if($action == "7") {
  $data = "$fcharacter (Account: $faccount) got $count x $item because of an MVP bonus.";
 }
 if($action == "9") {
  $data = "$fcharacter (Account: $faccount) received $count x $item from an NPC on the map $map.";
 }
 if($action == "10") {
  $data = "$fcharacter (Account: $faccount) gave $count x $item to an NPC on the map $map.";
 }

 echo "<tr>";
 echo "<td width=100 class=\"mytext\" bgcolor=#b6b6b6 align=center>[ <a href=\"view_itemlogs.php?do=del&index=$index\">Delete Entry</a> ]</td>";
 echo "<td width=800 class=\"mytext\" bgcolor=#b6b6b6 align=center>$data</td>";
 echo "</tr>";
}
echo "</table>";
EchoFoot();

include 'footer.inc';
?>
kookiekrak
mines being gay... i d/led the latest php from www.php.net
im using microsoft iis and its not working>_<
(u can see errors here)
http://24.184.218.14:79/aegis/login.php
kitsunestarwind
Another money bug
URL manitulation to make the Sender & reciever GID's the same , can be abuse infinitely
QUOTE


******@hotmail.com says:
selecte the person to take Z from
*****@hotmail.com says:
then the person to put Z on
*****@hotmail.com says:
then is saiz something like this in the URL

http://lords.servehttp.com/srocp/cp_user.p...404&GID2=100392
*****@hotmail.com says:
alter ego to aragon
SilverFox says:
~_~
*****@hotmail.com says:
so you change it.....to this

http://lords.servehttp.com/srocp/cp_user.p...404&GID2=100404

changing the GID's
*****
alter ego to alter ego
*****
then hit 100k and hit send over and over and over again

Delta-][
QUOTE (kookiekrak @ Apr 1 2004, 11:20 PM)
mines being gay... i d/led the latest php from www.php.net
im using microsoft iis and its not working>_<
(u can see errors here)
http://24.184.218.14:79/aegis/login.php

You need to make sure IIS is configured so users can "run scripts" from the folder you've got AegisCP installed. It's in there somewhere.... just don't know where anymore. Haven't used IIS in a while wink.gif
xmarv
@kookiekrak
I had the same problems, I think you don't have the real latest apache/php version or something like that tongue.gif
( I fixed the scripts that they work at me, so don't ask me where you can get it )

Aww... All these money bugs rolleyes.gif
I think it can be fixed when u send the gids by post blink.gif
I will try it wink.gif
Thx for info!
kookiekrak
bleh nvm i guess it only works well with apache and not iis
echira
somehow the server status screen wasn't working on my system (dont know if i'm alone or not...) i used the uniform server guide written by dovac biggrin.gif

so... i rewrote http://forum.asb-sakray.net/index.php?showtopic=14797 by lekiz for implimentation in the ACP. hehe.

just overwrite the serve_status.php if it isn't working for you. *shrug*

QUOTE

<?php

/* * * * * * * * * * * * * * * * * * * * * * * * * * * *
*     modified by echira        *
*     original code lekiz        *
* * * * * * * * * * * * * * * * * * * * * * * * * * * */

require 'memory.php';
include 'header.inc';

Authorize();

$login = CurrentUser();


echo " <table border=0 bgcolor=#000000 cellpadding=3><tr><th width=405><font face=Tahoma color=#ffffff size=1>Server Status</th></tr></table>";
echo "<table border=0 cellpadding=3 cellspacing=1 bgcolor=#000000>";
echo "<tr>";

error_reporting(0);

$IP = array(
"Login Server" => "PUT YOUR IP HERE:PORT",
"Character Server" => "PUT YOUR IP HERE:PORT",
"Zone Server" => "PUT YOUR IP HERE:PORT",
);
while(list($ServerName,$Host)=each($IP)) {
list($IPAddress,$Port)=explode(":",$Host);
echo("<td width=200 class=\"mytext\" bgcolor=#b6b6b6 align=center>".$ServerName."</td><td width=200 class=\"mytext\" bgcolor=#b6b6b6 align=center>");
if($fp=fsockopen($IPAddress,$Port,$ERROR_NO,$ERROR_STR,(float)0.5)) {
echo("Online");
fclose($fp);
}
else {


echo ("Offline");
}
echo ("</td></tr><tr>");
}
echo ("</table>");


EchoFoot();

include 'footer.inc';

?>


biggrin.gif
echira
QUOTE (kitsunestarwind @ Apr 2 2004, 06:47 AM)
Another money bug
URL manitulation to make the Sender & reciever GID's the same , can be abuse infinitely

insert this into cp_user.php

QUOTE


if ($GET_GID1 == $GET_GID2)
{
ReDirect("index.php","Do not try to cheat");
}



after

QUOTE


  elseif ($GET_step=="4")
  {
  $re = "-";
  $ereg = ereg($re,$GET_amount);
  if($ereg == false) {
    $char1 = CharNameByGID($GET_GID1);
    $char2 = CharNameByGID($GET_GID2);
    $money1 = MoneyOnChar($GET_GID1);
    $money2 = MoneyOnChar($GET_GID2);

    if (IsSyncAID($GET_GID1,AIDByAccount($myuser)) == 0)
    {
    ReDirect("index.php","An error has occured");
    }

    if (IsSyncAID($GET_GID2,AIDByAccount($myuser)) == 0)
    {
    ReDirect("index.php","An error has occured");
    }





biggrin.gif
xmarv
Here is another bug! You can't change the hairstyle of your 4th or 5th character...
Here is my fix:

Open cp_user.php
Search:
CODE
elseif (($GET_style > 0 && $GET_style < 20) && ($GET_charnum >-1 && $GET_charnum <3))

Replace:
CODE
elseif (($GET_style > 0 && $GET_style < 20) && ($GET_charnum >-1 && $GET_charnum <5))

Save and close cp_user.php

Have fun biggrin.gif
echira
lol... i gotta change that again for 9 characters, i found a way to get all 9 slots available >:)

only one problem with your itemlogs xmarv:

i tried to execute your script after my server's been up for a while... it takes over 30 minutes to execute (and my DB controller aint too shabby...) and the results were so much that none appear. (well... it was roughly 600,000 entires or so)

i'm trying to write a form imput where you put the top x number of results or whatever. like, specifics. toodles.
xmarv
Yes, thats a problem, I need to empty my itemlog every 3-4 days with ~50 accounts...
I will watch out for making it better/faster... tongue.gif

~~0fft0p1c~~
How do you get 9 slots??
I heard of it in the chat, but "Peter" didn't wanted to release it at that moment tongue.gif
And you also need to hex it into the client... Hard work blink.gif
echira
lol it's psudo 9 slots but technically 9 are available. lemmie consult the person that helped me design it and i'll see if he wants it released or not. it's kinda nice having 9 slots and being one of the few servers who has it.
biggrin.gif

xmarv i'm fixing your script up too, to suit my own needs. hope you dont mind.
edit: fixed up a bit, here's a look at it.
edit: changed it from [index] to [index] desc so newest appears first - easy to hit refresh and watch it scroll.


Current Release of Log Update:
http://forum.asb-sakray.net/index.php?show...80&#entry118446
xmarv
Nice! smile.gif
I don't think that I need the $time variable any more...
Delete it to make the script a bit faster biggrin.gif
echira
QUOTE (xmarv @ Apr 11 2004, 11:15 PM)
I don't think that I need the $time variable any more...
Delete it to make the script a bit faster biggrin.gif

i use time to tell how fast things are going. right now i'm actually trying to alter it more by making it highlight anything that occurect within the last 1minute and everything in the last 10 minutes and another color for the last 1 hour. just to make admin really worthwile, but i'm trying to find the syntax for measuring elapsed time.

any suggestions?
Riotblade
QUOTE (Rentus @ Feb 24 2004, 11:58 AM)
you have to activate the mssql_connect() by deleting the ";" in front of "extension=php_mssql.dll" in the php.ini

Fatal error: Call to undefined function: mssql_connect() in c:\inetpub\wwwroot\cp\memory.php on line 58

I have enabled it in php.ini. I'm currently using PHP 4.35 with ISS, tell me if there are any compatibilities tongue.gif.

Thanks
xmarv
You enabled it in all 3 php.inis ?

webfolder\php\php.ini
webfolder\apache\bin\php.ini
%SYSTEMROOT%\php.ini
echira
okay well i decided i wanted to snoop some more into my user's items... heh, for strategic bot hunting... bwhahaha. for what else? biggrin.gif
edit: added storage viewing.


in char_act.php, find:
QUOTE

if ($GET_action == "items")
{
  $result = mssql_query("select * from item where GID=$GET_GID",$char_db);
  $result_array = mssql_fetch_array($result);

  $item_data = bin2hex($result_array['equipItem']);
  EchoHead();
  echo "<table border=0 cellpadding=3 cellspacing=1 width=450 bgcolor=#000000>";

  $item_data = substr($item_data,4);
  while (strlen($item_data) > 0)
  {
   $item_code = hexdec(substr($item_data,2,2) . substr($item_data,0,2));
   $identified = substr($item_data,5,1);

   $item_name = GetNameFromID($item_code);

   $color = "#000000";
   if ($identified == 1) { $identified = "Identified"; }
   else { $identified = "Unidentified"; $color="#666666"; }

   if (IsEquip($item_code) == 1)
   {
    $equipped = hexdec(substr($item_data,14,5));
    $refined = hexdec(substr($item_data,20,2));
    $card[1] = GetNameFromID(hexdec(substr($item_data,24,2) . substr($item_data,22,2)));
    $card[2] = GetNameFromID(hexdec(substr($item_data,28,2) . substr($item_data,26,2)));
    $card[3] = GetNameFromID(hexdec(substr($item_data,32,2) . substr($item_data,30,2)));
    $card[4] = GetNameFromID(hexdec(substr($item_data,36,2) . substr($item_data,34,2)));

    $item_data = substr($item_data,38);
    if ($equipped > 0) { $color = "#AA0000"; }
    if ($refined > 0) { $refined = "+" . $refined; } else { $refined = ""; }

    echo "<tr>";
    echo " <td class=\"mytext\" bgcolor=#B6B6B6><font color=$color><b>$refined $item_name</b></font> [ ";

    for ($i=1; $i<5; ++$i)
    {
     if ($card[$i])
     {
      echo "<b>Slot$i:</b> $card[$i] ";
     }
    }
    echo "]</td></tr>";
   }
   elseif(IsArrow($item_code) == 1)
   {
    $quantity = hexdec(substr($item_data,8,2) . substr($item_data,6,2));
    $equipped = hexdec(substr($item_data,10,4));

    if ($equipped > 0) { $color = "#AA0000"; }

    echo "<tr>";
    echo " <td class=\"mytext\" bgcolor=#B6B6B6><font color=$color>$quantity $item_name(s)</font></tr>";
    echo "</tr>";

    $item_data = substr($item_data,14);
   }
   else
   {
    $quantity = hexdec(substr($item_data,8,2) . substr($item_data,6,2));

    $item_data = substr($item_data,10);

    echo "<tr>";
    echo "<td class=\"mytext\" bgcolor=#B6B6B6><font color=$color>$quantity $item_name(s)</font></tr>";
    echo "</tr>";
   }
  
  }

  echo "</table>";
  EchoFoot();
  echo "<br>";
}


and change it to:
QUOTE

if ($GET_action == "items")
{
  $result = mssql_query("select * from item where GID=$GET_GID",$char_db);
  while($result_array = mssql_fetch_array($result))
  {
  $item_data = bin2hex($result_array['equipItem']);
  }

  $result = mssql_query("select * from charinfo where GID=$GET_GID",$char_db);
  while($result_array = mssql_fetch_array($result))
  {
  $charname = $result_array['charname'];
  }

  EchoHead();
  echo "<table border=0 cellpadding=3 cellspacing=1 width=450 bgcolor=#000000>";
  echo "<tr>";
  echo " <td class=\"mytext\" bgcolor=#000000><FONT FACE=\"Tahoma\" SIZE=2 color=#ffffff><b>Character: $charname</b></font>";
  echo "</tr>";
  echo "</table>";
  EchoFoot();

  echo "<br>";

  EchoHead();
  echo "<table border=0 cellpadding=3 cellspacing=1 width=450 bgcolor=#000000>";
  echo "<tr>";
  echo " <td class=\"mytext\" bgcolor=#000000><FONT FACE=\"Tahoma\" SIZE=2 color=#ffffff><b>Items</b></font>";
  echo "</tr>";

  $item_data = substr($item_data,4);
  while (strlen($item_data) > 0)
  {
   $item_code = hexdec(substr($item_data,2,2) . substr($item_data,0,2));
   $identified = substr($item_data,5,1);

   $item_name = GetNameFromID($item_code);

   $color = "#000000";
   if ($identified == 1) { $identified = "Identified"; }
   else { $identified = "Unidentified"; $color="#666666"; }

   if (IsEquip($item_code) == 1)
   {
    $equipped = hexdec(substr($item_data,14,5));
    $refined = hexdec(substr($item_data,20,2));
    $card[1] = GetNameFromID(hexdec(substr($item_data,24,2) . substr($item_data,22,2)));
    $card[2] = GetNameFromID(hexdec(substr($item_data,28,2) . substr($item_data,26,2)));
    $card[3] = GetNameFromID(hexdec(substr($item_data,32,2) . substr($item_data,30,2)));
    $card[4] = GetNameFromID(hexdec(substr($item_data,36,2) . substr($item_data,34,2)));

    $item_data = substr($item_data,38);
    if ($equipped > 0) { $color = "#AA0000"; }
    if ($refined > 0) { $refined = "+" . $refined; } else { $refined = ""; }

    echo "<tr>";
    echo " <td class=\"mytext\" bgcolor=#B6B6B6><font color=$color><b>$refined $item_name</b></font> [ ";

    for ($i=1; $i<5; ++$i)
    {
     if ($card[$i])
     {
      echo "<b>Slot$i:</b> $card[$i] ";
     }
    }
    echo "]</td></tr>";
   }
   elseif(IsArrow($item_code) == 1)
   {
    $quantity = hexdec(substr($item_data,8,2) . substr($item_data,6,2));
    $equipped = hexdec(substr($item_data,10,4));

    if ($equipped > 0) { $color = "#AA0000"; }

    echo "<tr>";
    echo " <td class=\"mytext\" bgcolor=#B6B6B6><font color=$color>$quantity $item_name(s)</font></tr>";
    echo "</tr>";

    $item_data = substr($item_data,14);
   }
   else
   {
    $quantity = hexdec(substr($item_data,8,2) . substr($item_data,6,2));

    $item_data = substr($item_data,10);

    echo "<tr>";
    echo "<td class=\"mytext\" bgcolor=#B6B6B6><font color=$color>$quantity $item_name(s)</font></tr>";
    echo "</tr>";
   }
  
  }

  echo "</table>";
  EchoFoot();
  echo "<br>";
 
  EchoHead();
  echo "<table border=0 cellpadding=3 cellspacing=1 width=450 bgcolor=#000000>";

  echo "<tr>";
  echo " <td class=\"mytext\" bgcolor=#000000><FONT FACE=\"Tahoma\" SIZE=2 color=#ffffff><b>Cart Items</b></font>";

  $result = mssql_query("select * from cartItem where GID=$GET_GID",$char_db);
  while ($result_array = mssql_fetch_array($result))
  {
  $item_data = bin2hex($result_array['cartitem']);
  }

  $item_data = substr($item_data,4);
  while (strlen($item_data) > 0)
  {
   $item_code = hexdec(substr($item_data,2,2) . substr($item_data,0,2));
   $identified = substr($item_data,5,1);

   $item_name = GetNameFromID($item_code);

   $color = "#000000";
   if ($identified == 1) { $identified = "Identified"; }
   else { $identified = "Unidentified"; $color="#666666"; }

   if (IsEquip($item_code) == 1)
   {
    $equipped = hexdec(substr($item_data,14,5));
    $refined = hexdec(substr($item_data,20,2));
    $card[1] = GetNameFromID(hexdec(substr($item_data,24,2) . substr($item_data,22,2)));
    $card[2] = GetNameFromID(hexdec(substr($item_data,28,2) . substr($item_data,26,2)));
    $card[3] = GetNameFromID(hexdec(substr($item_data,32,2) . substr($item_data,30,2)));
    $card[4] = GetNameFromID(hexdec(substr($item_data,36,2) . substr($item_data,34,2)));

    $item_data = substr($item_data,38);
    if ($equipped > 0) { $color = "#AA0000"; }
    if ($refined > 0) { $refined = "+" . $refined; } else { $refined = ""; }

    echo "<tr>";
    echo " <td class=\"mytext\" bgcolor=#B6B6B6><font color=$color><b>$refined $item_name</b></font> [ ";

    for ($i=1; $i<5; ++$i)
    {
     if ($card[$i])
     {
      echo "<b>Slot$i:</b> $card[$i] ";
     }
    }
    echo "]</td></tr>";
   }
   elseif(IsArrow($item_code) == 1)
   {
    $quantity = hexdec(substr($item_data,8,2) . substr($item_data,6,2));
    $equipped = hexdec(substr($item_data,10,4));

    if ($equipped > 0) { $color = "#AA0000"; }

    echo "<tr>";
    echo " <td class=\"mytext\" bgcolor=#B6B6B6><font color=$color>$quantity $item_name(s)</font></tr>";
    echo "</tr>";

    $item_data = substr($item_data,14);
   }
   else
   {
    $quantity = hexdec(substr($item_data,8,2) . substr($item_data,6,2));

    $item_data = substr($item_data,10);

    echo "<tr>";
    echo "<td class=\"mytext\" bgcolor=#B6B6B6><font color=$color>$quantity $item_name(s)</font></tr>";
    echo "</tr>";
   }

  }


  echo "</table>";
  EchoFoot();
  echo "<br>";
}


this will add cart items to the active item list. if they have cart items, it will appear, otherwise, nothing will appear in the item table.




now... for the storage. it's controlled by account and not by character, so you're gonna have to modifiy user_act.php

edit: storage wasn't working correctly. removed till i fix it.

*sigh* i need sleep...

toodles biggrin.gif
serra
@echira

I noticed you are throwing the entire itemLog table in to an array before limiting how ever many you want to see at a time. Here is what you have:

CODE
if ($GET_action == "result")
{
$result = @mssql_query("SELECT * FROM itemLog ORDER BY [index] desc",$itemlog_db);


echo "<a href=\"view_itemlogs.php?action=delall\"><center><b>Delete all entries</b></center></a>";


if (!$GET_pg) { $GET_pg = 1; }

$rspp = $_SESSION['results_per_page'];


I suggest you go with the following or something along similar lines:

CODE
if ($GET_action == "result")
{
$rspp = $_SESSION['results_per_page'];

if( isset( $_SESSION['pg'] ) )
{
$offset = $_SESSION['pg'] * $rspp;
}
else
{
$offset = 0;
}

$result = @mssql_query("SELECT * FROM itemLog ORDER BY [index] desc LIMIT $offset,$rspp",$itemlog_db);


echo "<a href=\"view_itemlogs.php?action=delall\"><center><b>Delete all entries</b></center></a>";


if (!$GET_pg) { $GET_pg = 1; }


Then, instead of getting 600,000, you get how ever many you set $rspp to.
PuzZah
QUOTE (xmarv @ Apr 12 2004, 02:30 AM)
You enabled it in all 3 php.inis ?

webfolder\php\php.ini
webfolder\apache\bin\php.ini
%SYSTEMROOT%\php.ini

I can only find two php.ini files and also two php_safe.ini files all of which have the line:

extension=php_mssql.dll

inside. I've removed the ; from all four in an attempt to fix the error:

QUOTE
Fatal error: Call to undefined function: mssql_connect() in D:\xampp\xampp\htdocs\admin2\memory.php on line 58


with no luck. I can't see any other fix for this on this topic nor anywhere else on these forums. I've also searched google and php.net but can't find anything different to what's already been said here. Any other possible fixes?

I'm using xampp if that helps you come to a possible solution for me biggrin.gif

Thanks
echira
QUOTE (serra @ Apr 12 2004, 09:25 AM)
@echira

I noticed you are throwing the entire itemLog table in to an array before limiting how ever many you want to see at a time.

two things.

1) i believe i'm going to be splitting this command into two sections, one for searching and one for entire query. your command may be useful, but it will only show you the currently offset pages, being 50 on my system, which covers an expanse of about 1 minute worth of item results, during low time. it's very hard to scan through what's going on when your results leave the window faster than you can believe.

2) LIMIT is a MySQL command. i did some research (i'm an SQL noob but this is tons of fun) and found the appropriate command for MSSQL would be as follows:

QUOTE

if ($GET_action == "result")
{
$rspp = $_SESSION['results_per_page'];

if( isset( $_SESSION['pg'] ) )
{
$offset = $_SESSION['pg'] * $rspp;
}
else
{
$offset = $rspp;
}

$result = @mssql_query("SELECT TOP $rspp * FROM (SELECT TOP $offset * FROM itemLog ORDER BY [index] DESC) Subquery ORDER BY [index] DESC",$itemlog_db);


echo "<a href=\"view_itemlogs.php?action=delall\"><center><b>Delete all entries</b></center></a>";


if (!$GET_pg) { $GET_pg = 1; }
EchoHead();


you use a subquery to find a returned var inside a returned var.

the only problem, is that you're still only querying for the RSPP and then an offset inside of it, so multiple pages wont even appear due to the fact there is only one RSPP available. if you want the first page of results, that's "50", per example. well only one page is going to appear, since you've only got 50 responses. the code doesn't work as intended.


toodles biggrin.gif
serra
If I remember correctly, each row of the itemLog table has a unique key. If that is the case, you can query the table, order asc, offset 0, limit 1. Toss that value in to a variable. Then query the database again, but this time order desc, offset 0, limit 1, toss that in to another variable. Then do ($var1 - $var2)/($rspp) to find out how many pages there are. Duno if it's faster, but worth a shot maybe.
echira
i just realized this... actually, last night, but still the same, that my storage script is completely crap and i'll repost it after i fix it. i realized that heh, equipped items (on your person) are different than stored items, and are written with a different hex string, so i'm gonna be working on fixing that up. soz :|


QUOTE
If I remember correctly, each row of the itemLog table has a unique key.  If that is the case, you can query the table, order asc, offset 0, limit 1.  Toss that value in to a variable.  Then query the database again, but this time order desc, offset 0, limit 1, toss that in to another variable.  Then do ($var1 - $var2)/($rspp) to find out how many pages there are.  Duno if it's faster, but worth a shot maybe.


the only problem with this is that to return and count the rows available, you'd still have to query the entire structure and then divide them into pages, which then could give you the page count, the only problem is that you're still having to return all the data, which defeats the purpose of counting.
echira
okay. i spent like three hours today fixing this up, but i think i've got a much better result than i had before on 'em. there will be some DB modding for this, but it'll have better results in the end.

Current Release of Log Update:
http://forum.asb-sakray.net/index.php?show...80&#entry118446

i like the ability to let my GM's watch over each other by viewing the log files, but none can DELETE the log files unless they're del_log compatable.

is_super_account is used in my view_itemlogs.php for viewing of ALL logs no matter the username with no autorefresh, will return results in paged format based off of RSPP, like i originally modified it for.

hope this helps

toodles biggrin.gif
serra
QUOTE (echira @ Apr 13 2004, 07:55 PM)
QUOTE
If I remember correctly, each row of the itemLog table has a unique key.  If that is the case, you can query the table, order asc, offset 0, limit 1.  Toss that value in to a variable.  Then query the database again, but this time order desc, offset 0, limit 1, toss that in to another variable.  Then do ($var1 - $var2)/($rspp) to find out how many pages there are.  Duno if it's faster, but worth a shot maybe.


the only problem with this is that to return and count the rows available, you'd still have to query the entire structure and then divide them into pages, which then could give you the page count, the only problem is that you're still having to return all the data, which defeats the purpose of counting.

What I'm trying to do is limit the amount of work the web server has to do. Arrays take massive amounts of memory. In your case, you have an array with 600,000 or however many rows. In each row there is an array with another 10 or so rows of data. If all of the data were 1 byte, then that's 6MB that the mssql server has to give to the web server to output/count/whatever.

In my case, I would have an array with 50 or however many rows you wanted to see per page. Each row having 10 rows associated with it, 1 byte per row, would be 0.5KB. I would have the mssql server do the grunt work of figuring out how many total rows there are in the databse with the help of some simple math on the web server side.

In the end, it's either:

query the database once and loop through everything to count/output

-or-

query the database 3 times and loop through how ever many you want to see per page to output

If you could I would like to see the timed results of both, since I do not have over 600,000 entries in my itemLog or any log table for that matter. I'm sure I have a timer class somewhere if you don't. Hell, I'll even write a script for it if you wanted; I just want to see which is faster smile.gif
xmarv
Oh nice!
My part of the script is really little now... laugh.gif
echira
@ serra
well my newest fix should fix that, since you're either ONLY pulling the most recent or ONLY ones where the charname is located. the query all should be used in disgression, but i understand what you're trying to accomplish with it.

@xmarv
you wrote the original decipher for them all, couldn't have done it without the core of it.
any ideas on breaking up the storage code? i saw a thread around here that explained how they were coded but i never got into it.
xmarv
Didn't you already wrote a storage viewing script?
Or what do you mean by breaking it up?
echira
nono... my storage script read them as if they were equipped items, but they're coded differently in storage (someone posted a thread on this in the ... support or scripting section). i realized this after seeing 10 items in someone's storage and they had 91 ingame :X

in a bit i'll update the one for the account search that i just now finished.
xmarv
Yes thats right, if you get the <binary> cell by a query you only get a few items...
Its the same when you export and reimport the table, everyone will have lost almost all items rolleyes.gif
echira
as Serra posted in another section, even the difference between nonequippable items and equippable items are different. i believe storeItem works the same way.

http://forum.asb-sakray.net/index.php?showtopic=19035
echira
okay. i'm fininshed revising the item log files. this is going to be a master post for all my others, thank GOD.

they should be bug free, but if they aren't, please tell me and i'll fix 'em asap.

extract this to your acp's root folder, it'll take care of itself.

in your "flagged_accounts" table, add "del_logs" just like any other permission. give accordingly. "view_logs" cannot delete any logs, but "del_logs" users will be able to.

change your footer.inc:
QUOTE

if (ReadAccess(CurrentUser(),"view_logs") == 1)
{
  echo "<option value=\"view_logs.php\">Admin Controls";
  echo "<option value=\"view_logs.php\">-- View Log Files";
  echo "<option value=\"view_itemlogs.php?action=search\">-- View Item Log Files";
}


yeah the default extract folder is funky cuz of my network's webserver. tongue.gif

the "fast ticker" should work for both IE and Opera. *shrug* i use opera but i had a friend check the IE compatability.
echo_top
QUOTE (xmarv @ Mar 25 2004, 11:22 PM)
I won't do that, you would have to open your MsSQL port tongue.gif

hello... how i open my mssql port ??

cause i still get error when try to login...

Warning: MS SQL message: Login failed for user 'auth'. (severity 14) in c:\apache\htdocs\kings\memory.php on line 58

Warning: MS SQL: Unable to connect to server: 192.168.0.203 in c:\apache\htdocs\kings\memory.php on line 58

Warning: Supplied argument is not a valid MS SQL-Link resource in c:\apache\htdocs\kings\index.php on line 26



please.. anyone can help me?? cause there are 2 member that posting the same problem n i never see the answer in room .. thx
xmarv
You can open the MsSQL port in your router settings...
The uncustomized port is 1433 wink.gif

~edit~
Found another thing to fix if you are using a 5 slot charserver...
File: char_act.php

Search:
QUOTE

for ($i = 0; $i <= 2; $i++)
{
if ($i == $CharNum)
{
  $char_sel[$i] = "SELECTED";
}
else
{
  $char_sel[$i] = "";
}
}


Replace:
QUOTE

for ($i = 0; $i <= 4; $i++)
{
if ($i == $CharNum)
{
  $char_sel[$i] = "SELECTED";
}
else
{
  $char_sel[$i] = "";
}
}



Then:

Search:
QUOTE

<option value=\"0\" $char_sel[0]>Slot 1
<option value=\"1\" $char_sel[1]>Slot 2
<option value=\"2\" $char_sel[2]>Slot 3


Replace:
QUOTE

<option value=\"0\" $char_sel[0]>Slot 1
<option value=\"1\" $char_sel[1]>Slot 2
<option value=\"2\" $char_sel[2]>Slot 3
<option value=\"3\" $char_sel[3]>Slot 4
<option value=\"4\" $char_sel[4]>Slot 5
Veriad
QUOTE (echira @ Apr 13 2004, 10:14 PM)
as Serra posted in another section, even the difference between nonequippable items and equippable items are different. i believe storeItem works the same way.

Yes, there is a difference between equipment and non-equipment in the item table. However, it looks like Gravity stayed consistent with this item syntax, as the storeItem table works exactly the same as the item table. In fact, I could pretty much copy+paste the item section of char_act.php and add it to user_act.php. The only important change I made was the query:
Change:
QUOTE
$result = mssql_query("select * from item where GID=$GET_GID",$char_db);
to
QUOTE
$result = mssql_query("select * from storeitem where AID=$GET_AID",$char_db);
The rest is just copying and pasting, and adding something to the drop-down boxes to access that.

To answer another question, you said that you wanted to highlight things in the item log that happened in the last 1 minute, 10 minute, and hour. This can be easily done with the MSSQL "datediff" function. I looked in view_itemlogs.php for the query you used in the "View Current Logs" section. It was this:
QUOTE
$result = @mssql_query("SELECT TOP $rspp * FROM (SELECT TOP $offset * FROM itemLog ORDER BY [index] DESC) Subquery ORDER BY [index] DESC",$itemlog_db);
To add a little part for the elapsed time, I did this:
QUOTE
$result = @mssql_query("SELECT TOP $rspp *, datediff(minute,logtime,getdate()) as elapsed FROM (SELECT TOP $offset * FROM itemLog ORDER BY [index] DESC) Subquery ORDER BY [index] DESC",$itemlog_db);
That datediff function will return the time difference between the time in the log, and the current time, in an amount of minutes. Notice that I named the column "elapsed," so you could use:
QUOTE
$elapsed = $result_array['elapsed'];
Now that it has the elapsed time, you could use some simple if-statements to change the colors:
QUOTE
$color="#b6b6b6";
if ($elapsed <= 60) $color="#bdbdd6";
if ($elapsed <= 10) $color="#c6c6d6";
if ($elapsed <= 1) $color="#ececff";
Then, change the lines where it prints the table to use "$color" for the bgcolor instead of "#b6b6b6".
echira
the bit about storage i still believe is incorrect. i have a fully written storage script that i'm showing you and it does not display all items correctly.

thanks for the highlighting help heh.
a3world
Can anyone help me setup via msn or maybe even do by vnc?
Senku
Edit i was able to connect but now i get these errors




Warning: mssql_connect(): Unable to connect to server: server1 in W:\www\memory.php on line 58

Warning: mssql_query(): supplied argument is not a valid MS SQL-Link resource in W:\www\memory.php on line 46

Warning: mssql_fetch_array(): supplied argument is not a valid MS SQL-result resource in W:\www\memory.php on line 48
echira
QUOTE (Senku @ Apr 18 2004, 01:27 AM)
Edit i was able to connect but now i get these errors




Warning: mssql_connect(): Unable to connect to server: server1 in W:\www\memory.php on line 58

Warning: mssql_query(): supplied argument is not a valid MS SQL-Link resource in W:\www\memory.php on line 46

Warning: mssql_fetch_array(): supplied argument is not a valid MS SQL-result resource in W:\www\memory.php on line 48

are you using the default configuration of ACP?

also, make sure you're connecting to the correct DSN for your database. it seems these errors are being generated due to the fact it cannot communicate correctly with your DSN. make sure your configation files are correct for your system.
Veriad
QUOTE (echira @ Apr 17 2004, 07:40 PM)
the bit about storage i still believe is incorrect. i have a fully written storage script that i'm showing you and it does not display all items correctly.

I figured out that the problem was caused by PHP and MSSQL. When you run a query through PHP, only the first 255 bytes of a column are returned. Because storage has so many items, 255 bytes could not nearly be enough. To fix this, I made it run multiple queries, taking 255 bytes at a time. Here's how... If you did what I said in my previous post, you'll have an almost-working-storage viewer. To fix it, change this:
QUOTE
$result = mssql_query("select * from storeitem where AID=$GET_AID",$char_db);
while ($result_array = mssql_fetch_array($result))
{
$item_data = bin2hex($result_array['storedItem']);
}
to this:
QUOTE
$lresult= mssql_query("select len(storedItem) as length from storeitem",$char_db);
$lresult_array = mssql_fetch_array($lresult);
$length = $lresult_array['length'];
$qLength = floor($length/255) + (($length % 255) ? 1 : 0);
for($i=0;$i<$qLength;$i++) {
$result = mssql_query("select AID,substring(storedItem,$i*255+1,255) as storedItem from storeitem where AID=$GET_AID",$char_db);
while($result_array = mssql_fetch_array($result))
{
  $item_data .= bin2hex($result_array['storedItem']);
}
}

The same problem could occur with normal item viewing, so you might wanna make a similar change to that.
echira
you're my hero
serra
I haven't run in this problem, yet. It may be because of my setup, duno. Using apache 2.0.49, mod_php 4.3.6 on leenux. Could be something to do with the mssql_* functions, pear:biggrin.gifb seems to be working alright though. I put 80something daggers and a few other items on one of my characters and my parser picked up everything, to my knowledge. 38 bits per dagger * 80 daggers / 8 bits per byte = 380 bytes. My only gurdge is that at least 100 queries were made coz of all the items I had >.<
echira
lol, but to put in comparison, how many people are browsing storage? 1-2 at a time Max? i dont mind all the queries.
Silent Crusade
Can someone help me with this error please ohmy.gif



Fatal error: Call to undefined function: file_get_contents() in c:\program files\easyphp\www\char\memory.php on line 86




btw i only get this error when i click on the ladder sleep.gif
shiver
Same error here... Mayby its the version of PHP that is supported by the webserver. Im using EasyPHP 1.6
Silent Crusade
QUOTE (shiver @ Apr 25 2004, 12:54 PM)
Same error here... Mayby its the version of PHP that is supported by the webserver. Im using EasyPHP 1.6

im using same exact one ohmy.gif
serra
@Silent Crusade & shiver

The file_get_contents() function was added in php 4.3.0. If you upgrade to EasyPHP 1.7 or maybe go to SourceForge and look for Triad or FoxServ.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.