openscope / openscope

openScope Air Traffic Control Simulator
http://www.openscope.io
Other
617 stars 176 forks source link

[SPIKE] Separate client from server task list #124

Open erikquinn opened 7 years ago

erikquinn commented 7 years ago

From @erikquinn on December 15, 2016 17:5

Divisions will need to be made on which tasks are to be done locally in the user's browser, and which tasks will be done by the server.

Divisions of Responsibilities

Client-Side

Server-Side


Exchanges of Information

Server-Side

Client-Side

Copied from original issue: n8rzz/atc#212

erikquinn commented 7 years ago

From @n8rzz on December 20, 2016 3:59

There will be a lot of pieces that will need to change, be created, or moved in order to successfully accomplish this split. Here are a few major ones, that could be tackled now(ish):

The endgame with the aircraft is to have a single collection of all the aircraft models in the sim that is portable and easy to work with on both the server and the client.

This list will be added to and issues will be created from this list soon.

erikquinn commented 7 years ago

From @n8rzz on December 20, 2016 4:4

@erikquinn I propose that this issue be treated as a placeholder for thoughts and ideas pertaining to the split of client and server. From here we can then create actionable issues that are of manageable size. We can use this issue as a sounding board and note pad.

erikquinn commented 7 years ago

From @n8rzz on December 21, 2016 5:2

@erikquinn I am beginning to think that Redux may be a solution for transfer of data, history, replay, and overall state management. I've been toying with the idea of using it for a while and now my mind just keeps coming back to it.

If you are unfamiliar, Redux provides a way to predictably change the application state. It's typically lumped in with React (which is how I have come to know it) but it can be used on its own without React.

It just makes sense. It checks several boxes:

Thats really what we have here: a state that gets updated in a predictable way.


I'm mostly typing out loud here to share where my head is at. This may not be the best solution, but I think it's something to thin about for sure. I'm a fan of Redux and I've used it a lot with React. It's a little weird to start with, just because it is so different to work with for a lot of Javascript developers. But, after a little while, it clicks and you realize why it is so powerful.

At any rate, I think this might deserve a POC so I can get in and get my hands dirty n8rzz/atc#234.

erikquinn commented 7 years ago

@n8rzz That does sound incredibly promising... just reading their own description of it sounds like exactly what we would want.

erikquinn commented 7 years ago

From @n8rzz on December 22, 2016 1:21

Slack for iOS Upload.jpg

erikquinn commented 7 years ago

Reference the "update" phase in the above, depending on the role of the Player needing an udpate for its aircraft, it may only need a very limited amount of information to get by. There's two options:

  1. Send all AircraftInstanceModels as they exist in AircraftController.aircraft.list Note: Requires less processing by the server, but requires more bandwidth due to the excess data

  2. Extract only the pertinent information from each AircraftInstanceModel, and send that (when role='controller', as little as {callsign, position, flightplan_route} may be sufficient) Note: Requires more processing by the server, but requires far less bandwidth due to the minimal data

Depending on which is the limiting factor performance-wise for the server operations, which we have still yet to determine, one option may prove significantly better than the other.