@infernus/raknet
TypeScript icon, indicating that this package has built-in type declarations

0.11.0 • Public • Published

@infernus/raknet

npm npm npm bundle size

A wrapper of the popular SA-MP raknet plugin for samp-node.

Getting started

pnpm add @infernus/core @infernus/raknet

Example

import { Player } from "@infernus/core";
import {
  BitStream,
  IPacket,
  PacketIdList,
  OnFootSync,
  BulletSync,
} from "@infernus/raknet";
import type { IBulletSync } from "@infernus/raknet";

IPacket(PacketIdList.OnFootSync, ({ playerId, bs, next }) => {
  const sync = new OnFootSync(bs).readSync();
  console.log(playerId, sync);
  return next();
});

function sendBulletData(from: Player, to: Player | -1, data: IBulletSync) {
  const bs = new BulletSync(new BitStream());
  bs.writeSync(data);
  bs.sendPacket(to);
  bs.delete();
}

Package Sidebar

Install

npm i @infernus/raknet

Weekly Downloads

1

Version

0.11.0

License

MIT

Unpacked Size

83.4 kB

Total Files

6

Last publish

Collaborators

  • dockfries