Jump to content

Search the Community

Showing results for tags 'mysql'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • RuneLocus
    • News & Announcements
    • Information Booth
    • Website Support
    • Introductions
    • Chat
    • Forum Games
  • RuneScape Development
    • RSPS General
    • RuneScape Private Server (RS2)
    • RuneScape Private Server (503+)
    • RuneScape Private Server (EoC 742+)
  • Other
    • Digital Art
    • Gaming
    • Webdevelopment
    • Computers
  • Marketplace
    • RuneScape Market
    • RSPS Market
    • Others Market
    • Freelance Middleman Services
  • Super Secret Club's Topics

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



Found 90 results

  1. Hey, Well I have been working on this a couple of days now (though I could have got it completed in under a day, just y'know work, work more work @ real life...) I was going to work on making it full on SQL, but had decided to make it only store certain information with on the database, for if I did decide to store all on the database, it could cause strain on the database itself handling the requests. So we still use the character.TXT files for majority of the stuff. Any case, here is the results. 1. First off be sure you have the [URL="http://up.ht/1mmfHA9"]mysql JAR file[/URL], it is needed (stating the obvious), and an actual MySQL database server. 2. Be sure to include mysql.jar both in compiler and server runner BAT files (I won't go into detail about this, if you know what your doing then you should already understand. I won't do all the leg work ;) ) 3. Find [B]PlayerSave.java[/B] and remove it from the directory (We won't be needing it). 4. Download [URL="http://up.ht/1mmkrWs"]PlayerLoaderSQL.java[/URL], save file under server/util/sql (Create new folders if needed) 5. Next we need to remove the old variables for the old PlayerSave.java which is located within these files; Server.java Client.java PlayerHandler.java PlayerSaving.java RS2LoginProtocolDecoder.java ShutDownHook.java 6. Find on each of the files listed above [code] import server.model.players.PlayerSave; [/code] And replace with [code] import server.util.sql.PlayerLoaderSQL; [/code] 7. Find on all except RS2LoginProtocolDecoder.java: [code] PlayerSave.saveGame(c);[/code] And replace with [code] PlayerLoaderSQL.save_Player(c);[/code] 8. Now open RS2LoginProtocolDecoder.java Find: [code] load = PlayerSave.loadGame(cl, cl.playerName, cl.playerPass);[/code] And replace with [code] PlayerLoaderSQL.getConnection(); load = PlayerLoaderSQL.load_Player(cl, name, pass); PlayerLoaderSQL.destroyConnection(); [/code] 9. Download [URL="http://up.ht/1p4fNYJ"]this SQL file[/URL] and execute it on the database you have chosen. 10. Compile & Run 11. Login server offline notify (Optional) Underneath [B]PlayerLoaderSQL.load_Player(cl,name,pass)[/B] you will find something similar to this (or should find); [code] if (returnCode == 2) { switch (load) { case 3: returnCode = 3; cl.saveFile = false; break; default: for (int i = 0; i < cl.playerEquipment.length; i++) { if(cl.playerEquipment[i] == 0) { cl.playerEquipment[i] = -1; cl.playerEquipmentN[i] = 0; } } if (!PlayerHandler.newPlayerClient(cl)) { returnCode = 7; cl.saveFile = false; } else cl.saveFile = true; break; } } [/code] Underneath [B]case 3: [/B]add [code] case 8: returnCode = 8; cl.saveFile = false; break; [/code] This should return an error stating the login server is offline. [B]What's the benefit towards this?[/B] It will stop those who decide to spam log in on your server (at least to my knowledge correct me if I am wrong besides from sql injection), it will give you and your users more freedom on your website should they choose to register or not and being able to do more than with what most basic donation features are (donate, contact admin to receive donation in-game etc). [B]What's the down side towards this?[/B] Should your SQL database go down for what ever reason, no one won't be able to login, though there is a simple patch to this which I won't go into. Also, if your database isn't that secure enough (IE weak password to database) then you could be suseptible to those that could easily manipulate the database. [B]Required files in total;[/B] [URL="http://up.ht/1p4fNYJ"]SQL File [/URL][URL="http://up.ht/1mmkrWs"]PlayerLoaderSQL.java [/URL][URL="http://up.ht/1mmfHA9"]mysql JAR file[/URL][URL="http://up.ht/1p4fNYJ"] [/URL] Let me know if I missed anything :L half asleep been up for nearly 24 hours :x P.S. Hope I posted in the right area :L
  2. Hi all, I am having some trouble figuring out how to set up the game to write to a MySQL Database with the character information. Ideally I would like all the information that is saved in the character file under "data\characters" to be saved in a table that can then be called through php on my website. - This can be used as a modCP or just in a My Account section. I have set up highscores before through MySQL and understand it is the same kind of process but I just cannot figure it out. Would love if someone could help me, all advice is welcome Also, I have only mainly worked on a 317 server in the past, this is my first 718 server. - My source was Validus. If it is the same method as a 317 then I will follow a tutorial already online and make changes as I'm going through it. - It just seems to be a lot different in the way it is set up. Thanks! [attachment=34:charsig-1.png]
  3. Go ahead and delete this post if you want Mods, I solved the issue on my own. Had to do with my server.
  4. Can someone help me to connect to highscores and donations. Can someone help me? I pay 5 dollar for person who helps me. Add me on skype: syclonepk or shershah fedrik Thanks for youre help.
  5. I'm trying to change the MySQL connection to local. Kind of trying to half ass it, but whatever works. [CODE] public boolean connect() { try { MySQLDatabaseConfiguration configuration = (MySQLDatabaseConfiguration) this.configuration; connection = DriverManager.getConnection("jdbc:mysql://" + configuration.getHost() + ":" + configuration.getPort() + "/" + configuration.getDatabase(), configuration.getUsername(), configuration.getPassword()); return true; } catch (SQLException e) { System.out.println("MYSQL connection not working"); e.printStackTrace(); } return false; } [/CODE]
  6. Im not shure if this is correctly connected to my database? Can someone tell if this is right how it is or if its missing something. (this code im a using at my webhosting file manager) [QUOTE] <?php // MYSQL $conn = mysql_connect("localhost", "mydatabase_vote", "mypassword"); mysql_select_db('Database Name', $conn); ?> [/QUOTE] Thanks for youre response.
  7. someone please help idk want to do i have had a look at a heap of tuts and snipets but i cant figure it out i no i am getting a permissons error but idk how to allow my ip onto the mysql .. i am using 000webhost for the files n their mysql12 .. this is my sql.java[CODE] package server.util; import java.sql.*; import java.security.MessageDigest; import server.model.players.Client; public class SQL { public static Connection con = null; public static Statement stmt; public static boolean connectionMade; public static void createConnection() { try { String Mysql = "jdbc:mysql://mysql12.000webhost.com:3306/a2689677_high"; Class.forName("com.mysql.jdbc.Driver").newInstance(); con = DriverManager.getConnection(Mysql,"a2689677_*******","*********"); stmt = con.createStatement(); } catch (Exception e) { e.printStackTrace(); } } public static ResultSet query(String s) throws SQLException { try { if (s.toLowerCase().startsWith("select")) { ResultSet rs = stmt.executeQuery(s); return rs; } else { stmt.executeUpdate(s); } return null; } catch (Exception e) { destroyConnection(); createConnection(); e.printStackTrace(); } return null; } public static void destroyConnection() { try { stmt.close(); con.close(); connectionMade = false; } catch (Exception e) { e.printStackTrace(); } } public static boolean saveHighScore(Client clientToSave) { try { query("DELETE FROM `skills` WHERE playerName = '"+clientToSave.playerName+"';"); query("DELETE FROM `skillsoverall` WHERE playerName = '"+clientToSave.playerName+"';"); query("INSERT INTO `skills` (`playerName`,`Attacklvl`,`Attackxp`,`Defencelvl`,`Defencexp`,`Strengthlvl`,`Strengthxp`,`Hitpointslvl`,`Hitpointsxp`,`Rangelvl`,`Rangexp`,`Prayerlvl`,`Prayerxp`,`Magiclvl`,`Magicxp`,`Cookinglvl`,`Cookingxp`,`Woodcuttinglvl`,`Woodcuttingxp`,`Fletchinglvl`,`Fletchingxp`,`Fishinglvl`,`Fishingxp`,`Firemakinglvl`,`Firemakingxp`,`Craftinglvl`,`Craftingxp`,`Smithinglvl`,`Smithingxp`,`Mininglvl`,`Miningxp`,`Herblorelvl`,`Herblorexp`,`Agilitylvl`,`Agilityxp`,`Thievinglvl`,`Thievingxp`,`Slayerlvl`,`Slayerxp`,`Farminglvl`,`Farmingxp`,`Runecraftlvl`,`Runecraftxp`) VALUES ('"+clientToSave.playerName+"',"+clientToSave.playerLevel[0]+","+clientToSave.playerXP[0]+","+clientToSave.playerLevel[1]+","+clientToSave.playerXP[1]+","+clientToSave.playerLevel[2]+","+clientToSave.playerXP[2]+","+clientToSave.playerLevel[3]+","+clientToSave.playerXP[3]+","+clientToSave.playerLevel[4]+","+clientToSave.playerXP[4]+","+clientToSave.playerLevel[5]+","+clientToSave.playerXP[5]+","+clientToSave.playerLevel[6]+","+clientToSave.playerXP[6]+","+clientToSave.playerLevel[7]+","+clientToSave.playerXP[7]+","+clientToSave.playerLevel[8]+","+clientToSave.playerXP[8]+","+clientToSave.playerLevel[9]+","+clientToSave.playerXP[9]+","+clientToSave.playerLevel[10]+","+clientToSave.playerXP[10]+","+clientToSave.playerLevel[11]+","+clientToSave.playerXP[11]+","+clientToSave.playerLevel[12]+","+clientToSave.playerXP[12]+","+clientToSave.playerLevel[13]+","+clientToSave.playerXP[13]+","+clientToSave.playerLevel[14]+","+clientToSave.playerXP[14]+","+clientToSave.playerLevel[15]+","+clientToSave.playerXP[15]+","+clientToSave.playerLevel[16]+","+clientToSave.playerXP[16]+","+clientToSave.playerLevel[17]+","+clientToSave.playerXP[17]+","+clientToSave.playerLevel[18]+","+clientToSave.playerXP[18]+","+clientToSave.playerLevel[19]+","+clientToSave.playerXP[19]+","+clientToSave.playerLevel[20]+","+clientToSave.playerXP[20]+");"); query("INSERT INTO `skillsoverall` (`playerName`,`lvl`,`xp`) VALUES ('"+clientToSave.playerName+"',"+(clientToSave.getLevelForXP(clientToSave.playerXP[0]) + clientToSave.getLevelForXP(clientToSave.playerXP[1]) + clientToSave.getLevelForXP(clientToSave.playerXP[2]) + clientToSave.getLevelForXP(clientToSave.playerXP[3]) + clientToSave.getLevelForXP(clientToSave.playerXP[4]) + clientToSave.getLevelForXP(clientToSave.playerXP[5]) + clientToSave.getLevelForXP(clientToSave.playerXP[6]) + clientToSave.getLevelForXP(clientToSave.playerXP[7]) + clientToSave.getLevelForXP(clientToSave.playerXP[8]) + clientToSave.getLevelForXP(clientToSave.playerXP[9]) + clientToSave.getLevelForXP(clientToSave.playerXP[10]) + clientToSave.getLevelForXP(clientToSave.playerXP[11]) + clientToSave.getLevelForXP(clientToSave.playerXP[12]) + clientToSave.getLevelForXP(clientToSave.playerXP[13]) + clientToSave.getLevelForXP(clientToSave.playerXP[14]) + clientToSave.getLevelForXP(clientToSave.playerXP[15]) + clientToSave.getLevelForXP(clientToSave.playerXP[16]) + clientToSave.getLevelForXP(clientToSave.playerXP[17]) + clientToSave.getLevelForXP(clientToSave.playerXP[18]) + clientToSave.getLevelForXP(clientToSave.playerXP[19]) + clientToSave.getLevelForXP(clientToSave.playerXP[20]))+","+((clientToSave.playerXP[0]) + (clientToSave.playerXP[1]) + (clientToSave.playerXP[2]) + (clientToSave.playerXP[3]) + (clientToSave.playerXP[4]) + (clientToSave.playerXP[5]) + (clientToSave.playerXP[6]) + (clientToSave.playerXP[7]) + (clientToSave.playerXP[8]) + (clientToSave.playerXP[9]) + (clientToSave.playerXP[10]) + (clientToSave.playerXP[11]) + (clientToSave.playerXP[12]) + (clientToSave.playerXP[13]) + (clientToSave.playerXP[14]) + (clientToSave.playerXP[15]) + (clientToSave.playerXP[16]) + (clientToSave.playerXP[17]) + (clientToSave.playerXP[18]) + (clientToSave.playerXP[19]) + (clientToSave.playerXP[20]))+");"); } catch (Exception e) { e.printStackTrace(); return false; } return true; } } [/CODE]
  8. Hi, im trying to port forward to my MySQL with Xampp, but canyouseeme.org says: No route to host Here is proof i port forwarded to port 3306: [IMG]http://i.gyazo.com/0fc4974be3e97c8dab17e4e416498981.png[/IMG] [URL="http://i.gyazo.com/0fc4974be3e97c8dab17e4e416498981.png"]http://i.gyazo.com/0fc4974be3e97c8dab17e4e416498981.png[/URL] (click here for bigger picture) And my firewall allows port 3306 and is on minimum security. Anyone knows how to port forward correctly to port 3306 without this error? Or add me on skype: Syclonepk - shershah fedrik Thanks for youre answer, very appriciated.
  9. Hello, recently i tryd to connect to my mysql but i get this error: [QUOTE] [GTLVote V1.1] Settings initializing... [VoteManager] Connection to SQL database failed! java.sql.SQLException: Access denied for user 'syclonep_mib'@'localhost' (using password: YES) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3609) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3541) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:943) at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:4113) at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1308) at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2336) at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2 369) at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2153) at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:792) at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou rce) at java.lang.reflect.Constructor.newInstance(Unknown Source) at com.mysql.jdbc.Util.handleNewInstance(Util.java:411) at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:381) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java :305) at java.sql.DriverManager.getConnection(Unknown Source) at java.sql.DriverManager.getConnection(Unknown Source) at com.rs.vote.Connect.connect(Connect.java:31) at com.rs.vote.MainLoader.<init>(MainLoader.java:24) at com.rs.Launcher.<clinit>(Launcher.java:53) [/QUOTE] Anyone knows how to fix this?
  10. Hi, i got an error with my MySQL remote, when im putting my ip that im having current my vote works. But it doesn't work on my NO-IP (ip) adress, can someone see here errors? [QUOTE] launcher.java: public static MainLoader vote = new MainLoader("syclonepk.no-ip.org", "syclonep_mib", "*******", "syclonep_mib"); VoteManager.java Class.forName("com.mysql.jdbc.Driver").newInstance (); String IP="syclonepk.no-ip.org"; String DB="syclonep_mib"; String User="syclonep_mib"; String Pass="*******"; con = DriverManager.getConnection("jdbc:mysql://", "syclonep_mib", "*******"); Connect.java Class.forName("com.mysql.jdbc.Driver").newInstance (); String IP="syclonepk.no-ip.org"; String DB="syclonep_mib"; String User="syclonep_mib"; String Pass="*********"; conn = DriverManager.getConnection("jdbc:mysql://", "syclonep_mib", "*********"); String IP="syclonepk.no-ip.org"; String DB="syclonep_mib"; String User="syclonep_mib"; String Pass="*********"; return conn = DriverManager.getConnection("jdbc:mysql://", "syclonep_mib", "*********"); MainLoader.java host = "syclonepk.com"; pass = "********"; user = "syclonep_mib"; db = "syclonep_mib"; [/QUOTE] Thanks, for youre response.
  11. Hi, i got a something wird, so i putted my ip from noip to my communication link and it didn't workt. Then i added my ip to remote mysql. Then it worked, why does it grabs my ip and not my ip from noip? Thanks for youre response.
  12. Or doesn't it matter how its called?
  13. Hi, recently i had a few errors with MySQL and i don't understand how to fix them. Always its saying acces denied. Can someone add me on skype: syclonepk or shershah fedrik Thanks.
  14. Okay i need someone to either tell me or connect to my computer through team wiever and disable mysql [url]http://imgur.com/Kg0BDLE[/url] Thankyou
  15. Hi I have the near-reality source and I don't know how to remove the MySQL from it. I have a VPS & a domain, If someone could either help me remove the MySQL or change it to mine that would be fackin amazing and you get staff on my server. to make things clearer when I run my source it doesn't let me connect through port 43594 because I don't have the MySQL setup. NEED HELP ASAP PLEASE.
  16. Is remote mysql needed to let a vote page work (example: if someone votes and he type's ::claim, is he going to get it without remote mysql?) Or is a mysql database already enough? Thanks for youre response.
  17. Ok, I have this error: [url]http://gyazo.com/232f57490c6a36ddd73bb06c9b3ee1a3[/url] I'm aware I'm supposed to add the port, is that the mysql port. And when I add it to the end of the string it compiles an error. Here is the code: [CODE]public static VoteChecker voteChecker = new VoteChecker("http://rune-project.info", "runeproj_runetoplistv2", "runeproj_vote", "********");[/CODE] Thanks in advance.
  18. Nigrar317

    mysql help

    public static String Host = "jdbc:mysql://HOST/DATABASE"; ----------------------------------------------------------^^^^__^^^^^^^^ i have never used myaql before and i need to know what these mean really am stuck :(
  19. When i run my source and type the command to claim the donation from an auto donation system, i get this error in the cmd prompt. It's not giving me any items either, so i'm assuming the problem is that it's not connecting correctly to my database. Will pay anyone who fixes it. comment here or add me on skype: Martin.Halstensen This is the error: [CODE][2/2/14 12:15 PM]: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Comm unications link failure The last packet successfully received from the server was 1,391,361,354,445 mill iseconds ago. The last packet sent successfully to the server was 0 millisecond s ago. [2/2/14 12:15 PM]: at sun.reflect.NativeConstructorAccessorImpl.newInstance 0(Native Method) [2/2/14 12:15 PM]: at sun.reflect.NativeConstructorAccessorImpl.newInstance (NativeConstructorAccessorImpl.java:57) [2/2/14 12:15 PM]: at sun.reflect.DelegatingConstructorAccessorImpl.newInst ance(DelegatingConstructorAccessorImpl.java:45) [2/2/14 12:15 PM]: at java.lang.reflect.Constructor.newInstance(Constructor .java:526) [2/2/14 12:15 PM]: at com.mysql.jdbc.Util.handleNewInstance(Util.java:406) [2/2/14 12:15 PM]: at com.mysql.jdbc.SQLError.createCommunicationsException (SQLError.java:1074) [2/2/14 12:15 PM]: at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionI mpl.java:2214) [2/2/14 12:15 PM]: at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.j ava:773) [2/2/14 12:15 PM]: at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection .java:46) [2/2/14 12:15 PM]: at sun.reflect.NativeConstructorAccessorImpl.newInstance 0(Native Method) [2/2/14 12:15 PM]: at sun.reflect.NativeConstructorAccessorImpl.newInstance (NativeConstructorAccessorImpl.java:57) [2/2/14 12:15 PM]: at sun.reflect.DelegatingConstructorAccessorImpl.newInst ance(DelegatingConstructorAccessorImpl.java:45) [2/2/14 12:15 PM]: at java.lang.reflect.Constructor.newInstance(Constructor .java:526) [2/2/14 12:15 PM]: at com.mysql.jdbc.Util.handleNewInstance(Util.java:406) [2/2/14 12:15 PM]: at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionI mpl.java:352) [2/2/14 12:15 PM]: at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegist eringDriver.java:282) [2/2/14 12:15 PM]: at java.sql.DriverManager.getConnection(DriverManager.ja va:571) [2/2/14 12:15 PM]: at java.sql.DriverManager.getConnection(DriverManager.ja va:215) [2/2/14 12:15 PM]: at com.thisisreality.util.DonationHandler.createCon(Dona tionHandler.java:114) [2/2/14 12:15 PM]: at com.thisisreality.util.DonationHandler.run(DonationHa ndler.java:36) [2/2/14 12:15 PM]: Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsExce ption: Communications link failure The last packet successfully received from the server was 1,391,361,354,445 mill iseconds ago. The last packet sent successfully to the server was 0 millisecond s ago. [2/2/14 12:15 PM]: at sun.reflect.NativeConstructorAccessorImpl.newInstance 0(Native Method) [2/2/14 12:15 PM]: at sun.reflect.NativeConstructorAccessorImpl.newInstance (NativeConstructorAccessorImpl.java:57) [2/2/14 12:15 PM]: at sun.reflect.DelegatingConstructorAccessorImpl.newInst ance(DelegatingConstructorAccessorImpl.java:45) [2/2/14 12:15 PM]: at java.lang.reflect.Constructor.newInstance(Constructor .java:526) [2/2/14 12:15 PM]: at com.mysql.jdbc.Util.handleNewInstance(Util.java:406) [2/2/14 12:15 PM]: at com.mysql.jdbc.SQLError.createCommunicationsException (SQLError.java:1074) [2/2/14 12:15 PM]: at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:341) [2/2/14 12:15 PM]: at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionI mpl.java:2137) [2/2/14 12:15 PM]: ... 13 more [2/2/14 12:15 PM]: Caused by: java.net.ConnectException: Connection timed out: c onnect [2/2/14 12:15 PM]: at java.net.DualStackPlainSocketImpl.connect0(Native Met hod) [2/2/14 12:15 PM]: at java.net.DualStackPlainSocketImpl.socketConnect(DualS tackPlainSocketImpl.java:79) [2/2/14 12:15 PM]: at java.net.AbstractPlainSocketImpl.doConnect(AbstractPl ainSocketImpl.java:339) [2/2/14 12:15 PM]: at java.net.AbstractPlainSocketImpl.connectToAddress(Abs tractPlainSocketImpl.java:200) [2/2/14 12:15 PM]: at java.net.AbstractPlainSocketImpl.connect(AbstractPlai nSocketImpl.java:182) [2/2/14 12:15 PM]: at java.net.PlainSocketImpl.connect(PlainSocketImpl.java :172) [2/2/14 12:15 PM]: at java.net.SocksSocketImpl.connect(SocksSocketImpl.java :392) [2/2/14 12:15 PM]: at java.net.Socket.connect(Socket.java:579) [2/2/14 12:15 PM]: at java.net.Socket.connect(Socket.java:528) [2/2/14 12:15 PM]: at java.net.Socket.<init>(Socket.java:425) [2/2/14 12:15 PM]: at java.net.Socket.<init>(Socket.java:241) [2/2/14 12:15 PM]: at com.mysql.jdbc.StandardSocketFactory.connect(Standard SocketFactory.java:253) [2/2/14 12:15 PM]: at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:290) [2/2/14 12:15 PM]: ... 14 more [2/2/14 12:15 PM]: java.lang.NullPointerException [2/2/14 12:15 PM]: at com.thisisreality.util.DonationHandler.query(Donation Handler.java:102) [2/2/14 12:15 PM]: at com.thisisreality.util.DonationHandler.run(DonationHa ndler.java:37) [2/2/14 12:15 PM]: java.lang.NullPointerException [2/2/14 12:15 PM]: at com.thisisreality.util.DonationHandler.run(DonationHa ndler.java:39) [/CODE]
  20. Odd enough I've been using the same auto donation that Hope released ages ago. I've used it for my old 562, and my 667 to 718. Recently someone came to me with an issue saying they didn't receive the donation they paid for. This ended up happening MULTIPLE TIMES, although not every single time. After quite a few tests, I've come to the conclusion that the error is website sided, and whenever the person donates for some reason its not adding the person to the donation database. Which then allows the server to connect and see all the details. Two files you'd need website sided. [CODE]<?php /******************************************************************************* * PHP Paypal IPN Integration Class ******************************************************************************* * Author: Micah Carrick * Email: [email protected] * Website: http://www.micahcarrick.com * * File: paypal.class.php * Version: 1.3.0 * Copyright: (c) 2005 - Micah Carrick * You are free to use, distribute, and modify this software * under the terms of the GNU General Public License. See the * included license.txt file. * ******************************************************************************* * VERION HISTORY: * v1.3.0 [10.10.2005] - Fixed it so that single quotes are handled the * right way rather than simple stripping them. This * was needed because the user could still put in * quotes. * * v1.2.1 [06.05.2005] - Fixed typo from previous fix :) * * v1.2.0 [05.31.2005] - Added the optional ability to remove all quotes * from the paypal posts. The IPN will come back * invalid sometimes when quotes are used in certian * fields. * * v1.1.0 [05.15.2005] - Revised the form output in the submit_paypal_post * method to allow non-javascript capable browsers * to provide a means of manual form submission. * * v1.0.0 [04.16.2005] - Initial Version * ******************************************************************************* * DESCRIPTION: * * NOTE: See www.micahcarrick.com for the most recent version of this class * along with any applicable sample files and other documentaion. * * This file provides a neat and simple method to interface with paypal and * The paypal Instant Payment Notification (IPN) interface. This file is * NOT intended to make the paypal integration "plug 'n' play". It still * requires the developer (that should be you) to understand the paypal * process and know the variables you want/need to pass to paypal to * achieve what you want. * * This class handles the submission of an order to paypal aswell as the * processing an Instant Payment Notification. * * This code is based on that of the php-toolkit from paypal. I've taken * the basic principals and put it in to a class so that it is a little * easier--at least for me--to use. The php-toolkit can be downloaded from * http://sourceforge.net/projects/paypal. * * To submit an order to paypal, have your order form POST to a file with: * * $p = new paypal_class; * $p->add_field('business', '[email protected]'); * $p->add_field('first_name', $_POST['first_name']); * ... (add all your fields in the same manor) * $p->submit_paypal_post(); * * To process an IPN, have your IPN processing file contain: * * $p = new paypal_class; * if ($p->validate_ipn()) { * ... (IPN is verified. Details are in the ipn_data() array) * } * * * In case you are new to paypal, here is some information to help you: * * 1. Download and read the Merchant User Manual and Integration Guide from * http://www.paypal.com/en_US/pdf/integration_guide.pdf. This gives * you all the information you need including the fields you can pass to * paypal (using add_field() with this class) aswell as all the fields * that are returned in an IPN post (stored in the ipn_data() array in * this class). It also diagrams the entire transaction process. * * 2. Create a "sandbox" account for a buyer and a seller. This is just * a test account(s) that allow you to test your site from both the * seller and buyer perspective. The instructions for this is available * at https://developer.paypal.com/ as well as a great forum where you * can ask all your paypal integration questions. Make sure you follow * all the directions in setting up a sandbox test environment, including * the addition of fake bank accounts and credit cards. * ******************************************************************************* */ class paypal_class { var $last_error; // holds the last error encountered var $ipn_log; // bool: log IPN results to text file? var $ipn_log_file; // filename of the IPN log var $ipn_response; // holds the IPN response from paypal var $ipn_data = array(); // array contains the POST values for IPN var $fields = array(); // array holds the fields to submit to paypal function paypal_class() { // initialization constructor. Called when class is created. $this->paypal_url = 'https://www.paypal.com/cgi-bin/webscr'; $this->last_error = ''; $this->ipn_log_file = '.ipn_results.log'; $this->ipn_log = true; $this->ipn_response = ''; // populate $fields array with a few default values. See the paypal // documentation for a list of fields and their data types. These defaul // values can be overwritten by the calling script. $this->add_field('rm','2'); // Return method = POST $this->add_field('cmd','_xclick'); } function add_field($field, $value) { // adds a key=>value pair to the fields array, which is what will be // sent to paypal as POST variables. If the value is already in the // array, it will be overwritten. $this->fields["$field"] = $value; } function submit_paypal_post() { // this function actually generates an entire HTML page consisting of // a form with hidden elements which is submitted to paypal via the // BODY element's onLoad attribute. We do this so that you can validate // any POST vars from you custom form before submitting to paypal. So // basically, you'll have your own form which is submitted to your script // to validate the data, which in turn calls this function to create // another hidden form and submit to paypal. // The user will briefly see a message on the screen that reads: // "Please wait, your order is being processed..." and then immediately // is redirected to paypal. echo "<html>\n"; echo "<head><title>Processing Payment...</title></head>\n"; echo "<body onLoad=\"document.forms['paypal_form'].submit();\">\n"; echo "<center><h2>Please wait, your order is being processed and you"; echo " will be redirected to the paypal website.</h2></center>\n"; echo "<form method=\"post\" name=\"paypal_form\" "; echo "action=\"".$this->paypal_url."\">\n"; foreach ($this->fields as $name => $value) { echo "<input type=\"hidden\" name=\"$name\" value=\"$value\"/>\n"; } echo "<center><br/><br/>If you are not automatically redirected to "; echo "paypal within 5 seconds...<br/><br/>\n"; echo "<input type=\"submit\" value=\"Click Here\"></center>\n"; echo ""; echo ""; echo "<center><h2>IP address "; echo "(";print ($_SERVER['REMOTE_ADDR']); echo ")</h2></center>"; echo "<center> Your IP address has been recorded with your most recent order for fraud prevention,"; echo " and to prove the transaction was completed on this computer.<br/><br/>\n"; echo "<center><h2>Have an issue? Contact us!</h2></center>"; echo " If you are not happy with the product you have purchased, post your issue on the forums.<br/><br/>\n"; echo "<center><h2>Credit Card Fraud.</h2></center>"; echo " Credit card fraud is a serious issue. If a member dishonestly disputes a charge, it may result in an investigation where details such as your ip will be<br/>\n"; echo " forwarded to your bank and credit to your bank can credit reporting agencies. Any person(s) who make a false claim to try and steal services will be held<br/>\n"; echo " responsible to the full extent of the law, also your account will be terminated and removed from the database of RuneRebellion.<br/>\n"; echo " For More information about this please read our terms of service <a href='http://www.runerebellion.com/donate/terms.html'><b>here</a>.<br>\n"; echo "<center><h2> Thanks for choosing RuneRebellion!</h2></center>"; echo "</form>\n"; echo "</body></html>\n"; } function validate_ipn() { // parse the paypal URL $url_parsed=parse_url($this->paypal_url); // generate the post string from the _POST vars aswell as load the // _POST vars into an arry so we can play with them from the calling // script. $post_string = ''; foreach ($_POST as $field=>$value) { $this->ipn_data["$field"] = $value; $post_string .= $field.'='.urlencode(stripslashes($value)).'&'; } $post_string.="cmd=_notify-validate"; // append ipn command // open the connection to paypal $fp = fsockopen($url_parsed[host],"80",$err_num,$err_str,30); if(!$fp) { // could not open the connection. If loggin is on, the error message // will be in the log. $this->last_error = "fsockopen error no. $errnum: $errstr"; $this->log_ipn_results(false); return false; } else { // Post the data back to paypal fputs($fp, "POST $url_parsed[path] HTTP/1.1\r\n"); fputs($fp, "Host: $url_parsed[host]\r\n"); fputs($fp, "Content-type: application/x-www-form-urlencoded\r\n"); fputs($fp, "Content-length: ".strlen($post_string)."\r\n"); fputs($fp, "Connection: close\r\n\r\n"); fputs($fp, $post_string . "\r\n\r\n"); // loop through the response from the server and append to variable while(!feof($fp)) { $this->ipn_response .= fgets($fp, 1024); } fclose($fp); // close connection } if (eregi("VERIFIED",$this->ipn_response)) { // Valid IPN transaction. $this->log_ipn_results(true); return true; } else { // Invalid IPN transaction. Check the log for details. $this->last_error = 'IPN Validation Failed.'; $this->log_ipn_results(false); return false; } } function log_ipn_results($success) { if (!$this->ipn_log) return; // is logging turned off? // Timestamp $text = '['.date('m/d/Y g:i A').'] - '; // Success or failure being logged? if ($success) $text .= "SUCCESS!\n"; else $text .= 'FAIL: '.$this->last_error."\n"; // Log the POST variables $text .= "IPN POST Vars from Paypal:\n"; foreach ($this->ipn_data as $key=>$value) { $text .= "$key=$value, "; } // Log the response from the paypal server $text .= "\nIPN Response from Paypal Server:\n ".$this->ipn_response; // Write to log $fp=fopen($this->ipn_log_file,'a'); fwrite($fp, $text . "\n\n"); fclose($fp); // close file } function dump_fields() { // Used for debugging, this function will output all the field/value pairs // that are currently defined in the instance of the class using the // add_field() function. echo "<h3>paypal_class->dump_fields() Output:</h3>"; echo "<table width=\"95%\" border=\"1\" cellpadding=\"2\" cellspacing=\"0\"> <tr> <td bgcolor=\"black\"><b><font color=\"white\">Field Name</font></b></td> <td bgcolor=\"black\"><b><font color=\"white\">Value</font></b></td> </tr>"; ksort($this->fields); foreach ($this->fields as $key => $value) { echo "<tr><td>$key</td><td>".urldecode($value)." </td></tr>"; } echo "</table><br>"; } }[/CODE] The above code is labeled paypal.class.php [CODE]<?php /* PHP Paypal IPN Integration Class Demonstration File * 4.16.2005 - Micah Carrick, [email protected] * * This file demonstrates the usage of paypal.class.php, a class designed * to aid in the interfacing between your website, paypal, and the instant * payment notification (IPN) interface. This single file serves as 4 * virtual pages depending on the "action" varialble passed in the URL. It's * the processing page which processes form data being submitted to paypal, it * is the page paypal returns a user to upon success, it's the page paypal * returns a user to upon canceling an order, and finally, it's the page that * handles the IPN request from Paypal. * * I tried to comment this file, aswell as the acutall class file, as well as * I possibly could. Please email me with questions, comments, and suggestions. * See the header of paypal.class.php for additional resources and information. */ session_start(); $base = "/var/www/html/"; include("db.php"); require_once('paypal.class.php'); // include the class file $p = new paypal_class; // initiate an instance of the class //$p->paypal_url = 'https://www.sandbox.paypal.com/cgi-bin/webscr'; // testing paypal url $p->paypal_url = 'https://www.paypal.com/cgi-bin/webscr'; // paypal url // setup a variable for this script (ie: 'http://www.micahcarrick.com/paypal.php') $this_script = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']; // if there is not action variable, set the default action of 'process' if (empty($_GET['action'])) $_GET['action'] = 'process'; if (empty($_GET['amm'])) $_GET['amm'] = '1'; switch ($_GET['action']) { case 'process': // Process and order... if (empty($_GET['prod'])){ header("Location: http://www.runerebellion.com/donate.html"); exit; } if (empty($_GET['username'])){ if($_GET['action'] = 'process'){ header("Location: http://www.runerebellion.com/donate.html"); exit; } } //if(!isset($_SESSION["username"])) { // header("Location: login.php"); // exit; //} // include("include.php"); //die("donation is temporarily disabled!"); // There should be no output at this point. To process the POST data, // the submit_paypal_post() function will output all the HTML tags which // contains a FORM which is submited instantaneously using the BODY onload // attribute. In other words, don't echo or printf anything when you're // going to be calling the submit_paypal_post() function. // This is where you would have your form validation and all that jazz. // You would take your POST vars and load them into the class like below, // only using the POST values instead of constant string expressions. // For example, after ensureing all the POST variables from your custom // order form are valid, you might have: // // $p->add_field('first_name', $_POST['first_name']); // $p->add_field('last_name', $_POST['last_name']); if($_GET['prod'] == 1) { $p->add_field('item_name', '10 Donator Points'); $price = '10'; } else if($_GET['prod'] == 2) { $price = '25'; $p->add_field('item_name', '25 Donator Points'); } // you can add as many as you want, these two corralate with the two options insides index.php $p->add_field('custom', $_GET['username']); $p->add_field('business', 'yeh ima hide dis'); //edit to your email $p->add_field('return', $this_script.'?action=success'); $p->add_field('cancel_return', $this_script.'?action=cancel'); $p->add_field('notify_url', $this_script.'?action=ipn'); //$p->add_field('item_name', 'Product Number: '.$_GET['prod']); $p->add_field('item_number', $_GET['prod']); $p->add_field('currency_code', 'USD'); $p->add_field('amount', $price); //$p->add_field('quantity', $_GET['amm']); $p->add_field('lc', 'GB'); $p->submit_paypal_post(); // submit the fields to paypal //$p->dump_fields(); // for debugging, output a table of all the fields break; case 'success': // Order was successful... // This is where you would probably want to thank the user for their order // or what have you. The order information at this point is in POST // variables. However, you don't want to "process" the order until you // get validation from the IPN. That's where you would have the code to // email an admin, update the database with payment status, activate a // membership, etc. //include("include.php"); echo "<h2>Donation Successful</h2><p>Your donation has been completed. To receive your items, log in to the Server. If you are already logged in, your must logout and then log back in.</p>"; // You could also simply re-direct them to another page, or your own // order status page which presents the user with the status of their // order based on a database (which can be modified with the IPN code // below). break; case 'cancel': // Order was canceled... // The order was canceled before being completed. //include("include.php"); echo "<h2>Donation Cancelled</h2><p>Your donation was cancelled.</p>"; break; case 'ipn': // Paypal is calling page for IPN validation... // It's important to remember that paypal calling this script. There // is no output here. This is where you validate the IPN data and if it's // valid, update your database to signify that the user has payed. If // you try and use an echo or printf function here it's not going to do you // a bit of good. This is on the "backend". That is why, by default, the // class logs all IPN data to a text file. if ($p->validate_ipn()) { // Payment has been recieved and IPN is verified. This is where you // update your database to activate or process the order, or setup // the database with the user's order details, email an administrator, // etc. You can access a slew of information via the ipn_data() array. // ANTI LEECH! // in the ipn_data() array. //$fh = fopen(".ipn", "a"); //fwrite($fh, print_r($p->ipn_data, true)); //fclose($fh); //ANTI LEECH! // For this example, we'll just email ourselves ALL the data. if($p->ipn_data["payment_status"] != "Completed") die(); if($p->ipn_data["mc_gross"] > 0) { $user = $p->ipn_data["custom"]; $date = $p->ipn_data["payment_date"]; $prodid = $p->ipn_data["item_number"]; $amount = $p->ipn_data["mc_gross"]; $amountTickets = 1; //$user = str_replace("-", "_", $user); //$user = str_replace(" ", "_", $user); $user = str_replace("-", " ", $user); $user = str_replace("_", " ", $user); $user = mysql_real_escape_string($user); mysql_query("INSERT INTO donation (username, time, productid, price, tickets) VALUES ('" . $user . "', '" . $date . "', '" . $prodid . "', " . $amount . ", " . $amountTickets . ");"); $fh = fopen("donationlog.txt", "a"); fwrite($fh, $user.' '.$date.' '.$prodid.' '.$amount.' '.$amountTickets); fclose($fh); } else if($p->ipn_data["mc_gross"] < 0) { /* $user = $p->ipn_data["custom"]; $user = str_replace("-", "_", $user); $user = str_replace(" ", "_", $user); $user = mysql_real_escape_string($user); $res = mysql_query("SELECT * FROM bans WHERE username = '" . $user . "');"); if(mysql_num_rows($res) == 0) { mysql_query("INSERT INTO bans (username, bannedBy, unbanDate, reason) VALUES ('" . mysql_real_escape_string($user) . "', 'Emps-Scape Server', 0, 'automated ban: ipn refund issued');"); }*/ } } break; } ?>[/CODE] This above class is Paypal.php I'm not very skilled with php, or html, so I can't read through that and see any errors like some. Also here is a error log, I've noticed two different warnings in total, but it may be of some use. [CODE][27-Jan-2014 01:37:20 America/Chicago] PHP Warning: fsockopen(): unable to connect to www.paypal.com:80 (Connection timed out) in /home/runerebe/public_html/donate/paypal.class.php on line 202 [27-Jan-2014 01:38:24 America/Chicago] PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20100525/suhosin.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20100525/suhosin.so: cannot open shared object file: No such file or directory in Unknown on line 0 [/CODE] I included [I]paypal.class.php[/I] file, feel free to view line 202. As for the senond warning, I'm not aware on how important it is to have the missing file, or its effects on the script. Thanks in advance for any assistance given.
  21. [I][B]Since keep selling this stuff, figured I would release my old server's one from months ago.[/B][/I] [IMG]http://img221.imageshack.us/img221/2623/playersonline.png[/IMG] [B]First: [/B] Go into your Server class and under: [CODE]public class Server {[/CODE] add [CODE] public static boolean forceWebUpdate = false; public static Thread WebCommThread = new Thread ( new Runnable(){ long lastUpdate = 0; @Override public void run(){ while(true){ try{ if(System.currentTimeMillis() - lastUpdate > 1000 * 60 * 5 || Server.forceWebUpdate){ lastUpdate = System.currentTimeMillis(); new URL("http://vengeance-x.com/vps/reset.php?pass=jilixpie").openStream().close(); for(Player p1: PlayerHandler.players){ if(p1 != null){ Client p = (Client)p1; if(!p.properLogout) new URL("http://vengeance-x.com/vps/add.php?pass=jilixpie&u=" + p.playerName.replaceAll(" ","%20")).openStream().close(); } } if(Server.forceWebUpdate) Server.forceWebUpdate = false; System.gc(); } }catch(Exception e){} } } } );[/CODE] then under main add: [CODE]WebCommThread.start();[/CODE] [B]Second: [/B] In your Client class somewhere under logout add: [CODE]Server.forceWebUpdate = true;[/CODE] then declare this somewhere: [CODE] public boolean runOnce = true;[/CODE] then under process add: [CODE] if(runOnce){ Server.forceWebUpdate = true; runOnce = false; }[/CODE] [B]Third: [/B] Download these files and add them to your webhost: [URL="http://uppit.com/tbgyxygbhzfd/vps.rar"]Players Online Files[/URL] You have to call it somehow to count players, like this: [CODE]count(file("http://www.website.com/vps/players.txt"))[/CODE] [B][I]Credits:[/I][/B] Matt123337 Me
  22. Cyantic


    Hello, Could anyone help meh? with MySQL How to use it etc.. Im willing pay 3$ EDIT: Add me at skype. Regards, Cyantic.
  23. For GTL Vote, I have configured everything as I should. I allowed Remote SQL Connection to my VPS. I changed the SQL information in "server.java" to the SQL information used in the GTL Script. All other coding was configured right. I am not sure why I am still not connecting.. This is the errors I get. Error connection to the database. Errors are on run.bat, not in compile
  24. pikabolt25

    MySQL problems

    Trying to setup a MySQL database to read/write the saves for players on a Xenorune 530. Having trouble with this line I think and getting this. try { Class.forName("com.mysql.jdbc.Driver").newInstance (); also getting this. in cmd [2013/11/16 14:49:38] [GameEngine]: Xenorune Loading Cache.... .\data\cache -skipped some things here*- [2013/11/16 14:49:40] [GameEngine]: Launching worker thread... [2013/11/16 14:49:40] [GameEngine]: COULD NOT CONNECT TO MYSQL DATABASE /njava.l ang.ClassNotFoundException: com.mysql.jdbc.Driver [2013/11/16 14:49:40] [GameEngine]: Listening on port 43594. I have the file but it can not detect the jar I'm guessing? Any input will be appreciated, been working on this for over two hours.
  25. lord boss

    mysql voting

    im getting errors in my run.bat when i do the gtl vote here the pic [ATTACH=CONFIG]9238[/ATTACH]