diff options
author | MW | 2007-05-31 14:22:14 +0000 |
---|---|---|
committer | MW | 2007-05-31 14:22:14 +0000 |
commit | a575bc38d61ac5cb74f60e0eee503ca7f3e99803 (patch) | |
tree | 1ff674910b118bb3939e351eaeff10546d25b0fc | |
parent | (no commit message) (diff) | |
download | opensim-SC_OLD-a575bc38d61ac5cb74f60e0eee503ca7f3e99803.zip opensim-SC_OLD-a575bc38d61ac5cb74f60e0eee503ca7f3e99803.tar.gz opensim-SC_OLD-a575bc38d61ac5cb74f60e0eee503ca7f3e99803.tar.bz2 opensim-SC_OLD-a575bc38d61ac5cb74f60e0eee503ca7f3e99803.tar.xz |
More work on OpenGrid.Framework.Communications
6 files changed, 124 insertions, 22 deletions
diff --git a/Common/OpenGrid.Framework.Communications/RegionServerCommsManager.cs b/Common/OpenGrid.Framework.Communications/RegionServerCommsManager.cs index 9767185..2b8c5ca 100644 --- a/Common/OpenGrid.Framework.Communications/RegionServerCommsManager.cs +++ b/Common/OpenGrid.Framework.Communications/RegionServerCommsManager.cs | |||
@@ -31,7 +31,7 @@ namespace OpenGrid.Framework.Communications | |||
31 | /// </summary> | 31 | /// </summary> |
32 | /// <param name="regionInfo"></param> | 32 | /// <param name="regionInfo"></param> |
33 | /// <returns></returns> | 33 | /// <returns></returns> |
34 | public virtual IRegionCommsHost RegisterRegion(RegionInfo regionInfo) | 34 | public virtual RegionCommsHostBase RegisterRegion(RegionInfo regionInfo) |
35 | { | 35 | { |
36 | return null; | 36 | return null; |
37 | } | 37 | } |
diff --git a/Common/OpenGrid.Framework.Communications/TestLocalCommsManager.cs b/Common/OpenGrid.Framework.Communications/TestLocalCommsManager.cs index 32f4718..57049fc 100644 --- a/Common/OpenGrid.Framework.Communications/TestLocalCommsManager.cs +++ b/Common/OpenGrid.Framework.Communications/TestLocalCommsManager.cs | |||
@@ -12,6 +12,7 @@ namespace OpenGrid.Framework.Communications | |||
12 | public class TestLocalCommsManager : RegionServerCommsManager | 12 | public class TestLocalCommsManager : RegionServerCommsManager |
13 | { | 13 | { |
14 | protected Dictionary<uint , RegionInfo> regions = new Dictionary<uint,RegionInfo>(); | 14 | protected Dictionary<uint , RegionInfo> regions = new Dictionary<uint,RegionInfo>(); |
15 | protected Dictionary<uint, RegionCommsHostBase> regionHosts = new Dictionary<uint, RegionCommsHostBase>(); | ||
15 | 16 | ||
16 | public TestLocalCommsManager() | 17 | public TestLocalCommsManager() |
17 | { | 18 | { |
@@ -21,19 +22,20 @@ namespace OpenGrid.Framework.Communications | |||
21 | /// <summary> | 22 | /// <summary> |
22 | /// | 23 | /// |
23 | /// </summary> | 24 | /// </summary> |
24 | /// <returns></returns> | ||
25 | public override RegionInfo LoadRegionConfigFromGridServer(LLUUID regionID) | ||
26 | { | ||
27 | return null; | ||
28 | } | ||
29 | |||
30 | /// <summary> | ||
31 | /// | ||
32 | /// </summary> | ||
33 | /// <param name="regionInfo"></param> | 25 | /// <param name="regionInfo"></param> |
34 | /// <returns></returns> | 26 | /// <returns></returns> |
35 | public override IRegionCommsHost RegisterRegion(RegionInfo regionInfo) | 27 | public override RegionCommsHostBase RegisterRegion(RegionInfo regionInfo) |
36 | { | 28 | { |
29 | if (!this.regions.ContainsKey((uint)regionInfo.RegionHandle)) | ||
30 | { | ||
31 | this.regions.Add((uint)regionInfo.RegionHandle, regionInfo); | ||
32 | RegionCommsHostBase regionHost = new RegionCommsHostBase(); | ||
33 | this.regionHosts.Add((uint)regionInfo.RegionHandle, regionHost); | ||
34 | |||
35 | return regionHost; | ||
36 | } | ||
37 | |||
38 | //already in our list of regions so for now lets return null | ||
37 | return null; | 39 | return null; |
38 | } | 40 | } |
39 | 41 | ||
@@ -59,19 +61,30 @@ namespace OpenGrid.Framework.Communications | |||
59 | /// <summary> | 61 | /// <summary> |
60 | /// | 62 | /// |
61 | /// </summary> | 63 | /// </summary> |
64 | /// <param name="regionHandle"></param> | ||
65 | /// <param name="loginData"></param> | ||
62 | /// <returns></returns> | 66 | /// <returns></returns> |
63 | public override bool AvatarCrossingToRegion() | 67 | public bool AddNewSession(uint regionHandle, Login loginData) |
64 | { | 68 | { |
65 | return false; | 69 | AgentCircuitData agent = new AgentCircuitData(); |
66 | } | 70 | agent.AgentID = loginData.Agent; |
71 | agent.firstname = loginData.First; | ||
72 | agent.lastname = loginData.Last; | ||
73 | agent.SessionID = loginData.Session; | ||
74 | agent.SecureSessionID = loginData.SecureSession; | ||
75 | agent.circuitcode = loginData.CircuitCode; | ||
76 | agent.BaseFolder = loginData.BaseFolder; | ||
77 | agent.InventoryFolder = loginData.InventoryFolder; | ||
78 | agent.startpos = new LLVector3(128, 128, 70); | ||
67 | 79 | ||
68 | /// <summary> | 80 | if (this.regionHosts.ContainsKey((uint)regionHandle)) |
69 | /// | 81 | { |
70 | /// </summary> | 82 | this.regionHosts[(uint)regionHandle].TriggerExpectUser(agent); |
71 | /// <returns></returns> | 83 | return true; |
72 | public override IList RequestMapBlocks() | 84 | } |
73 | { | 85 | |
74 | return null; | 86 | // region not found |
87 | return false; | ||
75 | } | 88 | } |
76 | } | 89 | } |
77 | } | 90 | } |
diff --git a/Common/OpenSim.Framework/IRegionCommsHost.cs b/Common/OpenSim.Framework/IRegionCommsHost.cs index 815bd8e..d115bb7 100644 --- a/Common/OpenSim.Framework/IRegionCommsHost.cs +++ b/Common/OpenSim.Framework/IRegionCommsHost.cs | |||
@@ -6,7 +6,7 @@ using OpenSim.Framework.Types; | |||
6 | 6 | ||
7 | namespace OpenSim.Framework | 7 | namespace OpenSim.Framework |
8 | { | 8 | { |
9 | public delegate void ExpectUserDelegate(); | 9 | public delegate void ExpectUserDelegate(AgentCircuitData agent); |
10 | public delegate void UpdateNeighbours(List<RegionInfo> neighbours); | 10 | public delegate void UpdateNeighbours(List<RegionInfo> neighbours); |
11 | 11 | ||
12 | public interface IRegionCommsHost | 12 | public interface IRegionCommsHost |
diff --git a/Common/OpenSim.Framework/OpenSim.Framework.csproj b/Common/OpenSim.Framework/OpenSim.Framework.csproj index f83cb9d..be17a23 100644 --- a/Common/OpenSim.Framework/OpenSim.Framework.csproj +++ b/Common/OpenSim.Framework/OpenSim.Framework.csproj | |||
@@ -107,6 +107,7 @@ | |||
107 | <Compile Include="LoginService.cs"> | 107 | <Compile Include="LoginService.cs"> |
108 | <SubType>Code</SubType> | 108 | <SubType>Code</SubType> |
109 | </Compile> | 109 | </Compile> |
110 | <Compile Include="RegionCommsHostBase.cs" /> | ||
110 | <Compile Include="Remoting.cs"> | 111 | <Compile Include="Remoting.cs"> |
111 | <SubType>Code</SubType> | 112 | <SubType>Code</SubType> |
112 | </Compile> | 113 | </Compile> |
diff --git a/Common/OpenSim.Framework/RegionCommsHostBase.cs b/Common/OpenSim.Framework/RegionCommsHostBase.cs new file mode 100644 index 0000000..782755e --- /dev/null +++ b/Common/OpenSim.Framework/RegionCommsHostBase.cs | |||
@@ -0,0 +1,32 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Text; | ||
4 | using OpenSim.Framework.Interfaces; | ||
5 | using OpenSim.Framework.Types; | ||
6 | |||
7 | namespace OpenSim.Framework | ||
8 | { | ||
9 | public class RegionCommsHostBase :IRegionCommsHost | ||
10 | { | ||
11 | public event ExpectUserDelegate OnExpectUser; | ||
12 | public event GenericCall2 OnExpectChildAgent; | ||
13 | public event GenericCall2 OnAvatarCrossingIntoRegion; | ||
14 | public event UpdateNeighbours OnNeighboursUpdate; | ||
15 | |||
16 | /// <summary> | ||
17 | /// | ||
18 | /// </summary> | ||
19 | /// <param name="agent"></param> | ||
20 | /// <returns></returns> | ||
21 | public virtual bool TriggerExpectUser(AgentCircuitData agent) | ||
22 | { | ||
23 | if(OnExpectUser != null) | ||
24 | { | ||
25 | OnExpectUser(agent); | ||
26 | return true; | ||
27 | } | ||
28 | |||
29 | return false; | ||
30 | } | ||
31 | } | ||
32 | } | ||
diff --git a/OpenSim/OpenSim.RegionServer/ClientView.API.cs b/OpenSim/OpenSim.RegionServer/ClientView.API.cs index e7db495..b7d87ed 100644 --- a/OpenSim/OpenSim.RegionServer/ClientView.API.cs +++ b/OpenSim/OpenSim.RegionServer/ClientView.API.cs | |||
@@ -36,6 +36,9 @@ namespace OpenSim | |||
36 | public event NewAvatar OnNewAvatar; | 36 | public event NewAvatar OnNewAvatar; |
37 | public event GenericCall6 OnRemoveAvatar; | 37 | public event GenericCall6 OnRemoveAvatar; |
38 | 38 | ||
39 | /// <summary> | ||
40 | /// | ||
41 | /// </summary> | ||
39 | public LLVector3 StartPos | 42 | public LLVector3 StartPos |
40 | { | 43 | { |
41 | get | 44 | get |
@@ -48,6 +51,9 @@ namespace OpenSim | |||
48 | } | 51 | } |
49 | } | 52 | } |
50 | 53 | ||
54 | /// <summary> | ||
55 | /// | ||
56 | /// </summary> | ||
51 | public LLUUID AgentId | 57 | public LLUUID AgentId |
52 | { | 58 | { |
53 | get | 59 | get |
@@ -56,6 +62,9 @@ namespace OpenSim | |||
56 | } | 62 | } |
57 | } | 63 | } |
58 | 64 | ||
65 | /// <summary> | ||
66 | /// | ||
67 | /// </summary> | ||
59 | public string FirstName | 68 | public string FirstName |
60 | { | 69 | { |
61 | get | 70 | get |
@@ -65,6 +74,9 @@ namespace OpenSim | |||
65 | 74 | ||
66 | } | 75 | } |
67 | 76 | ||
77 | /// <summary> | ||
78 | /// | ||
79 | /// </summary> | ||
68 | public string LastName | 80 | public string LastName |
69 | { | 81 | { |
70 | get | 82 | get |
@@ -75,6 +87,10 @@ namespace OpenSim | |||
75 | 87 | ||
76 | #region World/Avatar to Client | 88 | #region World/Avatar to Client |
77 | 89 | ||
90 | /// <summary> | ||
91 | /// | ||
92 | /// </summary> | ||
93 | /// <param name="regInfo"></param> | ||
78 | public void MoveAgentIntoRegion(RegionInfo regInfo) | 94 | public void MoveAgentIntoRegion(RegionInfo regInfo) |
79 | { | 95 | { |
80 | AgentMovementCompletePacket mov = new AgentMovementCompletePacket(); | 96 | AgentMovementCompletePacket mov = new AgentMovementCompletePacket(); |
@@ -88,6 +104,15 @@ namespace OpenSim | |||
88 | 104 | ||
89 | OutPacket(mov); | 105 | OutPacket(mov); |
90 | } | 106 | } |
107 | |||
108 | /// <summary> | ||
109 | /// | ||
110 | /// </summary> | ||
111 | /// <param name="message"></param> | ||
112 | /// <param name="type"></param> | ||
113 | /// <param name="fromPos"></param> | ||
114 | /// <param name="fromName"></param> | ||
115 | /// <param name="fromAgentID"></param> | ||
91 | public void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID) | 116 | public void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID) |
92 | { | 117 | { |
93 | System.Text.Encoding enc = System.Text.Encoding.ASCII; | 118 | System.Text.Encoding enc = System.Text.Encoding.ASCII; |
@@ -104,6 +129,10 @@ namespace OpenSim | |||
104 | this.OutPacket(reply); | 129 | this.OutPacket(reply); |
105 | } | 130 | } |
106 | 131 | ||
132 | /// <summary> | ||
133 | /// | ||
134 | /// </summary> | ||
135 | /// <param name="wearables"></param> | ||
107 | public void SendWearables(AvatarWearable[] wearables) | 136 | public void SendWearables(AvatarWearable[] wearables) |
108 | { | 137 | { |
109 | AgentWearablesUpdatePacket aw = new AgentWearablesUpdatePacket(); | 138 | AgentWearablesUpdatePacket aw = new AgentWearablesUpdatePacket(); |
@@ -125,6 +154,12 @@ namespace OpenSim | |||
125 | this.OutPacket(aw); | 154 | this.OutPacket(aw); |
126 | } | 155 | } |
127 | 156 | ||
157 | /// <summary> | ||
158 | /// | ||
159 | /// </summary> | ||
160 | /// <param name="agentID"></param> | ||
161 | /// <param name="visualParams"></param> | ||
162 | /// <param name="textureEntry"></param> | ||
128 | public void SendAppearance(LLUUID agentID, byte[] visualParams, byte[] textureEntry) | 163 | public void SendAppearance(LLUUID agentID, byte[] visualParams, byte[] textureEntry) |
129 | { | 164 | { |
130 | AvatarAppearancePacket avp = new AvatarAppearancePacket(); | 165 | AvatarAppearancePacket avp = new AvatarAppearancePacket(); |
@@ -200,6 +235,10 @@ namespace OpenSim | |||
200 | } | 235 | } |
201 | } | 236 | } |
202 | 237 | ||
238 | /// <summary> | ||
239 | /// | ||
240 | /// </summary> | ||
241 | /// <param name="regionInfo"></param> | ||
203 | public void SendRegionHandshake(RegionInfo regionInfo) | 242 | public void SendRegionHandshake(RegionInfo regionInfo) |
204 | { | 243 | { |
205 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.VERBOSE, "Avatar.cs:SendRegionHandshake() - Creating empty RegionHandshake packet"); | 244 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.VERBOSE, "Avatar.cs:SendRegionHandshake() - Creating empty RegionHandshake packet"); |
@@ -240,6 +279,15 @@ namespace OpenSim | |||
240 | OutPacket(handshake); | 279 | OutPacket(handshake); |
241 | } | 280 | } |
242 | 281 | ||
282 | /// <summary> | ||
283 | /// | ||
284 | /// </summary> | ||
285 | /// <param name="regionInfo"></param> | ||
286 | /// <param name="firstName"></param> | ||
287 | /// <param name="lastName"></param> | ||
288 | /// <param name="avatarID"></param> | ||
289 | /// <param name="avatarLocalID"></param> | ||
290 | /// <param name="Pos"></param> | ||
243 | public void SendAvatarData(RegionInfo regionInfo, string firstName, string lastName, LLUUID avatarID, uint avatarLocalID, LLVector3 Pos) | 291 | public void SendAvatarData(RegionInfo regionInfo, string firstName, string lastName, LLUUID avatarID, uint avatarLocalID, LLVector3 Pos) |
244 | { | 292 | { |
245 | System.Text.Encoding _enc = System.Text.Encoding.ASCII; | 293 | System.Text.Encoding _enc = System.Text.Encoding.ASCII; |
@@ -263,6 +311,10 @@ namespace OpenSim | |||
263 | 311 | ||
264 | } | 312 | } |
265 | 313 | ||
314 | /// <summary> | ||
315 | /// | ||
316 | /// </summary> | ||
317 | /// <param name="objdata"></param> | ||
266 | protected void SetDefaultPacketValues(ref ObjectUpdatePacket.ObjectDataBlock objdata) | 318 | protected void SetDefaultPacketValues(ref ObjectUpdatePacket.ObjectDataBlock objdata) |
267 | { | 319 | { |
268 | objdata.PSBlock = new byte[0]; | 320 | objdata.PSBlock = new byte[0]; |
@@ -291,6 +343,10 @@ namespace OpenSim | |||
291 | objdata.ObjectData[64] = 189; | 343 | objdata.ObjectData[64] = 189; |
292 | } | 344 | } |
293 | 345 | ||
346 | /// <summary> | ||
347 | /// | ||
348 | /// </summary> | ||
349 | /// <returns></returns> | ||
294 | protected ObjectUpdatePacket.ObjectDataBlock CreateDefaultAvatarPacket() | 350 | protected ObjectUpdatePacket.ObjectDataBlock CreateDefaultAvatarPacket() |
295 | { | 351 | { |
296 | libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock objdata = new ObjectUpdatePacket.ObjectDataBlock(); // new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock(data1, ref i); | 352 | libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock objdata = new ObjectUpdatePacket.ObjectDataBlock(); // new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock(data1, ref i); |