java_distributed's People
java_distributed's Issues
implement scoring when there are two players
Implement TrackerStateGossipService
Every 0.5s, the user Gossip push out the TrackerState. If the recipient has a lower version, update the TrackerState, otherwise remains unchanged.
backup server should check whether primary server die every 0.5s
- First backup need to start the scheduler
- New backup also need to start the scheduler
Display player list and scoring
implement scoring when there are three players
Second Game Process Join
-
player mark itself as backup
-
tracker register the player in the list
-
player sync with primary server, build communication with primary
-
Primary sync the Game State to backup.
Create all the classes needed
Implement GameStateGossipService
Every 0.5s, the user should randomly gossip pull the state from other players. If the game version of other players is large, the use that state. Otherwise, remains unchanged.
Note: The reason we need it is because we want a player to get real-time update even though it is not making move request.
Third player joins the game
- joins the game
- gossip others to get the game state
- sync TrackerState to primary server ----> sync to primary server
- make a move and all three are updated
test
aaaa
First Game process join game
- receive N and K from Tracker
- render the grid and treasury
- generate location of treasury
- mark itself as primary
3rd player could not always sync its data to 4th player
Combine all stub into 1
Detect Crashing normal player
Using a single rmi registry
- Start joining Tracker only when all service starts
Tracker maintains player list info and N and K
player list [id, IP, port]
N is maze size
K is treasury number
Handle primary crash case
primary should check heart beat of backup
- primary should check heart beat of backup
- Gossip does not report whether server crash
- when promote as primary, need to spin the scheduler
- sync game state fail, will not find new backup server
Player gracefully exits the game
- 3rd player gracefully exits
- 4th player gracefully exits
Implement ServerSyncService
- Sync the updated GameState from primary server and backup server.
- Checking the heartbeat mutually (This is to prevent both servers from dying)
Register stub for each player beforehand
CS5223 Requirement Document
GUI:
[ ] name of the local player [top of the window]
Use Singleton to Store TrackerState
ssss
Game process should generate its own port
Implement MoveRequestService
Every time the player makes a move request, it will update primary server game state and get the updated game state as response.
Generate new treasury
Handle backup crash case
Server does not gossip
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.