Annotation of /trunk/ModularRex/RexNetwork/ClientViews/RexClientViewCompatible.cs
Parent Directory
|
Revision Log
Revision 243 - (view) (download)
| 1 : | mikkopa | 212 | using System; |
| 2 : | using System.Collections.Generic; | ||
| 3 : | using System.Text; | ||
| 4 : | using OpenMetaverse; | ||
| 5 : | using OpenMetaverse.Packets; | ||
| 6 : | using System.Net; | ||
| 7 : | using OpenSim.Framework; | ||
| 8 : | using OpenSim.Region.ClientStack.LindenUDP; | ||
| 9 : | using OpenSim.Region.ClientStack; | ||
| 10 : | mikkopa | 243 | using OpenSim.Region.Framework.Scenes; |
| 11 : | mikkopa | 212 | |
| 12 : | namespace ModularRex.RexNetwork | ||
| 13 : | { | ||
| 14 : | /// <summary> | ||
| 15 : | /// This client view is ment for realXtend clients and it is compatible with LLClient. | ||
| 16 : | /// This client view should not crash LL clients or their derivants. | ||
| 17 : | /// </summary> | ||
| 18 : | public class RexClientViewCompatible : RexClientViewBase | ||
| 19 : | { | ||
| 20 : | mikkopa | 243 | public RexClientViewCompatible(EndPoint remoteEP, Scene scene, |
| 21 : | LLUDPServer udpServer, LLUDPClient udpClient, AuthenticateResponse authenSessions, UUID agentId, | ||
| 22 : | UUID sessionId, uint circuitCode) | ||
| 23 : | : base(remoteEP, scene, udpServer, udpClient, authenSessions, agentId, | ||
| 24 : | sessionId, circuitCode) | ||
| 25 : | mikkopa | 212 | { |
| 26 : | } | ||
| 27 : | |||
| 28 : | mikkopa | 243 | public override void SendAvatarTerseUpdate(SendAvatarTerseData data) |
| 29 : | mikkopa | 212 | { |
| 30 : | mikkopa | 243 | if (data.Priority == double.NaN) |
| 31 : | { | ||
| 32 : | //m_log.Error("[LLClientView] SendAvatarTerseUpdate received a NaN priority, dropping update"); | ||
| 33 : | return; | ||
| 34 : | } | ||
| 35 : | |||
| 36 : | Quaternion rotation = data.Rotation; | ||
| 37 : | if (rotation.W == 0.0f && rotation.X == 0.0f && rotation.Y == 0.0f && rotation.Z == 0.0f) | ||
| 38 : | mikkopa | 212 | rotation = Quaternion.Identity; |
| 39 : | |||
| 40 : | mikkopa | 243 | ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock = CreateImprovedTerseBlock(data); |
| 41 : | mikkopa | 212 | |
| 42 : | mikkopa | 243 | lock (m_avatarTerseUpdates.SyncRoot) |
| 43 : | m_avatarTerseUpdates.Enqueue(data.Priority, terseBlock, data.LocalID); | ||
| 44 : | mikkopa | 212 | |
| 45 : | mikkopa | 243 | // If we received an update about our own avatar, process the avatar update priority queue immediately |
| 46 : | if (data.AgentID == m_agentId) | ||
| 47 : | ProcessAvatarTerseUpdates(); | ||
| 48 : | } | ||
| 49 : | mikkopa | 212 | |
| 50 : | mikkopa | 243 | //public override void SendAvatarTerseUpdate(ulong regionHandle, |
| 51 : | // ushort timeDilation, uint localID, Vector3 position, | ||
| 52 : | // 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 : | mikkopa | 212 | } |
| 80 : | } |
| ViewVC Help | |
| Powered by ViewVC 1.0.0 |

