diff options
author | Melanie Thielker | 2008-11-17 05:04:33 +0000 |
---|---|---|
committer | Melanie Thielker | 2008-11-17 05:04:33 +0000 |
commit | fa50156b4c2db13fa5c425dca48d1abfac404b6b (patch) | |
tree | 46dad432ccbe63313f75b4235dda95a78abe57c2 | |
parent | Fix previous build break (diff) | |
download | opensim-SC_OLD-fa50156b4c2db13fa5c425dca48d1abfac404b6b.zip opensim-SC_OLD-fa50156b4c2db13fa5c425dca48d1abfac404b6b.tar.gz opensim-SC_OLD-fa50156b4c2db13fa5c425dca48d1abfac404b6b.tar.bz2 opensim-SC_OLD-fa50156b4c2db13fa5c425dca48d1abfac404b6b.tar.xz |
Make the messageing server re-register with all it's user servers every five
minutes. This ensures that things don't get messy if a user server is restarted
and the user server's operator has no control over the host the message servers
run on.
-rw-r--r-- | OpenSim/Grid/MessagingServer/MessageService.cs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/OpenSim/Grid/MessagingServer/MessageService.cs b/OpenSim/Grid/MessagingServer/MessageService.cs index 5841672..77da306 100644 --- a/OpenSim/Grid/MessagingServer/MessageService.cs +++ b/OpenSim/Grid/MessagingServer/MessageService.cs | |||
@@ -29,8 +29,8 @@ using System; | |||
29 | using System.Collections; | 29 | using System.Collections; |
30 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
31 | using System.Net; | 31 | using System.Net; |
32 | using System.Reflection; | ||
33 | using System.Threading; | 32 | using System.Threading; |
33 | using System.Reflection; | ||
34 | using OpenMetaverse; | 34 | using OpenMetaverse; |
35 | using log4net; | 35 | using log4net; |
36 | using Nwc.XmlRpc; | 36 | using Nwc.XmlRpc; |
@@ -52,6 +52,8 @@ namespace OpenSim.Grid.MessagingServer | |||
52 | // a dictionary of all current regions this server knows about | 52 | // a dictionary of all current regions this server knows about |
53 | private Dictionary<ulong, RegionProfileData> m_regionInfoCache = new Dictionary<ulong,RegionProfileData>(); | 53 | private Dictionary<ulong, RegionProfileData> m_regionInfoCache = new Dictionary<ulong,RegionProfileData>(); |
54 | 54 | ||
55 | private System.Timers.Timer reconnectTimer = new System.Timers.Timer(300000); // 5 mins | ||
56 | |||
55 | public MessageService(MessageServerConfig cfg) | 57 | public MessageService(MessageServerConfig cfg) |
56 | { | 58 | { |
57 | m_cfg = cfg; | 59 | m_cfg = cfg; |
@@ -61,6 +63,9 @@ namespace OpenSim.Grid.MessagingServer | |||
61 | uc.DatabaseProvider = cfg.DatabaseProvider; | 63 | uc.DatabaseProvider = cfg.DatabaseProvider; |
62 | 64 | ||
63 | m_userManager.AddPlugin(cfg.DatabaseProvider, cfg.DatabaseConnect); | 65 | m_userManager.AddPlugin(cfg.DatabaseProvider, cfg.DatabaseConnect); |
66 | |||
67 | reconnectTimer.Elapsed += registerWithUserServer; | ||
68 | reconnectTimer.Start(); | ||
64 | } | 69 | } |
65 | 70 | ||
66 | 71 | ||
@@ -497,6 +502,11 @@ namespace OpenSim.Grid.MessagingServer | |||
497 | return regionProfile; | 502 | return regionProfile; |
498 | } | 503 | } |
499 | 504 | ||
505 | public void registerWithUserServer(object sender, System.Timers.ElapsedEventArgs e) | ||
506 | { | ||
507 | registerWithUserServer(); | ||
508 | } | ||
509 | |||
500 | public bool registerWithUserServer () | 510 | public bool registerWithUserServer () |
501 | { | 511 | { |
502 | Hashtable UserParams = new Hashtable(); | 512 | Hashtable UserParams = new Hashtable(); |