Git Product home page Git Product logo

multiplayertictactoe's Introduction

Team memeber

Zepiao Han

Xuanyi Li

File structure

tictactoeServer.c and tictactoeClient.c are source C files.
makefile the file to compile and run C program.
prtocolUtilUDP.c and protocolUtilUDP.h are utility to handle the protocol.
tictactoeUtil.h and tictactoeUtil.c are utility to handle the game board.

Functionality

Multiple servers play with multiple client, including three major phases: init handshake (game creation or reconnection), play, end handshake (acknowledge win or draw).

Fault tolerant to server crash: clients could find available servers and seamlessly recover from the interrupted point.

Servers validate the packet, evict out of time games, reject overwhelmed request of game creation and reconnection.

Clients make pollings to find available servers.

Claim

MAX GAME = 3. (Macro Name: MAXGAME, Location tictactoeServer.c)

port number should falls into the range [1024, 65535].

tcp timeout unit is set to 15s for game play. (Global Variable Name: TIMEOUT, Location: protocolUtil.c)

multicast timeout is set to 10s and polling times is set to 3 at client end. (Macro Name: MLTTIMEOUT, RETRYTIMES, Location: tictactoeClient.c)

Multicast Address: MC_PORT = 1818, MC_GROUP = 239.0.0.1

Run Instruction

Step 1 Initialize

make clean

Step 2: Compile all source codes

make

Step 3: Get server ip address at Server side.

hostname -I

Step 4: Start server program at Server side.

./server <server port>

Step 5: Start one or more client programs to send move at Client side.

./client <server port> <server ip>

Step 6: Stop the server by typing Ctrl c at Server side.

multiplayertictactoe's People

Contributors

wirybeaver avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.