* This update contains a bucket-full of network optimizations.
* ParcelProperties are sent only when needed instead of on any movement * Terse Updates and other temporary data packets are marked unreliable * After a certain amount of users, the sim actually sends updates on things less * Experimental * Tested to 68 avatar with pCampBot (And it's surprising what actually causes the most lag.. the text chat!)ThreadPoolClientBranch
parent
0e771c8d39
commit
3674257095
|
@ -164,6 +164,7 @@ namespace OpenSim.Framework
|
|||
{
|
||||
packet.AgentData.AgentID = LocalClients[i].AgentId;
|
||||
packet.AgentData.SessionID = LocalClients[i].SessionId;
|
||||
packet.Header.Reliable = false;
|
||||
LocalClients[i].OutPacket(packet, ThrottleOutPacketType.Task);
|
||||
}
|
||||
|
||||
|
|
|
@ -957,6 +957,7 @@ namespace OpenSim.Region.ClientStack
|
|||
kill.ObjectData = new KillObjectPacket.ObjectDataBlock[1];
|
||||
kill.ObjectData[0] = new KillObjectPacket.ObjectDataBlock();
|
||||
kill.ObjectData[0].ID = localID;
|
||||
kill.Header.Reliable = false;
|
||||
OutPacket(kill, ThrottleOutPacketType.Task);
|
||||
}
|
||||
|
||||
|
@ -1378,6 +1379,7 @@ namespace OpenSim.Region.ClientStack
|
|||
viewertime.TimeInfo.SunDirection = sunPos;
|
||||
viewertime.TimeInfo.SunAngVelocity = sunVel;
|
||||
viewertime.TimeInfo.UsecSinceStart = (ulong)Util.UnixTimeSinceEpoch();
|
||||
viewertime.Header.Reliable = false;
|
||||
OutPacket(viewertime, ThrottleOutPacketType.Task);
|
||||
}
|
||||
|
||||
|
@ -1426,6 +1428,7 @@ namespace OpenSim.Region.ClientStack
|
|||
}
|
||||
viewertime.TimeInfo.SunAngVelocity = new LLVector3(0, 0.0f, 10.0f);
|
||||
viewertime.TimeInfo.UsecSinceStart = (ulong)Util.UnixTimeSinceEpoch();
|
||||
viewertime.Header.Reliable = false;
|
||||
OutPacket(viewertime, ThrottleOutPacketType.Task);
|
||||
}
|
||||
|
||||
|
@ -1521,7 +1524,7 @@ namespace OpenSim.Region.ClientStack
|
|||
ani.AnimationList[i].AnimID = animations[i];
|
||||
ani.AnimationList[i].AnimSequenceID = seqs[i];
|
||||
}
|
||||
|
||||
ani.Header.Reliable = false;
|
||||
OutPacket(ani, ThrottleOutPacketType.Task);
|
||||
}
|
||||
|
||||
|
@ -1581,6 +1584,9 @@ namespace OpenSim.Region.ClientStack
|
|||
terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1];
|
||||
terse.ObjectData[0] = terseBlock;
|
||||
|
||||
terse.Header.Reliable = false;
|
||||
|
||||
|
||||
OutPacket(terse, ThrottleOutPacketType.Task);
|
||||
}
|
||||
|
||||
|
@ -1604,6 +1610,7 @@ namespace OpenSim.Region.ClientStack
|
|||
ib.You = -1;
|
||||
ib.Prey = -1;
|
||||
loc.Index = ib;
|
||||
loc.Header.Reliable = false;
|
||||
OutPacket(loc, ThrottleOutPacketType.Task);
|
||||
}
|
||||
|
||||
|
@ -1706,7 +1713,7 @@ namespace OpenSim.Region.ClientStack
|
|||
terse.RegionData.TimeDilation = timeDilation;
|
||||
terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1];
|
||||
terse.ObjectData[0] = CreatePrimImprovedBlock(localID, position, rotation, velocity, rotationalvelocity);
|
||||
|
||||
terse.Header.Reliable = false;
|
||||
OutPacket(terse, ThrottleOutPacketType.Task);
|
||||
}
|
||||
|
||||
|
@ -1719,7 +1726,7 @@ namespace OpenSim.Region.ClientStack
|
|||
terse.RegionData.TimeDilation = timeDilation;
|
||||
terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1];
|
||||
terse.ObjectData[0] = CreatePrimImprovedBlock(localID, position, rotation, velocity, rotationalvelocity);
|
||||
|
||||
terse.Header.Reliable = false;
|
||||
OutPacket(terse, ThrottleOutPacketType.Task);
|
||||
}
|
||||
|
||||
|
|
|
@ -718,23 +718,32 @@ namespace OpenSim.Region.Environment.LandManagement
|
|||
}
|
||||
}
|
||||
|
||||
public void sendLandUpdate(ScenePresence avatar)
|
||||
public void sendLandUpdate(ScenePresence avatar, bool force)
|
||||
{
|
||||
Land over = getLandObject((int) Math.Min(255, Math.Max(0, Math.Round(avatar.AbsolutePosition.X))),
|
||||
(int) Math.Min(255, Math.Max(0, Math.Round(avatar.AbsolutePosition.Y))));
|
||||
|
||||
if (over != null)
|
||||
{
|
||||
over.sendLandUpdateToClient(avatar.ControllingClient);
|
||||
if (force)
|
||||
{
|
||||
over.sendLandUpdateToClient(avatar.ControllingClient);
|
||||
}
|
||||
|
||||
if (avatar.currentParcelUUID != over.landData.globalID)
|
||||
{
|
||||
over.sendLandUpdateToClient(avatar.ControllingClient);
|
||||
avatar.currentParcelUUID = over.landData.globalID;
|
||||
m_scene.EventManager.TriggerAvatarEnteringNewParcel(avatar, over.landData.localID,
|
||||
m_scene.RegionInfo.RegionID);
|
||||
}
|
||||
}
|
||||
}
|
||||
public void sendLandUpdate(ScenePresence avatar)
|
||||
{
|
||||
sendLandUpdate(avatar, false);
|
||||
|
||||
}
|
||||
public void handleSignificantClientMovement(IClientAPI remote_client)
|
||||
{
|
||||
ScenePresence clientAvatar = m_scene.GetScenePresence(remote_client.AgentId);
|
||||
|
|
|
@ -626,6 +626,27 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
// Aquire a lock so only one update call happens at once
|
||||
updateLock.WaitOne();
|
||||
float physicsFPS = 0;
|
||||
int agentsInScene = m_innerScene.GetRootAgentCount() + m_innerScene.GetChildAgentCount();
|
||||
|
||||
if (agentsInScene > 21)
|
||||
{
|
||||
if (m_update_entities == 1)
|
||||
{
|
||||
m_update_avatars = 5;
|
||||
m_update_entities = 5;
|
||||
m_statsReporter.SetUpdateMS(6000);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_update_entities == 5)
|
||||
{
|
||||
m_update_avatars = 1;
|
||||
m_update_entities = 1;
|
||||
m_statsReporter.SetUpdateMS(3000);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
frameMS = System.Environment.TickCount;
|
||||
try
|
||||
|
|
|
@ -78,6 +78,7 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
private bool m_newCoarseLocations = true;
|
||||
private bool m_gotAllObjectsInScene = false;
|
||||
|
||||
|
||||
// Default AV Height
|
||||
private float m_avHeight = 127.0f;
|
||||
|
||||
|
@ -354,7 +355,7 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
RegisterToEvents();
|
||||
SetDirectionVectors();
|
||||
|
||||
m_scene.LandManager.sendLandUpdate(this);
|
||||
m_scene.LandManager.sendLandUpdate(this, true);
|
||||
}
|
||||
|
||||
public ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo, byte[] visualParams,
|
||||
|
|
|
@ -124,6 +124,13 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
m_report.Enabled = true;
|
||||
}
|
||||
|
||||
public void SetUpdateMS(int ms)
|
||||
{
|
||||
statsUpdatesEveryMS = ms;
|
||||
statsUpdateFactor = (float)(statsUpdatesEveryMS / 1000);
|
||||
m_report.Interval = statsUpdatesEveryMS;
|
||||
}
|
||||
|
||||
private void statsHeartBeat(object sender, EventArgs e)
|
||||
{
|
||||
m_report.Enabled = false;
|
||||
|
|
Loading…
Reference in New Issue