Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
For what purpose doing shell_exec? Php shell_exec as user account is ok but with nobody? Yes that is a joke. Running pw engine uses many resources and fastest way is using root account but as what i said before that you don't have to be root to run root's command you can do that with sudo.
*Need info*
- how to get the 1st roleid on account (normally 32 is role 1024-(1024+15) but what happen if we talk about a new user 288 and we deleted before out 2 highest user id 288 and 304 so here the the theory not work about roleid = (user id - 16 + 1024)
*if i can figure out this then can make work the xml editing plugin by ColdShot
[COLOR="#0000FF"]<form [/COLOR][COLOR="#FF8C00"]name[/COLOR]=[COLOR="#4B0082"]"changechar"[/COLOR] [COLOR="#FF8C00"]method[/COLOR]=[COLOR="#4B0082"]"post"[/COLOR] [COLOR="#FF8C00"]action[/COLOR]=[COLOR="#4B0082"]"index.jsp?page=role&show=details&type=id"[/COLOR][COLOR="#0000FF"]>[/COLOR]
[COLOR="#0000FF"]<select[/COLOR] [COLOR="#FF8C00"]name[/COLOR]=[COLOR="#4B0082"]"ident"[/COLOR] [COLOR="#FF8C00"]onchange[/COLOR]=[COLOR="#4B0082"]"document['changechar'].submit();"[/COLOR][COLOR="#0000FF"]>[/COLOR]
<[COLOR="#FFFF00"]%[/COLOR]
[COLOR="#006400"] // where account id is ofc the id you want it to be, for this example: 1024[/COLOR]
[COLOR="#0000CD"]int [/COLOR]account = 1024;
[COLOR="#006400"]// get rolevector from GameDB[/COLOR]
[COLOR="#008000"]DataVector[/COLOR] dv = [COLOR="#008000"]GameDB[/COLOR].getRolelist(uid);
[COLOR="#006400"]// if dv is NULL, account has no characters[/COLOR]
[COLOR="#0000CD"]if[/COLOR](dv != [COLOR="#0000CD"]null[/COLOR])
{
[COLOR="#008000"]Iterator [/COLOR]itr = dv.iterator();
[COLOR="#0000CD"]while[/COLOR](itr.hasNext())
{
[COLOR="#008000"]IntOctets[/COLOR] ios = ([COLOR="#008000"]IntOctets[/COLOR])itr.next();
[COLOR="#0000CD"]int [/COLOR]roleid = ios.m_int;
[COLOR="#0000CD"]String [/COLOR]rolename = ios.m_octets.getString();
[COLOR="#FFFF00"]%[/COLOR]>
[COLOR="#0000FF"]<option[/COLOR] [COLOR="#FF8C00"]value[/COLOR]=[COLOR="#4B0082"]"[/COLOR]<[COLOR="#FFFF00"]%[/COLOR]=roleid[COLOR="#FFFF00"]%[/COLOR]>[COLOR="#4B0082"]"[/COLOR][COLOR="#0000FF"]>[/COLOR]<[COLOR="#FFFF00"]%[/COLOR]=rolename[COLOR="#FFFF00"]%[/COLOR]>[COLOR="#0000FF"]</option>[/COLOR]
<[COLOR="#FFFF00"]%[/COLOR]
}
}
[COLOR="#FFFF00"]%[/COLOR]>
[COLOR="#0000FF"]</select>[/COLOR]
[COLOR="#0000FF"]</form>[/COLOR]
You don't calculate it. You send a RPC request to GameDB (rpc being: [GetUserRoles], see the config.xml in iweb for its structure)
Basically: you send a request with an account id and it returns a ArrayList with role Octets (SimpleRoleBean)
From there you just take the first item out of the array and there is your character on a user account.
I believe it was something like this
Code:[COLOR="#0000FF"]<form [/COLOR][COLOR="#FF8C00"]name[/COLOR]=[COLOR="#4B0082"]"changechar"[/COLOR] [COLOR="#FF8C00"]method[/COLOR]=[COLOR="#4B0082"]"post"[/COLOR] [COLOR="#FF8C00"]action[/COLOR]=[COLOR="#4B0082"]"index.jsp?page=role&show=details&type=id"[/COLOR][COLOR="#0000FF"]>[/COLOR] [COLOR="#0000FF"]<select[/COLOR] [COLOR="#FF8C00"]name[/COLOR]=[COLOR="#4B0082"]"ident"[/COLOR] [COLOR="#FF8C00"]onchange[/COLOR]=[COLOR="#4B0082"]"document['changechar'].submit();"[/COLOR][COLOR="#0000FF"]>[/COLOR] <[COLOR="#FFFF00"]%[/COLOR] [COLOR="#006400"] // where account id is ofc the id you want it to be, for this example: 1024[/COLOR] [COLOR="#0000CD"]int [/COLOR]account = 1024; [COLOR="#006400"]// get rolevector from GameDB[/COLOR] [COLOR="#008000"]DataVector[/COLOR] dv = [COLOR="#008000"]GameDB[/COLOR].getRolelist(uid); [COLOR="#006400"]// if dv is NULL, account has no characters[/COLOR] [COLOR="#0000CD"]if[/COLOR](dv != [COLOR="#0000CD"]null[/COLOR]) { [COLOR="#008000"]Iterator [/COLOR]itr = dv.iterator(); [COLOR="#0000CD"]while[/COLOR](itr.hasNext()) { [COLOR="#008000"]IntOctets[/COLOR] ios = ([COLOR="#008000"]IntOctets[/COLOR])itr.next(); [COLOR="#0000CD"]int [/COLOR]roleid = ios.m_int; [COLOR="#0000CD"]String [/COLOR]rolename = ios.m_octets.getString(); [COLOR="#FFFF00"]%[/COLOR]> [COLOR="#0000FF"]<option[/COLOR] [COLOR="#FF8C00"]value[/COLOR]=[COLOR="#4B0082"]"[/COLOR]<[COLOR="#FFFF00"]%[/COLOR]=roleid[COLOR="#FFFF00"]%[/COLOR]>[COLOR="#4B0082"]"[/COLOR][COLOR="#0000FF"]>[/COLOR]<[COLOR="#FFFF00"]%[/COLOR]=rolename[COLOR="#FFFF00"]%[/COLOR]>[COLOR="#0000FF"]</option>[/COLOR] <[COLOR="#FFFF00"]%[/COLOR] } } [COLOR="#FFFF00"]%[/COLOR]> [COLOR="#0000FF"]</select>[/COLOR] [COLOR="#0000FF"]</form>[/COLOR]
Thats how it worked in iWeb anyway. pretty simple principle
Edit: note, this was to populate the dropdown on the role editor.
/*
* Gunse's Code 2006-2017
* shared with GPL v3 License
*/
class user_data {
var $u_id;
public function __construct ($uid) {
return $this->u_id = $uid;
}
protected function roleid2data($rid) {
$SendEngine = "10.11.17.1"; // ip of iweb service
$SendPort = "8091"; // port of iweb serbvice
$temp_dir = "/opt/www/pwweb2/wp-content/temp/"; // wordpress access folder with www-data privileges i'm using nginx web service
$sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
if(!$sock) {
die(socket_strerror(socket_last_error()));
}
if(@socket_connect($sock, $SendEngine, $SendPort)) {
/* sending request data to java */
$ch = curl_init(); // this is curl function from php-curl
$fp = @fopen($temp_dir."rid2data-".$rid,"w");
$request_user_data = "http://10.11.17.1:8091/iweb/sendmail/roleparam.jsp?roleid=$rid"; // this is url path of iweb function the sendmail folder and its jsp are my custom made but actually they built based on common iweb function itself
curl_setopt($ch, CURLOPT_URL, $request_user_data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
@curl_setopt($ch, CURLOPT_FILE, $fp);
curl_exec($ch);
curl_close($ch);
@fclose($fp);
include $temp_dir."rid2data-".$rid;
$data = array($race,$rep,$zone,$cash);
}
unlink($temp_dir."rid2data-".$rid);
return $data;
}
public function data_gen () {
$SendEngine = "10.11.17.1";
$SendPort = "8091";
$temp_dir = "/opt/www/web/wp-content/temp/";
$sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
if(!$sock) {
die(socket_strerror(socket_last_error()));
}
if(@socket_connect($sock, $SendEngine, $SendPort)) {
$ch = curl_init();
$fp = @fopen($temp_dir."uid2rid-".$this->u_id,"w");
$request_userid_data = "http://10.11.17.1:8091/iweb/sendmail/rolelist.jsp?biao=1&userid=$this->u_id";
curl_setopt($ch, CURLOPT_URL, $request_userid_data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
@curl_setopt($ch, CURLOPT_FILE, $fp);
@curl_setopt($ch, CURLOPT_FILE, $fp);
curl_exec($ch);
curl_close($ch);
@fclose($fp);
include $temp_dir."uid2rid-".$this->u_id;
if ($rolelist > 0) {
$i=0;
while ($i < $rolelist) {
$sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
if(!$sock) {
die(socket_strerror(socket_last_error()));
}
if(@socket_connect($sock, $SendEngine, $SendPort)) {
$rid = ${'roleid'.$i};
$ch = curl_init();
$fp = @fopen($temp_dir."rolelogstatus-".$rid,"w");
$request_roleid_data = "http://10.11.17.1:8091/iweb/sendmail/rolelogstatus.jsp?roleid=$rid";
curl_setopt($ch, CURLOPT_URL, $request_roleid_data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
@curl_setopt($ch, CURLOPT_FILE, $fp);
curl_exec($ch);
curl_close($ch);
@fclose($fp);
include $temp_dir."rolelogstatus-".$rid;
if ($role_status == 5) { // --- 0 = offline, 5 = online --- //
$online_roleid = ${'roleid'.$i};
$online_rolename = ${'rolename'.$i};
$online_rolelevel = ${'level'.$i};
$charname = $online_rolename;
$charlevel = $online_rolelevel;
$charrole = $online_roleid;
$rolerace = $this->roleid2data($charrole);
$rolerace = $rolerace[0];
$rolerep = $this->roleid2data($charrole);
$rolerep = $rolerep[1];
$rolezone = $this->roleid2data($charrole);
$id_data = $this->roleid2data($charrole);
$res = array($charname, $charlevel, $charrole, $rolerace, $rolerep, $rolezone, $id_data);
return $res;
}
unlink($temp_dir."rolelogstatus-".$rid);
}
$i++;
}
}
unlink($temp_dir."uid2rid-".$this->u_id);
}
}
};
$winner_uid = new user_data ($uid); // result is array of [$charname, $charlevel, $charrole, $rolerace, $rolerep, $rolezone, $id_data]
$charrole = $winner_uid->data_gen()[2];
$charname = $winner_uid->data_gen()[0];
<?php
$time_created=<%=role.base.create_time%>;
$cash=<%=role.user.cash_add%>;
$red_time=<%=role.status.invader_time%>;
$pink_time=<%=role.status.pariah_time%>;
$red_status=<%=role.status.invader_state%>;
$race=<%=role.base.cls%>;
$rep=<%=role.status.reputation%>;
$lvl=<%=role.status.level%>;
$exp=<%=role.status.exp%>;
$sp=<%=role.status.sp%>;
$coin=<%=role.pocket.money%>;
$zone=<%=role.status.worldtag%>;
$posx=<%=(int)role.status.posx%>;
$posy=<%=(int)role.status.posy%>;
$posz=<%=(int)role.status.posz%>;
?>
<?php
$role_id=<%=roleid%>;
$role_status=<%=flag%>;
?>
i would be glad if you tell how to work around this only from php (so able to use or sudo commands in php or different user than nobody with php)
downloadable web
To view the content, you need to sign in or register
and video
Working:
- easy web setup wizard
- account stuff like registration/login
- user panel where can edit your user data, user search (ex. after username, truename, email, ip, gm rank,online etc)
- shouting in game chat via web
- user panel for admin (delete incative users by 1 click), adding gold who was online in last x day or atm online, change users data etc
- vote system (optional Web point or direct ingame gold), web point exchangeable and rate is what you setting up, example 100 point 1 gold, vote system configurable (vote interval, reward etc) not abuseable from a single account (checking user last vote dates before add gold or point)
*Need info*
- how can i make a proper start up, if i can figure out i can do .sh or direct start up
- how to get the 1st roleid on account (normally 32 is role 1024-(1024+15) but what happen if we talk about a new user 288 and we deleted before out 2 highest user id 288 and 304 so here the the theory not work about roleid = (user id - 16 + 1024)
*if i can figure out this then can make work the xml editing plugin by ColdShot
gunse GiantAxe meant that you can rewrite entire iweb from Java to PHP basing on same principles (RPC and config.xml file). It's actually way nicer way than wgetting Java scripts with PHP.
http://forum.ragezone.com/f752/pxweb-986763/
Why should rewrite? There is a shortcut method rather than reinventing the wheel? At the end choose your method that you like, isn't it?gunse GiantAxe meant that you can rewrite entire iweb from Java to PHP basing on same principles (RPC and config.xml file). It's actually way nicer way than wgetting Java scripts with PHP.
http://forum.ragezone.com/f752/pxweb-986763/
This is what i mean i don't have to bother "rewrite" that already exist, it is not difficult for you... Others? We don't know... I wrote small class and add small thing and well doneThat's what i ment yes.
Or, option B is to decompile iweb to java source files and just fix up the java iweb.
(Which really isn't that difficult tbh)
BTW, is there anyone rewrite iweb/pwadmin withTo view the content, you need to sign in or register
Well, that's a ton thing todoI take it thats to parse a role.xml?
If so, you will have to create classes for all the partial models that the xml is made out of.
GRoleInventory, GRoleBase, GRoleStatus, etc. to properly parse it.
Which again...involves decompiling the Java Iweb to get all the classes for it.
Actually, you can get the structures from the iweb config.xml.
We can't force you to do anything you don't want to. But really you should look into creating a PHP Socket Client and just call the rpc's yourself.
(If you were to do that you could do way more more stuff)
Although that said... there is a 3rd option you could try.
namely this (Thanks Google)To view the content, you need to sign in or register
Add that to Iweb (nothing more then adding the .jar file in the lib folder)
Create a new jsp page and make that page call the GameDB.get() function. this gives you a Java RoleBean
Then use the GSon plugin to convert the rolebean to JSON and make PHP call for the JSON page instead.
(JSON is far easier to parse then XML for instance)
see my example:To view the content, you need to sign in or register
That's just my 2 cents though.
Your apache have to be reverse proxy for php to be run, and your jsp have to be run by your tomcat.. You can meet them on approach that i already gave as an example.Noob question but If I have tomcat and separate appache the gamedb.js must be in tomcat folder if I want call it ,?
(Simple if I put both(PHP n JSP) in same www directory not worked
About nginx If I cannot make appache work then will try nginx, I hope it's easily portable like xampp
Its not trickable with disconnect disconnect from ISP and reconnect and automatically you have new IP?