replace hard tabs with 4 spaces to be consistant in the source.

Please adjust your editors to not use hard tabs.
0.6.0-stable
Sean Dague 2008-04-24 12:27:24 +00:00
parent aa8aee90a3
commit 2a2ef42e64
22 changed files with 768 additions and 768 deletions

View File

@ -35,7 +35,7 @@ namespace OpenSim.Framework
public int Version;
public LLVector3 Position;
public LLUUID RegionID;
public ulong RegionHandle;
public ulong RegionHandle;
public AssetLandmark(AssetBase a)
{

View File

@ -68,9 +68,9 @@ namespace OpenSim.Framework
public int Count()
{
lock(m_queueSync)
{
return m_queue.Count;
}
{
return m_queue.Count;
}
}
public T[] GetQueueArray()

View File

@ -440,9 +440,9 @@ namespace OpenSim.Framework
public delegate void ObjectIncludeInSearch(IClientAPI remoteClient, bool IncludeInSearch, uint localID);
public delegate void ScriptAnswer(IClientAPI remoteClient, LLUUID objectID, LLUUID itemID, int answer);
public delegate void RequestPayPrice(IClientAPI remoteClient, LLUUID objectID);
public delegate void ScriptAnswer(IClientAPI remoteClient, LLUUID objectID, LLUUID itemID, int answer);
public delegate void RequestPayPrice(IClientAPI remoteClient, LLUUID objectID);
public interface IClientAPI
{
event ImprovedInstantMessage OnInstantMessage;
@ -559,13 +559,13 @@ namespace OpenSim.Framework
event MoneyBalanceRequest OnMoneyBalanceRequest;
event UpdateAvatarProperties OnUpdateAvatarProperties;
event ParcelBuy OnParcelBuy;
event RequestPayPrice OnRequestPayPrice ;
event RequestPayPrice OnRequestPayPrice ;
event ObjectIncludeInSearch OnObjectIncludeInSearch;
event UUIDNameRequest OnTeleportHomeRequest;
event ScriptAnswer OnScriptAnswer;
event ScriptAnswer OnScriptAnswer;
LLVector3 StartPos { get; set; }
@ -578,8 +578,8 @@ namespace OpenSim.Framework
string FirstName { get; }
string LastName { get; }
int NextAnimationSequenceNumber { get; }
int NextAnimationSequenceNumber { get; }
/// <summary>
/// Returns the full name of the agent/avatar represented by this client
@ -624,7 +624,7 @@ namespace OpenSim.Framework
void SendTeleportFailed(string reason);
void SendTeleportLocationStart();
void SendMoneyBalance(LLUUID transaction, bool success, byte[] description, int balance);
void SendPayPrice(LLUUID objectID, int[] payPrice);
void SendPayPrice(LLUUID objectID, int[] payPrice);
void SendAvatarData(ulong regionHandle, string firstName, string lastName, LLUUID avatarID, uint avatarLocalID,
LLVector3 Pos, byte[] textureEntry, uint parentID);
@ -703,7 +703,7 @@ namespace OpenSim.Framework
void SendAvatarProperties(LLUUID avatarID, string aboutText, string bornOn, string charterMember, string flAbout,
uint flags, LLUUID flImageID, LLUUID imageID, string profileURL, LLUUID partnerID);
void SendScriptQuestion(LLUUID taskID, string taskName, string ownerName, LLUUID itemID, int question);
void SendScriptQuestion(LLUUID taskID, string taskName, string ownerName, LLUUID itemID, int question);
byte[] GetThrottlesPacked(float multiplier);

View File

@ -67,57 +67,57 @@ namespace OpenSim.Framework
private ushort _version;
public string Name {
get {
return _name;
}
set {
_name = value;
}
get {
return _name;
}
set {
_name = value;
}
}
public LLUUID Owner {
get {
return _owner;
}
set {
_owner = value;
}
get {
return _owner;
}
set {
_owner = value;
}
}
public LLUUID ParentID {
get {
return _parentID;
}
set {
_parentID = value;
}
get {
return _parentID;
}
set {
_parentID = value;
}
}
public LLUUID ID {
get {
return _id;
}
set {
_id = value;
}
get {
return _id;
}
set {
_id = value;
}
}
public short Type {
get {
return _type;
}
set {
_type = value;
}
get {
return _type;
}
set {
_type = value;
}
}
public ushort Version {
get {
return _version;
}
set {
_version = value;
}
get {
return _version;
}
set {
_version = value;
}
}
}
}

View File

@ -100,120 +100,120 @@ namespace OpenSim.Framework
private uint _everyOnePermissions;
public LLUUID ID {
get {
return _id;
}
set {
_id = value;
}
get {
return _id;
}
set {
_id = value;
}
}
public int InvType {
get {
return _invType;
}
set {
_invType = value;
}
get {
return _invType;
}
set {
_invType = value;
}
}
public LLUUID Folder {
get {
return _folder;
}
set {
_folder = value;
}
get {
return _folder;
}
set {
_folder = value;
}
}
public LLUUID Owner {
get {
return _owner;
}
set {
_owner = value;
}
get {
return _owner;
}
set {
_owner = value;
}
}
public LLUUID Creator {
get {
return _creator;
}
set {
_creator = value;
}
get {
return _creator;
}
set {
_creator = value;
}
}
public string Name {
get {
return _name;
}
set {
_name = value;
}
get {
return _name;
}
set {
_name = value;
}
}
public string Description {
get {
return _description;
}
set {
_description = value;
}
get {
return _description;
}
set {
_description = value;
}
}
public uint NextPermissions {
get {
return _nextPermissions;
}
set {
_nextPermissions = value;
}
get {
return _nextPermissions;
}
set {
_nextPermissions = value;
}
}
public uint CurrentPermissions {
get {
return _currentPermissions;
}
set {
_currentPermissions = value;
}
get {
return _currentPermissions;
}
set {
_currentPermissions = value;
}
}
public uint BasePermissions {
get {
return _basePermissions;
}
set {
_basePermissions = value;
}
get {
return _basePermissions;
}
set {
_basePermissions = value;
}
}
public uint EveryOnePermissions {
get {
return _everyOnePermissions;
}
set {
_everyOnePermissions = value;
}
get {
return _everyOnePermissions;
}
set {
_everyOnePermissions = value;
}
}
public int AssetType {
get {
return _assetType;
}
set {
_assetType = value;
}
get {
return _assetType;
}
set {
_assetType = value;
}
}
public LLUUID AssetID {
get {
return _assetID;
}
set {
_assetID = value;
}
get {
return _assetID;
}
set {
_assetID = value;
}
}
}
}

View File

@ -34,7 +34,7 @@ namespace OpenSim.Framework
public class OSUUID: IComparable
{
public Guid UUID;
public OSUUID() {}
/* Constructors */

View File

@ -154,14 +154,14 @@ namespace OpenSim.Framework
"lsl_text",
String.Empty,
String.Empty,
"bodypart",
"bodypart",
String.Empty,
"snapshot",
String.Empty,
String.Empty,
"wearable",
"animation",
"gesture"
"animation",
"gesture"
};
@ -183,15 +183,15 @@ namespace OpenSim.Framework
"lsltext",
"lslbyte",
"txtr_tga",
"bodypart",
"bodypart",
"trash",
"snapshot",
"lstndfnd",
"snd_wav",
"img_tga",
"jpeg",
"animatn",
"gesture"
"animatn",
"gesture"
};
public LLUUID ItemID = LLUUID.Zero;
@ -214,8 +214,8 @@ namespace OpenSim.Framework
public string Name = String.Empty;
public string Description = String.Empty;
public uint CreationDate = 0;
public LLUUID PermsGranter;
public int PermsMask;
public LLUUID PermsGranter;
public int PermsMask;
public LLUUID ParentPartID = LLUUID.Zero;

View File

@ -622,15 +622,15 @@ namespace OpenSim.Framework
}
return returnstring;
}
static public XmlRpcResponse XmlRpcCommand(string url, string methodName, params object[] args)
static public XmlRpcResponse XmlRpcCommand(string url, string methodName, params object[] args)
{
return SendXmlRpcCommand(url, methodName, args);
}
static public XmlRpcResponse SendXmlRpcCommand(string url, string methodName, object[] args)
{
XmlRpcRequest client = new XmlRpcRequest(methodName, args);
XmlRpcRequest client = new XmlRpcRequest(methodName, args);
return client.Send(url, 6000);
}

