GameTactic / Room

The "Room" component of Gametactic. Some say, its heart of the GameTactic.
GNU General Public License v3.0
14 stars 4 forks source link

Feature/193 WG API to Proxy + Refactor Room State + Implement basic Authentication + Implement premature code for Socket.io #196

Closed bryansamuel1 closed 4 years ago

bryansamuel1 commented 4 years ago

@Ataww , @NikoGrano , @MightyWizard83 , @Eirmas please read.

This PR contains some changes that are not yet working, or are in its early stages. Please bear that in mind.

Ataww this contains some of your Authentication work and it was necessary for me to include it so I can move the API calls to WG to use Nikos service anyway. I expect you to merge in this code when it gets merged into develop.

Niko and Eirmas this contains the removal of the old websocket code so now it doesn't error. The Socket.io code has yet to be completed and will be done in a later ticket. For now I wanted the code in develop to a) stop all the errors and b) give a developer a chance to work with Niko on the socket.io ticket

All developers this also contains a rework of the room state, which against was necessary for when I move the apis to back end as the old implementation was inefficient and was not scalable at all. The api calls for games have been moved to their own file in their folder /games. image This is the shape of the room state. It isn't finalised but holds the basics ready for all the future tickets.

  1. locale is the locale of the app for the user. It reads from the navigator.languages property on the browser. This area will need further work.
  2. game is the game name and all response api data. The api data is stored in an array of objects where you have the property name and data, where name is the unique name for the api data, and data is the data returned from the api.
  3. collections is the name given to a collection of tactics. By default all tactics are stored in a single collection (root) but over time we will implement nested collections allowing users the chance to group and lock tactics and collection of tactics.
  4. Tactics are an array of Tactic which holds all the data for its entities, its map and its shapes. Also whether it is locked from editing and which collection it sits in
  5. users is the array of users that have ever been on the app. This includes all offline and online users and their roles and permissions.
  6. isPresentationEnabled is a boolean that decides whether the app has been locked down for presentation mode
  7. presentationEnabledBy is a string | undefined that states who locked it down via JTI key.
  8. isPrivate is a boolean saying whether the room is a private or public room.

I am happy to explain more if you have questions.