Git Product home page Git Product logo

typemasters-game's Introduction

Typemasters

Tips

  • It is better to work in IDE which supports Javascript well, like WebStorm
  • It is better to have a good database manager like MySQL Workbench
  • It is better to have a Postman for checking HTTP requests
  • You must have suitable Node.js and NPM versions installed
  • In order to make code clean and standardized, make sure you have a standard.js installed and use it before committing the code to the repository

typemasters-game's People

Contributors

asahi7 avatar madinab avatar

Watchers

 avatar  avatar

typemasters-game's Issues

Make the game server fetch database data from a web server

It will add up a new (maybe unnecessary) layer for security check, and database related work. However, there are only 2 tasks that are done: text fetch and saving race data. We could make the game server more computing-heavy (network-heavy), and the web server more responsive for web connections (how?).

Also, the web server will have a firebase token user sign up processing and it will create a user "before" the race data will get saved (for non-existent user). One important notice of this is that the communication between servers can be always secure, because they will have whitelisted IP addresses.

Task list

Personal Page:
- Show last race date (1 day ago) (MadinaB) P.S. Write tests
- Show best race ever (by cpm) (MadinaB)
- Races won
- Allow country specification (Aibek)

  • Design points system (IN NEXT VERSION)
    - Design accuracy system (Aibek)
    - Make a user's input colored on inaccurate typing, and vice-versa (Aibek)
    - Show last race's wpm/cpm (Madina)
  • Allow conversion from wpm to cpm (IN NEXT VERSION)
    - Allow showing first race's date (Aibek)
    - Show a graphic of improvement (of races)** (Aibek)

Settings:
- Language selection* (Scores for different languages should be separate) (Aibek)

Leaderboard:
- Show last 20 best racers (include only today's races) (Aibek)
- Show best races of all time (Aibek)

Other:
- Design/develop a way of recording a winner of race (Aibek)
- Make it possible to end game if a user goes 'back' or stops the game. (Aibek)

  • Develop a friend system*** (IN NEXT VERSION)

  • Check API request's parameter's length, and security

  • Allow viewing other users' profile pages** (IN NEXT VERSION)

  • Create a group of races (IN NEXT VERSION)

  • Create individual races (IN NEXT VERSION)

  • Add social tools (Facebook, Twitter)
    - Add adds, monetize** (Aibek)
    - Add bots for gaming* (Aibek)
    - Make anonymous playing possible (Aibek)
    - After a game ends, show a window of general post-race info (Aibek)

    • Show a best wpm made for a text (IN NEXT VERSION)
  • Show available texts (IN NEXT VERSION)

  • Make possible to choose specific texts and race on them (IN NEXT VERSION)

  • Show time of finishing some text/race (IN NEXT VERSION)

  • Add tests***

    • Conduct load testing on all servers, make tweaks
    • Add unit tests
    • Add end-to-end tests?
  • Add notifications support***
    - Check if a user can play from two devices at the same time
    - What happens if a user enters an app and do not visit personal page, will them be able to play game and save data? (Aibek)

  • Add sounds (IN NEXT VERSION)

  • Write a shell script for initializing a working environment (like IP change)

Common application behavior tests

Write here

  1. All clients disconnect before game ends -> The game should immediately stop, and no results should be saved into DB, the game entry in Redis should be deleted

  2. There are multiple clients, all except one disconnect -> The game should continue, there should not be an entry in redis, and the data of single player should be saved into DB.

  3. All players finish the game, one loses and another wins -> Both players should be saved into DB, no game record should be left in Redis

  4. One player creates a room, then immediately exits it, and then enters again while the room has not yet started -> An (authenticated) user should be able to enter the room, however should be replaced. However, when playing anonymously should not be replaced, the result from disconnected players just has to be not saved into DB. The client should disconnect from a room, which was written in its socket._serverData.roomKey during creation of room or assignation to it. The client should flush the roomKey after gameEnd/disconnect.

  5. If user (both anonymous and authenticated) is disconnected, then they should be marked in redis as disconnected. They should be not saved to DB.

  6. Game was created, however all players left -> the game should not even start

  7. First player creates a new game, after it starts, second player creates another game -> There should be two completely separate games.

  8. Bots should be created, if there less than some amount of players

  9. Anonymous limiter (maximum 50 games from one IP) should be present, check this if a user signs up then, or signs in

  10. Maximum players in room should be checked

  11. Disallow same ip address from creation of too many rooms

  12. Make game-server encrypt data between client and server, and make it unfakeable

  13. Test for leaked timers periodically, delete them automatically

  14. When a game finishes, all sockets should be closed

  15. When a user send too many racedata requests -> The user should be blocked and connection should be closed, the player also needs to be removed from room.

Serious bug with authentication

On a first app entry, when a user signs in to the app, there is a inconsistency between firebase and the web-server. The user is not persisted in the web-server.

For example, if a client sends request in order to get the basic information of the user, it receives 400 error and crashes.

It can happen both when a user signs up or signs in.

We actually must send a request to create the user on the webserver (on sign in/up), and only then send the requests for their info.

Forbidden action game server

Error: Forbidden action game:5598d57b-9988-4c74-9df6-d6c255f84d6f:en
File "/Users/admin/Documents/UNIST/8semester/typemasters-game/game-server/index.js", line 325, in _validateClient
const err = new Error('Forbidden action ' + data.roomKey)
File "/Users/admin/Documents/UNIST/8semester/typemasters-game/game-server/index.js", line 250, in Command.callback
if (!_validateClient(room, data, socket)) {
...
(8 additional frame(s) were not displayed)

Watch on sentry

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.