• Global Chat 2 - Connect your servers!
    0 replies, posted
[IMG]https://dl.dropboxusercontent.com/u/40443211/Share/2015-04/2015-04-11_00-17-00.png[/IMG] [B]This is still a work in progress! My code is garbage and will continue to be, but more features will be added.[/B] 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. [URL="https://dl.dropboxusercontent.com/u/40443211/dev/GlobalChat2.zip"]Lua Addon[/URL] [URL="http://facepunch.com/showthread.php?t=1234005&page=2"]http://facepunch.com/showthread.php?t=1234005[/URL] Get the GlSock2 module here! [URL="https://dl.dropboxusercontent.com/u/40443211/dev/GlobalChat-Server.zip"]Server Software[/URL] [URL="https://github.com/TheFreezebug/Garrys-Mod-Global-Chat"]Server Source Code[/URL] [B][U]How to set it up[/U][/B] First, download the server software from here [URL="https://dl.dropboxusercontent.com/u/40443211/dev/GlobalChat-Server.zip"]https://dl.dropboxusercontent.com/u/40443211/dev/GlobalChat-Server.zip[/URL] 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. [IMG]https://dl.dropboxusercontent.com/u/40443211/Share/2015-04/2015-04-11_00-27-16.png[/IMG] 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. [IMG]https://dl.dropboxusercontent.com/u/40443211/Share/2015-04/2015-04-11_00-31-33.png[/IMG] Congratulations, the server is now ready to use. [B]Step 2 - Configuring the LUA addon.[/B] You can get the lua addon here! [URL="https://dl.dropboxusercontent.com/u/40443211/dev/GlobalChat2.zip"]Lua Addon[/URL] 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 [IMG]https://dl.dropboxusercontent.com/u/40443211/Share/2015-04/2015-04-11_00-36-13.png[/IMG] 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. [IMG]https://dl.dropboxusercontent.com/u/40443211/Share/2015-04/2015-04-11_00-41-17.png[/IMG] 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! [B]Developers[/B] 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)
Sorry, you need to Log In to post a reply to this thread.