aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/world/World.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/world/World.cs')
-rw-r--r--src/world/World.cs25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/world/World.cs b/src/world/World.cs
index b261884..f32f9ef 100644
--- a/src/world/World.cs
+++ b/src/world/World.cs
@@ -50,17 +50,20 @@ namespace OpenSim.world
50 { 50 {
51 if(Entities[UUID].needupdate) { 51 if(Entities[UUID].needupdate) {
52 Entities[UUID].update(); 52 Entities[UUID].update();
53 } 53
54 if(Entities[UUID] is Avatar) { // FIXME: only send updates when avatar moves. 54 if(Entities[UUID] is Avatar) {
55 ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock = Entities[UUID].CreateTerseBlock(); 55 Avatar avatar=(Avatar)Entities[UUID];
56 foreach(OpenSimClient client in OpenSim_Main.sim.ClientThreads.Values) { 56 if((avatar.oldpos!=avatar.position) || (avatar.oldvel!=avatar.velocity) || avatar.walking) {
57 ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket(); 57 ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock = Entities[UUID].CreateTerseBlock();
58 terse.RegionData.RegionHandle = OpenSim_Main.cfg.RegionHandle; // FIXME 58 foreach(OpenSimClient client in OpenSim_Main.sim.ClientThreads.Values) {
59 terse.RegionData.TimeDilation = 0; 59 ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket();
60 terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1]; 60 terse.RegionData.RegionHandle = OpenSim_Main.cfg.RegionHandle; // FIXME
61 terse.ObjectData[0] = terseBlock; 61 terse.RegionData.TimeDilation = 0;
62 client.OutPacket(terse); 62 terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1];
63 } 63 terse.ObjectData[0] = terseBlock;
64 client.OutPacket(terse);
65 }
66 }}
64 } 67 }
65 } 68 }
66 } 69 }