Vote Points

Results 1 to 6 of 6
  1. #1
    Member itscolee is offline
    MemberRank
    Oct 2013 Join Date
    53Posts

    Vote Points

    Hello,

    I am using AresDEV (moopldev base), and have managed to add in a votepoint system.. but I want to change it. I could not figure out how to insert the vote points into accounts, so I put it into 'insert into "character"'. I pretty much have the entire file already set up, I just need some guidance on where I should put the "voting records" and "donatorpoints" at instead of inserting them into the characters table.

    Here is my maplecharacter: http://pastebin.com/UrDcPwXF

    voting: votingrecords
    donator: donatorpoints

    I already have the functions getVotingRecords, setVotingRecords...etc etc. Just need some help on where I should have placed the stuff in the first place.

    Thanks in advance.
    Last edited by itscolee; 05-05-15 at 07:33 PM.


  2. #2
    :l Cygnus is offline
    MemberRank
    Mar 2015 Join Date
    f425Location
    237Posts

    Re: Vote Points

    You should just back-trace something you already have in your accounts table. For instance, If you have a column named 'PaypalNX' in your accounts table, if you wanted to find out how you would add information of additional columns for your accounts table, You could search for PaypalNX in your IDE, and it would tell exactly where the data is read from.

  3. #3
    Member itscolee is offline
    MemberRank
    Oct 2013 Join Date
    53Posts

    Re: Vote Points

    Quote Originally Posted by Cygnus View Post
    You should just back-trace something you already have in your accounts table. For instance, If you have a column named 'PaypalNX' in your accounts table, if you wanted to find out how you would add information of additional columns for your accounts table, You could search for PaypalNX in your IDE, and it would tell exactly where the data is read from.
    It's weird because my column is nxCredit, but if I search that in my IDE, the only instance of it is in CashShop,java... but if i put a value in nxCredit, it actually shows up in-game.

    Edit: did I just answer my own question? lol

    Code:
    ps = con.prepareStatement("SELECT `nxCredit`, `maplePoint`, `nxPrepaid` FROM `accounts` WHERE `id` = ?");			ps.setInt(1, accountId);
    			rs = ps.executeQuery();
    
    
    			if (rs.next()) {
    				this.nxCredit = rs.getInt("nxCredit");
    				this.maplePoint = rs.getInt("maplePoint");
    				this.nxPrepaid = rs.getInt("nxPrepaid");
    			}
    - - - Updated - - -

    http://pastebin.com/iJjq8vRY

    Since it loads from the cashshop.java, where would I put the stuff? Also, would i need to take it all out of maplecharacter, too?

  4. #4
    Member itscolee is offline
    MemberRank
    Oct 2013 Join Date
    53Posts

    Re: Vote Points

    I added something in the original post. I would appreciate it if someone could give me some feedback :).

    Thanks.

  5. #5
    Moongran Saii is offline
    MemberRank
    Jan 2012 Join Date
    510Posts

    Re: Vote Points

    I'm a bit confused but I'll try to answer.
    if you want to add certain variable(points in your case) to MapleClient, what you have to do is add all relevant methods(get, set, etc) to MapleClient as well, add the points row to the account table in your database.
    basically similar to the NXCredit you have - just like Cygnus said.

  6. #6
    Member itscolee is offline
    MemberRank
    Oct 2013 Join Date
    53Posts

    Re: Vote Points

    I've tried multiple things and I cannot get it to work. I added all the methods to mapleclient, as well as npcconversationmanager (getClient.. not getPlayer), still doesn't work. Any idea on how to get this to work in AresDEV source? I can get it to work if it loads from the character table, but not the account table.

    Here is a clean MapleClient.java:

    /* This file is part of the OdinMS Maple Story Server Copyright (C) 2008 Patri - Pastebin.com

    And the methods I use are

    Code:
      public void gaindonatorPoints(int amt) {        donatorPoints = donatorPoints + amt;
        }
    
    
        public int getdonatorPoints() {
            return donatorPoints;
        }
    
    
        public int getvotingRecords() {
            return votingRecords;
        }
    
    
        public void gainvotingRecords(int amt) {
            votingRecords = votingRecords + amt;
        }
    
    
        public void removedonatorPoints(int amt) {
            donatorPoints = donatorPoints - amt;
        }
    
    
        public void setdonatorPoints(int amt) {
            donatorPoints = amt;
        }
    
    
        public void setvotingRecords(int amt) {
            votingRecords = amt;
        }
    And yes, I've added the tables in my DB.

    EDIT: I've tried adding other things into my mapleclient...

    ex.. Adding votingRecords and donatorPoints stuff under
    Code:
     public int login
    but I just posted a clean mapleclient because what I have done is probably completely wrong, so I'd like to start fresh.

    But, to embarrass myself, here is my mapleclient:

    /* This file is part of the OdinMS Maple Story Server Copyright (C) 2008 Pat - Pastebin.com

    Also, I am a super beginner at Java, and am currently reading a few beginners books.. and trying to apply my knowledge to something tangible.. This "server" is just for me and my friends to play on.
    Last edited by itscolee; 11-05-15 at 03:18 AM.



Advertisement