Hi all,
As I told in my other topic that I want to get started, its now time for making a login system and lobby before I even start the gameplay.
Im not sure if there are free coding examples available for a login system and lobby, that can be used? Im planning to make the java game playable via webbrowser, so I think MySQL must be used.
So are there any examples/snippets available for this?
Love to finally make a start on this real project.
Thanks in advance,
check out Monkey Zone, https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:advanced:monkey_zone it has source available which utilities SpiderMonkey. MySQL is definitely an option for storing data, but i don’t think you’ll find much about MySQL in these forums. The language is not very hard, you just have to make sure SQL injection isn’t a problem, which using java.sql.PreparedStatement helps prevent. Just be warned that you have to account for delays in multi-player games. So don’t expect something you test on just your machine to work the same when you deploy it to a server.
Thanks for that, exactly what im searching for. My game will be hopefully an MMO of which the game starts at once (not like MMOrpg). So this would fit.
If there is something that could help me out and want to earn a bit, Im open for it via PM
-Need to get help in case that I can’t code the login system myself.
Ill use this as a base and see what I can learn from monkey zone!
If the sessions don’t need to be persistent, you can start with just storing the data in memory… For stats tracking, user databases, etc, all of that should be in some database (whether its MySQL, PostgreSQL, or something else)
Well, it depends what you mean with persistent.
For example: Username, settings, player money etc need to be fixed and only adjusted after a full game. This would be easy in MySQL
For HP, vehicles, hp and other stuff … Im not sure how to make that easy reachable. This is the information that is needed for one game and gets deleted after. Im sure this, especially HP should be serversided too, otherwise its memory-hackable. But thats for later on, those are temporary settings that must be reachable fast.
Im btw still searching for a hobby coder(not professional) that can help from own experience or to develop experience. Willing to pay too.
sheikh said:
For HP, vehicles, hp and other stuff .. Im not sure how to make that easy reachable. This is the information that is needed for one game and gets deleted after. Im sure this, especially HP should be serversided too, otherwise its memory-hackable. But thats for later on, those are temporary settings that must be reachable fast.
These are things that can be stored in memory. In theory, and this depends on how you want the backend to function, the database should only be updated when you want a value to survive into the next login. So, using your example of money, if a player makes a transaction, that should immediately go against the database. Player health, on the other hand, is presumably changing all the time within a session and is reset afterwords, so this can be done in memory. The cases I've laid out are very black and white, so just bear in mind that for every example there will be two more that exhibit some sort of grey area ;)
any “decisions” should always be done on the server. If there are 2 players, player 1 shoots, and then player 2 shoots, but to both players, it seems that they shot first. But someone has to die, and the server needs to make the decision and then send the data back to both players. And because “lag” is the biggest problem in online games, its something you have to think very carefully about. Any volatile data, health etc… would be in memory.