Coder Social home page Coder Social logo

instytutxr / openp2p Goto Github PK

View Code? Open in Web Editor NEW

This project forked from joetex/openp2p

0.0 1.0 0.0 742 KB

Peer-to-Peer game networking library for thousands of players simultaneously. Work in Progress

License: MIT License

C# 95.36% Makefile 0.18% Perl 4.44% Batchfile 0.02%

openp2p's Introduction

OpenP2P

Peer-to-Peer networking library for thousands of players simulatenously.

Design

Networking Core Design
NetworkClient/NetworkServer 

  -> NetworkProtocol 
  
    -> NetworkSocket
    
      -> NetworkThread
      
    -> NetworkChannel
    
      -> NetworkPacket
      
        ->NetworkMessage
Message System

NetworkChannel defines the types of messages that can be created. NetworkMessage derived classes perform the serialization into the packet buffer. You create a message, configure the message variables, then send a ReliableMessage, Message, or Response. ReliableMessage will expect a Response type message from their target endpoint. Message and Response are unreliable messages.

In future NetworkPeer and NetworkPeerGroup will allow stacking messages into a single packet, when possible.

NetworkMessage header encodes 5 bytes for ChannelType (up to 16 channels, 4 bits), SendType (Message/Response 1 bit), Reliable (yes/no 1 bit), Redirect (1 bit + 2 bytes for user id), Message Owner ID (2 bytes), Message Sequence (2 bytes).

Event System

Current event system allows hooking into the NetworkChannelEvents OnMessage and OnResponse for when a NetworkMessage is received. There are also low level NetworkSocket events OnSend and OnReceive, for further customization.

Multi-threaded

Send, Receive, and Receive Processing are the 3 sub threads on top of main thread.

Goals

Build P2P system that can send reliable and unreliable messages, and connect users via a position based topology. The end goal is to support 1,000 + real-time players on a single server.

openp2p's People

Contributors

joetex avatar ruizj-ibm avatar thebricktop avatar

Watchers

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