Hey guys, just recently came back to Rune-Server and I saw how badly my other tutorial was:
http://www.rune-server.org/runescape...on-system.html.
Well it wasn't that bad, the links were dead and I had a different system back then. I had another system that is far more effecient and I've decided to share it today with you.
Tested Sources - SoulSplit
Difficulty - 3/10
Base - PI
Revision - 317
Programs needed - Xampp, install the service MySql and Apache in Xampp
Files Modified - Client.java, sql.java
Description: This is a MySql script that will check to see if the user is has donated and purchased an item on the website. Then send it will check with the website to make sure the player actually purchased the item.
~ Starting ~
First Download
Xampp,
Sql.java,
Paypal.zip, and
Sql Table file.
Next install it and install the services: MySql and Apache.
Now go to into the server folder and go to src > server > util > and put the sql.java file inside there. Please change the settings that correspond to yours. [Defualt is root for username and nothing for the pass]
Next go to src > server > model > players > Client.java and add this at the top:
Code:
import server.util.SQL;
Now search for the logout method and below:
PlayerSave.saveGame(this);
Add this:
Code:
SQL.createConnection();
SQL.checkStatus(this);
SQL.destroyConnection();
Now open Xampp and start Apache then MySql.
Then click Admin for MySql. Now login and create a Database called "status"
Then click import and import the sql table.sql file.
Now you're server should be set up correctly. Any errors or bugs/glitches please tell me.
~~~~~~~~~~~~~~~~~~~~~~ IPN, PART 2 ~~~~~~~~~~~~~~~~~~~~~~
Now extract paypal.zip to your desktop.
Open up paypal.htm, and read the thing next to the <!-- ending with -->
You can change the prices to anything you want. If you want to add another item, look under:
<option value="20.00">20 USD</option> <!-- USD Amount for Item 3 -->
And add:
<option value="10.00">10 USD</option> <!-- USD Amount for Item 4 -->
But make sure if you add another option you open up ipn.php in the ipn folder.
Now look for:
$paylist = array("5.00" => itemId1, "10.00" => itemId2, "20.00" => itemId3);
Basically, when you pay using the first option (which is $5 USD), you will recieve the item id that is for itemId1. So lets say a dragon longsword was id 5877, for itemId1, you would replace that with 5877. Now when someone purchases using the first option, they would be paying $5 for a dragon longsword.
If you want to add another option (4th option or more), replace this:
$paylist = array("5.00" => itemId1, "10.00" => itemId2, "20.00" => itemId3);
With:
$paylist = array("5.00" => itemId1, "10.00" => itemId2, "20.00" => itemId3, "10.00" => itemId4);
Also make sure you edit ipn.php and paypal.htm and replace:
[email protected], with your email.
And make sure that you edit your MySql details (username, password, table name, port).
If you need anything, quote me, PM me, or add my msn and post a comment when you add me.
Msn:
[email protected]
~~~~~~~~~~~~~ Getting Paypal Setup with IPN Functions ~~~~~~~~~~~~~
Follow these pictures:
http://i56.tinypic.com/30vmxp2.png
http://i54.tinypic.com/2retjrk.png
http://i55.tinypic.com/1zjdya.png
Make sure the IPN link is in this format:
http://yoursite.com/paypal/ipn/ipn.php
It must have ipn.php at the end of the link.
If you think I'm missing something, I haven't explained enough detail in a specific section, or you need help, please tell me.
Thanks and nominate this post if you think it should be stickied (if Rune-Server allows this).