View File

@ -249,7 +249,7 @@ namespace OpenSim
config.Set("enabled", "false");
}
if (DefaultConfig.Configs["Voice"] == null)
if (DefaultConfig.Configs["Voice"] == null)
DefaultConfig.AddConfig("Voice");
config = DefaultConfig.Configs["Voice"];
if (config != null)
@ -522,8 +522,8 @@ namespace OpenSim
m_log.Info("[MODULES]: Loading Region's modules");
List<IRegionModule> modules = m_moduleLoader.PickupModules(scene, ".");
// This needs to be ahead of the script engine load, so the
// script module can pick up events exposed by a module
// This needs to be ahead of the script engine load, so the
// script module can pick up events exposed by a module
m_moduleLoader.InitialiseSharedModules(scene);
//m_moduleLoader.PickupModules(scene, "ScriptEngines");

View File

@ -91,7 +91,7 @@ namespace OpenSim.Region.ClientStack
private readonly uint m_circuitCode;
private int m_moneyBalance;
private int m_animationSequenceNumber = 1;
private int m_animationSequenceNumber = 1;
private byte[] m_channelVersion = Helpers.StringToField("OpenSimulator 0.5"); // Dummy value needed by libSL
@ -233,8 +233,8 @@ namespace OpenSim.Region.ClientStack
private RequestAsset handlerRequestAsset = null; // OnRequestAsset;
private UUIDNameRequest handlerTeleportHomeRequest = null;
private ScriptAnswer handlerScriptAnswer = null;
private RequestPayPrice handlerRequestPayPrice = null;
private ScriptAnswer handlerScriptAnswer = null;
private RequestPayPrice handlerRequestPayPrice = null;
private ObjectDeselect handlerObjectDetach = null;
/* Properties */
@ -307,10 +307,10 @@ namespace OpenSim.Region.ClientStack
get { return m_moneyBalance; }
}
public int NextAnimationSequenceNumber
{
get { return m_animationSequenceNumber++; }
}
public int NextAnimationSequenceNumber
{
get { return m_animationSequenceNumber++; }
}
/* METHODS */
@ -793,8 +793,8 @@ namespace OpenSim.Region.ClientStack
public event UUIDNameRequest OnTeleportHomeRequest;
public event ScriptAnswer OnScriptAnswer;
public event RequestPayPrice OnRequestPayPrice;
public event ScriptAnswer OnScriptAnswer;
public event RequestPayPrice OnRequestPayPrice;
#region Scene/Avatar to Client
@ -1171,28 +1171,28 @@ namespace OpenSim.Region.ClientStack
OutPacket(money, ThrottleOutPacketType.Task);
}
public void SendPayPrice(LLUUID objectID, int[] payPrice)
{
if(payPrice[0] == 0 &&
payPrice[1] == 0 &&
payPrice[2] == 0 &&
payPrice[3] == 0 &&
payPrice[4] == 0)
return;
public void SendPayPrice(LLUUID objectID, int[] payPrice)
{
if(payPrice[0] == 0 &&
payPrice[1] == 0 &&
payPrice[2] == 0 &&
payPrice[3] == 0 &&
payPrice[4] == 0)
return;
PayPriceReplyPacket payPriceReply = (PayPriceReplyPacket)PacketPool.Instance.GetPacket(PacketType.PayPriceReply);
payPriceReply.ObjectData.ObjectID = objectID;
payPriceReply.ObjectData.DefaultPayPrice = payPrice[0];
PayPriceReplyPacket payPriceReply = (PayPriceReplyPacket)PacketPool.Instance.GetPacket(PacketType.PayPriceReply);
payPriceReply.ObjectData.ObjectID = objectID;
payPriceReply.ObjectData.DefaultPayPrice = payPrice[0];
payPriceReply.ButtonData=new PayPriceReplyPacket.ButtonDataBlock[4];
payPriceReply.ButtonData[0]=new PayPriceReplyPacket.ButtonDataBlock();
payPriceReply.ButtonData[0].PayButton = payPrice[1];
payPriceReply.ButtonData[1]=new PayPriceReplyPacket.ButtonDataBlock();
payPriceReply.ButtonData[1].PayButton = payPrice[2];
payPriceReply.ButtonData[2]=new PayPriceReplyPacket.ButtonDataBlock();
payPriceReply.ButtonData[2].PayButton = payPrice[3];
payPriceReply.ButtonData[3]=new PayPriceReplyPacket.ButtonDataBlock();
payPriceReply.ButtonData[3].PayButton = payPrice[4];
payPriceReply.ButtonData=new PayPriceReplyPacket.ButtonDataBlock[4];
payPriceReply.ButtonData[0]=new PayPriceReplyPacket.ButtonDataBlock();
payPriceReply.ButtonData[0].PayButton = payPrice[1];
payPriceReply.ButtonData[1]=new PayPriceReplyPacket.ButtonDataBlock();
payPriceReply.ButtonData[1].PayButton = payPrice[2];
payPriceReply.ButtonData[2]=new PayPriceReplyPacket.ButtonDataBlock();
payPriceReply.ButtonData[2].PayButton = payPrice[3];
payPriceReply.ButtonData[3]=new PayPriceReplyPacket.ButtonDataBlock();
payPriceReply.ButtonData[3].PayButton = payPrice[4];
OutPacket(payPriceReply, ThrottleOutPacketType.Task);
}
@ -2530,8 +2530,8 @@ namespace OpenSim.Region.ClientStack
return true;
}
public void SendScriptQuestion(LLUUID taskID, string taskName, string ownerName, LLUUID itemID, int question)
{
public void SendScriptQuestion(LLUUID taskID, string taskName, string ownerName, LLUUID itemID, int question)
{
ScriptQuestionPacket scriptQuestion = (ScriptQuestionPacket)PacketPool.Instance.GetPacket(PacketType.ScriptQuestion);
scriptQuestion.Data = new ScriptQuestionPacket.DataBlock();
// TODO: don't create new blocks if recycling an old packet
@ -2542,7 +2542,7 @@ namespace OpenSim.Region.ClientStack
scriptQuestion.Data.ObjectOwner = Helpers.StringToField(ownerName);
OutPacket(scriptQuestion, ThrottleOutPacketType.Task);
}
}
protected virtual bool Logout(IClientAPI client, Packet packet)
{
@ -3915,14 +3915,14 @@ namespace OpenSim.Region.ClientStack
}
break;
case PacketType.ScriptAnswerYes:
case PacketType.ScriptAnswerYes:
ScriptAnswerYesPacket scriptAnswer = (ScriptAnswerYesPacket)Pack;
handlerScriptAnswer = OnScriptAnswer;
if (handlerScriptAnswer != null)
{
handlerScriptAnswer(this, scriptAnswer.Data.TaskID, scriptAnswer.Data.ItemID, scriptAnswer.Data.Questions);
}
handlerScriptAnswer = OnScriptAnswer;
if (handlerScriptAnswer != null)
{
handlerScriptAnswer(this, scriptAnswer.Data.TaskID, scriptAnswer.Data.ItemID, scriptAnswer.Data.Questions);
}
break;
#endregion
@ -4613,14 +4613,14 @@ namespace OpenSim.Region.ClientStack
// TODO: handle this packet
//m_log.Warn("[CLIENT]: unhandled EconomyDataRequest packet");
break;
case PacketType.RequestPayPrice:
case PacketType.RequestPayPrice:
RequestPayPricePacket requestPayPricePacket = (RequestPayPricePacket)Pack;
handlerRequestPayPrice = OnRequestPayPrice;
if (handlerRequestPayPrice != null)
{
handlerRequestPayPrice(this, requestPayPricePacket.ObjectData.ObjectID);
}
break;
handlerRequestPayPrice = OnRequestPayPrice;
if (handlerRequestPayPrice != null)
{
handlerRequestPayPrice(this, requestPayPricePacket.ObjectData.ObjectID);
}
break;
#endregion

View File

