Notes
Notes - notes.io |
class Server
datamembers
vector<Game>
vector<disconnectedGames>
vector<client>
methods
createGame() //add to vector, perhaps some initialization
startServerMethod(ServerType)
authorizeGame()
removeGame() //remove from games
subclass Host
vector<game> (size 1)
game constructor method
class Game //after game ends, send all info on game (maybe disconnected)
datamembers
vector<client>
enum GType = {Started, Public, Private}
GameID
map
methods
hardSync() //resend all resync info to clients
endgame() //send to database
class Client
datamembers
connection
userinfo //get identifier from webserver
joinedGame //game the client has joined
bool doisconnected //could check existence of connection
bool isHost //is this client the host or not
class Connection
methods
send
recieve
class enum ServerType = { p2p, mainserver }
class Map
Mapdata //general
class Action
/* NEW CONNECTIONS
* 1. Server recieves a connection
* 2. Determine connection type (host, client, spam)
* Check Login, send to web server (use JSON request)
* 3. What does connection want? Create or join a game (host or client), or join disconnected game?
* ceate; move on to creation
* joini public: Give list of public games
* join disconnected; check games with disconnected clients
* join private: let invited players join
*/
/*
* CREATE GAME
* 1. Is user in a game?
* yes: disconnected from game?
* yes: run joindis(), skip some checks, run resync
* no: reject connection, wait for game to finish
* no: create a game with client as host, check for valid game initialization info, kill client if no info
* 2. Create game using given client info (public/private, number of
* ...wait for clients in the game
*
*
* 3. start game, send all clients (not host) map info
*
*/
/* JOIN GAME (Disconnected, Public, Private)
* 1. Check if they sent proper join info (gameid, invite, disconnected, [gameid,password], [LAN])
* gameid: check if exists
* invited: check if invited
* disconnected: check disconnected games
* [gameid+password]: check gameid and password validity
* password good: try again
* invalid check: kill
* 2. Check game status
* disconnected: reestablish connection and hardSync()
* otherwise: add client to vector in game
*/
/* PROTOCOL
* Assumptions:
* 1. Game will send commands like
* createEntity, entity id, entity info
* actionEntity, entity id, action
* modifyEntity, entity id, entity info
* destroyEntity, entity id,
*
* Store map info server side periodically
* broadcast to clients
*
*/
|
Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 12 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team