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)
This commit is contained in:
Melanie Thielker
2008-07-22 17:58:42 +00:00
parent b2b5675bd4
commit f112cebde2
13 changed files with 837 additions and 834 deletions

View File

@@ -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)
{
}

View File

@@ -84,7 +84,7 @@ namespace OpenSim.Region.Examples.SimpleModule
{
for (int i = 0; i < 1; i++)
{
MyNpcCharacter m_character = new MyNpcCharacter(m_scene.EventManager);
MyNpcCharacter m_character = new MyNpcCharacter(m_scene);
m_scene.AddNewClient(m_character, false);
}