public void Initialize(OpenSim.Framework.IOpenSimBase openSim) { m_log.Info("[AURORADATA]: Setting up the data service"); OpenSimBase = openSim; Aurora.Services.DataService.LocalDataService service = new Aurora.Services.DataService.LocalDataService(); service.Initialise(openSim.ConfigSource); }
public XmlRpcResponse HandleXMLRPCLogin(XmlRpcRequest request, IPEndPoint remoteClient) { Hashtable requestData = (Hashtable)request.Params[0]; if (m_Proxy && request.Params[3] != null) { IPEndPoint ep = Util.GetClientIPFromXFF((string)request.Params[3]); if (ep != null) // Bang! remoteClient = ep; } if (requestData != null) { if (requestData.ContainsKey("first") && requestData["first"] != null && requestData.ContainsKey("last") && requestData["last"] != null && requestData.ContainsKey("passwd") && requestData["passwd"] != null) { string first = requestData["first"].ToString(); string last = requestData["last"].ToString(); string passwd = requestData["passwd"].ToString(); string startLocation = string.Empty; UUID scopeID = UUID.Zero; if (requestData["scope_id"] != null) scopeID = new UUID(requestData["scope_id"].ToString()); if (requestData.ContainsKey("start")) startLocation = requestData["start"].ToString(); string clientVersion = "Unknown"; if (requestData.Contains("version") && requestData["version"] != null) clientVersion = requestData["version"].ToString(); //MAC BANNING START string mac = (string)requestData["mac"]; Aurora.Framework.IAgentConnector AgentConnector = Aurora.DataManager.DataManager.RequestPlugin<Aurora.Framework.IAgentConnector>(); if (AgentConnector == null) { Aurora.Services.DataService.LocalDataService IDS = new Aurora.Services.DataService.LocalDataService(); IDS.Initialise(m_Config); AgentConnector = Aurora.DataManager.DataManager.RequestPlugin<Aurora.Framework.IAgentConnector>(); } if (AgentConnector != null) { if (!AgentConnector.CheckMacAndViewer(mac, clientVersion)) return FailedXMLRPCResponse("You have been banned from this grid."); } else { //We tried... might as well skip it } string channel = "Unknown"; if (requestData.Contains("channel") && requestData["channel"] != null) channel = requestData["channel"].ToString(); string id0 = "Unknown"; if (requestData.Contains("id0") && requestData["id0"] != null) id0 = requestData["id0"].ToString(); //m_log.InfoFormat("[LOGIN]: XMLRPC Login Requested for {0} {1}, starting in {2}, using {3}", first, last, startLocation, clientVersion); m_log.InfoFormat("[LOGIN]: XMLRPC Login Requested for {0} {1}, starting in {2}, using {3}", first, last, startLocation, clientVersion); LoginResponse reply = null; reply = m_LocalService.Login(first, last, passwd, startLocation, scopeID, clientVersion, channel, mac, id0, remoteClient, requestData); XmlRpcResponse response = new XmlRpcResponse(); response.Value = reply.ToHashtable(); return response; } } return FailedXMLRPCResponse(); }