Raised This Month: $51 Target: $400
 12% 

Updated other servers when info changes in SQL table


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-28-2009 , 20:53   Updated other servers when info changes in SQL table
Reply With Quote #1

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.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!

Last edited by Exolent[jNr]; 05-28-2009 at 20:56.
Exolent[jNr] is offline
danielkza
AMX Mod X Plugin Approver
Join Date: May 2007
Location: São Paulo - Brasil
Old 05-28-2009 , 23:56   Re: Updated other servers when info changes in SQL table
Reply With Quote #2

What kind of data is it? How often is it modified?
__________________

Community / No support through PM
danielkza is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-29-2009 , 00:28   Re: Updated other servers when info changes in SQL table
Reply With Quote #3

It is the ban information for my Advanced Bans.
I currently went with option #1 with a 1 minute interval between reloading the bans.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
zwfgdlc
Senior Member
Join Date: May 2006
Old 05-29-2009 , 01:53   Re: Updated other servers when info changes in SQL table
Reply With Quote #4

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.
zwfgdlc is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-29-2009 , 13:00   Re: Updated other servers when info changes in SQL table
Reply With Quote #5

Quote:
Originally Posted by zwfgdlc View Post
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?
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
danielkza
AMX Mod X Plugin Approver
Join Date: May 2007
Location: São Paulo - Brasil
Old 05-29-2009 , 13:15   Re: Updated other servers when info changes in SQL table
Reply With Quote #6

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.
__________________

Community / No support through PM
danielkza is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 19:24.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode