diff options
author | lbsa71 | 2007-09-18 12:13:44 +0000 |
---|---|---|
committer | lbsa71 | 2007-09-18 12:13:44 +0000 |
commit | 0bac4b430c264741b7f9e63b5d8fb781ba306c68 (patch) | |
tree | 8106614d6608aeb82b8d455ed95a01725376d9a7 /OpenSim/Region/ClientStack/ClientView.PacketHandlers.cs | |
parent | * Replaced usage of ClientView with IClientAPI (diff) | |
download | opensim-SC-0bac4b430c264741b7f9e63b5d8fb781ba306c68.zip opensim-SC-0bac4b430c264741b7f9e63b5d8fb781ba306c68.tar.gz opensim-SC-0bac4b430c264741b7f9e63b5d8fb781ba306c68.tar.bz2 opensim-SC-0bac4b430c264741b7f9e63b5d8fb781ba306c68.tar.xz |
* Handlerized ViewerEffect
* Now there-is-only-client-manager
* First step towards moving Logout and ConnectionClosed out of Client and into something else (which will let us get rid of ClientView reference to ClientManager
* General posititvity, peace, love and understanding
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ClientStack/ClientView.PacketHandlers.cs | 44 |
1 files changed, 30 insertions, 14 deletions
diff --git a/OpenSim/Region/ClientStack/ClientView.PacketHandlers.cs b/OpenSim/Region/ClientStack/ClientView.PacketHandlers.cs index 71fea0d..65ad431 100644 --- a/OpenSim/Region/ClientStack/ClientView.PacketHandlers.cs +++ b/OpenSim/Region/ClientStack/ClientView.PacketHandlers.cs | |||
@@ -37,13 +37,28 @@ namespace OpenSim.Region.ClientStack | |||
37 | protected virtual void RegisterLocalPacketHandlers() | 37 | protected virtual void RegisterLocalPacketHandlers() |
38 | { | 38 | { |
39 | this.AddLocalPacketHandler(PacketType.LogoutRequest, this.Logout); | 39 | this.AddLocalPacketHandler(PacketType.LogoutRequest, this.Logout); |
40 | this.AddLocalPacketHandler(PacketType.ViewerEffect, this.HandleViewerEffect); | ||
40 | this.AddLocalPacketHandler(PacketType.AgentCachedTexture, this.AgentTextureCached); | 41 | this.AddLocalPacketHandler(PacketType.AgentCachedTexture, this.AgentTextureCached); |
41 | this.AddLocalPacketHandler(PacketType.MultipleObjectUpdate, this.MultipleObjUpdate); | 42 | this.AddLocalPacketHandler(PacketType.MultipleObjectUpdate, this.MultipleObjUpdate); |
42 | } | 43 | } |
43 | 44 | ||
44 | protected virtual bool Logout(IClientAPI simClient, Packet packet) | 45 | private bool HandleViewerEffect(IClientAPI sender, Packet Pack) |
45 | { | 46 | { |
46 | MainLog.Instance.Verbose( "OpenSimClient.cs:ProcessInPacket() - Got a logout request"); | 47 | ViewerEffectPacket viewer = (ViewerEffectPacket)Pack; |
48 | |||
49 | if( OnViewerEffect != null ) | ||
50 | { | ||
51 | OnViewerEffect(sender, viewer.Effect); | ||
52 | } | ||
53 | |||
54 | return true; | ||
55 | } | ||
56 | |||
57 | protected virtual bool Logout(IClientAPI client, Packet packet) | ||
58 | { | ||
59 | // TODO: Refactor out this into an OnLogout so the ClientManager can close all clients. | ||
60 | |||
61 | MainLog.Instance.Verbose("OpenSimClient.cs:ProcessInPacket() - Got a logout request"); | ||
47 | //send reply to let the client logout | 62 | //send reply to let the client logout |
48 | LogoutReplyPacket logReply = new LogoutReplyPacket(); | 63 | LogoutReplyPacket logReply = new LogoutReplyPacket(); |
49 | logReply.AgentData.AgentID = this.AgentId; | 64 | logReply.AgentData.AgentID = this.AgentId; |
@@ -52,8 +67,9 @@ namespace OpenSim.Region.ClientStack | |||
52 | logReply.InventoryData[0] = new LogoutReplyPacket.InventoryDataBlock(); | 67 | logReply.InventoryData[0] = new LogoutReplyPacket.InventoryDataBlock(); |
53 | logReply.InventoryData[0].ItemID = LLUUID.Zero; | 68 | logReply.InventoryData[0].ItemID = LLUUID.Zero; |
54 | OutPacket(logReply); | 69 | OutPacket(logReply); |
55 | // | 70 | // |
56 | this.KillClient(); | 71 | this.Close(); |
72 | |||
57 | return true; | 73 | return true; |
58 | } | 74 | } |
59 | 75 | ||
@@ -81,7 +97,7 @@ namespace OpenSim.Region.ClientStack | |||
81 | protected bool MultipleObjUpdate(IClientAPI simClient, Packet packet) | 97 | protected bool MultipleObjUpdate(IClientAPI simClient, Packet packet) |
82 | { | 98 | { |
83 | MultipleObjectUpdatePacket multipleupdate = (MultipleObjectUpdatePacket)packet; | 99 | MultipleObjectUpdatePacket multipleupdate = (MultipleObjectUpdatePacket)packet; |
84 | // System.Console.WriteLine("new multi update packet " + multipleupdate.ToString()); | 100 | // System.Console.WriteLine("new multi update packet " + multipleupdate.ToString()); |
85 | for (int i = 0; i < multipleupdate.ObjectData.Length; i++) | 101 | for (int i = 0; i < multipleupdate.ObjectData.Length; i++) |
86 | { | 102 | { |
87 | #region position | 103 | #region position |
@@ -99,7 +115,7 @@ namespace OpenSim.Region.ClientStack | |||
99 | if (OnUpdatePrimSinglePosition != null) | 115 | if (OnUpdatePrimSinglePosition != null) |
100 | { | 116 | { |
101 | libsecondlife.LLVector3 pos = new LLVector3(multipleupdate.ObjectData[i].Data, 0); | 117 | libsecondlife.LLVector3 pos = new LLVector3(multipleupdate.ObjectData[i].Data, 0); |
102 | // System.Console.WriteLine("new movement position is " + pos.X + " , " + pos.Y + " , " + pos.Z); | 118 | // System.Console.WriteLine("new movement position is " + pos.X + " , " + pos.Y + " , " + pos.Z); |
103 | OnUpdatePrimSinglePosition(multipleupdate.ObjectData[i].ObjectLocalID, pos, this); | 119 | OnUpdatePrimSinglePosition(multipleupdate.ObjectData[i].ObjectLocalID, pos, this); |
104 | } | 120 | } |
105 | } | 121 | } |
@@ -128,7 +144,7 @@ namespace OpenSim.Region.ClientStack | |||
128 | if (OnUpdatePrimGroupRotation != null) | 144 | if (OnUpdatePrimGroupRotation != null) |
129 | { | 145 | { |
130 | libsecondlife.LLQuaternion rot = new LLQuaternion(multipleupdate.ObjectData[i].Data, 0, true); | 146 | libsecondlife.LLQuaternion rot = new LLQuaternion(multipleupdate.ObjectData[i].Data, 0, true); |
131 | // Console.WriteLine("new rotation is " + rot.X + " , " + rot.Y + " , " + rot.Z + " , " + rot.W); | 147 | // Console.WriteLine("new rotation is " + rot.X + " , " + rot.Y + " , " + rot.Z + " , " + rot.W); |
132 | OnUpdatePrimGroupRotation(multipleupdate.ObjectData[i].ObjectLocalID, rot, this); | 148 | OnUpdatePrimGroupRotation(multipleupdate.ObjectData[i].ObjectLocalID, rot, this); |
133 | } | 149 | } |
134 | } | 150 | } |
@@ -139,7 +155,7 @@ namespace OpenSim.Region.ClientStack | |||
139 | libsecondlife.LLVector3 pos = new LLVector3(multipleupdate.ObjectData[i].Data, 0); | 155 | libsecondlife.LLVector3 pos = new LLVector3(multipleupdate.ObjectData[i].Data, 0); |
140 | libsecondlife.LLQuaternion rot = new LLQuaternion(multipleupdate.ObjectData[i].Data, 12, true); | 156 | libsecondlife.LLQuaternion rot = new LLQuaternion(multipleupdate.ObjectData[i].Data, 12, true); |
141 | //Console.WriteLine("new rotation position is " + pos.X + " , " + pos.Y + " , " + pos.Z); | 157 | //Console.WriteLine("new rotation position is " + pos.X + " , " + pos.Y + " , " + pos.Z); |
142 | // Console.WriteLine("new rotation is " + rot.X + " , " + rot.Y + " , " + rot.Z + " , " + rot.W); | 158 | // Console.WriteLine("new rotation is " + rot.X + " , " + rot.Y + " , " + rot.Z + " , " + rot.W); |
143 | OnUpdatePrimGroupMouseRotation(multipleupdate.ObjectData[i].ObjectLocalID, pos, rot, this); | 159 | OnUpdatePrimGroupMouseRotation(multipleupdate.ObjectData[i].ObjectLocalID, pos, rot, this); |
144 | } | 160 | } |
145 | } | 161 | } |
@@ -164,10 +180,10 @@ namespace OpenSim.Region.ClientStack | |||
164 | if (OnUpdatePrimScale != null) | 180 | if (OnUpdatePrimScale != null) |
165 | { | 181 | { |
166 | libsecondlife.LLVector3 scale = new LLVector3(multipleupdate.ObjectData[i].Data, 12); | 182 | libsecondlife.LLVector3 scale = new LLVector3(multipleupdate.ObjectData[i].Data, 12); |
167 | // Console.WriteLine("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z ); | 183 | // Console.WriteLine("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z ); |
168 | OnUpdatePrimScale(multipleupdate.ObjectData[i].ObjectLocalID, scale, this); | 184 | OnUpdatePrimScale(multipleupdate.ObjectData[i].ObjectLocalID, scale, this); |
169 | libsecondlife.LLVector3 pos = new LLVector3(multipleupdate.ObjectData[i].Data, 0); | 185 | libsecondlife.LLVector3 pos = new LLVector3(multipleupdate.ObjectData[i].Data, 0); |
170 | OnUpdatePrimSinglePosition(multipleupdate.ObjectData[i].ObjectLocalID, pos, this); | 186 | OnUpdatePrimSinglePosition(multipleupdate.ObjectData[i].ObjectLocalID, pos, this); |
171 | } | 187 | } |
172 | } | 188 | } |
173 | else if (multipleupdate.ObjectData[i].Type == 5)//single prim scale from object tab | 189 | else if (multipleupdate.ObjectData[i].Type == 5)//single prim scale from object tab |
@@ -175,7 +191,7 @@ namespace OpenSim.Region.ClientStack | |||
175 | if (OnUpdatePrimScale != null) | 191 | if (OnUpdatePrimScale != null) |
176 | { | 192 | { |
177 | libsecondlife.LLVector3 scale = new LLVector3(multipleupdate.ObjectData[i].Data, 12); | 193 | libsecondlife.LLVector3 scale = new LLVector3(multipleupdate.ObjectData[i].Data, 12); |
178 | // Console.WriteLine("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z); | 194 | // Console.WriteLine("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z); |
179 | OnUpdatePrimScale(multipleupdate.ObjectData[i].ObjectLocalID, scale, this); | 195 | OnUpdatePrimScale(multipleupdate.ObjectData[i].ObjectLocalID, scale, this); |
180 | } | 196 | } |
181 | } | 197 | } |
@@ -184,7 +200,7 @@ namespace OpenSim.Region.ClientStack | |||
184 | if (OnUpdatePrimScale != null) | 200 | if (OnUpdatePrimScale != null) |
185 | { | 201 | { |
186 | libsecondlife.LLVector3 scale = new LLVector3(multipleupdate.ObjectData[i].Data, 12); | 202 | libsecondlife.LLVector3 scale = new LLVector3(multipleupdate.ObjectData[i].Data, 12); |
187 | // Console.WriteLine("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z); | 203 | // Console.WriteLine("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z); |
188 | OnUpdatePrimScale(multipleupdate.ObjectData[i].ObjectLocalID, scale, this); | 204 | OnUpdatePrimScale(multipleupdate.ObjectData[i].ObjectLocalID, scale, this); |
189 | } | 205 | } |
190 | } | 206 | } |