php script

Results 1 to 6 of 6
  1. #1
    Enthusiast shockwav3 is offline
    MemberRank
    Dec 2008 Join Date
    29Posts

    php script

    is it possible to get and edit the value of gold on a certain role via php scripts?


  2. #2

    Re: php script

    gold=(ingame coin) or Gold=((CUBI(ZEN))???

  3. #3
    Love MMORPG!! asreinna is offline
    MemberRank
    Sep 2008 Join Date
    AsiaLocation
    243Posts

    Re: php script

    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...

  4. #4
    Enthusiast shockwav3 is offline
    MemberRank
    Dec 2008 Join Date
    29Posts

    Re: php script

    @pastime4u gold in game

    @asreinna what i mean is edit a gold from a role(player/char) via a php script.

  5. #5
    Account Upgraded | Title Enabled! ronny1982 is offline
    MemberRank
    Jan 2010 Join Date
    744Posts

    Re: 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
    Code:
    <?
    	$message = urlencode("Hello World");
    	$handle = fopen("http://localhost:8080/broadcast.jsp?message=$message", "r");
    	while($line = fgets($handle))
    	{
    		echo($line);
    		echo ("<br>");
    	}
    	fclose($handle);
    ?>
    broadcast.jsp
    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>");
    		}
    	}
    %>
    Implement a security mechanism, or everyone can call the jsp with get command!

    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...
    Last edited by ronny1982; 17-08-10 at 05:52 PM.

  6. #6
    Enthusiast shockwav3 is offline
    MemberRank
    Dec 2008 Join Date
    29Posts

    Re: php script

    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
    Last edited by shockwav3; 18-08-10 at 08:59 AM.



Advertisement