@ -69,7 +69,7 @@ namespace OpenSim.Region.DataSnapshot
#region IRegionModule
public void Close()
{
}
public void Initialise(Scene scene, IConfigSource config)
@ -81,7 +81,7 @@ namespace OpenSim.Region.DataSnapshot
m_configLoaded = true;
m_log.Info("[DATASNAPSHOT]: Loading configuration");
//Read from the config for options
lock (m_syncInit) {
lock (m_syncInit) {
try {
m_enabled = config.Configs["DataSnapshot"].GetBoolean("index_sims", m_enabled);
if (config.Configs["Startup"].GetBoolean("gridmode", true))
@ -152,7 +152,7 @@ namespace OpenSim.Region.DataSnapshot
public string Name
{
get { return "External Data Generator"; }
get { return "External Data Generator"; }
}
public void PostInitialise()

View File

@ -54,20 +54,20 @@ namespace OpenSim.Region.Environment.Modules
/// svn co https://opensimwiredux.svn.sourceforge.net/svnroot/opensimwiredux
/// </summary>
public delegate void ObjectPaid(LLUUID objectID, LLUUID agentID, int amount);
public delegate void ObjectPaid(LLUUID objectID, LLUUID agentID, int amount);
public interface IMoneyModule : IRegionModule
{
bool ObjectGiveMoney(LLUUID objectID, LLUUID fromID, LLUUID toID, int amount);
public interface IMoneyModule : IRegionModule
{
bool ObjectGiveMoney(LLUUID objectID, LLUUID fromID, LLUUID toID, int amount);
event ObjectPaid OnObjectPaid;
}
event ObjectPaid OnObjectPaid;
}
public class BetaGridLikeMoneyModule: IMoneyModule
{
public event ObjectPaid OnObjectPaid;
public event ObjectPaid OnObjectPaid;
private ObjectPaid handerOnObjectPaid;
private ObjectPaid handerOnObjectPaid;
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@ -134,7 +134,7 @@ namespace OpenSim.Region.Environment.Modules
IConfig startupConfig = m_gConfig.Configs["Startup"];
IConfig economyConfig = m_gConfig.Configs["Economy"];
scene.RegisterModuleInterface<IMoneyModule>(this);
scene.RegisterModuleInterface<IMoneyModule>(this);
ReadConfigAndPopulate(scene, startupConfig, "Startup");
ReadConfigAndPopulate(scene, economyConfig, "Economy");
@ -320,7 +320,7 @@ namespace OpenSim.Region.Environment.Modules
// Subscribe to Money messages
client.OnEconomyDataRequest += EconomyDataRequestHandler;
client.OnMoneyBalanceRequest += SendMoneyBalance;
client.OnRequestPayPrice += requestPayPrice;
client.OnRequestPayPrice += requestPayPrice;
client.OnLogout += ClientClosed;
@ -328,20 +328,20 @@ namespace OpenSim.Region.Environment.Modules
#region event Handlers
public void requestPayPrice(IClientAPI client, LLUUID objectID)
{
Scene scene=LocateSceneClientIn(client.AgentId);
if(scene == null)
return;
public void requestPayPrice(IClientAPI client, LLUUID objectID)
{
Scene scene=LocateSceneClientIn(client.AgentId);
if(scene == null)
return;
SceneObjectPart task=scene.GetSceneObjectPart(objectID);
if(task == null)
return;
SceneObjectGroup group=task.ParentGroup;
SceneObjectPart root=group.RootPart;
SceneObjectPart task=scene.GetSceneObjectPart(objectID);
if(task == null)
return;
SceneObjectGroup group=task.ParentGroup;
SceneObjectPart root=group.RootPart;
client.SendPayPrice(objectID, root.PayPrice);
}
client.SendPayPrice(objectID, root.PayPrice);
}
/// <summary>
/// When the client closes the connection we remove their accounting info from memory to free up resources.
@ -380,52 +380,52 @@ namespace OpenSim.Region.Environment.Modules
private void ValidateLandBuy (Object osender, EventManager.LandBuyArgs e)
{
if (m_MoneyAddress.Length == 0)
{
lock (m_KnownClientFunds)
{
if (m_KnownClientFunds.ContainsKey(e.agentId))
{
// Does the sender have enough funds to give?
if (m_KnownClientFunds[e.agentId] >= e.parcelPrice)
{
lock(e)
{
e.economyValidated=true;
}
}
}
}
}
else
{
if(GetRemoteBalance(e.agentId) >= e.parcelPrice)
{
lock(e)
{
e.economyValidated=true;
}
}
}
if (m_MoneyAddress.Length == 0)
{
lock (m_KnownClientFunds)
{
if (m_KnownClientFunds.ContainsKey(e.agentId))
{
// Does the sender have enough funds to give?
if (m_KnownClientFunds[e.agentId] >= e.parcelPrice)
{
lock(e)
{
e.economyValidated=true;
}
}
}
}
}
else
{
if(GetRemoteBalance(e.agentId) >= e.parcelPrice)
{
lock(e)
{
e.economyValidated=true;
}
}
}
}
private void processLandBuy(Object osender, EventManager.LandBuyArgs e)
{
lock(e)
{
if(e.economyValidated == true && e.transactionID == 0)
{
e.transactionID=Util.UnixTimeSinceEpoch();
lock(e)
{
if(e.economyValidated == true && e.transactionID == 0)
{
e.transactionID=Util.UnixTimeSinceEpoch();
if(doMoneyTransfer(e.agentId, e.parcelOwnerID, e.parcelPrice, 0, "Land purchase"))
{
lock (e)
{
e.amountDebited = e.parcelPrice;
}
}
}
}
if(doMoneyTransfer(e.agentId, e.parcelOwnerID, e.parcelPrice, 0, "Land purchase"))
{
lock (e)
{
e.amountDebited = e.parcelPrice;
}
}
}
}
}
/// <summary>
@ -438,47 +438,47 @@ namespace OpenSim.Region.Environment.Modules
IClientAPI sender = null;
IClientAPI receiver = null;
if(m_MoneyAddress.Length > 0) // Handled on server
e.description=String.Empty;
if(m_MoneyAddress.Length > 0) // Handled on server
e.description=String.Empty;
if(e.transactiontype == 5008) // Object gets paid
{
sender = LocateClientObject(e.sender);
if (sender != null)
{
SceneObjectPart part=findPrim(e.receiver);
if(part == null)
return;
if(e.transactiontype == 5008) // Object gets paid
{
sender = LocateClientObject(e.sender);
if (sender != null)
{
SceneObjectPart part=findPrim(e.receiver);
if(part == null)
return;
string name=resolveAgentName(part.OwnerID);
if(name == String.Empty)
name="(hippos)";
string name=resolveAgentName(part.OwnerID);
if(name == String.Empty)
name="(hippos)";
receiver = LocateClientObject(part.OwnerID);
receiver = LocateClientObject(part.OwnerID);
string description=String.Format("Paid {0} via object {1}", name, e.description);
bool transactionresult = doMoneyTransfer(e.sender, part.OwnerID, e.amount, e.transactiontype, description);
string description=String.Format("Paid {0} via object {1}", name, e.description);
bool transactionresult = doMoneyTransfer(e.sender, part.OwnerID, e.amount, e.transactiontype, description);
if(transactionresult)
{
ObjectPaid handlerOnObjectPaid = OnObjectPaid;
if(handlerOnObjectPaid != null)
{
handlerOnObjectPaid(e.receiver, e.sender, e.amount);
}
}
if(transactionresult)
{
ObjectPaid handlerOnObjectPaid = OnObjectPaid;
if(handlerOnObjectPaid != null)
{
handlerOnObjectPaid(e.receiver, e.sender, e.amount);
}
}
if (e.sender != e.receiver)
{
sender.SendMoneyBalance(LLUUID.Random(), transactionresult, Helpers.StringToField(e.description), GetFundsForAgentID(e.sender));
}
if(receiver != null)
{
receiver.SendMoneyBalance(LLUUID.Random(), transactionresult, Helpers.StringToField(e.description), GetFundsForAgentID(part.OwnerID));
}
}
return;
}
if (e.sender != e.receiver)
{
sender.SendMoneyBalance(LLUUID.Random(), transactionresult, Helpers.StringToField(e.description), GetFundsForAgentID(e.sender));
}
if(receiver != null)
{
receiver.SendMoneyBalance(LLUUID.Random(), transactionresult, Helpers.StringToField(e.description), GetFundsForAgentID(part.OwnerID));
}
}
return;
}
sender = LocateClientObject(e.sender);
if (sender != null)
@ -652,45 +652,45 @@ namespace OpenSim.Region.Environment.Modules
{
// If we don't know about the sender, then the sender can't
// actually be here and therefore this is likely fraud or outdated.
if (m_MoneyAddress.Length == 0)
{
if (m_KnownClientFunds.ContainsKey(Sender))
{
// Does the sender have enough funds to give?
if (m_KnownClientFunds[Sender] >= amount)
{
// Subtract the funds from the senders account
m_KnownClientFunds[Sender] -= amount;
if (m_MoneyAddress.Length == 0)
{
if (m_KnownClientFunds.ContainsKey(Sender))
{
// Does the sender have enough funds to give?
if (m_KnownClientFunds[Sender] >= amount)
{
// Subtract the funds from the senders account
m_KnownClientFunds[Sender] -= amount;
// do we know about the receiver?
if (!m_KnownClientFunds.ContainsKey(Receiver))
{
// Make a record for them so they get the updated balance when they login
CheckExistAndRefreshFunds(Receiver);
}
if (m_enabled)
{
//Add the amount to the Receiver's funds
m_KnownClientFunds[Receiver] += amount;
result = true;
}
}
else
{
// These below are redundant to make this clearer to read
result = false;
}
}
else
{
result = false;
}
}
else
{
result = TransferMoneyonMoneyServer(Sender, Receiver, amount, transactiontype, description);
}
}
// do we know about the receiver?
if (!m_KnownClientFunds.ContainsKey(Receiver))
{
// Make a record for them so they get the updated balance when they login
CheckExistAndRefreshFunds(Receiver);
}
if (m_enabled)
{
//Add the amount to the Receiver's funds
m_KnownClientFunds[Receiver] += amount;
result = true;
}
}
else
{
// These below are redundant to make this clearer to read
result = false;
}
}
else
{
result = false;
}
}
else
{
result = TransferMoneyonMoneyServer(Sender, Receiver, amount, transactiontype, description);
}
}
}
return result;
}
@ -1003,50 +1003,50 @@ namespace OpenSim.Region.Environment.Modules
return MoneyRespData;
}
private SceneObjectPart findPrim(LLUUID objectID)
{
private SceneObjectPart findPrim(LLUUID objectID)
{
lock (m_scenel)
{
foreach (Scene s in m_scenel.Values)
{
SceneObjectPart part=s.GetSceneObjectPart(objectID);
if(part != null)
{
return part;
}
}
{
SceneObjectPart part=s.GetSceneObjectPart(objectID);
if(part != null)
{
return part;
}
}
}
return null;
}
return null;
}
private string resolveObjectName(LLUUID objectID)
{
SceneObjectPart part=findPrim(objectID);
if(part != null)
{
return part.Name;
}
return String.Empty;
}
private string resolveObjectName(LLUUID objectID)
{
SceneObjectPart part=findPrim(objectID);
if(part != null)
{
return part.Name;
}
return String.Empty;
}
private string resolveAgentName(LLUUID agentID)
private string resolveAgentName(LLUUID agentID)
{
// try avatar username surname
Scene scene=GetRandomScene();
Scene scene=GetRandomScene();
UserProfileData profile = scene.CommsManager.UserService.GetUserProfile(agentID);
if (profile != null)
{
string avatarname = profile.FirstName + " " + profile.SurName;
return avatarname;
}
return String.Empty;
}
return String.Empty;
}
public bool ObjectGiveMoney(LLUUID objectID, LLUUID fromID, LLUUID toID, int amount)
{
string description=String.Format("Object {0} pays {1}", resolveObjectName(objectID), resolveAgentName(toID));
return doMoneyTransfer(fromID, toID, amount, 2, description);
}
public bool ObjectGiveMoney(LLUUID objectID, LLUUID fromID, LLUUID toID, int amount)
{
string description=String.Format("Object {0} pays {1}", resolveObjectName(objectID), resolveAgentName(toID));
return doMoneyTransfer(fromID, toID, amount, 2, description);
}
/// <summary>
/// Informs the Money Grid Server of a transfer.
@ -1134,63 +1134,63 @@ namespace OpenSim.Region.Environment.Modules
}
public int GetRemoteBalance(LLUUID agentId)
{
int funds = 0;
public int GetRemoteBalance(LLUUID agentId)
{
int funds = 0;
IClientAPI aClient = LocateClientObject(agentId);
if (aClient != null)
{
Scene s = LocateSceneClientIn(agentId);
if (s != null)
{
if (m_MoneyAddress.Length > 0)
{
Hashtable hbinfo = GetBalanceForUserFromMoneyServer(aClient.AgentId, aClient.SecureSessionId, s.RegionInfo.originRegionID.ToString(), s.RegionInfo.regionSecret);
if ((bool)hbinfo["success"] == true)
{
try
{
funds = (Int32)hbinfo["funds"];
}
catch (ArgumentException)
{
}
catch (FormatException)
{
}
catch (OverflowException)
{
m_log.ErrorFormat("[MONEY]: While getting the Currency for user {0}, the return funds overflowed.", agentId);
aClient.SendAlertMessage("Unable to get your money balance, money operations will be unavailable");
}
catch (InvalidCastException)
{
funds = 0;
}
IClientAPI aClient = LocateClientObject(agentId);
if (aClient != null)
{
Scene s = LocateSceneClientIn(agentId);
if (s != null)
{
if (m_MoneyAddress.Length > 0)
{
Hashtable hbinfo = GetBalanceForUserFromMoneyServer(aClient.AgentId, aClient.SecureSessionId, s.RegionInfo.originRegionID.ToString(), s.RegionInfo.regionSecret);
if ((bool)hbinfo["success"] == true)
{
try
{
funds = (Int32)hbinfo["funds"];
}
catch (ArgumentException)
{
}
catch (FormatException)
{
}
catch (OverflowException)
{
m_log.ErrorFormat("[MONEY]: While getting the Currency for user {0}, the return funds overflowed.", agentId);
aClient.SendAlertMessage("Unable to get your money balance, money operations will be unavailable");
}
catch (InvalidCastException)
{
funds = 0;
}
}
else
{
m_log.WarnFormat("[MONEY]: Getting Money for user {0} failed with the following message:{1}", agentId, (string)hbinfo["errorMessage"]);
aClient.SendAlertMessage((string)hbinfo["errorMessage"]);
}
}
}
else
{
m_log.WarnFormat("[MONEY]: Getting Money for user {0} failed with the following message:{1}", agentId, (string)hbinfo["errorMessage"]);
aClient.SendAlertMessage((string)hbinfo["errorMessage"]);
}
}
SetLocalFundsForAgentID(agentId, funds);
SendMoneyBalance(aClient, agentId, aClient.SessionId, LLUUID.Zero);
}
else
{
m_log.Debug("[MONEY]: Got balance request update for agent that is here, but couldn't find which scene.");
}
}
else
{
m_log.Debug("[MONEY]: Got balance request update for agent that isn't here.");
}
return funds;
}
SetLocalFundsForAgentID(agentId, funds);
SendMoneyBalance(aClient, agentId, aClient.SessionId, LLUUID.Zero);
}
else
{
m_log.Debug("[MONEY]: Got balance request update for agent that is here, but couldn't find which scene.");
}
}
else
{
m_log.Debug("[MONEY]: Got balance request update for agent that isn't here.");
}
return funds;
}
public XmlRpcResponse GridMoneyUpdate(XmlRpcRequest request)
{
@ -1204,7 +1204,7 @@ namespace OpenSim.Region.Environment.Modules
Helpers.TryParse((string)requestData["agentId"], out agentId);
if (agentId != LLUUID.Zero)
{
GetRemoteBalance(agentId);
GetRemoteBalance(agentId);
}
else
@ -1228,7 +1228,7 @@ namespace OpenSim.Region.Environment.Modules
/// XMLRPC handler to send alert message and sound to client
/// </summary>
public XmlRpcResponse UserAlert(XmlRpcRequest request)
{
{
XmlRpcResponse ret = new XmlRpcResponse();
Hashtable retparam = new Hashtable();
Hashtable requestData = (Hashtable)request.Params[0];
@ -1236,36 +1236,36 @@ namespace OpenSim.Region.Environment.Modules
LLUUID agentId = LLUUID.Zero;
LLUUID soundId = LLUUID.Zero;
Helpers.TryParse((string)requestData["agentId"], out agentId);
Helpers.TryParse((string)requestData["soundId"], out soundId);
string text=(string)requestData["text"];
string secret=(string)requestData["secret"];
Helpers.TryParse((string)requestData["agentId"], out agentId);
Helpers.TryParse((string)requestData["soundId"], out soundId);
string text=(string)requestData["text"];
string secret=(string)requestData["secret"];
Scene userScene = GetRandomScene();
if(userScene.RegionInfo.regionSecret.ToString() == secret)
{
IClientAPI client = LocateClientObject(agentId);
Scene userScene = GetRandomScene();
if(userScene.RegionInfo.regionSecret.ToString() == secret)
{
IClientAPI client = LocateClientObject(agentId);
if (client != null)
{
if(soundId != LLUUID.Zero)
client.SendPlayAttachedSound(soundId, LLUUID.Zero, LLUUID.Zero, 1.0f, 0);
client.SendBlueBoxMessage(LLUUID.Zero, LLUUID.Zero, "", text);
retparam.Add("success", true);
}
else
{
retparam.Add("success", false);
}
}
else
{
retparam.Add("success", false);
}
if (client != null)
{
if(soundId != LLUUID.Zero)
client.SendPlayAttachedSound(soundId, LLUUID.Zero, LLUUID.Zero, 1.0f, 0);
client.SendBlueBoxMessage(LLUUID.Zero, LLUUID.Zero, "", text);
retparam.Add("success", true);
}
else
{
retparam.Add("success", false);
}
}
else
{
retparam.Add("success", false);
}
ret.Value = retparam;
return ret;
}
}
# region Standalone box enablers only

View File

@ -949,12 +949,12 @@ namespace OpenSim.Region.Environment.Modules.LandManagement
}
}
// If the economy has been validated by the economy module,
// and land has been validated as well, this method transfers
// the land ownership
// If the economy has been validated by the economy module,
// and land has been validated as well, this method transfers
// the land ownership
public void handleLandBuyRequest(Object o, EventManager.LandBuyArgs e)
{
{
if (e.economyValidated && e.landValidated)
{
lock (landList)
@ -966,11 +966,11 @@ namespace OpenSim.Region.Environment.Modules.LandManagement
}
}
}
}
}
// After receiving a land buy packet, first the data needs to
// be validated. This method validates the right to buy the
// parcel
// After receiving a land buy packet, first the data needs to
// be validated. This method validates the right to buy the
// parcel
public void handleLandValidationRequest(Object o, EventManager.LandBuyArgs e)
{

View File

@ -73,20 +73,20 @@ namespace OpenSim.Region.Environment.Modules.LandManagement
public LandData landData
{
get
{
return m_landData;
}
get
{
return m_landData;
}
set
{
m_landData = value;
}
set
{
m_landData = value;
}
}
public LLUUID regionUUID
{
get { return m_scene.RegionInfo.RegionID; }
get { return m_scene.RegionInfo.RegionID; }
}
#endregion

View File

@ -730,11 +730,11 @@ namespace OpenSim.Region.Environment.Scenes
if (item != null)
{
group.AddInventoryItem(remoteClient, primLocalID, item, copyID);
m_log.InfoFormat(
"[PRIM INVENTORY]: Update with item {0} requested of prim {1} for {2}",
item.Name, primLocalID, remoteClient.Name);
group.GetProperties(remoteClient);
group.AddInventoryItem(remoteClient, primLocalID, item, copyID);
m_log.InfoFormat(
"[PRIM INVENTORY]: Update with item {0} requested of prim {1} for {2}",
item.Name, primLocalID, remoteClient.Name);
group.GetProperties(remoteClient);
}
else
{

View File

@ -134,10 +134,10 @@ namespace OpenSim.Region.Environment.Scenes
EventManager.LandBuyArgs args = new EventManager.LandBuyArgs(
agentId, groupId, final, groupOwned, removeContribution, parcelLocalID, parcelArea, parcelPrice, authenticated);
// First, allow all validators a stab at it
// First, allow all validators a stab at it
m_eventManager.TriggerValidateLandBuy(this, args);
// Then, check validation and transfer
// Then, check validation and transfer
m_eventManager.TriggerLandBuy(this, args);
}

View File

@ -258,32 +258,32 @@ namespace OpenSim.Region.Environment.Scenes
}
}
// Assumes a lock is held on the inventory
private bool InventoryContainsName(string name)
{
foreach (TaskInventoryItem item in m_taskInventory.Values)
{
if(item.Name == name)
return true;
}
return false;
}
// Assumes a lock is held on the inventory
private bool InventoryContainsName(string name)
{
foreach (TaskInventoryItem item in m_taskInventory.Values)
{
if(item.Name == name)
return true;
}
return false;
}
private string FindAvailableInventoryName(string name)
{
if(!InventoryContainsName(name))
return name;
private string FindAvailableInventoryName(string name)
{
if(!InventoryContainsName(name))
return name;
int suffix=1;
while(suffix < 256)
{
string tryName=String.Format("{0} {1}", name, suffix);
if(!InventoryContainsName(tryName))
return tryName;
suffix++;
}
return String.Empty;
}
int suffix=1;
while(suffix < 256)
{
string tryName=String.Format("{0} {1}", name, suffix);
if(!InventoryContainsName(tryName))
return tryName;
suffix++;
}
return String.Empty;
}
/// <summary>
/// Add an item to this prim's inventory.
@ -295,11 +295,11 @@ namespace OpenSim.Region.Environment.Scenes
item.CreationDate = 1000;
item.ParentPartID = UUID;
string name=FindAvailableInventoryName(item.Name);
if(name == String.Empty)
return;
string name=FindAvailableInventoryName(item.Name);
if(name == String.Empty)
return;
item.Name=name;
item.Name=name;
lock (m_taskInventory)
{

View File

@ -97,7 +97,7 @@ namespace OpenSim.Region.Environment.Scenes
public uint Category;
// TODO: This needs to be persisted in next XML version update!
[XmlIgnore] public int[] PayPrice = {0,0,0,0,0};
[XmlIgnore] public int[] PayPrice = {0,0,0,0,0};
[XmlIgnore] public bool m_IsAttachment = false;
@ -2038,18 +2038,18 @@ namespace OpenSim.Region.Environment.Scenes
}
}
if(soundID == LLUUID.Zero)
return;
if(soundID == LLUUID.Zero)
return;
List<ScenePresence> avatarts = m_parentGroup.Scene.GetAvatars();
foreach (ScenePresence p in avatarts)
{
double dis=Util.GetDistanceTo(p.AbsolutePosition, position);
if(dis > 100.0) // Max audio distance
continue;
double dis=Util.GetDistanceTo(p.AbsolutePosition, position);
if(dis > 100.0) // Max audio distance
continue;
// Scale by distance
volume*=((100.0-dis)/100.0);
// Scale by distance
volume*=((100.0-dis)/100.0);
if (triggered)
{

View File

@ -270,7 +270,7 @@ namespace OpenSim.Region.Environment.Scenes
}
m_pos = value;
m_parentPosition=new LLVector3(0, 0, 0);
m_parentPosition=new LLVector3(0, 0, 0);
}
}
@ -362,7 +362,7 @@ namespace OpenSim.Region.Environment.Scenes
// Move them into an object to (hopefully) avoid threading issues.
try
{
SetMovementAnimation(Animations.AnimsLLUUID["STAND"]);
SetMovementAnimation(Animations.AnimsLLUUID["STAND"]);
}
catch (KeyNotFoundException)
{
@ -547,7 +547,7 @@ namespace OpenSim.Region.Environment.Scenes
AddToPhysicalScene();
m_physicsActor.Flying = isFlying;
SendAnimPack();
SendAnimPack();
m_scene.SwapRootAgentCount(false);
m_scene.CommsManager.UserProfileCacheService.RequestInventoryForUser(m_uuid);
@ -570,15 +570,15 @@ namespace OpenSim.Region.Environment.Scenes
/// </summary>
public void MakeChildAgent()
{
if(m_animations.Count > 0)
{
LLUUID movement=m_animations[0];
if(m_animations.Count > 0)
{
LLUUID movement=m_animations[0];
m_animations.Clear();
m_animationSeqs.Clear();
m_animations.Clear();
m_animationSeqs.Clear();
SetMovementAnimation(movement);
}
SetMovementAnimation(movement);
}
// m_log.DebugFormat(
// "[SCENEPRESENCE]: Downgrading child agent {0}, {1} to a root agent in {2}",
// Name, UUID, m_scene.RegionInfo.RegionName);
@ -611,10 +611,10 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="pos"></param>
public void Teleport(LLVector3 pos)
{
RemoveFromPhysicalScene();
Velocity = new LLVector3(0, 0, 0);
RemoveFromPhysicalScene();
Velocity = new LLVector3(0, 0, 0);
AbsolutePosition = pos;
AddToPhysicalScene();
AddToPhysicalScene();
SendTerseUpdateToAllClients();
}
@ -1055,12 +1055,12 @@ namespace OpenSim.Region.Environment.Scenes
public void AddAnimation(LLUUID animID)
{
if(m_isChildAgent)
return;
if(m_isChildAgent)
return;
// Don't let this animation become the movement animation
if(m_animations.Count < 1)
SetMovementAnimation(Animations.AnimsLLUUID["STAND"]);
// Don't let this animation become the movement animation
if(m_animations.Count < 1)
SetMovementAnimation(Animations.AnimsLLUUID["STAND"]);
if (!m_animations.Contains(animID))
{
@ -1072,8 +1072,8 @@ namespace OpenSim.Region.Environment.Scenes
public void RemoveAnimation(LLUUID animID)
{
if(m_isChildAgent)
return;
if(m_isChildAgent)
return;
if (m_animations.Contains(animID))
{
@ -1083,21 +1083,21 @@ namespace OpenSim.Region.Environment.Scenes
}
else
{
// What a HACK!! Anim list really needs to be an object!
int idx;
// What a HACK!! Anim list really needs to be an object!
int idx;
for(idx=0;idx < m_animations.Count;idx++)
{
if(m_animations[idx] == animID)
{
int seq=m_animationSeqs[idx];
for(idx=0;idx < m_animations.Count;idx++)
{
if(m_animations[idx] == animID)
{
int seq=m_animationSeqs[idx];
m_animations.Remove(animID);
m_animationSeqs.Remove(seq);
SendAnimPack();
break;
}
}
m_animations.Remove(animID);
m_animationSeqs.Remove(seq);
SendAnimPack();
break;
}
}
}
}
}
@ -1119,33 +1119,33 @@ namespace OpenSim.Region.Environment.Scenes
/// </summary>
protected void SetMovementAnimation(LLUUID anim)
{
if(m_animations.Count < 1)
{
m_animations.Add(Animations.AnimsLLUUID["STAND"]);
m_animationSeqs.Add(1);
if(m_animations.Count < 1)
{
m_animations.Add(Animations.AnimsLLUUID["STAND"]);
m_animationSeqs.Add(1);
SendAnimPack();
}
else
{
try
{
if (m_animations[0] != anim)
{
m_animations[0] = anim;
m_animationSeqs[0] = m_controllingClient.NextAnimationSequenceNumber;
}
SendAnimPack();
}
catch
{
m_log.Warn("[AVATAR]: SetMovementAnimation for avatar failed. Attempting recovery...");
m_animations[0] = anim;
m_animationSeqs[0] = m_controllingClient.NextAnimationSequenceNumber;
SendAnimPack();
}
}
}
SendAnimPack();
}
else
{
try
{
if (m_animations[0] != anim)
{
m_animations[0] = anim;
m_animationSeqs[0] = m_controllingClient.NextAnimationSequenceNumber;
}
SendAnimPack();
}
catch
{
m_log.Warn("[AVATAR]: SetMovementAnimation for avatar failed. Attempting recovery...");
m_animations[0] = anim;
m_animationSeqs[0] = m_controllingClient.NextAnimationSequenceNumber;
SendAnimPack();
}
}
}
/// <summary>
/// This method handles agent movement related animations
@ -1536,8 +1536,8 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="seqs"></param>
public void SendAnimPack(LLUUID[] animations, int[] seqs)
{
if(m_isChildAgent)
return;
if(m_isChildAgent)
return;
m_scene.Broadcast(
delegate(IClientAPI client) { client.SendAnimations(animations, seqs, m_controllingClient.AgentId); });

View File

@ -167,8 +167,8 @@ namespace OpenSim.Region.Examples.SimpleModule
public event ObjectIncludeInSearch OnObjectIncludeInSearch;
public event UUIDNameRequest OnTeleportHomeRequest;
public event ScriptAnswer OnScriptAnswer;
public event RequestPayPrice OnRequestPayPrice;
public event ScriptAnswer OnScriptAnswer;
public event RequestPayPrice OnRequestPayPrice;
#pragma warning restore 67
@ -221,10 +221,10 @@ namespace OpenSim.Region.Examples.SimpleModule
get { return FirstName + LastName; }
}
public virtual int NextAnimationSequenceNumber
{
get { return 1; }
}
public virtual int NextAnimationSequenceNumber
{
get { return 1; }
}
public virtual void OutPacket(Packet newPack, ThrottleOutPacketType packType)
{
@ -344,9 +344,9 @@ namespace OpenSim.Region.Examples.SimpleModule
{
}
public virtual void SendPayPrice(LLUUID objectID, int[] payPrice)
{
}
public virtual void SendPayPrice(LLUUID objectID, int[] payPrice)
{
}
public virtual void SendAvatarData(ulong regionHandle, string firstName, string lastName, LLUUID avatarID,
uint avatarLocalID, LLVector3 Pos, byte[] textureEntry, uint parentID)
@ -603,8 +603,8 @@ namespace OpenSim.Region.Examples.SimpleModule
{
}
public void SendScriptQuestion(LLUUID objectID, string taskName, string ownerName, LLUUID itemID, int question)
{
}
public void SendScriptQuestion(LLUUID objectID, string taskName, string ownerName, LLUUID itemID, int question)
{
}
}
}

View File

@ -70,7 +70,7 @@ namespace OpenSim.Region.ScriptEngine.Common
private DateTime m_timer = DateTime.Now;
private string m_state = "default";
private bool m_waitingForScriptAnswer=false;
private bool m_waitingForScriptAnswer=false;
public string State
@ -121,50 +121,50 @@ namespace OpenSim.Region.ScriptEngine.Common
return World.GetCommander(name);
}
private LLUUID InventorySelf()
{
LLUUID invItemID=new LLUUID();
private LLUUID InventorySelf()
{
LLUUID invItemID=new LLUUID();
foreach (KeyValuePair<LLUUID, TaskInventoryItem> inv in m_host.TaskInventory)
{
if(inv.Value.Type == 10 && inv.Value.ItemID == m_itemID)
{
invItemID=inv.Key;
break;
invItemID=inv.Key;
break;
}
}
return invItemID;
}
return invItemID;
}
private LLUUID InventoryKey(string name, int type)
{
private LLUUID InventoryKey(string name, int type)
{
m_host.AddScriptLPS(1);
foreach (KeyValuePair<LLUUID, TaskInventoryItem> inv in m_host.TaskInventory)
{
if(inv.Value.Name == name)
{
if(inv.Value.Type != type)
return LLUUID.Zero;
if(inv.Value.Name == name)
{
if(inv.Value.Type != type)
return LLUUID.Zero;
return inv.Value.AssetID.ToString();
}
}
return LLUUID.Zero;
}
return inv.Value.AssetID.ToString();
}
}
return LLUUID.Zero;
}
private LLUUID InventoryKey(string name)
{
private LLUUID InventoryKey(string name)
{
m_host.AddScriptLPS(1);
foreach (KeyValuePair<LLUUID, TaskInventoryItem> inv in m_host.TaskInventory)
{
if(inv.Value.Name == name)
{
return inv.Value.AssetID.ToString();
}
}
return LLUUID.Zero;
}
if(inv.Value.Name == name)
{
return inv.Value.AssetID.ToString();
}
}
return LLUUID.Zero;
}
//These are the implementations of the various ll-functions used by the LSL scripts.
//starting out, we use the System.Math library for trig functions. - ckrinke 8-14-07
@ -947,15 +947,15 @@ namespace OpenSim.Region.ScriptEngine.Common
{
m_host.AddScriptLPS(1);
LLUUID textureID=new LLUUID();
LLUUID textureID=new LLUUID();
if(!LLUUID.TryParse(texture, out textureID))
{
textureID=InventoryKey(texture, (int)AssetType.Texture);
}
if(!LLUUID.TryParse(texture, out textureID))
{
textureID=InventoryKey(texture, (int)AssetType.Texture);
}
if(textureID == LLUUID.Zero)
return;
if(textureID == LLUUID.Zero)
return;
LLObject.TextureEntry tex = m_host.Shape.Textures;
@ -1610,41 +1610,41 @@ namespace OpenSim.Region.ScriptEngine.Common
public int llGiveMoney(string destination, int amount)
{
LLUUID invItemID=InventorySelf();
if(invItemID == LLUUID.Zero)
return 0;
LLUUID invItemID=InventorySelf();
if(invItemID == LLUUID.Zero)
return 0;
m_host.AddScriptLPS(1);
if(m_host.TaskInventory[invItemID].PermsGranter == LLUUID.Zero)
return 0;
if(m_host.TaskInventory[invItemID].PermsGranter == LLUUID.Zero)
return 0;
if((m_host.TaskInventory[invItemID].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_DEBIT) == 0)
{
LSLError("No permissions to give money");
return 0;
}
if((m_host.TaskInventory[invItemID].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_DEBIT) == 0)
{
LSLError("No permissions to give money");
return 0;
}
LLUUID toID=new LLUUID();
LLUUID toID=new LLUUID();
if(!LLUUID.TryParse(destination, out toID))
{
LSLError("Bad key in llGiveMoney");
return 0;
}
if(!LLUUID.TryParse(destination, out toID))
{
LSLError("Bad key in llGiveMoney");
return 0;
}
IMoneyModule money=World.RequestModuleInterface<IMoneyModule>();
IMoneyModule money=World.RequestModuleInterface<IMoneyModule>();
if(money == null)
{
NotImplemented("llGiveMoney");
return 0;
}
if(money == null)
{
NotImplemented("llGiveMoney");
return 0;
}
bool result=money.ObjectGiveMoney(m_host.ParentGroup.RootPart.UUID, m_host.ParentGroup.RootPart.OwnerID, toID, amount);
bool result=money.ObjectGiveMoney(m_host.ParentGroup.RootPart.UUID, m_host.ParentGroup.RootPart.OwnerID, toID, amount);
if(result)
return 1;
if(result)
return 1;
return 0;
}
@ -1883,57 +1883,57 @@ namespace OpenSim.Region.ScriptEngine.Common
{
m_host.AddScriptLPS(1);
LLUUID invItemID=InventorySelf();
if(invItemID == LLUUID.Zero)
return;
LLUUID invItemID=InventorySelf();
if(invItemID == LLUUID.Zero)
return;
if(m_host.TaskInventory[invItemID].PermsGranter == LLUUID.Zero)
return;
if(m_host.TaskInventory[invItemID].PermsGranter == LLUUID.Zero)
return;
if((m_host.TaskInventory[invItemID].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_TRIGGER_ANIMATION) != 0)
{
// Do NOT try to parse LLUUID, animations cannot be triggered by ID
LLUUID animID=InventoryKey(anim, (int)AssetType.Animation);
if(animID == LLUUID.Zero)
return;
if((m_host.TaskInventory[invItemID].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_TRIGGER_ANIMATION) != 0)
{
// Do NOT try to parse LLUUID, animations cannot be triggered by ID
LLUUID animID=InventoryKey(anim, (int)AssetType.Animation);
if(animID == LLUUID.Zero)
return;
if (World.m_innerScene.ScenePresences.ContainsKey(m_host.TaskInventory[invItemID].PermsGranter))
{
ScenePresence presence = World.m_innerScene.ScenePresences[m_host.TaskInventory[invItemID].PermsGranter];
presence.AddAnimation(animID);
}
}
presence.AddAnimation(animID);
}
}
}
public void llStopAnimation(string anim)
{
m_host.AddScriptLPS(1);
LLUUID invItemID=InventorySelf();
if(invItemID == LLUUID.Zero)
return;
LLUUID invItemID=InventorySelf();
if(invItemID == LLUUID.Zero)
return;
if(m_host.TaskInventory[invItemID].PermsGranter == LLUUID.Zero)
return;
if(m_host.TaskInventory[invItemID].PermsGranter == LLUUID.Zero)
return;
if((m_host.TaskInventory[invItemID].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_TRIGGER_ANIMATION) != 0)
{
LLUUID animID = new LLUUID();
if((m_host.TaskInventory[invItemID].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_TRIGGER_ANIMATION) != 0)
{
LLUUID animID = new LLUUID();
if(!LLUUID.TryParse(anim, out animID))
{
animID=InventoryKey(anim);
}
if(!LLUUID.TryParse(anim, out animID))
{
animID=InventoryKey(anim);
}
if(animID == LLUUID.Zero)
return;
if(animID == LLUUID.Zero)
return;
if (World.m_innerScene.ScenePresences.ContainsKey(m_host.TaskInventory[invItemID].PermsGranter))
{
ScenePresence presence = World.m_innerScene.ScenePresences[m_host.TaskInventory[invItemID].PermsGranter];
presence.RemoveAnimation(animID);
}
}
presence.RemoveAnimation(animID);
}
}
}
public void llPointAt()
@ -1972,108 +1972,108 @@ namespace OpenSim.Region.ScriptEngine.Common
public void llRequestPermissions(string agent, int perm)
{
LLUUID agentID=new LLUUID();
LLUUID agentID=new LLUUID();
if(!LLUUID.TryParse(agent, out agentID))
return;
if(!LLUUID.TryParse(agent, out agentID))
return;
LLUUID invItemID=InventorySelf();
LLUUID invItemID=InventorySelf();
if(invItemID == LLUUID.Zero)
return; // Not in a prim? How??
if(invItemID == LLUUID.Zero)
return; // Not in a prim? How??
if(agentID == LLUUID.Zero || perm == 0) // Releasing permissions
{
m_host.TaskInventory[invItemID].PermsGranter=LLUUID.Zero;
m_host.TaskInventory[invItemID].PermsMask=0;
if(agentID == LLUUID.Zero || perm == 0) // Releasing permissions
{
m_host.TaskInventory[invItemID].PermsGranter=LLUUID.Zero;
m_host.TaskInventory[invItemID].PermsMask=0;
m_ScriptEngine.m_EventQueueManager.AddToScriptQueue(
m_localID, m_itemID, "run_time_permissions", EventQueueManager.llDetectNull, new Object[] {(int)0});
m_ScriptEngine.m_EventQueueManager.AddToScriptQueue(
m_localID, m_itemID, "run_time_permissions", EventQueueManager.llDetectNull, new Object[] {(int)0});
return;
}
return;
}
m_host.AddScriptLPS(1);
bool attachment=false; // Attachments not implemented yet. TODO: reflect real attachemnt state
bool attachment=false; // Attachments not implemented yet. TODO: reflect real attachemnt state
if(attachment && agent == m_host.OwnerID)
{
// When attached, certain permissions are implicit if requested from owner
int implicitPerms = BuiltIn_Commands_BaseClass.PERMISSION_TAKE_CONTROLS |
BuiltIn_Commands_BaseClass.PERMISSION_TRIGGER_ANIMATION |
BuiltIn_Commands_BaseClass.PERMISSION_ATTACH;
if(attachment && agent == m_host.OwnerID)
{
// When attached, certain permissions are implicit if requested from owner
int implicitPerms = BuiltIn_Commands_BaseClass.PERMISSION_TAKE_CONTROLS |
BuiltIn_Commands_BaseClass.PERMISSION_TRIGGER_ANIMATION |
BuiltIn_Commands_BaseClass.PERMISSION_ATTACH;
if((perm & (~implicitPerms)) == 0) // Requested only implicit perms
{
m_host.TaskInventory[invItemID].PermsGranter=agentID;
m_host.TaskInventory[invItemID].PermsMask=perm;
if((perm & (~implicitPerms)) == 0) // Requested only implicit perms
{
m_host.TaskInventory[invItemID].PermsGranter=agentID;
m_host.TaskInventory[invItemID].PermsMask=perm;
m_ScriptEngine.m_EventQueueManager.AddToScriptQueue(
m_localID, m_itemID, "run_time_permissions", EventQueueManager.llDetectNull, new Object[] {(int)perm});
m_ScriptEngine.m_EventQueueManager.AddToScriptQueue(
m_localID, m_itemID, "run_time_permissions", EventQueueManager.llDetectNull, new Object[] {(int)perm});
return;
}
}
else if(m_host.m_sitTargetAvatar == agentID) // Sitting avatar
{
// When agent is sitting, certain permissions are implicit if requested from sitting agent
int implicitPerms = BuiltIn_Commands_BaseClass.PERMISSION_TRIGGER_ANIMATION |
BuiltIn_Commands_BaseClass.PERMISSION_TRACK_CAMERA;
return;
}
}
else if(m_host.m_sitTargetAvatar == agentID) // Sitting avatar
{
// When agent is sitting, certain permissions are implicit if requested from sitting agent
int implicitPerms = BuiltIn_Commands_BaseClass.PERMISSION_TRIGGER_ANIMATION |
BuiltIn_Commands_BaseClass.PERMISSION_TRACK_CAMERA;
if((perm & (~implicitPerms)) == 0) // Requested only implicit perms
{
m_host.TaskInventory[invItemID].PermsGranter=agentID;
m_host.TaskInventory[invItemID].PermsMask=perm;
if((perm & (~implicitPerms)) == 0) // Requested only implicit perms
{
m_host.TaskInventory[invItemID].PermsGranter=agentID;
m_host.TaskInventory[invItemID].PermsMask=perm;
m_ScriptEngine.m_EventQueueManager.AddToScriptQueue(
m_localID, m_itemID, "run_time_permissions", EventQueueManager.llDetectNull, new Object[] {(int)perm});
m_ScriptEngine.m_EventQueueManager.AddToScriptQueue(
m_localID, m_itemID, "run_time_permissions", EventQueueManager.llDetectNull, new Object[] {(int)perm});
return;
}
}
return;
}
}
if (World.m_innerScene.ScenePresences.ContainsKey(agentID))
{
string ownerName=resolveName(m_host.ParentGroup.RootPart.OwnerID);
if(ownerName == String.Empty)
ownerName="(hippos)";
if (World.m_innerScene.ScenePresences.ContainsKey(agentID))
{
string ownerName=resolveName(m_host.ParentGroup.RootPart.OwnerID);
if(ownerName == String.Empty)
ownerName="(hippos)";
ScenePresence presence = World.m_innerScene.ScenePresences[agentID];
if(!m_waitingForScriptAnswer)
{
m_host.TaskInventory[invItemID].PermsGranter=agentID;
m_host.TaskInventory[invItemID].PermsMask=0;
presence.ControllingClient.OnScriptAnswer+=handleScriptAnswer;
m_waitingForScriptAnswer=true;
}
ScenePresence presence = World.m_innerScene.ScenePresences[agentID];
if(!m_waitingForScriptAnswer)
{
m_host.TaskInventory[invItemID].PermsGranter=agentID;
m_host.TaskInventory[invItemID].PermsMask=0;
presence.ControllingClient.OnScriptAnswer+=handleScriptAnswer;
m_waitingForScriptAnswer=true;
}
presence.ControllingClient.SendScriptQuestion(m_host.UUID, m_host.ParentGroup.RootPart.Name, ownerName, invItemID, perm);
return;
}
presence.ControllingClient.SendScriptQuestion(m_host.UUID, m_host.ParentGroup.RootPart.Name, ownerName, invItemID, perm);
return;
}
// Requested agent is not in range, refuse perms
m_ScriptEngine.m_EventQueueManager.AddToScriptQueue(
m_localID, m_itemID, "run_time_permissions", EventQueueManager.llDetectNull, new Object[] {(int)0});
// Requested agent is not in range, refuse perms
m_ScriptEngine.m_EventQueueManager.AddToScriptQueue(
m_localID, m_itemID, "run_time_permissions", EventQueueManager.llDetectNull, new Object[] {(int)0});
}
void handleScriptAnswer(IClientAPI client, LLUUID taskID, LLUUID itemID, int answer)
{
if(taskID != m_host.UUID)
return;
void handleScriptAnswer(IClientAPI client, LLUUID taskID, LLUUID itemID, int answer)
{
if(taskID != m_host.UUID)
return;
LLUUID invItemID=InventorySelf();
LLUUID invItemID=InventorySelf();
if(invItemID == LLUUID.Zero)
return;
if(invItemID == LLUUID.Zero)
return;
client.OnScriptAnswer-=handleScriptAnswer;
m_waitingForScriptAnswer=false;
client.OnScriptAnswer-=handleScriptAnswer;
m_waitingForScriptAnswer=false;
m_host.TaskInventory[invItemID].PermsMask=answer;
m_ScriptEngine.m_EventQueueManager.AddToScriptQueue(
m_localID, m_itemID, "run_time_permissions", EventQueueManager.llDetectNull, new Object[] {(int)answer});
}
m_host.TaskInventory[invItemID].PermsMask=answer;
m_ScriptEngine.m_EventQueueManager.AddToScriptQueue(
m_localID, m_itemID, "run_time_permissions", EventQueueManager.llDetectNull, new Object[] {(int)answer});
}
public string llGetPermissionsKey()
{
@ -2083,7 +2083,7 @@ namespace OpenSim.Region.ScriptEngine.Common
{
if(item.Type == 10 && item.ItemID == m_itemID)
{
return item.PermsGranter.ToString();
return item.PermsGranter.ToString();
}
}
@ -2098,7 +2098,7 @@ namespace OpenSim.Region.ScriptEngine.Common
{
if(item.Type == 10 && item.ItemID == m_itemID)
{
return item.PermsMask;
return item.PermsMask;
}
}
@ -3997,24 +3997,24 @@ namespace OpenSim.Region.ScriptEngine.Common
LSLError("First parameter to llDialog needs to be a key");
return;
}
if(buttons.Length > 12)
{
if(buttons.Length > 12)
{
LSLError("No more than 12 buttons can be shown");
return;
}
}
string[] buts = new string[buttons.Length];
for(int i = 0; i < buttons.Length; i++)
{
if(buttons.Data[i].ToString() == String.Empty)
{
LSLError("button label cannot be blank");
return;
}
if(buttons.Data[i].ToString().Length > 24)
{
LSLError("button label cannot be longer than 24 characters");
return;
}
if(buttons.Data[i].ToString() == String.Empty)
{
LSLError("button label cannot be blank");
return;
}
if(buttons.Data[i].ToString().Length > 24)
{
LSLError("button label cannot be longer than 24 characters");
return;
}
buts[i] = buttons.Data[i].ToString();
}
World.SendDialogToUser(av, m_host.Name, m_host.UUID, m_host.OwnerID, message, new LLUUID("00000000-0000-2222-3333-100000001000"), chat_channel, buts);
@ -5137,16 +5137,16 @@ namespace OpenSim.Region.ScriptEngine.Common
{
m_host.AddScriptLPS(1);
if(quick_pay_buttons.Data.Length != 4)
{
LSLError("List must have 4 elements");
return;
}
m_host.ParentGroup.RootPart.PayPrice[0]=price;
m_host.ParentGroup.RootPart.PayPrice[1]=(int)quick_pay_buttons.Data[0];
m_host.ParentGroup.RootPart.PayPrice[2]=(int)quick_pay_buttons.Data[1];
m_host.ParentGroup.RootPart.PayPrice[3]=(int)quick_pay_buttons.Data[2];
m_host.ParentGroup.RootPart.PayPrice[4]=(int)quick_pay_buttons.Data[3];
if(quick_pay_buttons.Data.Length != 4)
{
LSLError("List must have 4 elements");
return;
}
m_host.ParentGroup.RootPart.PayPrice[0]=price;
m_host.ParentGroup.RootPart.PayPrice[1]=(int)quick_pay_buttons.Data[0];
m_host.ParentGroup.RootPart.PayPrice[2]=(int)quick_pay_buttons.Data[1];
m_host.ParentGroup.RootPart.PayPrice[3]=(int)quick_pay_buttons.Data[2];
m_host.ParentGroup.RootPart.PayPrice[4]=(int)quick_pay_buttons.Data[3];
}
public LSL_Types.Vector3 llGetCameraPos()

View File

@ -71,11 +71,11 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
myScriptEngine.World.EventManager.OnRemoveScript += OnRemoveScript;
myScriptEngine.World.EventManager.OnScriptChangedEvent += changed;
// TODO: HOOK ALL EVENTS UP TO SERVER!
IMoneyModule money=myScriptEngine.World.RequestModuleInterface<IMoneyModule>();
if(money != null)
{
money.OnObjectPaid+=HandleObjectPaid;
}
IMoneyModule money=myScriptEngine.World.RequestModuleInterface<IMoneyModule>();
if(money != null)
{
money.OnObjectPaid+=HandleObjectPaid;
}
}
}