diff options
Diffstat (limited to 'OpenSim/Region/ClientStack')
-rw-r--r-- | OpenSim/Region/ClientStack/ClientView.cs | 198 |
1 files changed, 93 insertions, 105 deletions
diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs index 107bb6d..1a30619 100644 --- a/OpenSim/Region/ClientStack/ClientView.cs +++ b/OpenSim/Region/ClientStack/ClientView.cs | |||
@@ -50,51 +50,117 @@ namespace OpenSim.Region.ClientStack | |||
50 | /// </summary> | 50 | /// </summary> |
51 | public class ClientView : IClientAPI | 51 | public class ClientView : IClientAPI |
52 | { | 52 | { |
53 | /* static variables */ | ||
53 | public static TerrainManager TerrainManager; | 54 | public static TerrainManager TerrainManager; |
54 | 55 | ||
56 | /* private variables */ | ||
57 | private LLUUID m_sessionId; | ||
58 | private LLUUID m_secureSessionId = LLUUID.Zero; | ||
59 | private UseCircuitCodePacket cirpack; | ||
60 | //private AgentAssetUpload UploadAssets; | ||
61 | private LLUUID newAssetFolder = LLUUID.Zero; | ||
62 | private int debug = 0; | ||
63 | private ClientManager m_clientManager; | ||
64 | private AssetCache m_assetCache; | ||
65 | // private InventoryCache m_inventoryCache; | ||
66 | private int cachedtextureserial = 0; | ||
67 | private Timer clientPingTimer; | ||
68 | private int packetsReceived = 0; | ||
69 | private int probesWithNoIngressPackets = 0; | ||
70 | private int lastPacketsReceived = 0; | ||
71 | |||
72 | private Encoding enc = Encoding.ASCII; | ||
73 | private LLUUID m_agentId; | ||
74 | private uint m_circuitCode; | ||
75 | private int m_moneyBalance; | ||
76 | |||
77 | |||
78 | private byte[] m_channelVersion=new byte[] { 0x00} ; // Dummy value needed by libSL | ||
79 | |||
80 | /* protected variables */ | ||
55 | protected static Dictionary<PacketType, PacketMethod> PacketHandlers = | 81 | protected static Dictionary<PacketType, PacketMethod> PacketHandlers = |
56 | new Dictionary<PacketType, PacketMethod>(); //Global/static handlers for all clients | 82 | new Dictionary<PacketType, PacketMethod>(); //Global/static handlers for all clients |
57 | |||
58 | protected Dictionary<PacketType, PacketMethod> m_packetHandlers = new Dictionary<PacketType, PacketMethod>(); | 83 | protected Dictionary<PacketType, PacketMethod> m_packetHandlers = new Dictionary<PacketType, PacketMethod>(); |
59 | //local handlers for this instance | ||
60 | 84 | ||
61 | private LLUUID m_sessionId; | 85 | protected IScene m_scene; |
62 | 86 | protected AgentCircuitManager m_authenticateSessionsHandler; | |
63 | private LLUUID m_secureSessionId = LLUUID.Zero; | 87 | |
64 | 88 | protected PacketQueue PacketQueue; | |
65 | public LLUUID SecureSessionId | 89 | |
66 | { | 90 | protected Dictionary<uint, uint> PendingAcks = new Dictionary<uint, uint>(); |
67 | get { return m_secureSessionId; } | 91 | protected Dictionary<uint, Packet> NeedAck = new Dictionary<uint, Packet>(); |
68 | } | 92 | |
93 | protected Timer AckTimer; | ||
94 | protected uint Sequence = 0; | ||
95 | protected object SequenceLock = new object(); | ||
96 | protected const int MAX_APPENDED_ACKS = 10; | ||
97 | protected const int RESEND_TIMEOUT = 4000; | ||
98 | protected const int MAX_SEQUENCE = 0xFFFFFF; | ||
99 | protected PacketServer m_networkServer; | ||
69 | 100 | ||
101 | /* public variables */ | ||
70 | public string firstName; | 102 | public string firstName; |
71 | public string lastName; | 103 | public string lastName; |
72 | private UseCircuitCodePacket cirpack; | ||
73 | public Thread ClientThread; | 104 | public Thread ClientThread; |
74 | public LLVector3 startpos; | 105 | public LLVector3 startpos; |
106 | public EndPoint userEP; | ||
75 | 107 | ||
76 | //private AgentAssetUpload UploadAssets; | ||
77 | private LLUUID newAssetFolder = LLUUID.Zero; | ||
78 | private int debug = 0; | ||
79 | |||
80 | protected IScene m_scene; | ||
81 | 108 | ||
109 | /* Properties */ | ||
110 | public LLUUID SecureSessionId | ||
111 | { | ||
112 | get { return m_secureSessionId; } | ||
113 | } | ||
114 | |||
82 | public IScene Scene | 115 | public IScene Scene |
83 | { | 116 | { |
84 | get { return m_scene; } | 117 | get { return m_scene; } |
85 | } | 118 | } |
86 | 119 | ||
87 | private ClientManager m_clientManager; | 120 | public LLUUID SessionId |
88 | private AssetCache m_assetCache; | 121 | { |
89 | // private InventoryCache m_inventoryCache; | 122 | get { return m_sessionId; } |
90 | private int cachedtextureserial = 0; | 123 | } |
91 | protected AgentCircuitManager m_authenticateSessionsHandler; | 124 | |
92 | private Encoding enc = Encoding.ASCII; | 125 | public LLVector3 StartPos |
93 | // Dead client detection vars | 126 | { |
94 | private Timer clientPingTimer; | 127 | get { return startpos; } |
95 | private int packetsReceived = 0; | 128 | set { startpos = value; } |
96 | private int probesWithNoIngressPackets = 0; | 129 | } |
97 | private int lastPacketsReceived = 0; | 130 | |
131 | public LLUUID AgentId | ||
132 | { | ||
133 | get { return m_agentId; } | ||
134 | } | ||
135 | |||
136 | /// <summary> | ||
137 | /// | ||
138 | /// </summary> | ||
139 | public string FirstName | ||
140 | { | ||
141 | get { return firstName; } | ||
142 | } | ||
143 | |||
144 | /// <summary> | ||
145 | /// | ||
146 | /// </summary> | ||
147 | public string LastName | ||
148 | { | ||
149 | get { return lastName; } | ||
150 | } | ||
151 | |||
152 | public uint CircuitCode | ||
153 | { | ||
154 | get { return m_circuitCode; } | ||
155 | set { m_circuitCode = value; } | ||
156 | } | ||
157 | |||
158 | public int MoneyBalance | ||
159 | { | ||
160 | get { return m_moneyBalance; } | ||
161 | } | ||
162 | |||
163 | /* METHODS */ | ||
98 | 164 | ||
99 | public ClientView(EndPoint remoteEP, UseCircuitCodePacket initialcirpack, ClientManager clientManager, | 165 | public ClientView(EndPoint remoteEP, UseCircuitCodePacket initialcirpack, ClientManager clientManager, |
100 | IScene scene, AssetCache assetCache, PacketServer packServer, | 166 | IScene scene, AssetCache assetCache, PacketServer packServer, |
@@ -135,10 +201,6 @@ namespace OpenSim.Region.ClientStack | |||
135 | ClientThread.Start(); | 201 | ClientThread.Start(); |
136 | } | 202 | } |
137 | 203 | ||
138 | public LLUUID SessionId | ||
139 | { | ||
140 | get { return m_sessionId; } | ||
141 | } | ||
142 | 204 | ||
143 | public void SetDebug(int newDebug) | 205 | public void SetDebug(int newDebug) |
144 | { | 206 | { |
@@ -456,41 +518,6 @@ namespace OpenSim.Region.ClientStack | |||
456 | public event ParcelObjectOwnerRequest OnParcelObjectOwnerRequest; | 518 | public event ParcelObjectOwnerRequest OnParcelObjectOwnerRequest; |
457 | public event EstateOwnerMessageRequest OnEstateOwnerMessage; | 519 | public event EstateOwnerMessageRequest OnEstateOwnerMessage; |
458 | 520 | ||
459 | /// <summary> | ||
460 | /// | ||
461 | /// </summary> | ||
462 | public LLVector3 StartPos | ||
463 | { | ||
464 | get { return startpos; } | ||
465 | set { startpos = value; } | ||
466 | } | ||
467 | |||
468 | /// <summary> | ||
469 | /// | ||
470 | /// </summary> | ||
471 | private LLUUID m_agentId; | ||
472 | |||
473 | public LLUUID AgentId | ||
474 | { | ||
475 | get { return m_agentId; } | ||
476 | } | ||
477 | |||
478 | /// <summary> | ||
479 | /// | ||
480 | /// </summary> | ||
481 | public string FirstName | ||
482 | { | ||
483 | get { return firstName; } | ||
484 | } | ||
485 | |||
486 | /// <summary> | ||
487 | /// | ||
488 | /// </summary> | ||
489 | public string LastName | ||
490 | { | ||
491 | get { return lastName; } | ||
492 | } | ||
493 | |||
494 | #region Scene/Avatar to Client | 521 | #region Scene/Avatar to Client |
495 | 522 | ||
496 | /// <summary> | 523 | /// <summary> |
@@ -534,7 +561,6 @@ namespace OpenSim.Region.ClientStack | |||
534 | /// | 561 | /// |
535 | /// </summary> | 562 | /// </summary> |
536 | /// <param name="regInfo"></param> | 563 | /// <param name="regInfo"></param> |
537 | private byte[] m_channelVersion=new byte[] { 0x00} ; // Dummy value needed by libSL | ||
538 | public void MoveAgentIntoRegion(RegionInfo regInfo, LLVector3 pos, LLVector3 look) | 564 | public void MoveAgentIntoRegion(RegionInfo regInfo, LLVector3 pos, LLVector3 look) |
539 | { | 565 | { |
540 | AgentMovementCompletePacket mov = new AgentMovementCompletePacket(); | 566 | AgentMovementCompletePacket mov = new AgentMovementCompletePacket(); |
@@ -2028,38 +2054,6 @@ namespace OpenSim.Region.ClientStack | |||
2028 | PacketQueue.SetThrottleFromClient(throttles); | 2054 | PacketQueue.SetThrottleFromClient(throttles); |
2029 | } | 2055 | } |
2030 | // Previously ClientView.PacketQueue | 2056 | // Previously ClientView.PacketQueue |
2031 | protected PacketQueue PacketQueue; | ||
2032 | |||
2033 | protected Queue<QueItem> IncomingPacketQueue; | ||
2034 | protected Queue<QueItem> OutgoingPacketQueue; | ||
2035 | protected Queue<QueItem> ResendOutgoingPacketQueue; | ||
2036 | protected Queue<QueItem> LandOutgoingPacketQueue; | ||
2037 | protected Queue<QueItem> WindOutgoingPacketQueue; | ||
2038 | protected Queue<QueItem> CloudOutgoingPacketQueue; | ||
2039 | protected Queue<QueItem> TaskOutgoingPacketQueue; | ||
2040 | protected Queue<QueItem> TextureOutgoingPacketQueue; | ||
2041 | protected Queue<QueItem> AssetOutgoingPacketQueue; | ||
2042 | |||
2043 | protected Dictionary<uint, uint> PendingAcks = new Dictionary<uint, uint>(); | ||
2044 | protected Dictionary<uint, Packet> NeedAck = new Dictionary<uint, Packet>(); | ||
2045 | |||
2046 | protected Timer AckTimer; | ||
2047 | protected uint Sequence = 0; | ||
2048 | protected object SequenceLock = new object(); | ||
2049 | protected const int MAX_APPENDED_ACKS = 10; | ||
2050 | protected const int RESEND_TIMEOUT = 4000; | ||
2051 | protected const int MAX_SEQUENCE = 0xFFFFFF; | ||
2052 | |||
2053 | private uint m_circuitCode; | ||
2054 | public EndPoint userEP; | ||
2055 | |||
2056 | protected PacketServer m_networkServer; | ||
2057 | |||
2058 | public uint CircuitCode | ||
2059 | { | ||
2060 | get { return m_circuitCode; } | ||
2061 | set { m_circuitCode = value; } | ||
2062 | } | ||
2063 | 2057 | ||
2064 | // A thread safe sequence number allocator. | 2058 | // A thread safe sequence number allocator. |
2065 | protected uint NextSeqNum() | 2059 | protected uint NextSeqNum() |
@@ -2317,12 +2311,6 @@ namespace OpenSim.Region.ClientStack | |||
2317 | 2311 | ||
2318 | #endregion | 2312 | #endregion |
2319 | // Previously ClientView.ProcessPackets | 2313 | // Previously ClientView.ProcessPackets |
2320 | private int m_moneyBalance; | ||
2321 | |||
2322 | public int MoneyBalance | ||
2323 | { | ||
2324 | get { return m_moneyBalance; } | ||
2325 | } | ||
2326 | 2314 | ||
2327 | public bool AddMoney(int debit) | 2315 | public bool AddMoney(int debit) |
2328 | { | 2316 | { |