Code Monkey home page Code Monkey logo

connect4-multiplayer-common's Introduction

Connect 4 Multiplayer: Common

Build npm:latest npm:beta semantic-release

This library defines the packet interfaces and actions used by both the connect 4 multiplayer client and server.

Installation

Using npm:

$ npm i --save @brajkowski/connect4-multiplayer-common

Usage

Packet Interfaces

  • server => client packets adhere to the ServerPacket interface
  • client => server packets adhere to the ClientPacket interface

Action Values and Meaning

Both the client and the server send an action value in their respective packet payloads in order to trigger, and respond to, events:

ServerAction Values Description
0 The client action is not allowed.
1 An opponent has joined the session.
2 An opponent has placed a chip.
3 A new session has been created.
4 The client has joined a session.
5 The session the client is trying to reach does not exist.
6 The opponent has quit (graceful exit).
7 The game has finished and a new one is starting.
8 The session has ended (due to inactivity).
ClientAction Values Description
0 The client is requesting a new session to be created.
1 The client is requesting to join an existing session.
2 The client is requesting to place a chip at a location.
3 The client is gracefully quitting / leaving the session.

Building from Source

Using npm:

$ npm run build

will produce the compiled library under /dist.

connect4-multiplayer-common's People

Contributors

brajkowski avatar dependabot[bot] avatar

Watchers

James Cloos 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.