Giter Club home page Giter Club logo

winter's Introduction

winter

Winter is coming

see https://github.com/mysteriumnetwork/winter-is-coming

Building

Build with clang

Options -std=c++11

Running

Any *nix will do as long as it has ifconfig

Usage:

winter server [game-name] winter client [client-name]

This program will only work on the LAN

Notes

There is almost no concept of security here and it's very easy to make the client and server crash, read out of bounds and generally misbehave.

The program is agnostic of your ip address. We don't even need to record where msgs are coming from.

This could be developed to allow players from different networks to play with each other.

  • It would need a well-known server
  • a client on one net registers with server
  • a client on other net registers with server
  • they're friends so they swap exchange public ips using server
  • they msg each-other a few times, ignoring the content
  • one net is host net, the other is client net
  • all traffic of this program from client net is then sent to host net
  • all traffic from host net that didn't originate from client net is sent to client net

Protocol

The maximum msg size is 2048.

The underlying protocol is UDP.

The msg layout is common across all ports.

[head] Six bytes, whose value MUST equal UTF-8[winter], required

[op] one byte, MUST be one of, required

0x01 - ANNOUNCE
0x05 - SHOOT
0x06 - HIT
0x07 - MISS
0x09 - LOSE

[_game_name_size] one byte, the size of the game name

[game_name] A span of bytes, the name of the game this msg is about

[size] two bytes (short int), the size of the rest of the payload.

[payload] A span of bytes whose length is equal to [size]


0x05 - SHOOT
payload:
[_name_size] two bytes (short int), the size of the name of the sender ((should just be one byte but oh well))
[name] span of bytes, the name of the sender
[x] one byte, the x coordinate
[y] one byte, the y coordinate

0x06 - MISS
payload:
MUST be exactly the same as the shoot msg that triggered this msg

0x07 - HIT
payload:
MUST be exactly the same as the shoot msg that triggered this msg

0x09 - LOSE
payload:
SHOULD not have any payload

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.