![]() |
|
|
|
|
#1 |
|
Архивный участник
Join Date: Nov 2006
Posts: 11
|
anthder poblem is not support to Chinese
I dont konw anyabout php ....so i cannt modify about it any how it is very applied my english is very poor |
|
|
|
|
#2 |
|
Архивный участник
Join Date: Nov 2006
Posts: 15
|
is there a function such as ban user? I tested chatban is ok. but with 0 or 1 in punish option it does not work. also additem and delitem is not working.
|
|
|
|
|
#3 |
|
Архивный участник
Join Date: Nov 2006
Posts: 15
|
15. Getting char id by char name, directly from db. (tested)
16. Showing char invertory and warehouse by char id, directly from db. (tested) Those 2 when I click go they return with empty page, and it does not send message to cached.exe Any idea why? |
|
|
|
|
#4 | |
|
Архивный участник
Join Date: Nov 2005
Posts: 215
|
Quote:
15. - Return char_id by char name. 16. - Return items by char_id, that you got by 15. Maybe different ports ... check your *.ini files |
|
|
|
|
|
#5 | |
|
Архивный участник
Join Date: May 2005
Posts: 979
|
Quote:
If I chose function 16. it show me text from function 15 and when I chose function 15, I wrote charid 1 (its my character) then Go and nothing.. ----------------- its really broken, look: Code:
case 200:
$get_char_name=htmlspecialchars($_POST["param1"]);
if(strlen($get_char_name)<1){ ?>
<form method='post' action='cached.php'><b>Get char id by char name: </b>
<br><input type='text' name='param1'><br><input type='hidden' name='funcid' value='200'>
<br><input type='button' value='Go' onclick='doSpecialFunc()'></form><?php }
else{
$con_sql=mssql_connect($mssql_host,$mssql_user,$mssql_pass);
mssql_select_db($mssql_base,$con_sql);
$result=mssql_query("SELECT char_id FROM user_data WHERE char_name='$get_char_name'");
while($row=mssql_fetch_array($result)) echo($row["char_id"]);
mssql_close($con_sql);}
break;
case 201:
$get_char_id=htmlspecialchars($_POST["param1"]);
if(strlen($get_char_id)<1){ ?>
<form method='post' action='cached.php'><b>Get char id by char name: </b>
<br><input type='text' name='param1'><br><input type='hidden' name='funcid' value='201'>
<br><input type='button' value='Go' onclick='doSpecialFunc()'></form><?php }
else{
$con_sql=mssql_connect($mssql_host,$mssql_user,$mssql_pass);
mssql_select_db($mssql_base,$con_sql);
$result=mssql_query("SELECT item_id, item_type, amount, warehouse FROM user_item WHERE char_id='$get_char_id'");
while($row=mssql_fetch_array($result)){echo(ItemNameByItemId($row["item_type"])."(".$row["amount"].") --> warehouse: ".$row["warehouse"]." --> "."item uid: ".$row["item_id"]."<br>");}
mssql_close($con_sql);}
break;
|
|
|
|
|
|
#6 |
|
Архивный участник
Join Date: Nov 2006
Posts: 15
|
when I chose 16, it asked my the same option of 15. Strange...and when I input charname it shows a empty page... any idea what wrong with it?
|
|
|
|
|
#7 |
|
Архивный участник
Join Date: Nov 2005
Posts: 215
|
|
|
|
|
|
#8 |
|
Архивный участник
Join Date: Nov 2006
Posts: 15
|
also beside 2012 what other port it use? I don't see any other port should be open for it. You tested on single machine or 2 machines(cached is in a seperate machine)
|
|
|
|
|
#9 |
|
Архивный участник
Join Date: Feb 2006
Posts: 39
|
I can not make DelItem function work (13).
It returns 01 all the time. Does anybody succeded in using it? I'm using a little different code, but an original doesn't seems to work too. Code:
function ansi2unicode($string) {
$rs = ""; for($i = 0; $i < strlen($string); $i++) $rs .= $string[$i].chr(0);
return($rs.chr(0).chr(0));
}
function l2_cached_push($buf){
$cached_ip = "127.0.0.1";
$cached_port = "2012";
$fp = fsockopen($cached_ip, $cached_port, $errno, $errstr, 5); $rs = "";
if(!$fp)return 0;
else{
fwrite($fp, pack("s", (strlen($buf)+2)).$buf);
$len = unpack("v", fread($fp, 2)); $rid = unpack("c", fread($fp, 1));
for ($i = 0; $i < (($len[1]-4) / 4); $i++) { $read = unpack("i", fread($fp, 4)); $rs .= $read[1]; }
stream_set_timeout($fp, 2);
$answ=$rs;
fclose($fp);
return "$answ";
}
}
function l2_delItem ( $webadmin, $char_id, $warehouse, $item_id, $amount) {
$cached_op = pack("c", 13);
$cached_op .= pack("i", $char_id);
$cached_op .= pack("i", $warehouse);
$cached_op .= pack("i", $item_id);
$cached_op .= pack("i", $amount);
$cached_op .= ansi2unicode ( $webadmin );
$rs = l2_cached_push ($cached_op);
return ( $rs );
}
$changeacccost - some value like 10000. Code:
$answ = l2_delItem ( $_COOKIE['login'], $char_id, 0, $adena_id, $changeacccost); ![]() Function like Kick and MoveChar is working... But DeleteItem - does not
|
|
|
|
|
#10 |
|
Архивный участник
Join Date: Apr 2006
Posts: 120
|
I use DelItem2:
Code:
function l2_delitem2 ( $item_id, $amount ) {
// 54 - DelItem2, char_id, item_id
$cached_op = pack ( "cVVV", 54, $item_id, $amount, 1 );
$cached_op .= ansi2unicode ( "webadmin" );
$ret_string = l2_cached_push ( pack ( "s", strlen ( $cached_op ) + 2 ) . $cached_op );
return ( $ret_string );
}
|
|
|
|
|
#11 | |
|
Архивный участник
Join Date: Feb 2006
Posts: 39
|
Quote:
|
|
|
|
|
|
#12 |
|
Архивный участник
Join Date: Apr 2006
Posts: 120
|
I do not know, but without this it won't work.
|
|
|
|
|
#13 |
|
Архивный участник
Join Date: Jun 2006
Posts: 111
|
Suggestion: Quick Item Addition, Drop down menu for S grade A grade ect, it will not be to hard.
|
|
|
|
|
#14 |
|
Архивный участник
Join Date: Dec 2006
Posts: 5
|
I got this error while trying to edit new item:
I changed Cached to 2006 Port ( As it came from Rz ) Warning: unpack(): Type v: not enough input, need 2, have 0 in c:\appserv\www\functions.php on line 108 Warning: unpack(): Type c: not enough input, need 1, have 0 in c:\appserv\www\functions.php on line 108 Kicked: Warning: unpack(): Type v: not enough input, need 2, have 0 in c:\appserv\www\functions.php on line 98 Warning: unpack(): Type c: not enough input, need 1, have 0 in c:\appserv\www\functions.php on line 98 Item added: |
|
|
|
|
#15 |
|
Архивный участник
Join Date: Jun 2006
Posts: 163
|
me 2!.........
|
|
|
|
|
#16 |
|
Архивный участник
Join Date: Jul 2006
Posts: 81
|
Hel
if you make another version this one is kinda useful displays all the chars from an account by entering the account name Code:
<option value=203>--Get char name from an account--</option> Code:
case 203:
$get_account_name=htmlspecialchars($_POST["param1"]);
if(strlen($get_account_name)<1){ ?>
<form method='post' action='cached.php'><b>Get char on an account: </b>
<br>Enter account name:<input type='text' name='param1'><br><input type='hidden' name='funcid' value='203'>
<br><input type='button' value='Go' onclick='doSpecialFunc()'></form><?php }
else{
$con_sql=mssql_connect($mssql_host,$mssql_user,$mssql_pass);
mssql_select_db($mssql_base,$con_sql);
$result=mssql_query("SELECT char_name FROM user_data WHERE account_name='$get_account_name'");
while($row=mssql_fetch_array($result)) { print "$row[0]<br> $row[99]";
}
mssql_close($con_sql);}
break;
|
|
|
|
|
#17 |
|
Архивный участник
Join Date: May 2005
Posts: 979
|
I think someone simply dont make it 100% done..
because there is <br><input type='button' value='Go' onclick='doSpecialFunc()'> Instead onclick=AnyRealFunction.. |
|
|
|
|
#18 |
|
Архивный участник
Join Date: May 2005
Posts: 979
|
hmm I dont know php too much, so I changed it alittle bit..
simply I changed it to normal form where u insert name of player and it will forward to another my php code where it will change to ID ;] (I dont know code too much so I dont know how to merge it :-DD ) Code:
case 200:
$get_char_id=htmlspecialchars($_POST["param1"]);
if(strlen($get_char_id)<1){ ?>
<form method='get' action='charid.php?char='><b>Get char id by char name: </b>
<br><input name='char' size='10' value=''>
<br><input type='submit' value='odeslat'></form><?php }
break;
charid.php Code:
<?php
include("config.php");
echo "<html><head></head>
<style type=text/css>
A:link {
COLOR: #dd6900;
}
A:visited {
COLOR: #dd6900;
}
A:hover {
COLOR: #dd6900;
}
A:active {
COLOR: #dd6900;
}
body, html { font-size: 5px; background-color: black; margin: 0px; margin-top: 5px; margin-bottom: 5px; color: #dd6900; }
td { margin: 0px; padding: 0px; font-size: 14px; font-family: Tahoma, Verdana, Arial; color: #dd6900; }
.tbl_mainpage { width: 700px; margin: auto; border: 0px #5b5b5b solid; background-color: black; color: #dd6900; }
.tbl_title { height: 40px; font-size: 20px; text-align: center; vertical-align: middle; }
.tbl_time { text-align: center; height: 20px; border-bottom: 1px #dd6900 solid; color: ##dd6900; }
.tbl_head { border-bottom: 1px black solid; }
.tbl_female { background-color: #660000; clear: both;}
.tbl_male { background-color: #000000; clear: both; }
.tbl_charord { width: 30px; text-align: center; border-right: 1px #dd6900 solid; }
.tbl_charname { width: 300px; text-align: center; border-right: 1px #dd6900 solid; border-left: 1px #dd6900 solid;}
.tbl_charclass { width: 100px; text-align: center; border-right: 1px #dd6900 solid; }
.tbl_charlevel { width: 30px; text-align: center; border-right: 1px #dd6900 solid; }
</style>
<table class=tbl_mainpage cellspacing=0 cellpadding=0 align=center>
<tr>
<td class=tbl_charclass tbl_head><b>Char Name</b></td>
<td class=tbl_charclass tbl_head><b>Char ID</b></td>
</tr>";
mssql_select_db("lin2world");
$mssql["result"] = mssql_query("declare @char int; set @char = (select char_id from lin2world..user_data where char_name = '$_GET[char]'); select char_id, char_name from user_data where char_id = @char");
$i = 0;
while($mssql["entry"] = mssql_fetch_array($mssql["result"])) {
$i++;
echo "
<td class=tbl_charclass>".$mssql[entry][char_name]."</center></td>
<td class=tbl_charclass>".$mssql[entry][char_id]."</center></td>
</tr></table></body></html>"; }
?>
config.php Code:
<?php
header("Expires: ". gmdate("D, d M Y H:i:s")." GMT");
$mssql["server"] = "hyperjadro";
$mssql["user"] = "";
$mssql["password"] = "";
$mssql["database"] = "lin2db";
$mssql["die"] = "Error in connection to MS SQL";
mssql_connect($mssql["server"], $mssql["user"], $mssql["password"]); // or die($mssql["die"])
mssql_select_db($mssql["database"]);
?>
|
|
|
|
|
#19 |
|
Архивный участник
Join Date: Aug 2005
Posts: 23
|
Here is my little CP Demo. If you have enough PHP programming skills, possably some C, C++ or C#, you can create a complete and automated system to manage your L2 Server.
For example, the best practice is create one class to connect with the CacheD Server, and use this class to execute any operation on it, of course you will add some logs to those operations, because you are a professional Developer (aren't you?). If you are not a professional programmer, then you should look for one, learn to code in PHP or some other language or possibly try to buy some code. Here is the Login form: ![]() Main Administrator Control Panel Page (HGM has another interface, same thing for GMs, the system recognizes different types of Builders). ![]() The Administrator Accounts Manager ![]() Add Item to Char (Recognice the characters name instead the Char ID) ![]() Continue in next Post |
|
|
|
|
#20 |
|
Архивный участник
Join Date: Aug 2005
Posts: 23
|
Add Item to Char Step 2
![]() Add Item Results ![]() Delete Item from Character (Char Name again) ![]() Delete Item results ![]() Our CP allows many more actions, like Look-up all characters connected from the same IP, all accounts with same IP, Pledge Management, Donations management allowing add or del (or both) items to any char with only one click. Our code is strongly Object Oriented so add plenty of security on sessions and SQL Injection. You can do all you want if you know how to do it, all the Packets functions work, except some ones that crash the CacheD due a Buffer Overflow on cached Administrative socket. Greetings. |
|
|
|
|
#21 |
|
Архивный участник
Join Date: Jun 2006
Posts: 163
|
Why dont u share your CP :P
|
|
|
|
|
#22 |
|
Архивный участник
Join Date: Aug 2005
Posts: 23
|
Cause is completely integrated into our Forum-Game-Main Page system, we use external C++ Applications to automate some managament at server so this work was really hard to separate one piece and share it.
Anyway I can give you some explanations about some good PHP coding practices, like use Objects to store RQUEST variables and prevent any type of SQL Injection. www.php.net/manual/en <--------- Your best friend. |
|
|
|
|
#23 |
|
Архивный участник
Join Date: Apr 2006
Posts: 729
|
Sorry, but my project is closed. I was left community 3 months ago.
Wish to all get full off c5 server and be happy.
|
|
|
|
|
#24 |
|
Архивный участник
Join Date: Oct 2006
Posts: 2
|
hmm, i cant download attach file
|
|
|
|
|
#25 |
|
Архивный участник
Join Date: Jul 2006
Posts: 77
|
Thanks alot going to install it now
|
|
|
|
|