Updated other servers when info changes in SQL table
I need to be able to notify the other servers that use the same SQL database as one server when that one server updates, inserts, or deletes information on the table.
I thought of 2 solutions myself, and I wanted to know which is better, and if there was a better way than these 2. 1. Constantly retrieve the information from the database (scheduled tasks). 2. Use sockets and send a unique piece of data from one server to all the other servers (all ips are found in a .ini file) and then those servers know to read the database again. |
Re: Updated other servers when info changes in SQL table
What kind of data is it? How often is it modified?
|
Re: Updated other servers when info changes in SQL table
It is the ban information for my Advanced Bans.
I currently went with option #1 with a 1 minute interval between reloading the bans. |
Re: Updated other servers when info changes in SQL table
firs register a server console command for update ban information ,For example:"amx_update_baninfo" ,
and using the "socket" modules send a message to other server,like "rcon amx_update_baninfo". Reference Information: http://developer.valvesoftware.com/wiki/Server_Queries. sorry for my english. |
Re: Updated other servers when info changes in SQL table
Quote:
Also, your idea is unnecessary. Why use a command instead of reading the data and then loading the bans? |
Re: Updated other servers when info changes in SQL table
Checking on a fixed interval seems like a better way. Using sockets would make you need to list all servers somewhere, and the risk of having race conditions is huge.
As long as you make it easily modifiable in a cvar it shouldn't be a problem. |
All times are GMT -4. The time now is 17:51. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.