private GetConfig ( ) : WhiteCore.Modules.Currency.BaseCurrencyConfig | ||
Результат | WhiteCore.Modules.Currency.BaseCurrencyConfig |
public XmlRpcResponse LandBuyFunc(XmlRpcRequest request, IPEndPoint ep) { Hashtable requestData = (Hashtable)request.Params [0]; bool success = false; if (requestData.ContainsKey("agentId") && requestData.ContainsKey("currencyBuy") && m_connector.GetConfig().CanBuyCurrencyInworld) { UUID agentId; if (UUID.TryParse((string)requestData ["agentId"], out agentId)) { uint amountBuying = uint.Parse(requestData ["currencyBuy"].ToString()); m_connector.UserCurrencyTransfer(agentId, UUID.Zero, amountBuying, "Inworld purchase", TransactionType.SystemGenerated, UUID.Zero); success = true; } } XmlRpcResponse returnval = new XmlRpcResponse(); Hashtable returnresp = new Hashtable { { "success", success } }; returnval.Value = returnresp; return(returnval); }
public void Start (IConfigSource config, IRegistryCore registry) { if (config.Configs ["Currency"] == null || config.Configs ["Currency"].GetString ("Module", "") != "BaseCurrency") return; // we only want this if we are local.. bool remoteCalls = false; IConfig connectorConfig = config.Configs ["WhiteCoreConnectors"]; if ((connectorConfig != null) && connectorConfig.Contains ("DoRemoteCalls")) remoteCalls = connectorConfig.GetBoolean ("DoRemoteCalls", false); if (remoteCalls) return; m_connector = Framework.Utilities.DataManager.RequestPlugin<IBaseCurrencyConnector> () as BaseCurrencyConnector; var curPort = m_connector.GetConfig ().ClientPort; if (curPort == 0 && MainServer.Instance == null) return; IHttpServer server = registry.RequestModuleInterface<ISimulationBase> ().GetHttpServer ((uint)curPort); server.AddXmlRPCHandler ("getCurrencyQuote", QuoteFunc); server.AddXmlRPCHandler ("buyCurrency", BuyFunc); server.AddXmlRPCHandler ("preflightBuyLandPrep", PreflightBuyLandPrepFunc); server.AddXmlRPCHandler ("buyLandPrep", LandBuyFunc); server.AddXmlRPCHandler ("getBalance", GetbalanceFunc); server.AddXmlRPCHandler ("/currency.php", GetbalanceFunc); server.AddXmlRPCHandler ("/landtool.php", GetbalanceFunc); m_syncMessagePoster = registry.RequestModuleInterface<ISyncMessagePosterService> (); m_agentInfoService = registry.RequestModuleInterface<IAgentInfoService> (); }
public void Start(IConfigSource config, IRegistryCore registry) { if (config.Configs ["Currency"] == null || config.Configs ["Currency"].GetString("Module", "") != "BaseCurrency") { return; } // we only want this if we are local.. bool remoteCalls = false; IConfig connectorConfig = config.Configs ["WhiteCoreConnectors"]; if ((connectorConfig != null) && connectorConfig.Contains("DoRemoteCalls")) { remoteCalls = connectorConfig.GetBoolean("DoRemoteCalls", false); } if (remoteCalls) { return; } m_connector = Framework.Utilities.DataManager.RequestPlugin <IBaseCurrencyConnector> () as BaseCurrencyConnector; var curPort = m_connector.GetConfig().ClientPort; if (curPort == 0 && MainServer.Instance == null) { return; } IHttpServer server = registry.RequestModuleInterface <ISimulationBase> ().GetHttpServer((uint)curPort); server.AddXmlRPCHandler("getCurrencyQuote", QuoteFunc); server.AddXmlRPCHandler("buyCurrency", BuyFunc); server.AddXmlRPCHandler("preflightBuyLandPrep", PreflightBuyLandPrepFunc); server.AddXmlRPCHandler("buyLandPrep", LandBuyFunc); server.AddXmlRPCHandler("getBalance", GetbalanceFunc); server.AddXmlRPCHandler("/currency.php", GetbalanceFunc); server.AddXmlRPCHandler("/landtool.php", GetbalanceFunc); m_syncMessagePoster = registry.RequestModuleInterface <ISyncMessagePosterService> (); m_agentInfoService = registry.RequestModuleInterface <IAgentInfoService> (); }