is it possible to get and edit the value of gold on a certain role via php scripts?
Printable View
is it possible to get and edit the value of gold on a certain role via php scripts?
gold=(ingame coin) or Gold=((CUBI(ZEN))???
i think not yet exist a php script to edit value of the gold...and i not really understand y u want to edit the value of the gold...
@pastime4u gold in game
@asreinna what i mean is edit a gold from a role(player/char) via a php script.
yes it is possible, you can create a php wrapper that interacts with jsp. I recommend a http-request wrapper:
- your php script opens a stream to a iWeb jsp file with content sending by http-get
- the jsp fetch the get variable(s), do some action with this and then print something out to the stream
- php reads from the stream and interpret the output produced by jsp
Example Broadcast Wrapper:
broadcast.php
broadcast.jspCode:<?
$message = urlencode("Hello World");
$handle = fopen("http://localhost:8080/broadcast.jsp?message=$message", "r");
while($line = fgets($handle))
{
echo($line);
echo ("<br>");
}
fclose($handle);
?>
Implement a security mechanism, or everyone can call the jsp with get command!Code:<%@page import="java.io.*"%>
<%@page import="java.util.*"%>
<%
if(request.getParameter("message") != null)
{
String broadcast = request.getParameter("message");
if(protocol.DeliveryDB.broadcast((byte)9, -1, broadcast))
{
out.println("<font color=\"#00cc00\"><b>Message Send</b></font>");
}
else
{
out.println("<font color=\"#ee0000\"><b>Sending Message Failed</b></font>");
}
}
%>
If you're confirm with php, you can create a function i.e. broadcast($message) that executes the code above, doing this for multiple functions will give you a nice php API...
thanks about this ronny1982, i'll try to use this codes
thanks about the codes you gave last time about that broadcast, but there is one more question about how to get the current gold(ingame) from a character, im lil bit confuse and i didn't know where to trigger that gold from DB. its like what you done you spwAdmin that it show the current storehousecoins. thanks in advance