• Global Chat -- Chat with multiple gmod servers
    45 replies, posted
As seen in key G-mod communities, you can now chat across multiple servers using this MySQL based script [release] [b]Information:[/b] This is a customizable addon using andyvincent's MySQL module to transmit chat messages over multiple servers. [b] Features: [/b] [list] [*] Customizable refresh rate (how often to recieve new messages from the MySQL) [*] Customizable table deletion time (How often to purge the MySQL table of all messages, to reduce lag and large queries) [*] Anti-Flood (Or anti-spam) with a time setting [*] Countless other script traits and variables I could define as a *feature* ? [/list] [/release] [release] [b]This requires your own MySQL Database to use. This will not work without the gm_mysql module ([url]http://forums.facepunchstudios.com/showthread.php?t=241247[/url]) [/b] :siren: This does [highlight]NOT[/highlight] create a huge chat room with every server running it, nor does it replace normal chat. This is an optional global chat (Used by typing /g <message> by default) used between either multiple servers you own, or between you and other G-mod servers of your choice :siren: [/release] [release] [b]Installation:[/b] Extract the globalchat folder to [b]garrysmod \ addons[/b] Navigate to and open the [b]globalchat \ lua \ autorun \ server \ chat.lua[/b] file. You need to edit the MySQL data to your database, and other variables as shown below: [lua] -- Variables -- local serverName = "Server X" --Name of the server to be displayed in the chat local trigger = "/g" --Trigger to send the global chat local antiflood = 30 --How often a client can send a global chat (0 to disable, NOT reccomended) -- MySQL Variables -- local host = "localhost" --Host address local user = "username" --MySQL Username local pass = "password" --MySQL Password local database = "chat" --Database used to store the chat table local port = 3306 --Port to connect to local persistent = true --Use a persistant MySQL connection? local updatetime = 30 --In Seconds, how often to get messages from the MySQL local cleantime = 10 --In MINUTES, how often to delete all records from MySQL table (To prevent the table from growing too large)[/lua] The table structure is found in the chat.lua file or here: [b]Table structure [/b] [quote]CREATE TABLE `chat` ( `message` text NOT NULL, `location` text NOT NULL, `id` int(11) NOT NULL auto_increment, PRIMARY KEY (`id`) )[/quote] [/release] [release] [b] Screenshots [/b] [i] Not too much to take a screenshot of..[/i] contrasting local to global chat [img]http://img145.imageshack.us/img145/6774/gmconstruct0002hg1.jpg[/img] Anti-flood [img]http://img75.imageshack.us/img75/2341/gmconstruct0000ub0.jpg[/img] [/release] [release] [b]Download:[/b] [url=http://www.garrysmod.org/downloads/?a=view&id=45844][img]http://www.garrysmod.org/img/?t=dll&id=45844[/img][/url] [b]Current version: 1.0.1[/b] [/release] [release] [b]Changelog[/b] [code] [list] [*] Version 1.0.1 Fixed messages not outputting when another server clears the table [*] Version 1.0 Fixed small problem with the substring not calculating for a longer trigger (More characters that is) [*] Version 1.0 first release [/list] [/code] [/release] I use MySQL as opposed to sockets to do the communication between servers for ease and expandability. Instead of having to edit the file in every server when adding another, the new server simply has to connect to the existing MySQL database. (And well, to be honest, I don't know where to start with sockets) :siren: [highlight][b]Please report any bugs here [/b][/highlight]:siren:
yay its finally here! it reminds me of war of the servers
1.0.1 Released (That was quick eh) [code] [list] [*]Version 1.0.1 Fixed messages not outputting when another server clears the chat [/list] [/code] See OP for download
Seems like it'd lag insanely. Try making one with sockets, seems like it'd be more efficient.
Cool idea, although i wish it would work with css or even all Source games :P Could you do it with microphones aswell? Good job so far!
[QUOTE=Looter]Seems like it'd lag insanely. Try making one with sockets, seems like it'd be more efficient.[/QUOTE] It only updates every x seconds (30 default), so it wouldn't lag as if it was a constant query I was actually thinking about making a socket version. I went with MySQL just to make it easier for the average person to use (If they can get MySQL working correctly that is) I'll work on making a socket version of this script. [quote=Ketchupy] Cool idea, although i wish it would work with css or even all Source games :P Could you do it with microphones aswell? Good job so far! [/quote] Microphones would be a whole new ballgame. And compatibility with all Source games might not be out of the question (TF2 and CS:S if nothing else, as these are the most popular)
Thanks, a socket version would be great.
I <3 you
Some screenshots (As if they were needed?) [img]http://img145.imageshack.us/img145/6774/gmconstruct0002hg1.jpg[/img] [img]http://img75.imageshack.us/img75/2341/gmconstruct0000ub0.jpg[/img] Not really much else to take a screenshot of.
Awesome work.
Cool.
Update: Still pretty much stuck at the gate for a socket version, Haven't had much experience with sockets so don't really know where to start. Anyone who could help with sockets, or how to use them, security factors that should be considered, etc, please feel free (And please do) contact me. My steam profile page is: [url]https://steamcommunity.com/id/suicidebomber[/url] , you should be able to add me through there. Any other hints, suggestions or comments would be highly appreciated
It would be rather awesome if someone could explain how to set up a MySQL Database without having too much work.
Awesome idea! :D
you should instead have global chat hooked through an irc channel. So it can be more instant :D.
I use this on my 2 servers :) Works great!
I think i have see this addon on another server its ace. I have been searching for ways to get garrysmod chat on to my website and then i found "Web Interface for GlobalChat" so i downloaded it and setup a database (i don't know mysql lol) but i got the web interface working. I edited the lua files so the server knows the IP,user,pass and database. I can't get your addon to work :S I don't know if it is my bad luck the addon or gm_mysql. please help
Hmm, sounds nice. I think there's a plugin by FLOOR_MASTER that implements it via SourceMod - I'll have to see which one is more efficient.
@suicide_bomb - I have done this server -> server chat with my Modified Fairy Addon, and found that if you do the sql connection per player, will cause mixed results lag wise. If you think of it logically, the laggiest part of mysql is the initial connection. Send Username Send Password Send Databasename Send Table Send query Get Result and if you are doing this per a player, even if on a timer, you can end up with 3 or 4 queries going off in a row, or even at same time... (And if this is using gdatabase, you need to make sure that the Database connection variable is unique, otherwise another players connection to db will fail if that variable name exists already.) The way I got around this was to open 1 connection for the server, and just keep it open, and every 6 or 7 seconds, for each player, query to see if there are any messages for that specific player, if not, do nothing, if there is, send them the message. Means that no matter how many players join, the queries are all going off at a fixed time, and there will never be more than one connection per server. (My fairy network is slightly different, in that I have provided a MYSQL database as a central repository, for all users to use, accross all servers that the addon gets installed on.)
This would be great if it wasn't deleted...can you post a mirror?
Oh ancients somewhere, ze bump! ZE BUMP! You just had to do it eh? :smug:
I want it too D:
I will try and contact him as i think i have him on steam
Although I know very well how to do this myself I'd like to see your work, but it appears not to be online.
Constantly polling a mysql db for the latest messages is terrible, this should be rewritten utilizing the sockets module and shit.
This great. [highlight]LINK IS BROKEN WE NEED A NEW ONE NAOW[/highlight]
Anyone have this script? Or anyone knows if there is any script of sockets global chat? Thanks.
I'm currently recoding this without mysql. Release date should be tomorrow.
Neat, how do you do that without mysql? (if it is super complicated don't tell me ;)
[QUOTE=The-Stone;17341134]I'm currently recoding this without mysql. Release date should be tomorrow.[/QUOTE] That sounds crazy. Insane
Sorry, you need to Log In to post a reply to this thread.