This is actually what I plan to be working on for a while, synchronous online capabilities in MV seem to a bit far-fetched but doable, I've started researching and lightly developing asynchronous multiplayer features, (Trading, Chat, etc), Looks like we're all on the same boat lol.
Haha, we're at the same point it seems 😀
If you plan to use <inputs /> for your login form, you'll need to override Input._onKeyDown and Input._shouldPreventDefault, you'll see why 😛
Since it was asked elsewhere,
How do you prevent against hacking?
Everything done in game is sent to the server for saving (in little bits, rather than as a whole). For example when you change maps, that request is sent to the server.
While the player could hack their map id on the client side, they cannot hack it on the server side.
On the server, we can perform checks to see things such as:
- could the player have accessed this map at this point? (Check switches, variables, items, etc)
- has enough time passed between requests?
- and anything vaguely dodgy about the request, basically
The same goes for gaining items: could they have logically gained the item at this point?
And gold. Is it rising too fast?
It's still possible to hack the client to replicate all of this, but at that point it becomes almost as much work as actually playing the game.
The important thing is never to impede on real players' gameplay to prevent hackers. That's a no-no.
As an example, let's say we have a quest:
HEY SERVER, SET SWITCH 1 TO TRUE
Ok. Set switch 1 to true.
HEY SERVER, SET SWITCH 2 TO TRUE
Was switch 1 set? Yes it was. And over five minutes ago. The NPC before us lasted at least ten minutes. Let's continue.
HEY SERVER, SET SWITCH 3 TO TRUE
Wait, wait. The previous NPC gave us a sword. Do we have it? No. Where is the sword? We missed a step.
HACK ATTEMPT
^^ what you do in such a situation is up to you. As I said before, it's important not to impede on genuine gameplay, but you *could* look out for definite hacks and ban players for it. Or bring up flags which the admin then goes around checking to see for themselves.
Trade happens on the server.
HEY SERVER, SEND A REQUEST TO AMY FOR HER POLLOCK FOR MY TROUT
But you don't have a trout, at least, not on the server...
OKAY. 🙁
General Discussion as a forum is about discussing principles, concepts, ideas which are applicable to several games. This thread, however, is solely about one game.
Do you want this moving to Projects in development or to Completed Games?
Erm... I'm not sure. I guess Plugins in Development might be a better place? It's not really a game.
I created a nice login system today using cookies and sessions. Then realised it's completely unnecessary - the game client can hold all the data a cookie would have held anyway.
I also implemented SHA-256 encryption for the passwords. Encrypted client side, sent to the server, then re-encrypted there with a salt, for three levels of protection.
I would say ask for the post I replied to on release to be locked or removed and then have this moved to release and then just massive WIP or better yet have this thread move into WIP and just keep it under one thread if you want to easily manage it.
I'll ask for it to go into Plug ins in development. The WIP thread is more for graphic resources than something like this.
Moved to plugins in development.
The development's going well, but I am having more trouble than I thought abstracting things for use outside of my game. I am beginning to think the kit should take more the form of a group of polished tutorials than a complete plugin. The reason being that each online system has to be tailored a little to the game being created; and some systems such as login really need to use different authentication for each game for security purposes (it would be bad practice to have every game using the exact same encryption algorithm).
I don't think it'll be used as much if it's just tutorials