Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
@mu-online-js/mu-packet-manager
Advanced tools
It allows you to define packet structures in a single place and easily convert between buffer and object representations of these structures.
mu-online-js packet manager is a library that provides a simple way to define and manage packet structures used in the popular MMORPG game Mu Online. It allows you to define packet structures in a single place and easily convert between buffer and object representations of these structures. The library is designed to be used in any Mu Online server application that runs on node.js.
npm install @mu-online-js/mu-packet-manager
or
yarn add @mu-online-js/mu-packet-manager
First, you need to require the library in your code:
const packetManager = require('@mu-online-js/mu-packet-manager');
You can then get the list of available packet structures:
const structs = packetManager.getStructs();
You can define your packet structure using an object and convert it to a buffer like this:
const messageStruct = {
header: {
type: 0xC1,
size: 'auto',
headCode: 0xF4,
subCode: 0x06,
},
}
const message = new packetManager()
.useStruct(structs.MainCSSendServerListRequest)
.toBuffer(messageStruct);
You can also convert a buffer to an object like this:
const data = Buffer;/* a buffer received from the client/server */;
const messageObj = new packetManager().fromBuffer(data)
.useStruct(structs.CSServerListResponse).toObject();
Contributions are welcome! If you find a bug or have a feature request, please open an issue. If you want to contribute code, please open a pull request.
mu-online-js packet manager is licensed under the MIT License.
FAQs
It allows you to define packet structures in a single place and easily convert between buffer and object representations of these structures.
We found that @mu-online-js/mu-packet-manager demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.