RediSkript/README.md

86 lines
3.9 KiB
Markdown
Raw Normal View History

2021-05-15 23:05:37 +00:00
[![RediSkript Build](https://github.com/Limework/RediSkript/actions/workflows/maven.yml/badge.svg?branch=master)](https://github.com/Limework/RediSkript/actions/workflows/maven.yml)
2020-10-24 11:32:48 +00:00
RediSkript allows you to communicate between your servers with use of Redis, it's very fast and easy to use.
2020-12-16 10:55:19 +00:00
Skript: https://github.com/SkriptLang/Skript
2020-12-16 10:55:43 +00:00
2020-12-16 10:55:19 +00:00
RediSkript spigot page: https://www.spigotmc.org/resources/rediskript-communicate-between-servers-with-ease.85067/
2020-12-26 12:28:13 +00:00
Jedis: https://github.com/redis/jedis
2020-10-24 11:32:48 +00:00
You can transfer any data in the form of text between your servers, you can program it to execute a set of instructions on the server depending on the redis message, etc. This can be used for making scripts that sync data between all servers and much more!
2020-12-14 12:20:17 +00:00
It is developed and maintained by Govindas & the team of Govindas Limework developers.
2020-10-24 11:32:48 +00:00
2020-11-28 08:12:11 +00:00
Redis Message:
2020-10-24 11:32:48 +00:00
```
on redis message:
if redis channel is "world":
broadcast "%redis message% %redis channel% %redis message date%"
command /sendredis <text> <text>:
usage: /sendredis <message> <channel>
trigger:
send redis message arg 1 to channel arg 2
send redis message "hello world!" to channel "world"
```
2020-11-28 08:12:11 +00:00
Managing variables:
```
set variables "test::1", "test::2", "test::3" in channel "global" to 100
#then use this in any server that listens to "global" redis channel and was online when the above line was executed:
send "%{test::*}%" #outputs 100, 100 and 100
delete variables "test::*" in channel "global"
2020-10-24 11:32:48 +00:00
2020-11-28 08:12:11 +00:00
set variable "test::%uuid of player%" in channel "playerdata" to tool of player
#then you can in any server that is listening to "playerdata" channel and was online when the above line was executed:
give {test::%uuid of player%} to player
```
Syntax:
```
variable[s] %strings% in [redis] [channel] %string%
```
2020-11-28 08:14:19 +00:00
There is only one command: /reloadredis it fully reloads the configuration, you can reload IP, password, channels and everything else.
2020-11-28 08:12:11 +00:00
You only need to have matching configuration in every server for communication and a Redis server to connect to. I recommend using VPS for hosting redis server, I personally use VPS from humbleservers.com.
2020-10-24 11:32:48 +00:00
Configuration:
```
Redis:
#a secure password that cannot be cracked, please change it!
#it is also recommended to firewall your redis server with iptables so it can only be accessed by specific IP addresses
Password: "yHy0d2zdBlRmaSPj3CiBwEv5V3XxBTLTrCsGW7ntBnzhfxPxXJS6Q1aTtR6DSfAtCZr2VxWnsungXHTcF94a4bsWEpGAvjL9XMU"
Host: "127.0.0.1"
#must be 2 or higher, if you set to lower, the addon will automatically use 2 as a minimum
MaxConnections: 2
#the default Redis port
Port: 6379
#time out in milliseconds, how long it should take before it decides that it is unable to connect when sending a message
#90000 = 90 seconds
TimeOut: 90000
#also known as SSL, only use this if you're running Redis 6.0.6 or higher, older versions will not work correctly
#it encrypts your traffic and makes data exchange between distant servers completely secure
useTLS: false
#may be useful if you cannot use TLS due to use of older version of Redis
#however this will not encrypt the initial authentication password, only the messages sent
#it uses AES-128 SIV encryption which is secure enough for this
EncryptMessages: true
EncryptionKey: "16CHARACTERS KEY"
MacKey: "16CHARACTERS KEY"
#the channels from which this server can receive messages
#you can always send messages to all channels!
#you can add as many channels as you wish!
Channels:
- "Channel1"
- "Channel2"
- "Channel3"
```
2021-05-23 20:44:22 +00:00
## YourKit
YourKit supports open source projects with innovative and intelligent tools for monitoring and profiling Java and .NET applications. YourKit is the creator of [YourKit Java Profiler](https://www.yourkit.com/java/profiler/), [YourKit .NET Profiler](https://www.yourkit.com/.net/profiler/) and [YourKit YouMonitor](https://www.yourkit.com/youmonitor/).
![YourKit](https://www.yourkit.com/images/yklogo.png)