ronkle
v1.2.1
Published
ronkle - real time roblox communication library
Downloads
1
Maintainers
Readme
RONKLE - Realtime Roblox communication library
Real time communication library for ROBLOX. Supports websockets.
Features:
- Easy to setup and use
- Complete freedom over what you receive and send
- Native serialization
- Extremely low latency (~14-16 ms local hosting)
- No packet or rate limit
- Lightweight
- Support for multiple roblox instances
- Protected sessions with keys
- Websockets support
Currently NOT available for public use...
Headstart
NOTE: this is only for the server side, the roblox side is different.
Installing ronkle:
npm i ronkle
Sample code:
Server side:
const ronkle = require('ronkle');
const { Packet, websocket } = ronkle;
const { Session, sessionEmitter } = ronkle.sessionRelations;
const hostingOptions = {
bind_address: "127.0.0.1",
bind_port: 24545,
max_sessions: -1, // infinite
logging_enabled: true
}
ronkle.hostServer(hostingOptions).then(() => {
// Creating
const session = new Session("Password", [123456789]);
console.log(`New session id: ${session.sessionId}`);
// Sending
const hiPacket = new Packet(
"hi",
{ // sender
id: 123456,
type: "RobloxServer"
},
{ // data
message : "hi"
}
);
session.sendPacket(hiPacket);
})
// Host a ronkle websocket server (native and easy support)
websocket.hostServer(24546);
// Intercepting and receiving
sessionEmitter.on('sessionCreated', (session) => {
// Intercepting an incoming packet
session.eventEmitter.on('receivedPacket', (packet) => {
const type = packet.type;
const sender = packet.sender;
if (type == "hi") console.log(`${sender.type} is sending hi!`);
websocket.sendMessageToAllClients(packet.json());
});
});
Roblox side:
local serverScriptService = game:GetService("ServerScriptService")
local ronkleFolder = serverScriptService:WaitForChild("Ronkle")
local socketController = require(ronkleFolder:WaitForChild("SocketController"))
socketController.Event:Connect(function(eventName, data)
if eventName == "connected" then
print("Connected!")
end
if eventName == "receivedPacket" then
local packet = data
if packet["type"] == "hi" then
local packet = {
["type"] = "hi",
["sender"] = { -- sender
["id"] = 0,
["type"] = "Server"
},
["data"] = { -- data
message = "hi"
}
}
socketController.SendPacket(packet)
end
end
end)
wait(1)
socketController.Session.Join(277921, "Password")
wait(3)
socketController.Session.Terminate()
wait(1)
socketController.Session.Create("Password", {ronkleFolder:GetAttribute("universeId")})
(real)coloride - 2023, not available to public and currently under no license.