aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs16
-rw-r--r--OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs1
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs3
-rw-r--r--OpenSim/Region/Environment/Scenes/SimStatsReporter.cs8
-rw-r--r--OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs1
5 files changed, 28 insertions, 1 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index 5ce5235..9d8ecf0 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -272,6 +272,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
272 private StartLure handlerStartLure; 272 private StartLure handlerStartLure;
273 private TeleportLureRequest handlerTeleportLureRequest; 273 private TeleportLureRequest handlerTeleportLureRequest;
274 274
275 private NetworkStats handlerNetworkStatsUpdate;
276
275 private readonly IGroupsModule m_GroupsModule; 277 private readonly IGroupsModule m_GroupsModule;
276 278
277 //private TerrainUnacked handlerUnackedTerrain = null; 279 //private TerrainUnacked handlerUnackedTerrain = null;
@@ -450,7 +452,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
450 452
451 m_PacketHandler = new LLPacketHandler(this, m_networkServer, userSettings); 453 m_PacketHandler = new LLPacketHandler(this, m_networkServer, userSettings);
452 m_PacketHandler.SynchronizeClient = SynchronizeClient; 454 m_PacketHandler.SynchronizeClient = SynchronizeClient;
453 455 m_PacketHandler.OnPacketStats += PopulateStats;
456
454 RegisterLocalPacketHandlers(); 457 RegisterLocalPacketHandlers();
455 458
456 m_clientThread = new Thread(Start); 459 m_clientThread = new Thread(Start);
@@ -572,6 +575,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
572 575
573 public void Terminate() 576 public void Terminate()
574 { 577 {
578 m_PacketHandler.OnPacketStats -= PopulateStats;
575 m_PacketHandler.Stop(); 579 m_PacketHandler.Stop();
576 580
577 // wait for thread stoped 581 // wait for thread stoped
@@ -585,6 +589,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP
585 589
586 # region Packet Handling 590 # region Packet Handling
587 591
592 public void PopulateStats(int inPackets, int outPackets, int unAckedBytes)
593 {
594 handlerNetworkStatsUpdate = OnNetworkStatsUpdate;
595 if (handlerNetworkStatsUpdate != null)
596 {
597 handlerNetworkStatsUpdate(inPackets, outPackets, unAckedBytes);
598 }
599 }
600
588 public static bool AddPacketHandler(PacketType packetType, PacketMethod handler) 601 public static bool AddPacketHandler(PacketType packetType, PacketMethod handler)
589 { 602 {
590 bool result = false; 603 bool result = false;
@@ -1017,6 +1030,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1017 1030
1018 public event StartLure OnStartLure; 1031 public event StartLure OnStartLure;
1019 public event TeleportLureRequest OnTeleportLureRequest; 1032 public event TeleportLureRequest OnTeleportLureRequest;
1033 public event NetworkStats OnNetworkStatsUpdate;
1020 1034
1021 1035
1022 public void ActivateGesture(UUID assetId, UUID gestureId) 1036 public void ActivateGesture(UUID assetId, UUID gestureId)
diff --git a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs
index 66662a0..6ca2bb4 100644
--- a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs
+++ b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs
@@ -344,6 +344,7 @@ namespace OpenSim.Region.Environment.Modules.World.NPC
344 344
345 public event StartLure OnStartLure; 345 public event StartLure OnStartLure;
346 public event TeleportLureRequest OnTeleportLureRequest; 346 public event TeleportLureRequest OnTeleportLureRequest;
347 public event NetworkStats OnNetworkStatsUpdate;
347 348
348 349
349#pragma warning restore 67 350#pragma warning restore 67
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 2b8ee74..5bc416f 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -2346,6 +2346,9 @@ namespace OpenSim.Region.Environment.Scenes
2346 client.OnSoundTrigger += soundModule.TriggerSound; 2346 client.OnSoundTrigger += soundModule.TriggerSound;
2347 2347
2348 client.OnObjectOwner += ObjectOwner; 2348 client.OnObjectOwner += ObjectOwner;
2349
2350 if (m_statsReporter != null)
2351 client.OnNetworkStatsUpdate += m_statsReporter.AddPacketsFromClientStats;
2349 2352
2350 // EventManager.TriggerOnNewClient(client); 2353 // EventManager.TriggerOnNewClient(client);
2351 } 2354 }
diff --git a/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs b/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs
index 70287fc..c614f78 100644
--- a/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs
+++ b/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs
@@ -409,6 +409,14 @@ namespace OpenSim.Region.Environment.Scenes
409 return lastReportedSimFPS; 409 return lastReportedSimFPS;
410 } 410 }
411 411
412 public void AddPacketsFromClientStats(int inPackets, int outPackets, int unAckedBytes)
413 {
414 AddInPackets(inPackets);
415 AddOutPackets(outPackets);
416 AddunAckedBytes(unAckedBytes);
417
418 }
419
412 #endregion 420 #endregion
413 } 421 }
414} 422}
diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
index 35b5233..4cd5187 100644
--- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
+++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
@@ -239,6 +239,7 @@ namespace OpenSim.Region.Examples.SimpleModule
239 239
240 public event StartLure OnStartLure; 240 public event StartLure OnStartLure;
241 public event TeleportLureRequest OnTeleportLureRequest; 241 public event TeleportLureRequest OnTeleportLureRequest;
242 public event NetworkStats OnNetworkStatsUpdate;
242 243
243#pragma warning restore 67 244#pragma warning restore 67
244 245