From f112cebde2c1bc06108839acac82bc8addd7c506 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Tue, 22 Jul 2008 17:58:42 +0000 Subject: Refactor the packet scheduling out of ClientView. Add intelligent resending, timeouts, packet discarding. Add notification event for packet discarding. Add priority scheduling for packet queues. Add outgoing duplicate detection facility. Correct packet sequencing. Make provisions for automatic server side throttle adjustments (comes in next installment) --- .../Region/Examples/SimpleModule/MyNpcCharacter.cs | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs') diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs index c975df5..bc675ff 100644 --- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs @@ -42,6 +42,7 @@ namespace OpenSim.Region.Examples.SimpleModule private LLQuaternion bodyDirection = LLQuaternion.Identity; private short count = 0; private short frame = 0; + private Scene m_scene; // disable warning: public events, part of the public API #pragma warning disable 67 @@ -165,7 +166,6 @@ namespace OpenSim.Region.Examples.SimpleModule public event FriendActionDelegate OnApproveFriendRequest; public event FriendActionDelegate OnDenyFriendRequest; public event FriendshipTermination OnTerminateFriendship; - public event PacketStats OnPacketStats; public event EconomyDataRequest OnEconomyDataRequest; public event MoneyBalanceRequest OnMoneyBalanceRequest; @@ -208,10 +208,12 @@ namespace OpenSim.Region.Examples.SimpleModule private LLUUID myID = LLUUID.Random(); - public MyNpcCharacter(EventManager eventManager) + public MyNpcCharacter(Scene scene) { + // startPos = new LLVector3(128, (float)(Util.RandomClass.NextDouble()*100), 2); - eventManager.OnFrame += Update; + m_scene = scene; + m_scene.EventManager.OnFrame += Update; } private LLVector3 startPos = new LLVector3(128, 128, 2); @@ -280,6 +282,11 @@ namespace OpenSim.Region.Examples.SimpleModule get { return 1; } } + public IScene Scene + { + get { return m_scene; } + } + public virtual void OutPacket(Packet newPack, ThrottleOutPacketType packType) { } @@ -432,7 +439,7 @@ namespace OpenSim.Region.Examples.SimpleModule LLVector3 acc, LLQuaternion rotation, LLVector3 rvel, uint flags, LLUUID objectID, LLUUID ownerID, string text, byte[] color, uint parentID, - byte[] particleSystem, byte clickAction, bool track) + byte[] particleSystem, byte clickAction) { } public virtual void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, @@ -441,7 +448,7 @@ namespace OpenSim.Region.Examples.SimpleModule LLUUID objectID, LLUUID ownerID, string text, byte[] color, uint parentID, byte[] particleSystem, byte clickAction, byte[] textureanimation, - bool attachment, uint AttachmentPoint, LLUUID AssetId, LLUUID SoundId, double SoundVolume, byte SoundFlags, double SoundRadius, bool track) + bool attachment, uint AttachmentPoint, LLUUID AssetId, LLUUID SoundId, double SoundVolume, byte SoundFlags, double SoundRadius) { } public virtual void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, @@ -700,6 +707,10 @@ namespace OpenSim.Region.Examples.SimpleModule { } + public void ProcessInPacket(Packet NewPack) + { + } + public void Close(bool ShutdownCircuit) { } -- cgit v1.1