* Whole buncha stuff.

ThreadPoolClientBranch
Adam Frisby 2008-02-04 10:39:30 +00:00
parent 35a8c95e1d
commit 6fbc64af5e
7 changed files with 85 additions and 10 deletions

View File

@ -401,8 +401,7 @@ namespace OpenSim.Framework
public delegate void PacketStats(int inPackets, int outPackets, int unAckedBytes);
public delegate void MoneyTransferRequest(LLUUID sourceID, LLUUID destID, int amount, int transactionType, string description);
public delegate void ObjectPermissions(
@ -505,6 +504,9 @@ namespace OpenSim.Framework
event FriendshipTermination OnTerminateFriendship;
event PacketStats OnPacketStats;
// Financial packets
event MoneyTransferRequest OnMoneyTransferRequest;
LLVector3 StartPos { get; set; }

View File

@ -578,6 +578,8 @@ namespace OpenSim.Region.ClientStack
public event PacketStats OnPacketStats;
public event MoneyTransferRequest OnMoneyTransferRequest;
#region Scene/Avatar to Client
@ -2044,6 +2046,21 @@ namespace OpenSim.Region.ClientStack
AddLocalPacketHandler(PacketType.ViewerEffect, HandleViewerEffect);
AddLocalPacketHandler(PacketType.AgentCachedTexture, AgentTextureCached);
AddLocalPacketHandler(PacketType.MultipleObjectUpdate, MultipleObjUpdate);
AddLocalPacketHandler(PacketType.MoneyTransferRequest, HandleMoneyTransferRequest);
}
private bool HandleMoneyTransferRequest(IClientAPI sender, Packet Pack)
{
MoneyTransferRequestPacket money = (MoneyTransferRequestPacket)Pack;
if (OnMoneyTransferRequest != null)
{
OnMoneyTransferRequest(money.MoneyData.SourceID, money.MoneyData.DestID,
money.MoneyData.Amount, money.MoneyData.TransactionType,
Util.FieldToString(money.MoneyData.Description));
}
return true;
}
private bool HandleViewerEffect(IClientAPI sender, Packet Pack)

View File

@ -138,6 +138,14 @@ namespace OpenSim.Region.Environment.Scenes
}
}
public virtual void ProcessMoneyTransferRequest(LLUUID source, LLUUID destination, int amount, int transactiontype, string description)
{
EventManager.MoneyTransferArgs args = new EventManager.MoneyTransferArgs(
source, destination, amount, transactiontype, description);
EventManager.TriggerMoneyTransfer(this, args);
}
public virtual void ProcessObjectGrab(uint localID, LLVector3 offsetPos, IClientAPI remoteClient)
{
EventManager.TriggerObjectGrab(localID, offsetPos, remoteClient);

View File

@ -1078,7 +1078,7 @@ namespace OpenSim.Region.Environment.Scenes
}
}
public virtual void AddNewPrim(LLUUID ownerID, LLVector3 pos, LLQuaternion rot, PrimitiveBaseShape shape)
public virtual SceneObjectGroup AddNewPrim(LLUUID ownerID, LLVector3 pos, LLQuaternion rot, PrimitiveBaseShape shape)
{
SceneObjectGroup sceneOb =
new SceneObjectGroup(this, m_regionHandle, ownerID, PrimIDAllocate(), pos, rot, shape);
@ -1093,18 +1093,21 @@ namespace OpenSim.Region.Environment.Scenes
}
// if not phantom, add to physics
sceneOb.ApplyPhysics(m_physicalPrim);
return sceneOb;
}
public void AddTree(LLVector3 scale, LLQuaternion rotation, LLVector3 position,
public SceneObjectGroup AddTree(LLVector3 scale, LLQuaternion rotation, LLVector3 position,
Tree treeType, bool newTree)
{
LLUUID uuid = this.RegionInfo.MasterAvatarAssignedUUID;
PrimitiveBaseShape treeShape = new PrimitiveBaseShape();
treeShape.PathCurve = 16;
treeShape.PathEnd = 49900;
treeShape.PCode = newTree ? (byte) PCode.NewTree : (byte) PCode.Tree;
treeShape.Scale = scale;
treeShape.State = (byte) treeType;
AddNewPrim(LLUUID.Random(), position, rotation, treeShape,(byte)1,LLVector3.Zero,LLUUID.Zero,(byte)1);
return AddNewPrim(uuid, position, rotation, treeShape);
}
public void RemovePrim(uint localID, LLUUID avatar_deleter)
@ -1253,6 +1256,7 @@ namespace OpenSim.Region.Environment.Scenes
client.OnUpdateTaskInventory += UpdateTaskInventory;
client.OnGrabObject += ProcessObjectGrab;
client.OnMoneyTransferRequest += ProcessMoneyTransferRequest;
client.OnAvatarPickerRequest += ProcessAvatarPickerRequest;
client.OnPacketStats += AddPacketStats;

View File

@ -129,6 +129,31 @@ namespace OpenSim.Region.Environment.Scenes
public event ScriptChangedEvent OnScriptChangedEvent;
public class MoneyTransferArgs : System.EventArgs
{
public LLUUID sender;
public LLUUID reciever;
// Always false. The SL protocol sucks.
public bool authenticated = false;
public int amount;
public int transactiontype;
public string description;
public MoneyTransferArgs(LLUUID asender, LLUUID areciever, int aamount, int atransactiontype, string adescription) {
sender = asender;
reciever = areciever;
amount = aamount;
transactiontype = atransactiontype;
description = adescription;
}
}
public delegate void MoneyTransferEvent(Object sender, MoneyTransferArgs e);
public event MoneyTransferEvent OnMoneyTransfer;
public void TriggerOnScriptChangedEvent(uint localID, uint change)
{
if (OnScriptChangedEvent != null)
@ -191,16 +216,21 @@ namespace OpenSim.Region.Environment.Scenes
public void TriggerParcelPrimCountUpdate()
{
/*
* Removed by Adam to prevent some exceptions, temporary.
* */
if (OnParcelPrimCountUpdate != null)
{
OnParcelPrimCountUpdate();
}
}
public void TriggerMoneyTransfer(Object sender, MoneyTransferArgs e)
{
if (OnMoneyTransfer != null)
{
OnMoneyTransfer(sender, e);
}
}
public void TriggerParcelPrimCountAdd(SceneObjectGroup obj)
{
if (OnParcelPrimCountAdd != null)

View File

@ -47,6 +47,8 @@ namespace SimpleApp
public event Action<IClientAPI> OnLogout;
public event ObjectPermissions OnObjectPermissions;
public event MoneyTransferRequest OnMoneyTransferRequest;
public event Action<IClientAPI> OnConnectionClosed;
public event ImprovedInstantMessage OnInstantMessage;

View File

@ -3199,6 +3199,18 @@ namespace OpenSim.Region.ScriptEngine.Common
World.SendGeneralAlert(msg);
}
public void osSetRot(LLUUID target, Quaternion rotation)
{
if (World.Entities.ContainsKey(target))
{
World.Entities[target].Rotation = rotation;
}
else
{
LSLError("osSetRot: Invalid target");
}
}
public string osSetDynamicTextureURL(string dynamicID, string contentType, string url, string extraParams,
int timer)
{