without rebuilding the java classes you have a large amount of traffic and power consumption
i.e. rolebean class
you need to rebuild this class in php, so that java fetch a rolebean and return a rolebean in a single step, otherwise you have to call a function everytime you need a member of this class (and the RoleBean have a lot members)...
Pseudocode pwapi.php
Code:
session_start();
class PW
{
public function Login($java_password)
{
// GET request to login.jsp api file
// java check for $java_password
// if password check success, java (register and) returns a session_key
... // get the session_key here by scanning through jsp result
// php registers the $session_key
$_SESSION['key'] = $session_key;
}
public function Logout()
{
// GET request to logout.jsp api file
... // clear session key in java
// clear the session_key in php
unset($_SESSION['key']);
}
public function GetRoleBean($char_id, $session_key)
{
$role_bean = new RoleBean();
// GET request to get_rolebean.jsp api file
... // fill the RoleBean here by scanning through jsp result
// return the fetched RoleBean object
return($role_bean);
}
public function SetRoleBean($char_id, $role_bean, $session_key)
{
$status = "ERROR";
// GET request $role_bean to set_rolebean.jsp api file
... // get the status by scanning through jsp result
// return "OK" if saving role_bean successed
return($status);
}
}
class RoleBean
{
public $Level;
public $Name;
public $Spouse;
public $HP;
public $Mana;
...
}
// somewhere later in our code we can acquire a role bean...
// user login in
PW::Login("password");
$role_bean = PW::GetRoleBean(32, $_SESSION['key']);
... // do some more stuff
// user ends session by logout
PW::Logout();
other required classes are roleinventory, roleitem, ...