Unity Simple Zombie FPS Co-op Scoring Server
Scoring Server for Unity Simple Zombie FPS Co-op Example.
- User Authentication (Login/Register)
- Saving user's play data to the server permanently.
How to run?
- You need a public accessible server with fixed ip address.
- You need to install these softwares into your server:
- Make sure to open port 5010 to public access.
- Create DB named ZombieScore
- Create new user named "zombieadmin" with password "freshmeat".
- Grant read/write roles of ZombieScore DB to zombieadmin
Run the server
- You have to install Node.js dependencies first. Install via NPM:
$ npm install
- Run the server.
$ node server
- Highly recommend to run server with PM2 or Forever module. The server must be run while you gameplaying.
$ sudo npm install -g pm2 $ pm2 start server.js --name "ZombieScoreServer"
Ok, just show me how
Ok, well.. Here's the video how to:
Click the above image to redirect to youtube.
Authentication system is just really simple, because it's focused on implementation, not for product ready state. When user logged in, server returns string token, and it saves into the server's local memory(Redis). After then user can access other APIs that requires authentication with that token. When user logged out, server will destroy that token.
Oh, I forgot to remove tokens when user just shutting down the client. If you make something product inspired by these examples, don't forget to remove token after some specific times that user didn't anything.
Also in this demonstration, I didn't checked that user try to access while it's already logged in. You have to check this too.
Please don't tell me why you made this something this blabla, it's just demonstration XD I just focused on Logic itself, not perfection!