Skip to content

Instantly share code, notes, and snippets.

@kasymovga
Last active March 3, 2021 12:00
Show Gist options
  • Save kasymovga/db36ada5209434806c804a16b293886d to your computer and use it in GitHub Desktop.
Save kasymovga/db36ada5209434806c804a16b293886d to your computer and use it in GitHub Desktop.

Requirements

  • Two of more server instances of Rexuiz.

Server interconnect example

For example you have 3 servers:

Server1 1.2.3.1:26051
Server2 1.2.3.2:26052
Server3 1.2.3.3:26053

First you need decide which server will have main role. In this example this is Server1. For setup this role you need add this lines to server.cfg:

sv_updchat_id Server1
sv_udpchat_client1 1.2.3.2:26052 //Server2
sv_udpchat_client2 1.2.3.3:26053 //Server3

You need list client servers with sv_udpchat_client* cvars. Note that you cannot omit cvar index, if sv_udpchat_clientX is empty then sv_udpchat_clientX+1 and next after that will be ignored.

On other servers (clients) you need add this lines: Server2:

sv_udpchat_id Server2
sv_udpchat_server 1.2.3.1:26051 //Server1

Server3:

sv_udpchat_id Server3
sv_udpchat_server 1.2.3.1:26051 //Server1

Forwarding chat to external gateways

You can connect server chat for other chats with gateways. Gateway is any software that can parse Rexuiz UDPChat packets and forward messages to other chats. For example if you need link your server with address 1.2.3.1:26051 chat to discord with gateway on server with ip address 1.2.3.4 you will need do next:

  1. Create bot and invite him on your server. Here is example how to do it: https://discordpy.readthedocs.io/en/latest/discord.html You will need add permission for sending and read messages to your bot.

  2. Build rexudp2discord gateway. You will require install golang and git for this first.

git clone https://github.com/kasymovga/rexudp2discord
cd rexudp2discord
go build
  1. Obtain your bot token from your bot page in discord.

  2. Obtain channel id on your discord server in which you want forward server chat (just right click on channel and "Copy id").

  3. Run rexudp2discrod, in this example XXXXXX is your bot token and YYYYYY is channel id:

./rexudp2discord -t XXXXXX -c YYYYYY -s 1.2.3.1:26051

rexudp2discord listen port 10000 by default. you can change it with -p option.

  1. Connect your rexuiz server to discord gateway by adding this settings in server.cfg:
sv_udpchat_server 1.2.3.4:10000
sv_udpchat_id Server1

In case if your server is already main server of rexuiz updchat you can add discord gateway as a client:

sv_udpchat_client3 1.2.3.4:10000

  1. After testing that everything work you will need setup rexudp2discord as system service to avoid manual run everytime when server rebooted.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment