aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorlbsa712007-09-18 09:59:33 +0000
committerlbsa712007-09-18 09:59:33 +0000
commita963b3057bdc80fc403e2b8402d0666c3d3f5c97 (patch)
treee2395d69fd3a7ef9fd4002498d9ebad914235645 /OpenSim
parent* Merged ClientViewBase into ClientView for great justice (diff)
downloadopensim-SC_OLD-a963b3057bdc80fc403e2b8402d0666c3d3f5c97.zip
opensim-SC_OLD-a963b3057bdc80fc403e2b8402d0666c3d3f5c97.tar.gz
opensim-SC_OLD-a963b3057bdc80fc403e2b8402d0666c3d3f5c97.tar.bz2
opensim-SC_OLD-a963b3057bdc80fc403e2b8402d0666c3d3f5c97.tar.xz
* Replaced usage of ClientView with IClientAPI
* Some propertification and hideousness of fields.
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Framework/General/Interfaces/IClientAPI.cs2
-rw-r--r--OpenSim/Framework/General/NullClientAPI.cs8
-rw-r--r--OpenSim/Region/ClientStack/ClientView.API.cs53
-rw-r--r--OpenSim/Region/ClientStack/ClientView.PacketHandlers.cs19
-rw-r--r--OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs11
-rw-r--r--OpenSim/Region/ClientStack/ClientView.cs20
-rw-r--r--OpenSim/Region/ClientStack/PacketServer.cs8
-rw-r--r--OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs15
-rw-r--r--OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs6
9 files changed, 78 insertions, 64 deletions
diff --git a/OpenSim/Framework/General/Interfaces/IClientAPI.cs b/OpenSim/Framework/General/Interfaces/IClientAPI.cs
index 747ad5c..580a263 100644
--- a/OpenSim/Framework/General/Interfaces/IClientAPI.cs
+++ b/OpenSim/Framework/General/Interfaces/IClientAPI.cs
@@ -241,5 +241,7 @@ namespace OpenSim.Framework.Interfaces
241 void SendViewerTime(int phase); 241 void SendViewerTime(int phase);
242 void SendAvatarProperties(LLUUID avatarID, string aboutText, string bornOn, string charterMember, string flAbout, uint flags, LLUUID flImageID, LLUUID imageID, string profileURL, LLUUID partnerID); 242 void SendAvatarProperties(LLUUID avatarID, string aboutText, string bornOn, string charterMember, string flAbout, uint flags, LLUUID flImageID, LLUUID imageID, string profileURL, LLUUID partnerID);
243 void SetDebug(int newDebug); 243 void SetDebug(int newDebug);
244 void InPacket(Packet NewPack);
245 void ConnectionClosed();
244 } 246 }
245} 247}
diff --git a/OpenSim/Framework/General/NullClientAPI.cs b/OpenSim/Framework/General/NullClientAPI.cs
index cf7e448..2b6de9e 100644
--- a/OpenSim/Framework/General/NullClientAPI.cs
+++ b/OpenSim/Framework/General/NullClientAPI.cs
@@ -167,6 +167,14 @@ namespace OpenSim.Framework
167 public void SendViewerTime(int phase) { } 167 public void SendViewerTime(int phase) { }
168 public void SendAvatarProperties(LLUUID avatarID, string aboutText, string bornOn, string charterMember, string flAbout, uint flags, LLUUID flImageID, LLUUID imageID, string profileURL, LLUUID partnerID) { } 168 public void SendAvatarProperties(LLUUID avatarID, string aboutText, string bornOn, string charterMember, string flAbout, uint flags, LLUUID flImageID, LLUUID imageID, string profileURL, LLUUID partnerID) { }
169 public void SetDebug(int newDebug) { } 169 public void SetDebug(int newDebug) { }
170
171 public void InPacket(Packet NewPack)
172 {
173 }
174
175 public void ConnectionClosed()
176 {
177 }
170 } 178 }
171} 179}
172 180
diff --git a/OpenSim/Region/ClientStack/ClientView.API.cs b/OpenSim/Region/ClientStack/ClientView.API.cs
index c97ba37..9d5a9e8 100644
--- a/OpenSim/Region/ClientStack/ClientView.API.cs
+++ b/OpenSim/Region/ClientStack/ClientView.API.cs
@@ -124,19 +124,12 @@ namespace OpenSim.Region.ClientStack
124 /// <summary> 124 /// <summary>
125 /// 125 ///
126 /// </summary> 126 /// </summary>
127 private LLUUID m_agentId;
127 public LLUUID AgentId 128 public LLUUID AgentId
128 { 129 {
129 get 130 get
130 { 131 {
131 return this.AgentID; 132 return m_agentId;
132 }
133 }
134
135 public LLUUID SessionId
136 {
137 get
138 {
139 return this.SessionID;
140 } 133 }
141 } 134 }
142 135
@@ -212,8 +205,8 @@ namespace OpenSim.Region.ClientStack
212 public void MoveAgentIntoRegion(RegionInfo regInfo, LLVector3 pos, LLVector3 look) 205 public void MoveAgentIntoRegion(RegionInfo regInfo, LLVector3 pos, LLVector3 look)
213 { 206 {
214 AgentMovementCompletePacket mov = new AgentMovementCompletePacket(); 207 AgentMovementCompletePacket mov = new AgentMovementCompletePacket();
215 mov.AgentData.SessionID = this.SessionID; 208 mov.AgentData.SessionID = this.m_sessionId;
216 mov.AgentData.AgentID = this.AgentID; 209 mov.AgentData.AgentID = this.AgentId;
217 mov.Data.RegionHandle = regInfo.RegionHandle; 210 mov.Data.RegionHandle = regInfo.RegionHandle;
218 mov.Data.Timestamp = 1172750370; // TODO - dynamicalise this 211 mov.Data.Timestamp = 1172750370; // TODO - dynamicalise this
219 212
@@ -377,7 +370,7 @@ namespace OpenSim.Region.ClientStack
377 { 370 {
378 AgentCircuitData agentData = new AgentCircuitData(); 371 AgentCircuitData agentData = new AgentCircuitData();
379 agentData.AgentID = this.AgentId; 372 agentData.AgentID = this.AgentId;
380 agentData.SessionID = this.SessionID; 373 agentData.SessionID = this.m_sessionId;
381 agentData.SecureSessionID = this.SecureSessionID; 374 agentData.SecureSessionID = this.SecureSessionID;
382 agentData.circuitcode = this.CircuitCode; 375 agentData.circuitcode = this.CircuitCode;
383 agentData.child = false; 376 agentData.child = false;
@@ -393,8 +386,8 @@ namespace OpenSim.Region.ClientStack
393 386
394 CrossedRegionPacket newSimPack = new CrossedRegionPacket(); 387 CrossedRegionPacket newSimPack = new CrossedRegionPacket();
395 newSimPack.AgentData = new CrossedRegionPacket.AgentDataBlock(); 388 newSimPack.AgentData = new CrossedRegionPacket.AgentDataBlock();
396 newSimPack.AgentData.AgentID = this.AgentID; 389 newSimPack.AgentData.AgentID = this.AgentId;
397 newSimPack.AgentData.SessionID = this.SessionID; 390 newSimPack.AgentData.SessionID = this.m_sessionId;
398 newSimPack.Info = new CrossedRegionPacket.InfoBlock(); 391 newSimPack.Info = new CrossedRegionPacket.InfoBlock();
399 newSimPack.Info.Position = pos; 392 newSimPack.Info.Position = pos;
400 newSimPack.Info.LookAt = look; // new LLVector3(0.0f, 0.0f, 0.0f); // copied from Avatar.cs - SHOULD BE DYNAMIC!!!!!!!!!! 393 newSimPack.Info.LookAt = look; // new LLVector3(0.0f, 0.0f, 0.0f); // copied from Avatar.cs - SHOULD BE DYNAMIC!!!!!!!!!!
@@ -415,7 +408,7 @@ namespace OpenSim.Region.ClientStack
415 public void SendMapBlock(List<MapBlockData> mapBlocks) 408 public void SendMapBlock(List<MapBlockData> mapBlocks)
416 { 409 {
417 MapBlockReplyPacket mapReply = new MapBlockReplyPacket(); 410 MapBlockReplyPacket mapReply = new MapBlockReplyPacket();
418 mapReply.AgentData.AgentID = this.AgentID; 411 mapReply.AgentData.AgentID = this.AgentId;
419 mapReply.Data = new MapBlockReplyPacket.DataBlock[mapBlocks.Count]; 412 mapReply.Data = new MapBlockReplyPacket.DataBlock[mapBlocks.Count];
420 mapReply.AgentData.Flags = 0; 413 mapReply.AgentData.Flags = 0;
421 414
@@ -437,7 +430,7 @@ namespace OpenSim.Region.ClientStack
437 public void SendLocalTeleport(LLVector3 position, LLVector3 lookAt, uint flags) 430 public void SendLocalTeleport(LLVector3 position, LLVector3 lookAt, uint flags)
438 { 431 {
439 TeleportLocalPacket tpLocal = new TeleportLocalPacket(); 432 TeleportLocalPacket tpLocal = new TeleportLocalPacket();
440 tpLocal.Info.AgentID = this.AgentID; 433 tpLocal.Info.AgentID = this.AgentId;
441 tpLocal.Info.TeleportFlags = flags; 434 tpLocal.Info.TeleportFlags = flags;
442 tpLocal.Info.LocationID = 2; 435 tpLocal.Info.LocationID = 2;
443 tpLocal.Info.LookAt = lookAt; 436 tpLocal.Info.LookAt = lookAt;
@@ -448,7 +441,7 @@ namespace OpenSim.Region.ClientStack
448 public void SendRegionTeleport(ulong regionHandle, byte simAccess, IPEndPoint newRegionEndPoint, uint locationID, uint flags, string capsURL) 441 public void SendRegionTeleport(ulong regionHandle, byte simAccess, IPEndPoint newRegionEndPoint, uint locationID, uint flags, string capsURL)
449 { 442 {
450 TeleportFinishPacket teleport = new TeleportFinishPacket(); 443 TeleportFinishPacket teleport = new TeleportFinishPacket();
451 teleport.Info.AgentID = this.AgentID; 444 teleport.Info.AgentID = this.AgentId;
452 teleport.Info.RegionHandle = regionHandle; 445 teleport.Info.RegionHandle = regionHandle;
453 teleport.Info.SimAccess = simAccess; 446 teleport.Info.SimAccess = simAccess;
454 447
@@ -475,8 +468,8 @@ namespace OpenSim.Region.ClientStack
475 public void SendTeleportCancel() 468 public void SendTeleportCancel()
476 { 469 {
477 TeleportCancelPacket tpCancel = new TeleportCancelPacket(); 470 TeleportCancelPacket tpCancel = new TeleportCancelPacket();
478 tpCancel.Info.SessionID = this.SessionID; 471 tpCancel.Info.SessionID = this.m_sessionId;
479 tpCancel.Info.AgentID = this.AgentID; 472 tpCancel.Info.AgentID = this.AgentId;
480 473
481 OutPacket(tpCancel); 474 OutPacket(tpCancel);
482 } 475 }
@@ -494,7 +487,7 @@ namespace OpenSim.Region.ClientStack
494 public void SendMoneyBalance(LLUUID transaction, bool success, byte[] description, int balance) 487 public void SendMoneyBalance(LLUUID transaction, bool success, byte[] description, int balance)
495 { 488 {
496 MoneyBalanceReplyPacket money = new MoneyBalanceReplyPacket(); 489 MoneyBalanceReplyPacket money = new MoneyBalanceReplyPacket();
497 money.MoneyData.AgentID = this.AgentID; 490 money.MoneyData.AgentID = this.AgentId;
498 money.MoneyData.TransactionID = transaction; 491 money.MoneyData.TransactionID = transaction;
499 money.MoneyData.TransactionSuccess = success; 492 money.MoneyData.TransactionSuccess = success;
500 money.MoneyData.Description = description; 493 money.MoneyData.Description = description;
@@ -641,7 +634,7 @@ namespace OpenSim.Region.ClientStack
641 Encoding enc = Encoding.ASCII; 634 Encoding enc = Encoding.ASCII;
642 uint FULL_MASK_PERMISSIONS = 2147483647; 635 uint FULL_MASK_PERMISSIONS = 2147483647;
643 UpdateCreateInventoryItemPacket InventoryReply = new UpdateCreateInventoryItemPacket(); 636 UpdateCreateInventoryItemPacket InventoryReply = new UpdateCreateInventoryItemPacket();
644 InventoryReply.AgentData.AgentID = this.AgentID; 637 InventoryReply.AgentData.AgentID = this.AgentId;
645 InventoryReply.AgentData.SimApproved = true; 638 InventoryReply.AgentData.SimApproved = true;
646 InventoryReply.InventoryData = new UpdateCreateInventoryItemPacket.InventoryDataBlock[1]; 639 InventoryReply.InventoryData = new UpdateCreateInventoryItemPacket.InventoryDataBlock[1];
647 InventoryReply.InventoryData[0] = new UpdateCreateInventoryItemPacket.InventoryDataBlock(); 640 InventoryReply.InventoryData[0] = new UpdateCreateInventoryItemPacket.InventoryDataBlock();
@@ -672,8 +665,8 @@ namespace OpenSim.Region.ClientStack
672 public void SendRemoveInventoryItem(LLUUID itemID) 665 public void SendRemoveInventoryItem(LLUUID itemID)
673 { 666 {
674 RemoveInventoryItemPacket remove = new RemoveInventoryItemPacket(); 667 RemoveInventoryItemPacket remove = new RemoveInventoryItemPacket();
675 remove.AgentData.AgentID = this.AgentID; 668 remove.AgentData.AgentID = this.AgentId;
676 remove.AgentData.SessionID = this.SessionID; 669 remove.AgentData.SessionID = this.m_sessionId;
677 remove.InventoryData = new RemoveInventoryItemPacket.InventoryDataBlock[1]; 670 remove.InventoryData = new RemoveInventoryItemPacket.InventoryDataBlock[1];
678 remove.InventoryData[0] = new RemoveInventoryItemPacket.InventoryDataBlock(); 671 remove.InventoryData[0] = new RemoveInventoryItemPacket.InventoryDataBlock();
679 remove.InventoryData[0].ItemID = itemID; 672 remove.InventoryData[0].ItemID = itemID;
@@ -718,7 +711,7 @@ namespace OpenSim.Region.ClientStack
718 public void SendAgentAlertMessage(string message, bool modal) 711 public void SendAgentAlertMessage(string message, bool modal)
719 { 712 {
720 AgentAlertMessagePacket alertPack = new AgentAlertMessagePacket(); 713 AgentAlertMessagePacket alertPack = new AgentAlertMessagePacket();
721 alertPack.AgentData.AgentID = this.AgentID; 714 alertPack.AgentData.AgentID = this.AgentId;
722 alertPack.AlertData.Message = Helpers.StringToField(message); 715 alertPack.AlertData.Message = Helpers.StringToField(message);
723 alertPack.AlertData.Modal = modal; 716 alertPack.AlertData.Modal = modal;
724 OutPacket(alertPack); 717 OutPacket(alertPack);
@@ -799,7 +792,7 @@ namespace OpenSim.Region.ClientStack
799 public void SendAvatarProperties(LLUUID avatarID, string aboutText, string bornOn, string charterMember, string flAbout, uint flags, LLUUID flImageID, LLUUID imageID, string profileURL, LLUUID partnerID) 792 public void SendAvatarProperties(LLUUID avatarID, string aboutText, string bornOn, string charterMember, string flAbout, uint flags, LLUUID flImageID, LLUUID imageID, string profileURL, LLUUID partnerID)
800 { 793 {
801 AvatarPropertiesReplyPacket avatarReply = new AvatarPropertiesReplyPacket(); 794 AvatarPropertiesReplyPacket avatarReply = new AvatarPropertiesReplyPacket();
802 avatarReply.AgentData.AgentID = this.AgentID; 795 avatarReply.AgentData.AgentID = this.AgentId;
803 avatarReply.AgentData.AvatarID = avatarID; 796 avatarReply.AgentData.AvatarID = avatarID;
804 avatarReply.PropertiesData.AboutText = Helpers.StringToField(aboutText); 797 avatarReply.PropertiesData.AboutText = Helpers.StringToField(aboutText);
805 avatarReply.PropertiesData.BornOn = Helpers.StringToField(bornOn); 798 avatarReply.PropertiesData.BornOn = Helpers.StringToField(bornOn);
@@ -823,9 +816,9 @@ namespace OpenSim.Region.ClientStack
823 public void SendWearables(AvatarWearable[] wearables) 816 public void SendWearables(AvatarWearable[] wearables)
824 { 817 {
825 AgentWearablesUpdatePacket aw = new AgentWearablesUpdatePacket(); 818 AgentWearablesUpdatePacket aw = new AgentWearablesUpdatePacket();
826 aw.AgentData.AgentID = this.AgentID; 819 aw.AgentData.AgentID = this.AgentId;
827 aw.AgentData.SerialNum = 0; 820 aw.AgentData.SerialNum = 0;
828 aw.AgentData.SessionID = this.SessionID; 821 aw.AgentData.SessionID = this.m_sessionId;
829 822
830 aw.WearableData = new AgentWearablesUpdatePacket.WearableDataBlock[13]; 823 aw.WearableData = new AgentWearablesUpdatePacket.WearableDataBlock[13];
831 AgentWearablesUpdatePacket.WearableDataBlock awb; 824 AgentWearablesUpdatePacket.WearableDataBlock awb;
@@ -968,8 +961,8 @@ namespace OpenSim.Region.ClientStack
968 public void AttachObject(uint localID, LLQuaternion rotation, byte attachPoint) 961 public void AttachObject(uint localID, LLQuaternion rotation, byte attachPoint)
969 { 962 {
970 ObjectAttachPacket attach = new ObjectAttachPacket(); 963 ObjectAttachPacket attach = new ObjectAttachPacket();
971 attach.AgentData.AgentID = this.AgentID; 964 attach.AgentData.AgentID = this.AgentId;
972 attach.AgentData.SessionID = this.SessionID; 965 attach.AgentData.SessionID = this.m_sessionId;
973 attach.AgentData.AttachmentPoint = attachPoint; 966 attach.AgentData.AttachmentPoint = attachPoint;
974 attach.ObjectData = new ObjectAttachPacket.ObjectDataBlock[1]; 967 attach.ObjectData = new ObjectAttachPacket.ObjectDataBlock[1];
975 attach.ObjectData[0] = new ObjectAttachPacket.ObjectDataBlock(); 968 attach.ObjectData[0] = new ObjectAttachPacket.ObjectDataBlock();
@@ -1284,7 +1277,7 @@ namespace OpenSim.Region.ClientStack
1284 objdata.ID = 8880000; 1277 objdata.ID = 8880000;
1285 objdata.NameValue = enc.GetBytes("FirstName STRING RW SV Test \nLastName STRING RW SV User \0"); 1278 objdata.NameValue = enc.GetBytes("FirstName STRING RW SV Test \nLastName STRING RW SV User \0");
1286 LLVector3 pos2 = new LLVector3(100f, 100f, 23f); 1279 LLVector3 pos2 = new LLVector3(100f, 100f, 23f);
1287 //objdata.FullID=user.AgentID; 1280 //objdata.FullID=user.AgentId;
1288 byte[] pb = pos.GetBytes(); 1281 byte[] pb = pos.GetBytes();
1289 Array.Copy(pb, 0, objdata.ObjectData, 16, pb.Length); 1282 Array.Copy(pb, 0, objdata.ObjectData, 16, pb.Length);
1290 1283
diff --git a/OpenSim/Region/ClientStack/ClientView.PacketHandlers.cs b/OpenSim/Region/ClientStack/ClientView.PacketHandlers.cs
index fdde027..71fea0d 100644
--- a/OpenSim/Region/ClientStack/ClientView.PacketHandlers.cs
+++ b/OpenSim/Region/ClientStack/ClientView.PacketHandlers.cs
@@ -28,6 +28,7 @@
28using libsecondlife; 28using libsecondlife;
29using libsecondlife.Packets; 29using libsecondlife.Packets;
30using OpenSim.Framework.Console; 30using OpenSim.Framework.Console;
31using OpenSim.Framework.Interfaces;
31 32
32namespace OpenSim.Region.ClientStack 33namespace OpenSim.Region.ClientStack
33{ 34{
@@ -40,13 +41,13 @@ namespace OpenSim.Region.ClientStack
40 this.AddLocalPacketHandler(PacketType.MultipleObjectUpdate, this.MultipleObjUpdate); 41 this.AddLocalPacketHandler(PacketType.MultipleObjectUpdate, this.MultipleObjUpdate);
41 } 42 }
42 43
43 protected virtual bool Logout(ClientView simClient, Packet packet) 44 protected virtual bool Logout(IClientAPI simClient, Packet packet)
44 { 45 {
45 MainLog.Instance.Verbose( "OpenSimClient.cs:ProcessInPacket() - Got a logout request"); 46 MainLog.Instance.Verbose( "OpenSimClient.cs:ProcessInPacket() - Got a logout request");
46 //send reply to let the client logout 47 //send reply to let the client logout
47 LogoutReplyPacket logReply = new LogoutReplyPacket(); 48 LogoutReplyPacket logReply = new LogoutReplyPacket();
48 logReply.AgentData.AgentID = this.AgentID; 49 logReply.AgentData.AgentID = this.AgentId;
49 logReply.AgentData.SessionID = this.SessionID; 50 logReply.AgentData.SessionID = this.m_sessionId;
50 logReply.InventoryData = new LogoutReplyPacket.InventoryDataBlock[1]; 51 logReply.InventoryData = new LogoutReplyPacket.InventoryDataBlock[1];
51 logReply.InventoryData[0] = new LogoutReplyPacket.InventoryDataBlock(); 52 logReply.InventoryData[0] = new LogoutReplyPacket.InventoryDataBlock();
52 logReply.InventoryData[0].ItemID = LLUUID.Zero; 53 logReply.InventoryData[0].ItemID = LLUUID.Zero;
@@ -56,13 +57,13 @@ namespace OpenSim.Region.ClientStack
56 return true; 57 return true;
57 } 58 }
58 59
59 protected bool AgentTextureCached(ClientView simclient, Packet packet) 60 protected bool AgentTextureCached(IClientAPI simclient, Packet packet)
60 { 61 {
61 //System.Console.WriteLine("texture cached: " + packet.ToString()); 62 //System.Console.WriteLine("texture cached: " + packet.ToString());
62 AgentCachedTexturePacket chechedtex = (AgentCachedTexturePacket)packet; 63 AgentCachedTexturePacket chechedtex = (AgentCachedTexturePacket)packet;
63 AgentCachedTextureResponsePacket cachedresp = new AgentCachedTextureResponsePacket(); 64 AgentCachedTextureResponsePacket cachedresp = new AgentCachedTextureResponsePacket();
64 cachedresp.AgentData.AgentID = this.AgentID; 65 cachedresp.AgentData.AgentID = this.AgentId;
65 cachedresp.AgentData.SessionID = this.SessionID; 66 cachedresp.AgentData.SessionID = this.m_sessionId;
66 cachedresp.AgentData.SerialNum = this.cachedtextureserial; 67 cachedresp.AgentData.SerialNum = this.cachedtextureserial;
67 this.cachedtextureserial++; 68 this.cachedtextureserial++;
68 cachedresp.WearableData = new AgentCachedTextureResponsePacket.WearableDataBlock[chechedtex.WearableData.Length]; 69 cachedresp.WearableData = new AgentCachedTextureResponsePacket.WearableDataBlock[chechedtex.WearableData.Length];
@@ -77,7 +78,7 @@ namespace OpenSim.Region.ClientStack
77 return true; 78 return true;
78 } 79 }
79 80
80 protected bool MultipleObjUpdate(ClientView simClient, Packet packet) 81 protected bool MultipleObjUpdate(IClientAPI simClient, Packet packet)
81 { 82 {
82 MultipleObjectUpdatePacket multipleupdate = (MultipleObjectUpdatePacket)packet; 83 MultipleObjectUpdatePacket multipleupdate = (MultipleObjectUpdatePacket)packet;
83 // System.Console.WriteLine("new multi update packet " + multipleupdate.ToString()); 84 // System.Console.WriteLine("new multi update packet " + multipleupdate.ToString());
@@ -197,7 +198,7 @@ namespace OpenSim.Region.ClientStack
197 //should be getting the map layer from the grid server 198 //should be getting the map layer from the grid server
198 //send a layer covering the 800,800 - 1200,1200 area (should be covering the requested area) 199 //send a layer covering the 800,800 - 1200,1200 area (should be covering the requested area)
199 MapLayerReplyPacket mapReply = new MapLayerReplyPacket(); 200 MapLayerReplyPacket mapReply = new MapLayerReplyPacket();
200 mapReply.AgentData.AgentID = this.AgentID; 201 mapReply.AgentData.AgentID = this.AgentId;
201 mapReply.AgentData.Flags = 0; 202 mapReply.AgentData.Flags = 0;
202 mapReply.LayerData = new MapLayerReplyPacket.LayerDataBlock[1]; 203 mapReply.LayerData = new MapLayerReplyPacket.LayerDataBlock[1];
203 mapReply.LayerData[0] = new MapLayerReplyPacket.LayerDataBlock(); 204 mapReply.LayerData[0] = new MapLayerReplyPacket.LayerDataBlock();
@@ -214,7 +215,7 @@ namespace OpenSim.Region.ClientStack
214 /* 215 /*
215 IList simMapProfiles = m_gridServer.RequestMapBlocks(minX, minY, maxX, maxY); 216 IList simMapProfiles = m_gridServer.RequestMapBlocks(minX, minY, maxX, maxY);
216 MapBlockReplyPacket mbReply = new MapBlockReplyPacket(); 217 MapBlockReplyPacket mbReply = new MapBlockReplyPacket();
217 mbReply.AgentData.AgentID = this.AgentID; 218 mbReply.AgentData.AgentId = this.AgentId;
218 int len; 219 int len;
219 if (simMapProfiles == null) 220 if (simMapProfiles == null)
220 len = 0; 221 len = 0;
diff --git a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
index 80e499b..95ce3c5 100644
--- a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
+++ b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
@@ -33,6 +33,7 @@ using libsecondlife.Packets;
33using OpenSim.Framework.Inventory; 33using OpenSim.Framework.Inventory;
34using OpenSim.Framework.Types; 34using OpenSim.Framework.Types;
35using OpenSim.Framework.Utilities; 35using OpenSim.Framework.Utilities;
36using OpenSim.Framework.Interfaces;
36 37
37namespace OpenSim.Region.ClientStack 38namespace OpenSim.Region.ClientStack
38{ 39{
@@ -76,12 +77,12 @@ namespace OpenSim.Region.ClientStack
76 { 77 {
77 case PacketType.ViewerEffect: 78 case PacketType.ViewerEffect:
78 ViewerEffectPacket viewer = (ViewerEffectPacket)Pack; 79 ViewerEffectPacket viewer = (ViewerEffectPacket)Pack;
79 foreach (ClientView client in m_clientThreads.Values) 80 foreach (IClientAPI client in m_clientThreads.Values)
80 { 81 {
81 if (client.AgentID != this.AgentID) 82 if (client.AgentId != this.AgentId)
82 { 83 {
83 viewer.AgentData.AgentID = client.AgentID; 84 viewer.AgentData.AgentID = client.AgentId;
84 viewer.AgentData.SessionID = client.SessionID; 85 viewer.AgentData.SessionID = client.SessionId;
85 client.OutPacket(viewer); 86 client.OutPacket(viewer);
86 } 87 }
87 } 88 }
@@ -106,7 +107,7 @@ namespace OpenSim.Region.ClientStack
106 byte[] message = inchatpack.ChatData.Message; 107 byte[] message = inchatpack.ChatData.Message;
107 byte type = inchatpack.ChatData.Type; 108 byte type = inchatpack.ChatData.Type;
108 LLVector3 fromPos = new LLVector3(); // ClientAvatar.Pos; 109 LLVector3 fromPos = new LLVector3(); // ClientAvatar.Pos;
109 LLUUID fromAgentID = AgentID; 110 LLUUID fromAgentID = AgentId;
110 111
111 int channel = inchatpack.ChatData.Channel; 112 int channel = inchatpack.ChatData.Channel;
112 113
diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs
index 1d92cca..2bff88a 100644
--- a/OpenSim/Region/ClientStack/ClientView.cs
+++ b/OpenSim/Region/ClientStack/ClientView.cs
@@ -45,7 +45,7 @@ using Timer = System.Timers.Timer;
45 45
46namespace OpenSim.Region.ClientStack 46namespace OpenSim.Region.ClientStack
47{ 47{
48 public delegate bool PacketMethod(ClientView simClient, Packet packet); 48 public delegate bool PacketMethod(IClientAPI simClient, Packet packet);
49 49
50 /// <summary> 50 /// <summary>
51 /// Handles new client connections 51 /// Handles new client connections
@@ -58,8 +58,7 @@ namespace OpenSim.Region.ClientStack
58 protected static Dictionary<PacketType, PacketMethod> PacketHandlers = new Dictionary<PacketType, PacketMethod>(); //Global/static handlers for all clients 58 protected static Dictionary<PacketType, PacketMethod> PacketHandlers = new Dictionary<PacketType, PacketMethod>(); //Global/static handlers for all clients
59 protected Dictionary<PacketType, PacketMethod> m_packetHandlers = new Dictionary<PacketType, PacketMethod>(); //local handlers for this instance 59 protected Dictionary<PacketType, PacketMethod> m_packetHandlers = new Dictionary<PacketType, PacketMethod>(); //local handlers for this instance
60 60
61 public LLUUID AgentID; 61 private LLUUID m_sessionId;
62 public LLUUID SessionID;
63 public LLUUID SecureSessionID = LLUUID.Zero; 62 public LLUUID SecureSessionID = LLUUID.Zero;
64 public string firstName; 63 public string firstName;
65 public string lastName; 64 public string lastName;
@@ -72,7 +71,7 @@ namespace OpenSim.Region.ClientStack
72 private LLUUID newAssetFolder = LLUUID.Zero; 71 private LLUUID newAssetFolder = LLUUID.Zero;
73 private int debug = 0; 72 private int debug = 0;
74 protected IScene m_scene; 73 protected IScene m_scene;
75 private Dictionary<uint, ClientView> m_clientThreads; 74 private Dictionary<uint, IClientAPI> m_clientThreads;
76 private AssetCache m_assetCache; 75 private AssetCache m_assetCache;
77 // private InventoryCache m_inventoryCache; 76 // private InventoryCache m_inventoryCache;
78 private int cachedtextureserial = 0; 77 private int cachedtextureserial = 0;
@@ -84,7 +83,7 @@ namespace OpenSim.Region.ClientStack
84 private int probesWithNoIngressPackets = 0; 83 private int probesWithNoIngressPackets = 0;
85 private int lastPacketsReceived = 0; 84 private int lastPacketsReceived = 0;
86 85
87 public ClientView(EndPoint remoteEP, UseCircuitCodePacket initialcirpack, Dictionary<uint, ClientView> clientThreads, IScene scene, AssetCache assetCache, PacketServer packServer, AgentCircuitManager authenSessions) 86 public ClientView(EndPoint remoteEP, UseCircuitCodePacket initialcirpack, Dictionary<uint, IClientAPI> clientThreads, IScene scene, AssetCache assetCache, PacketServer packServer, AgentCircuitManager authenSessions)
88 { 87 {
89 m_moneyBalance = 1000; 88 m_moneyBalance = 1000;
90 89
@@ -116,6 +115,11 @@ namespace OpenSim.Region.ClientStack
116 ClientThread.Start(); 115 ClientThread.Start();
117 } 116 }
118 117
118 public LLUUID SessionId
119 {
120 get { return m_sessionId; }
121 }
122
119 public void SetDebug(int newDebug) 123 public void SetDebug(int newDebug)
120 { 124 {
121 debug = newDebug; 125 debug = newDebug;
@@ -285,7 +289,7 @@ namespace OpenSim.Region.ClientStack
285 289
286 protected virtual void AuthUser() 290 protected virtual void AuthUser()
287 { 291 {
288 // AuthenticateResponse sessionInfo = m_gridServer.AuthenticateSession(cirpack.CircuitCode.SessionID, cirpack.CircuitCode.ID, cirpack.CircuitCode.Code); 292 // AuthenticateResponse sessionInfo = m_gridServer.AuthenticateSession(cirpack.CircuitCode.m_sessionId, cirpack.CircuitCode.ID, cirpack.CircuitCode.Code);
289 AuthenticateResponse sessionInfo = this.m_authenticateSessionsHandler.AuthenticateSession(cirpack.CircuitCode.SessionID, cirpack.CircuitCode.ID, cirpack.CircuitCode.Code); 293 AuthenticateResponse sessionInfo = this.m_authenticateSessionsHandler.AuthenticateSession(cirpack.CircuitCode.SessionID, cirpack.CircuitCode.ID, cirpack.CircuitCode.Code);
290 if (!sessionInfo.Authorised) 294 if (!sessionInfo.Authorised)
291 { 295 {
@@ -297,8 +301,8 @@ namespace OpenSim.Region.ClientStack
297 { 301 {
298 MainLog.Instance.Notice("OpenSimClient.cs:AuthUser() - Got authenticated connection from " + userEP.ToString()); 302 MainLog.Instance.Notice("OpenSimClient.cs:AuthUser() - Got authenticated connection from " + userEP.ToString());
299 //session is authorised 303 //session is authorised
300 this.AgentID = cirpack.CircuitCode.ID; 304 m_agentId = cirpack.CircuitCode.ID;
301 this.SessionID = cirpack.CircuitCode.SessionID; 305 this.m_sessionId = cirpack.CircuitCode.SessionID;
302 this.CircuitCode = cirpack.CircuitCode.Code; 306 this.CircuitCode = cirpack.CircuitCode.Code;
303 this.firstName = sessionInfo.LoginInfo.First; 307 this.firstName = sessionInfo.LoginInfo.First;
304 this.lastName = sessionInfo.LoginInfo.Last; 308 this.lastName = sessionInfo.LoginInfo.Last;
diff --git a/OpenSim/Region/ClientStack/PacketServer.cs b/OpenSim/Region/ClientStack/PacketServer.cs
index 5d0862b..481e445 100644
--- a/OpenSim/Region/ClientStack/PacketServer.cs
+++ b/OpenSim/Region/ClientStack/PacketServer.cs
@@ -40,7 +40,7 @@ namespace OpenSim.Region.ClientStack
40 { 40 {
41 private ClientStackNetworkHandler _networkHandler; 41 private ClientStackNetworkHandler _networkHandler;
42 private IScene _localScene; 42 private IScene _localScene;
43 public Dictionary<uint, ClientView> ClientThreads = new Dictionary<uint, ClientView>(); 43 public Dictionary<uint, IClientAPI> ClientThreads = new Dictionary<uint, IClientAPI>();
44 private ClientManager m_clientManager = new ClientManager(); 44 private ClientManager m_clientManager = new ClientManager();
45 public ClientManager ClientManager 45 public ClientManager ClientManager
46 { 46 {
@@ -106,7 +106,7 @@ namespace OpenSim.Region.ClientStack
106 /// </summary> 106 /// </summary>
107 /// <param name="packet"></param> 107 /// <param name="packet"></param>
108 /// <param name="simClient"></param> 108 /// <param name="simClient"></param>
109 public virtual void SendPacketToAllExcept(Packet packet, ClientView simClient) 109 public virtual void SendPacketToAllExcept(Packet packet, IClientAPI simClient)
110 { 110 {
111 111
112 } 112 }
@@ -129,7 +129,7 @@ namespace OpenSim.Region.ClientStack
129 129
130 } 130 }
131 131
132 protected virtual ClientView CreateNewClient(EndPoint remoteEP, UseCircuitCodePacket initialcirpack, Dictionary<uint, ClientView> clientThreads, IScene scene, AssetCache assetCache, PacketServer packServer, AgentCircuitManager authenSessions) 132 protected virtual IClientAPI CreateNewClient(EndPoint remoteEP, UseCircuitCodePacket initialcirpack, Dictionary<uint, IClientAPI> clientThreads, IScene scene, AssetCache assetCache, PacketServer packServer, AgentCircuitManager authenSessions)
133 { 133 {
134 return new ClientView(remoteEP, initialcirpack, clientThreads, scene, assetCache, packServer, authenSessions ); 134 return new ClientView(remoteEP, initialcirpack, clientThreads, scene, assetCache, packServer, authenSessions );
135 } 135 }
@@ -145,7 +145,7 @@ namespace OpenSim.Region.ClientStack
145 /// <returns></returns> 145 /// <returns></returns>
146 public virtual bool AddNewClient(EndPoint epSender, UseCircuitCodePacket useCircuit, AssetCache assetCache, AgentCircuitManager authenticateSessionsClass) 146 public virtual bool AddNewClient(EndPoint epSender, UseCircuitCodePacket useCircuit, AssetCache assetCache, AgentCircuitManager authenticateSessionsClass)
147 { 147 {
148 ClientView newuser = 148 IClientAPI newuser =
149 CreateNewClient(epSender, useCircuit, ClientThreads, _localScene, assetCache, this, 149 CreateNewClient(epSender, useCircuit, ClientThreads, _localScene, assetCache, this,
150 authenticateSessionsClass); 150 authenticateSessionsClass);
151 151
diff --git a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs
index b009192..72a1e19 100644
--- a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs
+++ b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs
@@ -1,16 +1,11 @@
1using System.Collections.Generic; 1using System.Collections.Generic;
2using System.Net; 2using System.Net;
3using System.Timers;
4using System;
5using System.Text; 3using System.Text;
6
7using libsecondlife; 4using libsecondlife;
8using libsecondlife.Packets; 5using libsecondlife.Packets;
9 6using OpenSim.Framework.Data;
10using OpenSim.Framework;
11using OpenSim.Framework.Interfaces; 7using OpenSim.Framework.Interfaces;
12using OpenSim.Framework.Types; 8using OpenSim.Framework.Types;
13using OpenSim.Framework.Data;
14using OpenSim.Framework.Utilities; 9using OpenSim.Framework.Utilities;
15using OpenSim.Region.Environment.Scenes; 10using OpenSim.Region.Environment.Scenes;
16 11
@@ -228,5 +223,13 @@ namespace SimpleApp
228 public void SendViewerTime(int phase) { } 223 public void SendViewerTime(int phase) { }
229 public void SendAvatarProperties(LLUUID avatarID, string aboutText, string bornOn, string charterMember, string flAbout, uint flags, LLUUID flImageID, LLUUID imageID, string profileURL, LLUUID partnerID) { } 224 public void SendAvatarProperties(LLUUID avatarID, string aboutText, string bornOn, string charterMember, string flAbout, uint flags, LLUUID flImageID, LLUUID imageID, string profileURL, LLUUID partnerID) { }
230 public void SetDebug(int newDebug) { } 225 public void SetDebug(int newDebug) { }
226
227 public void InPacket(Packet NewPack)
228 {
229 }
230
231 public void ConnectionClosed()
232 {
233 }
231 } 234 }
232} 235}
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs
index e1989c4..197eb72 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs
@@ -284,8 +284,10 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
284 long before; 284 long before;
285 before = GC.GetTotalMemory(true); 285 before = GC.GetTotalMemory(true);
286#endif 286#endif
287 LSL_BaseClass CompiledScript; 287
288 CompiledScript = m_scriptEngine.m_AppDomainManager.LoadScript(ScriptSource); 288 LSL_BaseClass CompiledScript;
289 CompiledScript = m_scriptEngine.m_AppDomainManager.LoadScript(ScriptSource);
290
289#if DEBUG 291#if DEBUG
290 Console.WriteLine("Script " + itemID + " occupies {0} bytes", GC.GetTotalMemory(true) - before); 292 Console.WriteLine("Script " + itemID + " occupies {0} bytes", GC.GetTotalMemory(true) - before);
291#endif 293#endif