Skip to content

Lightning fast, yet lightning simple

License

sasial-dev/Buremo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Buremo

This is a work in progress! It will be published to npm as @rbxts/buremo once a stable version is complete.

Installation

Flamework must be setup on your project for the macros to work. If you do not have it installed, follow this guide. You do not need to use any other features of Flamework such as Flamework.ignite.

Quick Example

const remotes = createRemotes<{
	test1: Remote<ToServer, [string]>;
	test2: Remote<ToClient, [string], Unreliable>;
	test3: {
		test4: Remote<ToServer, [string]>;
		test5: Remote<ToServer, [string]>;
		test6: {
			test7: Remote<ToServer, [string]>;
			test8: Remote<ToServer, [string], Unreliable>;
		};
	};
	test9: {
		test10: Remote<ToServer, [string]>;
	};
}>();

API Reference

createRemotes

function createRemotes<T>(
	scope?: string,
	reliableName?: string,
	// *
): Remotes<T>;

*(3rd, 4th and 5th paramaters omitted as they are populated by the Flamework transformer)

Example usage can be found at the quick example.

<T>

An object populated with Remote as properties. It can be nested. You can use the full scope of the TS type system here, so you can intersect objects, use other types to create the Remote property etc.

scope (optional)

If you have two instances of Buremo in your game, you will need to change this scope. You can do this by passing in a string.

It defaults to REMOTES.

If the obfuscation option of rbxts-transformer-flamework is set to true, the scope name will instead default to UUID.

reliableName (optional)

Because Buremo batches reliables, this name is used for the remote. If you wish to change it from the default you can pass in a string.

It defaults to Reliable.

If there is a remote with the name Reliable, Buremo will automatically find an alternative name.

If obfuscation option of rbxts-transformer-flamework is set to true, the reliable name will instead default to UUID.

Type Reference

Remote

interface Remote<Mode, Args, Type> {}

Mode

Must be one of ToClient or ToServer.

Args (optional)

Must be an array.

It has a default value of [] if not specified.

Type (optional)

Must be one of Reliable or Unreliable.

Has a default value of Reliable if not specified.

ToClient

This is a nominal type that sets the direction of the Remote to be sending data to the client.

ToServer

This is a nominal type that sets the direction of the Remote to be sending data to the server.

Reliable

This is a nominal type that makes the Remote use a RemoteEvent. The remote will be batched with other reliables and sent per frame.

Unreliable

This is a nominal type that makes the Remote use an UnreliableRemoteEvent.

About

Lightning fast, yet lightning simple

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published