mattmarji / mazewar Goto Github PK
View Code? Open in Web Editor NEWDistributed Systems Lab
Distributed Systems Lab
Introduction ============ This implements a client-server Mazewar game. Additionally, the MSocket class can be used to induce errors, such as adding delays and reordering packets. Architecture ============ The server starts and listens on some port. When a client contacts the server, the server spawns a ServerListenerThread. Server.java defines the MAX_CLIENTS constant that determines the maximum number of clients that join. When the expected number of clients have contacted the server, the server spawns a single ServerSenderThreads, that broadcasts the name and location of all the clients (this requires that names must be unique). When an event happens, it is sent to the server. The server stamps the event with a global sequence number and broadcasts to all hosts. The client and server communicates using MSockets, and MServerSockets which are analogous to Sockets and ServerSockets. MSockets are constructed by passing a host address and port. MSockets expose two main methods, readObject and writeObject to read and write objects, respectively. The MSocket can reorder packets and add delays based on 3 constants defined in MSocket.java, namely DELAY_WEIGHT, DELAY_THRESHOLD, UNORDER_FACTOR. Errors are added both on sending and receiveing packets. Making and Running ================== To make the project run make To run the server: </path/to/java/>java Server <listening port> To run the clients: </path/to/java/>java Mazewar <server host> <server port>
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.