Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mazurwiktor/photon_decode
Set of utilities for decoding messages generated by photon framework.
https://github.com/mazurwiktor/photon_decode
Last synced: 2 months ago
JSON representation
Set of utilities for decoding messages generated by photon framework.
- Host: GitHub
- URL: https://github.com/mazurwiktor/photon_decode
- Owner: mazurwiktor
- License: apache-2.0
- Created: 2019-11-13T18:20:02.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-01-26T11:48:16.000Z (almost 5 years ago)
- Last Synced: 2024-10-01T16:26:16.192Z (3 months ago)
- Language: Rust
- Size: 23.4 KB
- Stars: 12
- Watchers: 3
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
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](https://docs.rs/photon_decode/badge.svg)](https://docs.rs/photon_decode/*/photon_decode/)
## Usage
To use `photon_decode`, first add this to your `Cargo.toml`:
```toml
[dependencies]
photon_decode = "0.1"
``````rust
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* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
* MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)at your option.