| 7 |
using OpenSim.Framework; |
using OpenSim.Framework; |
| 8 |
using OpenSim.Region.ClientStack.LindenUDP; |
using OpenSim.Region.ClientStack.LindenUDP; |
| 9 |
using OpenSim.Region.ClientStack; |
using OpenSim.Region.ClientStack; |
| 10 |
|
using OpenSim.Region.Framework.Scenes; |
| 11 |
|
|
| 12 |
namespace ModularRex.RexNetwork |
namespace ModularRex.RexNetwork |
| 13 |
{ |
{ |
| 17 |
/// </summary> |
/// </summary> |
| 18 |
public class RexClientViewCompatible : RexClientViewBase |
public class RexClientViewCompatible : RexClientViewBase |
| 19 |
{ |
{ |
| 20 |
public RexClientViewCompatible(EndPoint remoteEP, IScene scene, |
public RexClientViewCompatible(EndPoint remoteEP, Scene scene, |
| 21 |
LLPacketServer packServer, AuthenticateResponse authenSessions, UUID agentId, |
LLUDPServer udpServer, LLUDPClient udpClient, AuthenticateResponse authenSessions, UUID agentId, |
| 22 |
UUID sessionId, uint circuitCode, EndPoint proxyEP, ClientStackUserSettings userSettings) |
UUID sessionId, uint circuitCode) |
| 23 |
: base(remoteEP, scene, packServer, authenSessions, agentId, |
: base(remoteEP, scene, udpServer, udpClient, authenSessions, agentId, |
| 24 |
sessionId, circuitCode, proxyEP, userSettings) |
sessionId, circuitCode) |
| 25 |
{ |
{ |
| 26 |
} |
} |
| 27 |
|
|
| 28 |
public override void SendAvatarTerseUpdate(ulong regionHandle, |
public override void SendAvatarTerseUpdate(SendAvatarTerseData data) |
|
ushort timeDilation, uint localID, Vector3 position, |
|
|
Vector3 velocity, Quaternion rotation, UUID agentid) |
|
| 29 |
{ |
{ |
| 30 |
if (rotation.X == rotation.Y && |
if (data.Priority == double.NaN) |
| 31 |
rotation.Y == rotation.Z && |
{ |
| 32 |
rotation.Z == rotation.W && rotation.W == 0) |
//m_log.Error("[LLClientView] SendAvatarTerseUpdate received a NaN priority, dropping update"); |
| 33 |
rotation = Quaternion.Identity; |
return; |
| 34 |
|
} |
| 35 |
|
|
| 36 |
position.Z = (float)(position.Z - 0.15); |
Quaternion rotation = data.Rotation; |
| 37 |
|
if (rotation.W == 0.0f && rotation.X == 0.0f && rotation.Y == 0.0f && rotation.Z == 0.0f) |
| 38 |
|
rotation = Quaternion.Identity; |
| 39 |
|
|
| 40 |
ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock = |
ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock = CreateImprovedTerseBlock(data); |
|
CreateAvatarImprovedBlock(localID, position, velocity, rotation); |
|
| 41 |
|
|
| 42 |
lock (m_avatarTerseUpdates) |
lock (m_avatarTerseUpdates.SyncRoot) |
| 43 |
{ |
m_avatarTerseUpdates.Enqueue(data.Priority, terseBlock, data.LocalID); |
|
m_avatarTerseUpdates.Add(terseBlock); |
|
| 44 |
|
|
| 45 |
// If packet is full or own movement packet, send it. |
// If we received an update about our own avatar, process the avatar update priority queue immediately |
| 46 |
if (m_avatarTerseUpdates.Count >= m_avatarTerseUpdatesPerPacket) |
if (data.AgentID == m_agentId) |
| 47 |
{ |
ProcessAvatarTerseUpdates(); |
| 48 |
ProcessAvatarTerseUpdates(this, null); |
} |
| 49 |
} |
|
| 50 |
else if (m_avatarTerseUpdates.Count == 1) |
//public override void SendAvatarTerseUpdate(ulong regionHandle, |
| 51 |
{ |
// ushort timeDilation, uint localID, Vector3 position, |
| 52 |
m_avatarTerseUpdateTimer.Start(); |
// Vector3 velocity, Quaternion rotation, UUID agentid) |
| 53 |
} |
//{ |
| 54 |
} |
// if (rotation.X == rotation.Y && |
| 55 |
} |
// rotation.Y == rotation.Z && |
| 56 |
|
// rotation.Z == rotation.W && rotation.W == 0) |
| 57 |
|
// rotation = Quaternion.Identity; |
| 58 |
|
|
| 59 |
|
// position.Z = (float)(position.Z - 0.15); |
| 60 |
|
|
| 61 |
|
// ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock = |
| 62 |
|
// CreateAvatarImprovedBlock(localID, position, velocity, rotation); |
| 63 |
|
|
| 64 |
|
// lock (m_avatarTerseUpdates) |
| 65 |
|
// { |
| 66 |
|
// m_avatarTerseUpdates.Add(terseBlock); |
| 67 |
|
|
| 68 |
|
// // If packet is full or own movement packet, send it. |
| 69 |
|
// if (m_avatarTerseUpdates.Count >= m_avatarTerseUpdatesPerPacket) |
| 70 |
|
// { |
| 71 |
|
// ProcessAvatarTerseUpdates(this, null); |
| 72 |
|
// } |
| 73 |
|
// else if (m_avatarTerseUpdates.Count == 1) |
| 74 |
|
// { |
| 75 |
|
// m_avatarTerseUpdateTimer.Start(); |
| 76 |
|
// } |
| 77 |
|
// } |
| 78 |
|
//} |
| 79 |
} |
} |
| 80 |
} |
} |