photon_decode

Crates.iophoton_decode
lib.rsphoton_decode
version0.2.1
sourcesrc
created_at2019-11-13 18:34:07.210876
updated_at2020-01-26 11:48:22.086613
descriptionSet of utilities for decoding messages generated by photon framework.
homepage
repositoryhttps://github.com/mazurwiktor/photon_decode
max_upload_size
id181031
size56,430
Wiktor Mazur (mazurwiktor)

documentation

https://docs.rs/photon_decode/*/photon_decode/

README

Photon decode

Set of utilities for decoding messages generated by *photon framework.

*Photon is a development framework for multiplayer games. More on https://www.photonengine.com/.

Documentation

Usage

To use photon_decode, first add this to your Cargo.toml:

[dependencies]
photon_decode = "0.1"
use photon_decode::{Photon, Message};

let mut photon = Photon::new();
let photon_packet = vec![
    0x00, 0x01, 			// PeerID
    0x01,                   // CrcEnabled
    0x00,                   // CommandCount
    0x00, 0x00, 0x00, 0x01, // Timestamp
    0x00, 0x00, 0x00, 0x01, // Challenge
];

for message in photon.decode(&photon_packet).iter() {
    match message {
        Message::Event(_) => {
            // use event
        },
        Message::Request(_) => {
            // use request
        },
        Message::Response(_) => {
            // use response
        }
    }
}

Projects using photon decode

https://github.com/mazurwiktor/albion-online-stats - Albion online stats is an extension to MMORPG game - Albion Online. It tracks network traffic and displays various statistics, such as damage and DPS meter calculated from in-game actions.

License

Licensed under either of

at your option.

Commit count: 7

cargo fmt