AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Updated other servers when info changes in SQL table (https://forums.alliedmods.net/showthread.php?t=93436)

Exolent[jNr] 05-28-2009 20:53

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.

danielkza 05-28-2009 23:56

Re: Updated other servers when info changes in SQL table
 
What kind of data is it? How often is it modified?

Exolent[jNr] 05-29-2009 00:28

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.

zwfgdlc 05-29-2009 01:53

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.

Exolent[jNr] 05-29-2009 13:00

Re: Updated other servers when info changes in SQL table
 
Quote:

Originally Posted by zwfgdlc (Post 837087)
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.

Thanks, that link helps, but not for this situation.
Also, your idea is unnecessary. Why use a command instead of reading the data and then loading the bans?

danielkza 05-29-2009 13:15

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.