Help > Ingame Voting questions

Results 1 to 4 of 4
  1. #1
    Valued Member DeathTob is offline
    MemberRank
    Apr 2014 Join Date
    116Posts

    Help > Ingame Voting questions

    Hi rageZone. Does anyone know if a server has in-game voting system how does it work ? like after a player votes does the 'p0int' enter a category in Characters under SQL or under Accounts.

    Also , how do they make the sql save while players are ingame ? if i update a category in the sql while logged in , after relog it's gone !


  2. #2
    That one pokemon thing Luxray is offline
    MemberRank
    Apr 2010 Join Date
    2,043Posts

    Re: Help > Ingame Voting questions

    Quote Originally Posted by DeathTob View Post
    Hi rageZone. Does anyone know if a server has in-game voting system how does it work ? like after a player votes does the 'p0int' enter a category in Characters under SQL or under Accounts.

    Also , how do they make the sql save while players are ingame ? if i update a category in the sql while logged in , after relog it's gone !
    Regarding the second question, all information regarding a character and account is stored within variables. This means that whenever a person logs in, all information from the database is selected and stored in the java runtime environment.
    Now, this wouldn't pose a problem if the source would only ask information from the database and not save the whole, but just parts. Fortunately, it doesn't. The ammount of stress on the database would be too high if you were to have a huge player base.
    Thus they made it, that whenever someone logs out, crashes or performs a crucial action all information regarding a character is saved to the database. If you've put anything in the database before the character logged out, the saveToDb function in MapleCharacter.java will simply override it with what it's got saved in the variables stored in the Java runtime environment.

    TL;DR: Only change something when a player's offline, or change the values of a person's variable instead of SQL information.

  3. #3
    Member Shmoconut is offline
    MemberRank
    Aug 2014 Join Date
    56Posts

    Re: Help > Ingame Voting questions

    The best way to do this is to make a vote service that consumes vote messages from the website. It could be in the same jvm (which is easiest) or separate (which is the real way to do it), in which case it would forward the message to the server.

  4. #4
    Member Drum is offline
    MemberRank
    Jul 2013 Join Date
    80Posts

    Re: Help > Ingame Voting questions

    You can also just literally read and save the value of votepoints from your database whenever you do anything with it instead of having it as a instance variable. Schmoconut's suggestion is far better though. That's the proper way to do this, and is more extensible to larger player bases.



Advertisement