fl0rek / projekttin Goto Github PK
View Code? Open in Web Editor NEWProjekt na przedmiot TIN realizowany w 4 osobowym zespole.
Projekt na przedmiot TIN realizowany w 4 osobowym zespole.
Game needs to send message on stdout to ClientAPP on user action
Server needs to keep track of mapping libnet client id <-> username for associated clients and keep track of their roles (viewer/player)
In case of libnet connection failure client needs to inform the user about error and mark chat messages that could to be saved.
In case of player mode client should request game state synchronisation on reconnect.
Game needs to be able to simulate move provided on stdin and return information whether it's valid move.
Game needs to be able to initialise itself from provided game state.
Server needs to initialise local libnet instance in server mode providing it with session key.
Client should provide libnet with user provided session key and request association.
In case of failure appropriate error message needs to be displayed to user.
Server needs to verify incoming chat messages against it's own associated users list.
Game needs to notify ClientAPP on stdout if provided move leads to invalid internal state and request whole game state resynchronisation.
Server needs to be able to query locally running game instance for current game state.
ChatAPP needs to create message from user provided text and send it on stdout
Server needs to appropriately answer client association messages namely:
In case of viewer:
Player:
library object needs to have single function that when called on properly initialised instance will fork and receive/send data in background.
Library needs to support serialising and deserialising c++ classes.
This could be done with either dedicated library (boost::serialize for example) or by adding serialize and deserialize methods to appropriate classes.
I would suggest latter as it enables exploiting tlv structure to it's full potential.
Client needs to be able to start GameAPP attaching its stdin/stdout to pipes to enable communication with it.
Seeding GameAPP with game state received from server is also needed.
Client needs to provide functionality for a chat client to send message to server via libnet
Library needs to enable as seamless reconnection as possible.
If connection can be reestablished all buffered messaged must be retransmitted and cannot be lost.
Function
attach(server_ip) -> error_code
needs to perform handshake with server using key provided for user (and server key on the other side).
I suggest sending encrypted helo message and performing symmetric key negotiation.
Client needs to enable game to request state synchronisation (in case game detects internal state inconsistency) or manually synchronising game state (e.g. on connect)
Server needs to be able to correctly answer current game state message request.
Server needs to save every received message (possibly marking it as invalid) and every sent message.
Client needs to handle receiving chat message from server and forward it to chat client
library needs to enable functionality
enque(tlv message) -> void
that broadcasts message to all associated instances.
Function should return immediately and send message in background. In case of error appropriate message should be locally sent.
Server needs to allow client to seamlessly reconnect in case of loss of connection.
Library needs to provide easy to use interaface to build tlv buffer
proposed methods:
void init() add(tag t, size_t length, byte[] value) TLV get()
There needs to be single method of signature:
attach(server_ip) -> error_code
that internally connects to server, performs all necessary handshakes and marks it as associated instance (from now on messages sent using enque
are sent there).
Function should return once associations finishes successfully or error occurs.
Server needs to verify incoming game messages against it's own associated users list.
Client needs to be able to start ChatAPP and attach its stdin and stdout to pipes to enable communication.
Client needs to support receiving game messages and correctly forwarding it to game instance.
Valid chat message needs to be checked against throttling policies and either rejected silently or broadcasted to all associated viewers.
Game needs to be able to initialise itself to beginning game state.
Client needs to be able to start GameAPP with clean state.
library needs to be able to convert byte buffer of known length into parsed structure
Game needs to accept game progress provided on stdin changing internal state accordingly.
ChatAPP needs to provide way for displaying error messages sent on stdin
Server needs to be able to start headless game instance
ChatAPP needs to be able to accept messages sent on stdin and display them appropriately
Game needs to be able to export current game state on request
Client needs to enable game to send messages via libnet
Client needs to be able to change from active player mode to viewer mode by starting ChatAPP and ending GameAPP.
library needs to provide functions that initialises it in server mode.
Session key will be passed there or in other initialisation function.
libnet should enable functionality akin to
wait_for_tag(tag t) -> tlv
that blocks until appropriate tag is received
Server needs to first check with locally running game instance whether proposed game message is valid and either reject it notifying sender or apply it on locally running game instance and broadcast it to all associated clients.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.