1 Attachment(s)
[Arcturus] Simple RCON wrapper
Simple PHP wrapper for Arcturus RCON.
Available commands:
# $hotelAlert('message', 'url') // optional url
# $disconnect(userId)
# $sendCredit(userId, amount)
# $sendPixel(userId, amount)
# $sendPoint(userId, amount)
# $sendBadge(userId, badgeName)
# $sendGift(userId, itemId, 'message') // optional message
Just download the file and edit line 7 in index.php with RCON host and port.
Latest version: https://github.com/higoka/arcturus-rcon/releases/latest
If you want me to implement other commands post it here or create a issue on github
Re: [Arcturus] Simple RCON wrapper
Added three new commands:
# Send a alert to all staffs.
$staffAlert('message')
# Send a alert to a user.
$userAlert(userId, 'message')
# Mute a user. Duration in seconds.
$mute(userId, duration)
You can download the latest version from here: https://github.com/higoka/arcturus-rcon/releases/latest
Re: [Arcturus] Simple RCON wrapper
Why not make them as a "real" function instead of an anonymous function in a global variable. You generally want to avoid global variables. Another thing is that you can't (without explicity telling so) access that variable inside another function.
Another thing you can try look at; make it more user friendly. You still have a lot of boilerplate code. By that I mean setting up the connection and writing the actual data. You can make a nice class for it that handles it.
Good luck!
Re: [Arcturus] Simple RCON wrapper
Im kind of used to nodejs thats why i use anonymous functions. I think a class for such simple thing is overkill. But i can make a seperate branch whit OOP, if there is enough interest.
Thank you for the feedback.
Re: [Arcturus] Simple RCON wrapper
A function would also suffice for sending, indeed :)