private UserCurrencyTransfer ( UUID toID, UUID fromID, UUID toObjectID, string toObjectName, UUID fromObjectID, string fromObjectName, uint amount, string description, TransactionType type, UUID transactionID ) : bool | ||
toID | UUID | |
fromID | UUID | |
toObjectID | UUID | |
toObjectName | string | |
fromObjectID | UUID | |
fromObjectName | string | |
amount | uint | |
description | string | |
type | TransactionType | |
transactionID | UUID | |
Résultat | bool |
bool EventManager_OnValidateBuyLand(EventManager.LandBuyArgs e) { IParcelManagementModule parcelManagement = GetSceneFor(e.agentId).RequestModuleInterface <IParcelManagementModule>(); if (parcelManagement == null) { return(false); } ILandObject lob = parcelManagement.GetLandObject(e.parcelLocalID); if (lob != null) { UUID AuthorizedID = lob.LandData.AuthBuyerID; int saleprice = lob.LandData.SalePrice; UUID pOwnerID = lob.LandData.OwnerID; bool landforsale = ((lob.LandData.Flags & (uint)(ParcelFlags.ForSale | ParcelFlags.ForSaleObjects | ParcelFlags.SellParcelObjects)) != 0); if ((AuthorizedID == UUID.Zero || AuthorizedID == e.agentId) && e.parcelPrice >= saleprice && landforsale) { if (m_connector.UserCurrencyTransfer(lob.LandData.OwnerID, e.agentId, (uint)saleprice, "Land Buy", TransactionType.LandSale, UUID.Zero)) { e.parcelOwnerID = pOwnerID; e.landValidated = true; return(true); } // not validated e.landValidated = false; } } return(false); }
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); }