This is still a work in progress! My code is garbage and will continue to be, but more features will be added.
Introducing my very belated (in terms of release) global chat server. This software provides a foundation for garrysmod servers to communicate together using Zeh Matt’s wonderful glsock2 module!
Global chat allows you to send messages in between up to 32 servers! (More if you want to recompile the server with a different slot count :v).
It is very easy to set up, and very low bandwidth.
http://forum.facepunch.com/showthread.php?t=1234005 Get the GlSock2 module here!
Server Source Code
How to set it up
First, download the server software from here https://dl.dropboxusercontent.com/u/40443211/dev/GlobalChat-Server.zip
Place both the Global Chat 2.exe in a directory you feel comfortable with, then proceed to launch the executable.
When you’ve first launched it, it will enter configuration mode, which looks like this.
Enter your desired port and be sure to have it forwarded. Press ENTER once you’ve entered a port between 1 and 65535.
It will then ask you if you want to use a password, if you do, then press Y ( reccomended ); otherwise press N.
If you pressed Y, it will prompt you for a password, enter it then press ENTER to start the server.
Congratulations, the server is now ready to use.
Step 2 - Configuring the LUA addon.
You can get the lua addon here! Lua Addon
Download this, and install it into your server, be sure to drop the lua/bin/ folder into the garrysmod folder, otherwise it has a potential to not load properly.
After you have the global chat 2 folder in your addons, navigate inside it to lua/autorun/server/ and open sv_mcs.lua in your favorite text editor.
You will see something like this
Change GlobalChat.Server to the IP of your chat server that you set up in step 1, and the port to the port you specified in your configuration. (You can change it by typing changeport in the server console)
Next, assign a ServerID for that server, Mine is “DevTest”
Finally, specify your password, mine was “bablobrabbins”. (You can change the server password by typing “changeauthkey” in the server console.)
Now, restart your garrysmod server, you should see in the server console something like this.
If you do, good job! That server is now ready for global chat!
Repeat step 2 on your other servers (using different server ID’s) to connect the chats together!
Chat messages aren’t the only thing the server can send, experiment with it and see what you can send over servers with it, there’s a hook for the chat messages “GlobalChatMessage” its argument is the buffer table, return true to block.
You can also use GlobalChat.SendBuffer(tab,identity) to send a buffer to all connected servers. (Identity specifies the “Type” in the json table" and “tab” specfiies the “BufferData” index)