Skip to content

darfink/muonline-packet

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
res
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Mu Online Packet

This is an implementation of the network packet used in the MMORPG Mu Online. It supports C1/C2 XOR encryption as well as the symmetric-key algorithm used in C3/C4 packets.

Features

  • serialize: Includes derive, serialization and deserializaition.
  • codec: Includes a Tokio IO codec ready for use.

Example

Packet - derive

use serde::{Serialize, Deserialize};
use muonline_packet::{Packet, PacketEncodable, PacketDecodable};

#[derive(Serialize, Deserialize, Packet, Debug, PartialEq, Eq)]
#[packet(kind = "C1", code = "18")]
struct CharacterAction {
  direction: u8,
  action: u8,
}

fn main() {
  let action = CharacterAction { direction: 3, action: 7 };
  let packet = action.to_packet().unwrap();
  assert_eq!(&packet.to_bytes(), &[0xC1, 0x05, 0x18, 0x3, 0x7]);

  let action2 = CharacterAction::from_packet(&packet).unwrap();
  assert_eq!(action, action2);
}

About

An implementation Mu Online's network packet

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages