From 1613ca58be0cc3a4c53e72b63899b7fa4492ed7b Mon Sep 17 00:00:00 2001 From: onefang Date: Wed, 7 Aug 2019 07:44:25 +1000 Subject: Swap out MySQLGenericHandler and swap in MySQLRaw. Smaller, simpler, works better. --- OpenSim/Server/Handlers/Web/WebServerInConnector.cs | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'OpenSim/Server/Handlers/Web/WebServerInConnector.cs') diff --git a/OpenSim/Server/Handlers/Web/WebServerInConnector.cs b/OpenSim/Server/Handlers/Web/WebServerInConnector.cs index 8c14fde..bc34bae 100644 --- a/OpenSim/Server/Handlers/Web/WebServerInConnector.cs +++ b/OpenSim/Server/Handlers/Web/WebServerInConnector.cs @@ -49,7 +49,7 @@ namespace OpenSim.Server.Handlers.Web // This is all slow and clunky, it's not a real web server, just something to use if you don't want a real one. private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private IConfigSource m_Config; - protected MySQLGenericHandler m_Database = null; + protected MySQLRaw m_database = null; private Hashtable mime = new Hashtable(); private Hashtable ssi = new Hashtable(); @@ -78,8 +78,9 @@ namespace OpenSim.Server.Handlers.Web //// TODO - Should do the plugin thing to pick between database backends. //// Or not, we are all using MariaDB anyway. // m_Database = LoadPlugin(dllName, new Object[] { connString }); - m_Database = new MySQLGenericHandler(connString); - if (m_Database == null) + + m_database = new MySQLRaw(connString); + if (m_database == null) throw new Exception("Could not find a storage interface in the given module " + dllName); mime.Add(".gz", "application/gzip"); @@ -118,16 +119,16 @@ namespace OpenSim.Server.Handlers.Web private Hashtable WebRequestHandler(Hashtable request) { - long locIn = m_Database.GetCount("Presence", "RegionID != '00000000-0000-0000-0000-000000000000'"); // Locals online but not HGing, and HGers in world. - long HGin = m_Database.GetCount("Presence", "UserID NOT IN (SELECT PrincipalID FROM UserAccounts)"); // HGers in world. - long locOut = m_Database.GetCount("hg_traveling_data", "GridExternalName != '" + ssi["uri"] + "'"); // Locals that are HGing. + long locIn = m_database.Count("Presence", "RegionID != '00000000-0000-0000-0000-000000000000'"); // Locals online but not HGing, and HGers in world. + long HGin = m_database.Count("Presence", "UserID NOT IN (SELECT PrincipalID FROM UserAccounts)"); // HGers in world. + long locOut = m_database.Count("hg_traveling_data", "GridExternalName != '" + ssi["uri"] + "'"); // Locals that are HGing. Hashtable reply = new Hashtable(); - ssi["members"] = m_Database.GetCount("UserAccounts").ToString(); - ssi["sims"] = m_Database.GetCount("regions").ToString(); + ssi["members"] = m_database.Count("UserAccounts").ToString(); + ssi["sims"] = m_database.Count("regions").ToString(); ssi["inworld"] = (locIn - HGin).ToString(); ssi["outworld"] = locOut.ToString(); ssi["hgers"] = HGin.ToString(); - ssi["month"] = m_Database.GetCount("GridUser", "Login > UNIX_TIMESTAMP(FROM_UNIXTIME(UNIX_TIMESTAMP(now()) - 2419200))").ToString(); + ssi["month"] = m_database.Count("GridUser", "Login > UNIX_TIMESTAMP(FROM_UNIXTIME(UNIX_TIMESTAMP(now()) - 2419200))").ToString(); string reqpath = (string) request["uri"]; string[] query = (string[]) request["querystringkeys"]; -- cgit v1.1