aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim-Source/OpenSim.RegionServer
diff options
context:
space:
mode:
authorMW2007-05-24 12:16:50 +0000
committerMW2007-05-24 12:16:50 +0000
commit3376b82501000692d6dac24b051af738cdaf2737 (patch)
tree90ed0a5d4955236f011fa63fce9d555186b0d179 /OpenSim-Source/OpenSim.RegionServer
parentAdded "terrain save grdmap <filename> <gradientmap>" function to console. Gra... (diff)
downloadopensim-SC_OLD-3376b82501000692d6dac24b051af738cdaf2737.zip
opensim-SC_OLD-3376b82501000692d6dac24b051af738cdaf2737.tar.gz
opensim-SC_OLD-3376b82501000692d6dac24b051af738cdaf2737.tar.bz2
opensim-SC_OLD-3376b82501000692d6dac24b051af738cdaf2737.tar.xz
Some more code refactoring, plus a restructuring of the directories so that the Grid servers can be a separate solution to the region server.
Diffstat (limited to '')
-rw-r--r--OpenSim-Source/OpenSim.RegionServer/AgentAssetUpload.cs (renamed from OpenSim.RegionServer/AgentAssetUpload.cs)0
-rw-r--r--OpenSim-Source/OpenSim.RegionServer/Assets/AssetCache.cs (renamed from OpenSim.RegionServer/Assets/AssetCache.cs)0
-rw-r--r--OpenSim-Source/OpenSim.RegionServer/Assets/InventoryCache.cs (renamed from OpenSim.RegionServer/Assets/InventoryCache.cs)0
-rw-r--r--OpenSim-Source/OpenSim.RegionServer/AuthenticateSessionsBase.cs (renamed from OpenSim.RegionServer/AuthenticateSessionsBase.cs)0
-rw-r--r--OpenSim-Source/OpenSim.RegionServer/AuthenticateSessionsLocal.cs (renamed from OpenSim.RegionServer/AuthenticateSessionsLocal.cs)0
-rw-r--r--OpenSim-Source/OpenSim.RegionServer/AuthenticateSessionsRemote.cs (renamed from OpenSim.RegionServer/AuthenticateSessionsRemote.cs)0
-rw-r--r--OpenSim-Source/OpenSim.RegionServer/CAPS/AdminWebFront.cs (renamed from OpenSim.RegionServer/CAPS/AdminWebFront.cs)0
-rw-r--r--OpenSim-Source/OpenSim.RegionServer/ClientView.Grid.cs (renamed from OpenSim.RegionServer/ClientView.Grid.cs)71
-rw-r--r--OpenSim-Source/OpenSim.RegionServer/ClientView.PacketHandlers.cs (renamed from OpenSim.RegionServer/ClientView.PacketHandlers.cs)27
-rw-r--r--OpenSim-Source/OpenSim.RegionServer/ClientView.ProcessPackets.cs (renamed from OpenSim.RegionServer/ClientView.ProcessPackets.cs)218
-rw-r--r--OpenSim-Source/OpenSim.RegionServer/ClientView.cs (renamed from OpenSim.RegionServer/ClientView.cs)3
-rw-r--r--OpenSim-Source/OpenSim.RegionServer/ClientViewBase.cs (renamed from OpenSim.RegionServer/ClientViewBase.cs)4
-rw-r--r--OpenSim-Source/OpenSim.RegionServer/Grid.cs (renamed from OpenSim.RegionServer/Grid.cs)0
-rw-r--r--OpenSim-Source/OpenSim.RegionServer/OpenSim.RegionServer.csproj (renamed from OpenSim.RegionServer/OpenSim.RegionServer.csproj)0
-rw-r--r--OpenSim-Source/OpenSim.RegionServer/OpenSim.RegionServer.csproj.user12
-rw-r--r--OpenSim-Source/OpenSim.RegionServer/OpenSim.RegionServer.dll.build (renamed from OpenSim.RegionServer/OpenSim.RegionServer.dll.build)0
-rw-r--r--OpenSim-Source/OpenSim.RegionServer/OpenSimMain.cs (renamed from OpenSim.RegionServer/OpenSimMain.cs)0
-rw-r--r--OpenSim-Source/OpenSim.RegionServer/OpenSimNetworkHandler.cs (renamed from OpenSim.RegionServer/OpenSimNetworkHandler.cs)0
-rw-r--r--OpenSim-Source/OpenSim.RegionServer/PacketServer.cs (renamed from OpenSim.RegionServer/PacketServer.cs)2
-rw-r--r--OpenSim-Source/OpenSim.RegionServer/RegionInfo.cs (renamed from OpenSim.RegionServer/RegionInfo.cs)0
-rw-r--r--OpenSim-Source/OpenSim.RegionServer/RegionInfoBase.cs (renamed from OpenSim.RegionServer/RegionInfoBase.cs)0
-rw-r--r--OpenSim-Source/OpenSim.RegionServer/RegionServerBase.cs (renamed from OpenSim.RegionServer/RegionServerBase.cs)0
-rw-r--r--OpenSim-Source/OpenSim.RegionServer/UDPServer.cs (renamed from OpenSim.RegionServer/UDPServer.cs)0
-rw-r--r--OpenSim-Source/OpenSim.RegionServer/VersionInfo.cs (renamed from OpenSim.RegionServer/VersionInfo.cs)0
-rw-r--r--OpenSim-Source/OpenSim.RegionServer/types/Mesh.cs (renamed from OpenSim.RegionServer/types/Mesh.cs)0
-rw-r--r--OpenSim-Source/OpenSim.RegionServer/types/Triangle.cs (renamed from OpenSim.RegionServer/types/Triangle.cs)0
-rw-r--r--OpenSim-Source/OpenSim.RegionServer/world/Avatar.Client.cs (renamed from OpenSim.RegionServer/world/Avatar.Client.cs)0
-rw-r--r--OpenSim-Source/OpenSim.RegionServer/world/Avatar.Update.cs (renamed from OpenSim.RegionServer/world/Avatar.Update.cs)4
-rw-r--r--OpenSim-Source/OpenSim.RegionServer/world/Avatar.cs (renamed from OpenSim.RegionServer/world/Avatar.cs)7
-rw-r--r--OpenSim-Source/OpenSim.RegionServer/world/AvatarAnimations.cs (renamed from OpenSim.RegionServer/world/AvatarAnimations.cs)0
-rw-r--r--OpenSim-Source/OpenSim.RegionServer/world/Entity.cs (renamed from OpenSim.RegionServer/world/Entity.cs)0
-rw-r--r--OpenSim-Source/OpenSim.RegionServer/world/Primitive.cs (renamed from OpenSim.RegionServer/world/Primitive.cs)0
-rw-r--r--OpenSim-Source/OpenSim.RegionServer/world/Primitive2.cs (renamed from OpenSim.RegionServer/world/Primitive2.cs)0
-rw-r--r--OpenSim-Source/OpenSim.RegionServer/world/SceneObject.cs (renamed from OpenSim.RegionServer/world/SceneObject.cs)0
-rw-r--r--OpenSim-Source/OpenSim.RegionServer/world/World.PacketHandlers.cs (renamed from OpenSim.RegionServer/world/World.PacketHandlers.cs)149
-rw-r--r--OpenSim-Source/OpenSim.RegionServer/world/World.Scripting.cs (renamed from OpenSim.RegionServer/world/World.Scripting.cs)0
-rw-r--r--OpenSim-Source/OpenSim.RegionServer/world/World.cs (renamed from OpenSim.RegionServer/world/World.cs)20
-rw-r--r--OpenSim-Source/OpenSim.RegionServer/world/WorldBase.cs (renamed from OpenSim.RegionServer/world/WorldBase.cs)0
-rw-r--r--OpenSim-Source/OpenSim.RegionServer/world/scripting/IScriptContext.cs (renamed from OpenSim.RegionServer/world/scripting/IScriptContext.cs)0
-rw-r--r--OpenSim-Source/OpenSim.RegionServer/world/scripting/IScriptEntity.cs (renamed from OpenSim.RegionServer/world/scripting/IScriptEntity.cs)0
-rw-r--r--OpenSim-Source/OpenSim.RegionServer/world/scripting/IScriptHandler.cs (renamed from OpenSim.RegionServer/world/scripting/IScriptHandler.cs)0
-rw-r--r--OpenSim-Source/OpenSim.RegionServer/world/scripting/Script.cs (renamed from OpenSim.RegionServer/world/scripting/Script.cs)0
-rw-r--r--OpenSim-Source/OpenSim.RegionServer/world/scripting/ScriptFactory.cs (renamed from OpenSim.RegionServer/world/scripting/ScriptFactory.cs)0
-rw-r--r--OpenSim-Source/OpenSim.RegionServer/world/scripting/Scripts/FollowRandomAvatar.cs (renamed from OpenSim.RegionServer/world/scripting/Scripts/FollowRandomAvatar.cs)0
44 files changed, 302 insertions, 215 deletions
diff --git a/OpenSim.RegionServer/AgentAssetUpload.cs b/OpenSim-Source/OpenSim.RegionServer/AgentAssetUpload.cs
index dd2b2a9..dd2b2a9 100644
--- a/OpenSim.RegionServer/AgentAssetUpload.cs
+++ b/OpenSim-Source/OpenSim.RegionServer/AgentAssetUpload.cs
diff --git a/OpenSim.RegionServer/Assets/AssetCache.cs b/OpenSim-Source/OpenSim.RegionServer/Assets/AssetCache.cs
index ccebb24..ccebb24 100644
--- a/OpenSim.RegionServer/Assets/AssetCache.cs
+++ b/OpenSim-Source/OpenSim.RegionServer/Assets/AssetCache.cs
diff --git a/OpenSim.RegionServer/Assets/InventoryCache.cs b/OpenSim-Source/OpenSim.RegionServer/Assets/InventoryCache.cs
index 64a7a32..64a7a32 100644
--- a/OpenSim.RegionServer/Assets/InventoryCache.cs
+++ b/OpenSim-Source/OpenSim.RegionServer/Assets/InventoryCache.cs
diff --git a/OpenSim.RegionServer/AuthenticateSessionsBase.cs b/OpenSim-Source/OpenSim.RegionServer/AuthenticateSessionsBase.cs
index 99b86d4..99b86d4 100644
--- a/OpenSim.RegionServer/AuthenticateSessionsBase.cs
+++ b/OpenSim-Source/OpenSim.RegionServer/AuthenticateSessionsBase.cs
diff --git a/OpenSim.RegionServer/AuthenticateSessionsLocal.cs b/OpenSim-Source/OpenSim.RegionServer/AuthenticateSessionsLocal.cs
index 6c1c7d2..6c1c7d2 100644
--- a/OpenSim.RegionServer/AuthenticateSessionsLocal.cs
+++ b/OpenSim-Source/OpenSim.RegionServer/AuthenticateSessionsLocal.cs
diff --git a/OpenSim.RegionServer/AuthenticateSessionsRemote.cs b/OpenSim-Source/OpenSim.RegionServer/AuthenticateSessionsRemote.cs
index 0802d75..0802d75 100644
--- a/OpenSim.RegionServer/AuthenticateSessionsRemote.cs
+++ b/OpenSim-Source/OpenSim.RegionServer/AuthenticateSessionsRemote.cs
diff --git a/OpenSim.RegionServer/CAPS/AdminWebFront.cs b/OpenSim-Source/OpenSim.RegionServer/CAPS/AdminWebFront.cs
index 2299fa4..2299fa4 100644
--- a/OpenSim.RegionServer/CAPS/AdminWebFront.cs
+++ b/OpenSim-Source/OpenSim.RegionServer/CAPS/AdminWebFront.cs
diff --git a/OpenSim.RegionServer/ClientView.Grid.cs b/OpenSim-Source/OpenSim.RegionServer/ClientView.Grid.cs
index 5229dbd..a3b191c 100644
--- a/OpenSim.RegionServer/ClientView.Grid.cs
+++ b/OpenSim-Source/OpenSim.RegionServer/ClientView.Grid.cs
@@ -35,45 +35,38 @@ namespace OpenSim
35 35
36 foreach (Hashtable neighbour in gridServer.neighbours) 36 foreach (Hashtable neighbour in gridServer.neighbours)
37 { 37 {
38 try 38 string neighbourIPStr = (string)neighbour["sim_ip"];
39 { 39 System.Net.IPAddress neighbourIP = System.Net.IPAddress.Parse(neighbourIPStr);
40 string neighbourIPStr = (string)neighbour["sim_ip"]; 40 ushort neighbourPort = (ushort)Convert.ToInt32(neighbour["sim_port"]);
41 System.Net.IPAddress neighbourIP = System.Net.IPAddress.Parse(neighbourIPStr); 41 string reqUrl = "http://" + neighbourIPStr + ":" + neighbourPort.ToString();
42 ushort neighbourPort = (ushort)Convert.ToInt32(neighbour["sim_port"]); 42
43 string reqUrl = "http://" + neighbourIPStr + ":" + neighbourPort.ToString(); 43 Console.WriteLine(reqUrl);
44 44
45 Console.WriteLine(reqUrl); 45 SimParams = new Hashtable();
46 46 SimParams["session_id"] = this.SessionID.ToString();
47 SimParams = new Hashtable(); 47 SimParams["secure_session_id"] = this.SecureSessionID.ToString();
48 SimParams["session_id"] = this.SessionID.ToString(); 48 SimParams["firstname"] = this.ClientAvatar.firstname;
49 SimParams["secure_session_id"] = this.SecureSessionID.ToString(); 49 SimParams["lastname"] = this.ClientAvatar.lastname;
50 SimParams["firstname"] = this.ClientAvatar.firstname; 50 SimParams["agent_id"] = this.AgentID.ToString();
51 SimParams["lastname"] = this.ClientAvatar.lastname; 51 SimParams["circuit_code"] = (Int32)this.CircuitCode;
52 SimParams["agent_id"] = this.AgentID.ToString(); 52 SimParams["child_agent"] = "1";
53 SimParams["circuit_code"] = (Int32)this.CircuitCode; 53 SendParams = new ArrayList();
54 SimParams["child_agent"] = "1"; 54 SendParams.Add(SimParams);
55 SendParams = new ArrayList(); 55
56 SendParams.Add(SimParams); 56 GridReq = new XmlRpcRequest("expect_user", SendParams);
57 57 GridResp = GridReq.Send(reqUrl, 3000);
58 GridReq = new XmlRpcRequest("expect_user", SendParams); 58 EnableSimulatorPacket enablesimpacket = new EnableSimulatorPacket();
59 GridResp = GridReq.Send(reqUrl, 3000); 59 enablesimpacket.SimulatorInfo = new EnableSimulatorPacket.SimulatorInfoBlock();
60 EnableSimulatorPacket enablesimpacket = new EnableSimulatorPacket(); 60 enablesimpacket.SimulatorInfo.Handle = Helpers.UIntsToLong((uint)(Convert.ToInt32(neighbour["region_locx"]) * 256), (uint)(Convert.ToInt32(neighbour["region_locy"]) * 256));
61 enablesimpacket.SimulatorInfo = new EnableSimulatorPacket.SimulatorInfoBlock(); 61
62 enablesimpacket.SimulatorInfo.Handle = Helpers.UIntsToLong((uint)(Convert.ToInt32(neighbour["region_locx"]) * 256), (uint)(Convert.ToInt32(neighbour["region_locy"]) * 256)); 62
63 63 byte[] byteIP = neighbourIP.GetAddressBytes();
64 64 enablesimpacket.SimulatorInfo.IP = (uint)byteIP[3] << 24;
65 byte[] byteIP = neighbourIP.GetAddressBytes(); 65 enablesimpacket.SimulatorInfo.IP += (uint)byteIP[2] << 16;
66 enablesimpacket.SimulatorInfo.IP = (uint)byteIP[3] << 24; 66 enablesimpacket.SimulatorInfo.IP += (uint)byteIP[1] << 8;
67 enablesimpacket.SimulatorInfo.IP += (uint)byteIP[2] << 16; 67 enablesimpacket.SimulatorInfo.IP += (uint)byteIP[0];
68 enablesimpacket.SimulatorInfo.IP += (uint)byteIP[1] << 8; 68 enablesimpacket.SimulatorInfo.Port = neighbourPort;
69 enablesimpacket.SimulatorInfo.IP += (uint)byteIP[0]; 69 enablePackets.Add(enablesimpacket);
70 enablesimpacket.SimulatorInfo.Port = neighbourPort;
71 enablePackets.Add(enablesimpacket);
72 }
73 catch (Exception e)
74 {
75 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Could not connect to neighbour " + neighbour["sim_ip"] + ":" + neighbour["sim_port"] + ", continuing.");
76 }
77 } 70 }
78 Thread.Sleep(3000); 71 Thread.Sleep(3000);
79 foreach (Packet enable in enablePackets) 72 foreach (Packet enable in enablePackets)
diff --git a/OpenSim.RegionServer/ClientView.PacketHandlers.cs b/OpenSim-Source/OpenSim.RegionServer/ClientView.PacketHandlers.cs
index 070c200..75fcf18 100644
--- a/OpenSim.RegionServer/ClientView.PacketHandlers.cs
+++ b/OpenSim-Source/OpenSim.RegionServer/ClientView.PacketHandlers.cs
@@ -98,39 +98,18 @@ namespace OpenSim
98 if (multipleupdate.ObjectData[i].Type == 9) //change position 98 if (multipleupdate.ObjectData[i].Type == 9) //change position
99 { 99 {
100 libsecondlife.LLVector3 pos = new LLVector3(multipleupdate.ObjectData[i].Data, 0); 100 libsecondlife.LLVector3 pos = new LLVector3(multipleupdate.ObjectData[i].Data, 0);
101 foreach (Entity ent in m_world.Entities.Values) 101 OnUpdatePrimPosition(multipleupdate.ObjectData[i].ObjectLocalID, pos, this);
102 {
103 if (ent.localid == multipleupdate.ObjectData[i].ObjectLocalID)
104 {
105 ((OpenSim.world.Primitive)ent).UpdatePosition(pos);
106
107 }
108 }
109 //should update stored position of the prim 102 //should update stored position of the prim
110 } 103 }
111 else if (multipleupdate.ObjectData[i].Type == 10)//rotation 104 else if (multipleupdate.ObjectData[i].Type == 10)//rotation
112 { 105 {
113 libsecondlife.LLQuaternion rot = new LLQuaternion(multipleupdate.ObjectData[i].Data, 0, true); 106 libsecondlife.LLQuaternion rot = new LLQuaternion(multipleupdate.ObjectData[i].Data, 0, true);
114 foreach (Entity ent in m_world.Entities.Values) 107 OnUpdatePrimRotation(multipleupdate.ObjectData[i].ObjectLocalID, rot, this);
115 {
116 if (ent.localid == multipleupdate.ObjectData[i].ObjectLocalID)
117 {
118 ent.rotation = new Axiom.MathLib.Quaternion(rot.W, rot.X, rot.Y, rot.Z);
119 ((OpenSim.world.Primitive)ent).UpdateFlag = true;
120 }
121 }
122 } 108 }
123 else if (multipleupdate.ObjectData[i].Type == 13)//scale 109 else if (multipleupdate.ObjectData[i].Type == 13)//scale
124 { 110 {
125
126 libsecondlife.LLVector3 scale = new LLVector3(multipleupdate.ObjectData[i].Data, 12); 111 libsecondlife.LLVector3 scale = new LLVector3(multipleupdate.ObjectData[i].Data, 12);
127 foreach (Entity ent in m_world.Entities.Values) 112 OnUpdatePrimScale(multipleupdate.ObjectData[i].ObjectLocalID, scale, this);
128 {
129 if (ent.localid == multipleupdate.ObjectData[i].ObjectLocalID)
130 {
131 ((OpenSim.world.Primitive)ent).Scale = scale;
132 }
133 }
134 } 113 }
135 } 114 }
136 return true; 115 return true;
diff --git a/OpenSim.RegionServer/ClientView.ProcessPackets.cs b/OpenSim-Source/OpenSim.RegionServer/ClientView.ProcessPackets.cs
index a78f27a..a6ad8d2 100644
--- a/OpenSim.RegionServer/ClientView.ProcessPackets.cs
+++ b/OpenSim-Source/OpenSim.RegionServer/ClientView.ProcessPackets.cs
@@ -20,17 +20,20 @@ namespace OpenSim
20{ 20{
21 public partial class ClientView 21 public partial class ClientView
22 { 22 {
23 public delegate void ChatFromViewer(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID); 23 public delegate void GenericCall(ClientView remoteClient);
24 public delegate void RezObject(AssetBase primasset, LLVector3 pos);
25 public delegate void ModifyTerrain(byte Action, float North, float West);
26 public delegate void SetAppearance(byte[] texture, AgentSetAppearancePacket.VisualParamBlock[] visualParam);
27 public delegate void StartAnim(LLUUID animID, int seq);
28 public delegate void GenericCall(ClientView RemoteClient);
29 public delegate void GenericCall2(); 24 public delegate void GenericCall2();
30 public delegate void GenericCall3(Packet packet); // really don't want to be passing packets in these events, so this is very temporary. 25 public delegate void GenericCall3(Packet packet); // really don't want to be passing packets in these events, so this is very temporary.
26 public delegate void GenericCall4(Packet packet, ClientView remoteClient);
27 public delegate void UpdateShape(uint localID, ObjectShapePacket.ObjectDataBlock shapeBlock);
28 public delegate void ObjectSelect(uint localID, ClientView remoteClient);
29 public delegate void UpdatePrimFlags(uint localID, Packet packet, ClientView remoteClient);
30 public delegate void UpdatePrimTexture(uint localID, byte[] texture, ClientView remoteClient);
31 public delegate void UpdatePrimVector(uint localID, LLVector3 pos, ClientView remoteClient);
32 public delegate void UpdatePrimRotation(uint localID, LLQuaternion rot, ClientView remoteClient);
31 33
32 public event ChatFromViewer OnChatFromViewer; 34 public event ChatFromViewer OnChatFromViewer;
33 public event RezObject OnRezObject; 35 public event RezObject OnRezObject;
36 public event GenericCall4 OnDeRezObject;
34 public event ModifyTerrain OnModifyTerrain; 37 public event ModifyTerrain OnModifyTerrain;
35 public event GenericCall OnRegionHandShakeReply; 38 public event GenericCall OnRegionHandShakeReply;
36 public event GenericCall OnRequestWearables; 39 public event GenericCall OnRequestWearables;
@@ -39,6 +42,15 @@ namespace OpenSim
39 public event GenericCall3 OnAgentUpdate; 42 public event GenericCall3 OnAgentUpdate;
40 public event StartAnim OnStartAnim; 43 public event StartAnim OnStartAnim;
41 public event GenericCall OnRequestAvatarsData; 44 public event GenericCall OnRequestAvatarsData;
45 public event LinkObjects OnLinkObjects;
46 public event GenericCall4 OnAddPrim;
47 public event UpdateShape OnUpdatePrimShape;
48 public event ObjectSelect OnObjectSelect;
49 public event UpdatePrimFlags OnUpdatePrimFlags;
50 public event UpdatePrimTexture OnUpdatePrimTexture;
51 public event UpdatePrimVector OnUpdatePrimPosition;
52 public event UpdatePrimRotation OnUpdatePrimRotation;
53 public event UpdatePrimVector OnUpdatePrimScale;
42 54
43 protected override void ProcessInPacket(Packet Pack) 55 protected override void ProcessInPacket(Packet Pack)
44 { 56 {
@@ -62,7 +74,20 @@ namespace OpenSim
62 74
63 switch (Pack.Type) 75 switch (Pack.Type)
64 { 76 {
65 #region New Event system 77 case PacketType.ViewerEffect:
78 ViewerEffectPacket viewer = (ViewerEffectPacket)Pack;
79 foreach (ClientView client in m_clientThreads.Values)
80 {
81 if (client.AgentID != this.AgentID)
82 {
83 viewer.AgentData.AgentID = client.AgentID;
84 viewer.AgentData.SessionID = client.SessionID;
85 client.OutPacket(viewer);
86 }
87 }
88 break;
89
90 #region New Event System - World/Avatar
66 case PacketType.ChatFromViewer: 91 case PacketType.ChatFromViewer:
67 ChatFromViewerPacket inchatpack = (ChatFromViewerPacket)Pack; 92 ChatFromViewerPacket inchatpack = (ChatFromViewerPacket)Pack;
68 if (Util.FieldToString(inchatpack.ChatData.Message) == "") 93 if (Util.FieldToString(inchatpack.ChatData.Message) == "")
@@ -93,153 +118,100 @@ namespace OpenSim
93 } 118 }
94 } 119 }
95 break; 120 break;
121 case PacketType.DeRezObject:
122 OnDeRezObject(Pack, this);
123 break;
96 case PacketType.ModifyLand: 124 case PacketType.ModifyLand:
97 ModifyLandPacket modify = (ModifyLandPacket)Pack; 125 ModifyLandPacket modify = (ModifyLandPacket)Pack;
98 if (modify.ParcelData.Length > 0) 126 if (modify.ParcelData.Length > 0)
99 { 127 {
100 OnModifyTerrain(modify.ModifyBlock.Action, modify.ParcelData[0].North, modify.ParcelData[0].West); 128 OnModifyTerrain(modify.ModifyBlock.Action, modify.ParcelData[0].North, modify.ParcelData[0].West);
101 } 129 }
102 break; 130 break;
131 case PacketType.RegionHandshakeReply:
132 OnRegionHandShakeReply(this);
133 break;
134 case PacketType.AgentWearablesRequest:
135 OnRequestWearables(this);
136 OnRequestAvatarsData(this);
137 break;
138 case PacketType.AgentSetAppearance:
139 AgentSetAppearancePacket appear = (AgentSetAppearancePacket)Pack;
140 OnSetAppearance(appear.ObjectData.TextureEntry, appear.VisualParam);
141 break;
142 case PacketType.CompleteAgentMovement:
143 if (this.m_child) this.UpgradeClient();
144 OnCompleteMovementToRegion();
145 this.EnableNeighbours();
146 break;
147 case PacketType.AgentUpdate:
148 OnAgentUpdate(Pack);
149 break;
150 case PacketType.AgentAnimation:
151 if (!m_child)
152 {
153 AgentAnimationPacket AgentAni = (AgentAnimationPacket)Pack;
154 for (int i = 0; i < AgentAni.AnimationList.Length; i++)
155 {
156 if (AgentAni.AnimationList[i].StartAnim)
157 {
158 OnStartAnim(AgentAni.AnimationList[i].AnimID, 1);
159 }
160 }
161 }
162 break;
103 163
104 case PacketType.RegionHandshakeReply:
105 OnRegionHandShakeReply(this);
106 break;
107 case PacketType.AgentWearablesRequest:
108 OnRequestWearables(this);
109 OnRequestAvatarsData(this);
110 break;
111 case PacketType.AgentSetAppearance:
112 AgentSetAppearancePacket appear = (AgentSetAppearancePacket)Pack;
113 OnSetAppearance(appear.ObjectData.TextureEntry, appear.VisualParam);
114 break;
115 case PacketType.CompleteAgentMovement:
116 if (this.m_child) this.UpgradeClient();
117 OnCompleteMovementToRegion();
118 this.EnableNeighbours();
119 break;
120 case PacketType.AgentUpdate:
121 OnAgentUpdate(Pack);
122 break;
123 case PacketType.AgentAnimation:
124 if (!m_child)
125 {
126 AgentAnimationPacket AgentAni = (AgentAnimationPacket)Pack;
127 for (int i = 0; i < AgentAni.AnimationList.Length; i++)
128 {
129 if (AgentAni.AnimationList[i].StartAnim)
130 {
131 OnStartAnim(AgentAni.AnimationList[i].AnimID, 1);
132 }
133 }
134 }
135 break;
136 case PacketType.AgentIsNowWearing:
137 // AgentIsNowWearingPacket wear = (AgentIsNowWearingPacket)Pack;
138 //Console.WriteLine(Pack.ToString());
139 break;
140 #endregion 164 #endregion
141 165
142 //old handling, should move most to a event based system. 166 #region New Event System - Objects/Prims
143 #region World/Avatar/Primitive related packets
144 case PacketType.ObjectAdd:
145 m_world.AddNewPrim((ObjectAddPacket)Pack, this);
146 break;
147 case PacketType.ObjectLink: 167 case PacketType.ObjectLink:
148 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, Pack.ToString()); 168 // OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, Pack.ToString());
149 ObjectLinkPacket link = (ObjectLinkPacket)Pack; 169 ObjectLinkPacket link = (ObjectLinkPacket)Pack;
150 uint parentprimid = 0; 170 uint parentprimid = 0;
151 OpenSim.world.Primitive parentprim = null; 171 List<uint> childrenprims = new List<uint>();
152 if (link.ObjectData.Length > 1) 172 if (link.ObjectData.Length > 1)
153 { 173 {
154 parentprimid = link.ObjectData[0].ObjectLocalID; 174 parentprimid = link.ObjectData[0].ObjectLocalID;
155 foreach (Entity ent in m_world.Entities.Values)
156 {
157 if (ent.localid == parentprimid)
158 {
159 parentprim = (OpenSim.world.Primitive)ent;
160 175
161 }
162 }
163 for (int i = 1; i < link.ObjectData.Length; i++) 176 for (int i = 1; i < link.ObjectData.Length; i++)
164 { 177 {
165 foreach (Entity ent in m_world.Entities.Values) 178 childrenprims.Add(link.ObjectData[i].ObjectLocalID);
166 {
167 if (ent.localid == link.ObjectData[i].ObjectLocalID)
168 {
169 ((OpenSim.world.Primitive)ent).MakeParent(parentprim);
170 }
171 }
172 } 179 }
173 } 180 }
181 OnLinkObjects(parentprimid, childrenprims);
174 break; 182 break;
175 case PacketType.ObjectScale: 183 case PacketType.ObjectAdd:
176 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, Pack.ToString()); 184 m_world.AddNewPrim((ObjectAddPacket)Pack, this);
185 OnAddPrim(Pack, this);
177 break; 186 break;
178 case PacketType.ObjectShape: 187 case PacketType.ObjectShape:
179 ObjectShapePacket shape = (ObjectShapePacket)Pack; 188 ObjectShapePacket shape = (ObjectShapePacket)Pack;
180 for (int i = 0; i < shape.ObjectData.Length; i++) 189 for (int i = 0; i < shape.ObjectData.Length; i++)
181 { 190 {
182 foreach (Entity ent in m_world.Entities.Values) 191 OnUpdatePrimShape(shape.ObjectData[i].ObjectLocalID, shape.ObjectData[i]);
183 {
184 if (ent.localid == shape.ObjectData[i].ObjectLocalID)
185 {
186 ((OpenSim.world.Primitive)ent).UpdateShape(shape.ObjectData[i]);
187 }
188 }
189 } 192 }
190 break; 193 break;
191 case PacketType.ObjectSelect: 194 case PacketType.ObjectSelect:
192 ObjectSelectPacket incomingselect = (ObjectSelectPacket)Pack; 195 ObjectSelectPacket incomingselect = (ObjectSelectPacket)Pack;
193 for (int i = 0; i < incomingselect.ObjectData.Length; i++) 196 for (int i = 0; i < incomingselect.ObjectData.Length; i++)
194 { 197 {
195 foreach (Entity ent in m_world.Entities.Values) 198 OnObjectSelect(incomingselect.ObjectData[i].ObjectLocalID, this);
196 {
197 if (ent.localid == incomingselect.ObjectData[i].ObjectLocalID)
198 {
199 ((OpenSim.world.Primitive)ent).GetProperites(this);
200 break;
201 }
202 }
203 } 199 }
204 break; 200 break;
201 case PacketType.ObjectFlagUpdate:
202 ObjectFlagUpdatePacket flags = (ObjectFlagUpdatePacket)Pack;
203 OnUpdatePrimFlags(flags.AgentData.ObjectLocalID, Pack, this);
204 break;
205 case PacketType.ObjectImage: 205 case PacketType.ObjectImage:
206 ObjectImagePacket imagePack = (ObjectImagePacket)Pack; 206 ObjectImagePacket imagePack = (ObjectImagePacket)Pack;
207 for (int i = 0; i < imagePack.ObjectData.Length; i++) 207 for (int i = 0; i < imagePack.ObjectData.Length; i++)
208 { 208 {
209 foreach (Entity ent in m_world.Entities.Values) 209 OnUpdatePrimTexture(imagePack.ObjectData[i].ObjectLocalID, imagePack.ObjectData[i].TextureEntry, this);
210 { 210
211 if (ent.localid == imagePack.ObjectData[i].ObjectLocalID)
212 {
213 ((OpenSim.world.Primitive)ent).UpdateTexture(imagePack.ObjectData[i].TextureEntry);
214 }
215 }
216 }
217 break;
218 case PacketType.ObjectFlagUpdate:
219 ObjectFlagUpdatePacket flags = (ObjectFlagUpdatePacket)Pack;
220 foreach (Entity ent in m_world.Entities.Values)
221 {
222 if (ent.localid == flags.AgentData.ObjectLocalID)
223 {
224 ((OpenSim.world.Primitive)ent).UpdateObjectFlags(flags);
225 }
226 } 211 }
227 break; 212 break;
213 #endregion
228 214
229 case PacketType.ViewerEffect:
230 ViewerEffectPacket viewer = (ViewerEffectPacket)Pack;
231 foreach (ClientView client in m_clientThreads.Values)
232 {
233 if (client.AgentID != this.AgentID)
234 {
235 viewer.AgentData.AgentID = client.AgentID;
236 viewer.AgentData.SessionID = client.SessionID;
237 client.OutPacket(viewer);
238 }
239 }
240 break;
241 #endregion
242
243 #region Inventory/Asset/Other related packets 215 #region Inventory/Asset/Other related packets
244 case PacketType.RequestImage: 216 case PacketType.RequestImage:
245 RequestImagePacket imageRequest = (RequestImagePacket)Pack; 217 RequestImagePacket imageRequest = (RequestImagePacket)Pack;
@@ -464,6 +436,16 @@ namespace OpenSim
464 } 436 }
465 break; 437 break;
466 #endregion 438 #endregion
439
440 #region unimplemented handlers
441 case PacketType.AgentIsNowWearing:
442 // AgentIsNowWearingPacket wear = (AgentIsNowWearingPacket)Pack;
443 //Console.WriteLine(Pack.ToString());
444 break;
445 case PacketType.ObjectScale:
446 //OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, Pack.ToString());
447 break;
448 #endregion
467 } 449 }
468 } 450 }
469 } 451 }
diff --git a/OpenSim.RegionServer/ClientView.cs b/OpenSim-Source/OpenSim.RegionServer/ClientView.cs
index ccea2f3..e66b830 100644
--- a/OpenSim.RegionServer/ClientView.cs
+++ b/OpenSim-Source/OpenSim.RegionServer/ClientView.cs
@@ -50,7 +50,7 @@ namespace OpenSim
50 /// Handles new client connections 50 /// Handles new client connections
51 /// Constructor takes a single Packet and authenticates everything 51 /// Constructor takes a single Packet and authenticates everything
52 /// </summary> 52 /// </summary>
53 public partial class ClientView : ClientViewBase 53 public partial class ClientView : ClientViewBase, IClientAPI
54 { 54 {
55 protected static Dictionary<PacketType, PacketMethod> PacketHandlers = new Dictionary<PacketType, PacketMethod>(); //Global/static handlers for all clients 55 protected static Dictionary<PacketType, PacketMethod> PacketHandlers = new Dictionary<PacketType, PacketMethod>(); //Global/static handlers for all clients
56 protected Dictionary<PacketType, PacketMethod> m_packetHandlers = new Dictionary<PacketType, PacketMethod>(); //local handlers for this instance 56 protected Dictionary<PacketType, PacketMethod> m_packetHandlers = new Dictionary<PacketType, PacketMethod>(); //local handlers for this instance
@@ -138,7 +138,6 @@ namespace OpenSim
138 { 138 {
139 this.startpos = m_authenticateSessionsHandler.GetPosition(CircuitCode); 139 this.startpos = m_authenticateSessionsHandler.GetPosition(CircuitCode);
140 m_authenticateSessionsHandler.UpdateAgentChildStatus(CircuitCode, false); 140 m_authenticateSessionsHandler.UpdateAgentChildStatus(CircuitCode, false);
141 //Console.WriteLine("upgrade start pos is " + this.startpos.X + " , " + this.startpos.Y + " , " + this.startpos.Z);
142 } 141 }
143 this.InitNewClient(); 142 this.InitNewClient();
144 } 143 }
diff --git a/OpenSim.RegionServer/ClientViewBase.cs b/OpenSim-Source/OpenSim.RegionServer/ClientViewBase.cs
index 814b025..572dbce 100644
--- a/OpenSim.RegionServer/ClientViewBase.cs
+++ b/OpenSim-Source/OpenSim.RegionServer/ClientViewBase.cs
@@ -9,11 +9,11 @@ using System.IO;
9using System.Threading; 9using System.Threading;
10using System.Timers; 10using System.Timers;
11using OpenSim.Framework.Utilities; 11using OpenSim.Framework.Utilities;
12 12using OpenSim.Framework.Interfaces;
13 13
14namespace OpenSim 14namespace OpenSim
15{ 15{
16 public class ClientViewBase 16 public class ClientViewBase
17 { 17 {
18 protected BlockingQueue<QueItem> PacketQueue; 18 protected BlockingQueue<QueItem> PacketQueue;
19 protected Dictionary<uint, uint> PendingAcks = new Dictionary<uint, uint>(); 19 protected Dictionary<uint, uint> PendingAcks = new Dictionary<uint, uint>();
diff --git a/OpenSim.RegionServer/Grid.cs b/OpenSim-Source/OpenSim.RegionServer/Grid.cs
index db5b8fe..db5b8fe 100644
--- a/OpenSim.RegionServer/Grid.cs
+++ b/OpenSim-Source/OpenSim.RegionServer/Grid.cs
diff --git a/OpenSim.RegionServer/OpenSim.RegionServer.csproj b/OpenSim-Source/OpenSim.RegionServer/OpenSim.RegionServer.csproj
index 512ee88..512ee88 100644
--- a/OpenSim.RegionServer/OpenSim.RegionServer.csproj
+++ b/OpenSim-Source/OpenSim.RegionServer/OpenSim.RegionServer.csproj
diff --git a/OpenSim-Source/OpenSim.RegionServer/OpenSim.RegionServer.csproj.user b/OpenSim-Source/OpenSim.RegionServer/OpenSim.RegionServer.csproj.user
new file mode 100644
index 0000000..d47d65d
--- /dev/null
+++ b/OpenSim-Source/OpenSim.RegionServer/OpenSim.RegionServer.csproj.user
@@ -0,0 +1,12 @@
1<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
4 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
5 <ReferencePath>C:\New Folder\second-life-viewer\opensim-dailys2\opensim15-07\bin\</ReferencePath>
6 <LastOpenVersion>8.0.50727</LastOpenVersion>
7 <ProjectView>ProjectFiles</ProjectView>
8 <ProjectTrust>0</ProjectTrust>
9 </PropertyGroup>
10 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
11 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
12</Project>
diff --git a/OpenSim.RegionServer/OpenSim.RegionServer.dll.build b/OpenSim-Source/OpenSim.RegionServer/OpenSim.RegionServer.dll.build
index 4ec3537..4ec3537 100644
--- a/OpenSim.RegionServer/OpenSim.RegionServer.dll.build
+++ b/OpenSim-Source/OpenSim.RegionServer/OpenSim.RegionServer.dll.build
diff --git a/OpenSim.RegionServer/OpenSimMain.cs b/OpenSim-Source/OpenSim.RegionServer/OpenSimMain.cs
index 003412d..003412d 100644
--- a/OpenSim.RegionServer/OpenSimMain.cs
+++ b/OpenSim-Source/OpenSim.RegionServer/OpenSimMain.cs
diff --git a/OpenSim.RegionServer/OpenSimNetworkHandler.cs b/OpenSim-Source/OpenSim.RegionServer/OpenSimNetworkHandler.cs
index 15ee740..15ee740 100644
--- a/OpenSim.RegionServer/OpenSimNetworkHandler.cs
+++ b/OpenSim-Source/OpenSim.RegionServer/OpenSimNetworkHandler.cs
diff --git a/OpenSim.RegionServer/PacketServer.cs b/OpenSim-Source/OpenSim.RegionServer/PacketServer.cs
index 4ebe023..fb35723 100644
--- a/OpenSim.RegionServer/PacketServer.cs
+++ b/OpenSim-Source/OpenSim.RegionServer/PacketServer.cs
@@ -58,7 +58,7 @@ namespace OpenSim
58 { 58 {
59 if (this._localWorld != null) 59 if (this._localWorld != null)
60 { 60 {
61 ClientView.AddPacketHandler(PacketType.DeRezObject, _localWorld.DeRezObject); 61 //ClientView.AddPacketHandler(PacketType.DeRezObject, _localWorld.DeRezObject);
62 ClientView.AddPacketHandler(PacketType.UUIDNameRequest, this.RequestUUIDName); 62 ClientView.AddPacketHandler(PacketType.UUIDNameRequest, this.RequestUUIDName);
63 } 63 }
64 } 64 }
diff --git a/OpenSim.RegionServer/RegionInfo.cs b/OpenSim-Source/OpenSim.RegionServer/RegionInfo.cs
index f82495a..f82495a 100644
--- a/OpenSim.RegionServer/RegionInfo.cs
+++ b/OpenSim-Source/OpenSim.RegionServer/RegionInfo.cs
diff --git a/OpenSim.RegionServer/RegionInfoBase.cs b/OpenSim-Source/OpenSim.RegionServer/RegionInfoBase.cs
index 42d3030..42d3030 100644
--- a/OpenSim.RegionServer/RegionInfoBase.cs
+++ b/OpenSim-Source/OpenSim.RegionServer/RegionInfoBase.cs
diff --git a/OpenSim.RegionServer/RegionServerBase.cs b/OpenSim-Source/OpenSim.RegionServer/RegionServerBase.cs
index 69a8748..69a8748 100644
--- a/OpenSim.RegionServer/RegionServerBase.cs
+++ b/OpenSim-Source/OpenSim.RegionServer/RegionServerBase.cs
diff --git a/OpenSim.RegionServer/UDPServer.cs b/OpenSim-Source/OpenSim.RegionServer/UDPServer.cs
index 3a93e66..3a93e66 100644
--- a/OpenSim.RegionServer/UDPServer.cs
+++ b/OpenSim-Source/OpenSim.RegionServer/UDPServer.cs
diff --git a/OpenSim.RegionServer/VersionInfo.cs b/OpenSim-Source/OpenSim.RegionServer/VersionInfo.cs
index 49cc6a5..49cc6a5 100644
--- a/OpenSim.RegionServer/VersionInfo.cs
+++ b/OpenSim-Source/OpenSim.RegionServer/VersionInfo.cs
diff --git a/OpenSim.RegionServer/types/Mesh.cs b/OpenSim-Source/OpenSim.RegionServer/types/Mesh.cs
index 3e00c91..3e00c91 100644
--- a/OpenSim.RegionServer/types/Mesh.cs
+++ b/OpenSim-Source/OpenSim.RegionServer/types/Mesh.cs
diff --git a/OpenSim.RegionServer/types/Triangle.cs b/OpenSim-Source/OpenSim.RegionServer/types/Triangle.cs
index 8dfea6e..8dfea6e 100644
--- a/OpenSim.RegionServer/types/Triangle.cs
+++ b/OpenSim-Source/OpenSim.RegionServer/types/Triangle.cs
diff --git a/OpenSim.RegionServer/world/Avatar.Client.cs b/OpenSim-Source/OpenSim.RegionServer/world/Avatar.Client.cs
index 7656a89..7656a89 100644
--- a/OpenSim.RegionServer/world/Avatar.Client.cs
+++ b/OpenSim-Source/OpenSim.RegionServer/world/Avatar.Client.cs
diff --git a/OpenSim.RegionServer/world/Avatar.Update.cs b/OpenSim-Source/OpenSim.RegionServer/world/Avatar.Update.cs
index 266fc38..e49fab3 100644
--- a/OpenSim.RegionServer/world/Avatar.Update.cs
+++ b/OpenSim-Source/OpenSim.RegionServer/world/Avatar.Update.cs
@@ -93,10 +93,10 @@ namespace OpenSim.world
93 } 93 }
94 94
95 } 95 }
96 public void SendUpdateToOtherClient(Avatar RemoteAvatar) 96 public void SendUpdateToOtherClient(Avatar remoteAvatar)
97 { 97 {
98 ObjectUpdatePacket objupdate = CreateUpdatePacket(); 98 ObjectUpdatePacket objupdate = CreateUpdatePacket();
99 RemoteAvatar.SendPacketToViewer(objupdate); 99 remoteAvatar.SendPacketToViewer(objupdate);
100 } 100 }
101 101
102 public ObjectUpdatePacket CreateUpdatePacket() 102 public ObjectUpdatePacket CreateUpdatePacket()
diff --git a/OpenSim.RegionServer/world/Avatar.cs b/OpenSim-Source/OpenSim.RegionServer/world/Avatar.cs
index 4e90364..680d059 100644
--- a/OpenSim.RegionServer/world/Avatar.cs
+++ b/OpenSim-Source/OpenSim.RegionServer/world/Avatar.cs
@@ -6,6 +6,7 @@ using libsecondlife;
6using libsecondlife.Packets; 6using libsecondlife.Packets;
7using OpenSim.Physics.Manager; 7using OpenSim.Physics.Manager;
8using OpenSim.Framework.Inventory; 8using OpenSim.Framework.Inventory;
9using OpenSim.Framework.Interfaces;
9using Axiom.MathLib; 10using Axiom.MathLib;
10 11
11namespace OpenSim.world 12namespace OpenSim.world
@@ -66,11 +67,11 @@ namespace OpenSim.world
66 67
67 //register for events 68 //register for events
68 ControllingClient.OnRequestWearables += new ClientView.GenericCall(this.SendOurAppearance); 69 ControllingClient.OnRequestWearables += new ClientView.GenericCall(this.SendOurAppearance);
69 ControllingClient.OnSetAppearance += new ClientView.SetAppearance(this.SetAppearance); 70 ControllingClient.OnSetAppearance += new SetAppearance(this.SetAppearance);
70 ControllingClient.OnCompleteMovementToRegion += new ClientView.GenericCall2(this.CompleteMovement); 71 ControllingClient.OnCompleteMovementToRegion += new ClientView.GenericCall2(this.CompleteMovement);
71 ControllingClient.OnCompleteMovementToRegion += new ClientView.GenericCall2(this.SendInitialPosition); 72 ControllingClient.OnCompleteMovementToRegion += new ClientView.GenericCall2(this.SendInitialPosition);
72 ControllingClient.OnAgentUpdate += new ClientView.GenericCall3(this.HandleAgentUpdate); 73 ControllingClient.OnAgentUpdate += new ClientView.GenericCall3(this.HandleAgentUpdate);
73 ControllingClient.OnStartAnim += new ClientView.StartAnim(this.SendAnimPack); 74 ControllingClient.OnStartAnim += new StartAnim(this.SendAnimPack);
74 75
75 } 76 }
76 77
@@ -349,7 +350,7 @@ namespace OpenSim.world
349 } 350 }
350 351
351 //really really should be moved somewhere else (RegionInfo.cs ?) 352 //really really should be moved somewhere else (RegionInfo.cs ?)
352 public void SendRegionHandshake(World RegionInfo) 353 public void SendRegionHandshake(World regionInfo)
353 { 354 {
354 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.VERBOSE,"Avatar.cs:SendRegionHandshake() - Creating empty RegionHandshake packet"); 355 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.VERBOSE,"Avatar.cs:SendRegionHandshake() - Creating empty RegionHandshake packet");
355 System.Text.Encoding _enc = System.Text.Encoding.ASCII; 356 System.Text.Encoding _enc = System.Text.Encoding.ASCII;
diff --git a/OpenSim.RegionServer/world/AvatarAnimations.cs b/OpenSim-Source/OpenSim.RegionServer/world/AvatarAnimations.cs
index b554af8..b554af8 100644
--- a/OpenSim.RegionServer/world/AvatarAnimations.cs
+++ b/OpenSim-Source/OpenSim.RegionServer/world/AvatarAnimations.cs
diff --git a/OpenSim.RegionServer/world/Entity.cs b/OpenSim-Source/OpenSim.RegionServer/world/Entity.cs
index 96e039a..96e039a 100644
--- a/OpenSim.RegionServer/world/Entity.cs
+++ b/OpenSim-Source/OpenSim.RegionServer/world/Entity.cs
diff --git a/OpenSim.RegionServer/world/Primitive.cs b/OpenSim-Source/OpenSim.RegionServer/world/Primitive.cs
index e048a9e..e048a9e 100644
--- a/OpenSim.RegionServer/world/Primitive.cs
+++ b/OpenSim-Source/OpenSim.RegionServer/world/Primitive.cs
diff --git a/OpenSim.RegionServer/world/Primitive2.cs b/OpenSim-Source/OpenSim.RegionServer/world/Primitive2.cs
index 6d071d4..6d071d4 100644
--- a/OpenSim.RegionServer/world/Primitive2.cs
+++ b/OpenSim-Source/OpenSim.RegionServer/world/Primitive2.cs
diff --git a/OpenSim.RegionServer/world/SceneObject.cs b/OpenSim-Source/OpenSim.RegionServer/world/SceneObject.cs
index a846fb5..a846fb5 100644
--- a/OpenSim.RegionServer/world/SceneObject.cs
+++ b/OpenSim-Source/OpenSim.RegionServer/world/SceneObject.cs
diff --git a/OpenSim.RegionServer/world/World.PacketHandlers.cs b/OpenSim-Source/OpenSim.RegionServer/world/World.PacketHandlers.cs
index 7d74cb7..348cd30 100644
--- a/OpenSim.RegionServer/world/World.PacketHandlers.cs
+++ b/OpenSim-Source/OpenSim.RegionServer/world/World.PacketHandlers.cs
@@ -15,31 +15,31 @@ namespace OpenSim.world
15{ 15{
16 public partial class World 16 public partial class World
17 { 17 {
18 public void ModifyTerrain(byte Action, float North, float West) 18 public void ModifyTerrain(byte action, float north, float west)
19 { 19 {
20 switch (Action) 20 switch (action)
21 { 21 {
22 case 1: 22 case 1:
23 // raise terrain 23 // raise terrain
24 Terrain.raise(North, West, 10.0, 0.001); 24 Terrain.raise(north, west, 10.0, 0.1);
25 RegenerateTerrain(true, (int)North, (int)West); 25 RegenerateTerrain(true, (int)north, (int)west);
26 break; 26 break;
27 case 2: 27 case 2:
28 //lower terrain 28 //lower terrain
29 Terrain.lower(North, West, 10.0, 0.001); 29 Terrain.lower(north, west, 10.0, 0.1);
30 RegenerateTerrain(true, (int)North, (int)West); 30 RegenerateTerrain(true, (int)north, (int)west);
31 break; 31 break;
32 } 32 }
33 return; 33 return;
34 } 34 }
35 35
36 public void SimChat(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID) 36 public void SimChat(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID)
37 { 37 {
38 foreach (ClientView client in m_clientThreads.Values) 38 foreach (ClientView client in m_clientThreads.Values)
39 { 39 {
40 // int dis = Util.fast_distance2d((int)(client.ClientAvatar.Pos.X - simClient.ClientAvatar.Pos.X), (int)(client.ClientAvatar.Pos.Y - simClient.ClientAvatar.Pos.Y)); 40 // int dis = Util.fast_distance2d((int)(client.ClientAvatar.Pos.X - simClient.ClientAvatar.Pos.X), (int)(client.ClientAvatar.Pos.Y - simClient.ClientAvatar.Pos.Y));
41 int dis = (int)client.ClientAvatar.Pos.GetDistanceTo(fromPos); 41 int dis = (int)client.ClientAvatar.Pos.GetDistanceTo(fromPos);
42 42
43 switch (type) 43 switch (type)
44 { 44 {
45 case 0: // Whisper 45 case 0: // Whisper
@@ -61,7 +61,7 @@ namespace OpenSim.world
61 client.SendChatMessage(message, type, fromPos, fromName, fromAgentID); 61 client.SendChatMessage(message, type, fromPos, fromName, fromAgentID);
62 } 62 }
63 break; 63 break;
64 64
65 case 0xff: // Broadcast 65 case 0xff: // Broadcast
66 client.SendChatMessage(message, type, fromPos, fromName, fromAgentID); 66 client.SendChatMessage(message, type, fromPos, fromName, fromAgentID);
67 break; 67 break;
@@ -70,16 +70,16 @@ namespace OpenSim.world
70 } 70 }
71 } 71 }
72 72
73 public void RezObject(AssetBase primasset, LLVector3 pos) 73 public void RezObject(AssetBase primAsset, LLVector3 pos)
74 { 74 {
75 PrimData primd = new PrimData(primasset.Data); 75 PrimData primd = new PrimData(primAsset.Data);
76 Primitive nPrim = new Primitive(m_clientThreads, m_regionHandle, this); 76 Primitive nPrim = new Primitive(m_clientThreads, m_regionHandle, this);
77 nPrim.CreateFromStorage(primd, pos, this._primCount, true); 77 nPrim.CreateFromStorage(primd, pos, this._primCount, true);
78 this.Entities.Add(nPrim.uuid, nPrim); 78 this.Entities.Add(nPrim.uuid, nPrim);
79 this._primCount++; 79 this._primCount++;
80 } 80 }
81 81
82 public bool DeRezObject(ClientView simClient, Packet packet) 82 public void DeRezObject(Packet packet, ClientView simClient)
83 { 83 {
84 DeRezObjectPacket DeRezPacket = (DeRezObjectPacket)packet; 84 DeRezObjectPacket DeRezPacket = (DeRezObjectPacket)packet;
85 85
@@ -165,19 +165,130 @@ namespace OpenSim.world
165 } 165 }
166 } 166 }
167 } 167 }
168 return true; 168
169 } 169 }
170 170
171 public void SendAvatarsToClient(ClientView RemoteClient) 171 public void SendAvatarsToClient(ClientView remoteClient)
172 { 172 {
173 foreach (ClientView client in m_clientThreads.Values) 173 foreach (ClientView client in m_clientThreads.Values)
174 { 174 {
175 if (client.AgentID != RemoteClient.AgentID) 175 if (client.AgentID != remoteClient.AgentID)
176 {
177 // ObjectUpdatePacket objupdate = client.ClientAvatar.CreateUpdatePacket();
178 // RemoteClient.OutPacket(objupdate);
179 client.ClientAvatar.SendUpdateToOtherClient(remoteClient.ClientAvatar);
180 client.ClientAvatar.SendAppearanceToOtherAgent(remoteClient.ClientAvatar);
181 }
182 }
183 }
184
185 public void LinkObjects(uint parentPrim, List<uint> childPrims)
186 {
187 Primitive parentprim = null;
188 foreach (Entity ent in Entities.Values)
189 {
190 if (ent.localid == parentPrim)
191 {
192 parentprim = (OpenSim.world.Primitive)ent;
193
194 }
195 }
196
197 for (int i = 0; i < childPrims.Count; i++)
198 {
199 uint childId = childPrims[i];
200 foreach (Entity ent in Entities.Values)
201 {
202 if (ent.localid == childId)
203 {
204 ((OpenSim.world.Primitive)ent).MakeParent(parentprim);
205 }
206 }
207 }
208
209 }
210
211 public void UpdatePrimShape(uint primLocalID, ObjectShapePacket.ObjectDataBlock shapeBlock)
212 {
213 foreach (Entity ent in Entities.Values)
214 {
215 if (ent.localid == primLocalID)
216 {
217 ((OpenSim.world.Primitive)ent).UpdateShape(shapeBlock);
218 break;
219 }
220 }
221 }
222
223 public void SelectPrim(uint primLocalID, ClientView remoteClient)
224 {
225 foreach (Entity ent in Entities.Values)
226 {
227 if (ent.localid == primLocalID)
228 {
229 ((OpenSim.world.Primitive)ent).GetProperites(remoteClient);
230 break;
231 }
232 }
233 }
234
235 public void UpdatePrimFlags(uint localID, Packet packet, ClientView remoteClient)
236 {
237 foreach (Entity ent in Entities.Values)
238 {
239 if (ent.localid == localID)
240 {
241 ((OpenSim.world.Primitive)ent).UpdateObjectFlags((ObjectFlagUpdatePacket) packet);
242 break;
243 }
244 }
245 }
246
247 public void UpdatePrimTexture(uint localID, byte[] texture, ClientView remoteClient)
248 {
249 foreach (Entity ent in Entities.Values)
250 {
251 if (ent.localid == localID)
252 {
253 ((OpenSim.world.Primitive)ent).UpdateTexture(texture);
254 break;
255 }
256 }
257 }
258
259 public void UpdatePrimPosition(uint localID, LLVector3 pos, ClientView remoteClient)
260 {
261 foreach (Entity ent in Entities.Values)
262 {
263 if (ent.localid == localID)
264 {
265 ((OpenSim.world.Primitive)ent).UpdatePosition(pos);
266 break;
267 }
268 }
269 }
270
271 public void UpdatePrimRotation(uint localID, LLQuaternion rot, ClientView remoteClient)
272 {
273 foreach (Entity ent in Entities.Values)
274 {
275 if (ent.localid == localID)
176 { 276 {
177 // ObjectUpdatePacket objupdate = client.ClientAvatar.CreateUpdatePacket(); 277 ent.rotation = new Axiom.MathLib.Quaternion(rot.W, rot.X, rot.Y, rot.Z);
178 // RemoteClient.OutPacket(objupdate); 278 ((OpenSim.world.Primitive)ent).UpdateFlag = true;
179 client.ClientAvatar.SendUpdateToOtherClient(RemoteClient.ClientAvatar); 279 break;
180 client.ClientAvatar.SendAppearanceToOtherAgent(RemoteClient.ClientAvatar); 280 }
281 }
282 }
283
284 public void UpdatePrimScale(uint localID, LLVector3 scale, ClientView remoteClient)
285 {
286 foreach (Entity ent in Entities.Values)
287 {
288 if (ent.localid == localID)
289 {
290 ((OpenSim.world.Primitive)ent).Scale = scale;
291 break;
181 } 292 }
182 } 293 }
183 } 294 }
diff --git a/OpenSim.RegionServer/world/World.Scripting.cs b/OpenSim-Source/OpenSim.RegionServer/world/World.Scripting.cs
index 44ef05a..44ef05a 100644
--- a/OpenSim.RegionServer/world/World.Scripting.cs
+++ b/OpenSim-Source/OpenSim.RegionServer/world/World.Scripting.cs
diff --git a/OpenSim.RegionServer/world/World.cs b/OpenSim-Source/OpenSim.RegionServer/world/World.cs
index 99fb8e0..921da3c 100644
--- a/OpenSim.RegionServer/world/World.cs
+++ b/OpenSim-Source/OpenSim.RegionServer/world/World.cs
@@ -495,9 +495,9 @@ namespace OpenSim.world
495 } 495 }
496 } 496 }
497 497
498 public void AddNewPrim(ObjectAddPacket addPacket, ClientView AgentClient) 498 public void AddNewPrim(Packet addPacket, ClientView agentClient)
499 { 499 {
500 AddNewPrim(addPacket, AgentClient.AgentID); 500 AddNewPrim((ObjectAddPacket)addPacket, agentClient.AgentID);
501 } 501 }
502 502
503 public void AddNewPrim(ObjectAddPacket addPacket, LLUUID ownerID) 503 public void AddNewPrim(ObjectAddPacket addPacket, LLUUID ownerID)
@@ -533,12 +533,22 @@ namespace OpenSim.world
533 public override void AddViewerAgent(ClientView agentClient) 533 public override void AddViewerAgent(ClientView agentClient)
534 { 534 {
535 //register for events 535 //register for events
536 agentClient.OnChatFromViewer += new ClientView.ChatFromViewer(this.SimChat); 536 agentClient.OnChatFromViewer += new ChatFromViewer(this.SimChat);
537 agentClient.OnRezObject += new ClientView.RezObject(this.RezObject); 537 agentClient.OnRezObject += new RezObject(this.RezObject);
538 agentClient.OnModifyTerrain += new ClientView.ModifyTerrain(this.ModifyTerrain); 538 agentClient.OnModifyTerrain += new ModifyTerrain(this.ModifyTerrain);
539 agentClient.OnRegionHandShakeReply += new ClientView.GenericCall(this.SendLayerData); 539 agentClient.OnRegionHandShakeReply += new ClientView.GenericCall(this.SendLayerData);
540 agentClient.OnRequestWearables += new ClientView.GenericCall(this.GetInitialPrims); 540 agentClient.OnRequestWearables += new ClientView.GenericCall(this.GetInitialPrims);
541 agentClient.OnRequestAvatarsData += new ClientView.GenericCall(this.SendAvatarsToClient); 541 agentClient.OnRequestAvatarsData += new ClientView.GenericCall(this.SendAvatarsToClient);
542 agentClient.OnLinkObjects += new LinkObjects(this.LinkObjects);
543 agentClient.OnAddPrim += new ClientView.GenericCall4(this.AddNewPrim);
544 agentClient.OnUpdatePrimShape += new ClientView.UpdateShape(this.UpdatePrimShape);
545 agentClient.OnObjectSelect += new ClientView.ObjectSelect(this.SelectPrim);
546 agentClient.OnUpdatePrimFlags += new ClientView.UpdatePrimFlags(this.UpdatePrimFlags);
547 agentClient.OnUpdatePrimTexture += new ClientView.UpdatePrimTexture(this.UpdatePrimTexture);
548 agentClient.OnUpdatePrimPosition += new ClientView.UpdatePrimVector(this.UpdatePrimPosition);
549 agentClient.OnUpdatePrimRotation += new ClientView.UpdatePrimRotation(this.UpdatePrimRotation);
550 agentClient.OnUpdatePrimScale += new ClientView.UpdatePrimVector(this.UpdatePrimScale);
551 agentClient.OnDeRezObject += new ClientView.GenericCall4(this.DeRezObject);
542 552
543 try 553 try
544 { 554 {
diff --git a/OpenSim.RegionServer/world/WorldBase.cs b/OpenSim-Source/OpenSim.RegionServer/world/WorldBase.cs
index edc5518..edc5518 100644
--- a/OpenSim.RegionServer/world/WorldBase.cs
+++ b/OpenSim-Source/OpenSim.RegionServer/world/WorldBase.cs
diff --git a/OpenSim.RegionServer/world/scripting/IScriptContext.cs b/OpenSim-Source/OpenSim.RegionServer/world/scripting/IScriptContext.cs
index 465c23b..465c23b 100644
--- a/OpenSim.RegionServer/world/scripting/IScriptContext.cs
+++ b/OpenSim-Source/OpenSim.RegionServer/world/scripting/IScriptContext.cs
diff --git a/OpenSim.RegionServer/world/scripting/IScriptEntity.cs b/OpenSim-Source/OpenSim.RegionServer/world/scripting/IScriptEntity.cs
index 2ef16a4..2ef16a4 100644
--- a/OpenSim.RegionServer/world/scripting/IScriptEntity.cs
+++ b/OpenSim-Source/OpenSim.RegionServer/world/scripting/IScriptEntity.cs
diff --git a/OpenSim.RegionServer/world/scripting/IScriptHandler.cs b/OpenSim-Source/OpenSim.RegionServer/world/scripting/IScriptHandler.cs
index 15efc49..15efc49 100644
--- a/OpenSim.RegionServer/world/scripting/IScriptHandler.cs
+++ b/OpenSim-Source/OpenSim.RegionServer/world/scripting/IScriptHandler.cs
diff --git a/OpenSim.RegionServer/world/scripting/Script.cs b/OpenSim-Source/OpenSim.RegionServer/world/scripting/Script.cs
index 48c18ff..48c18ff 100644
--- a/OpenSim.RegionServer/world/scripting/Script.cs
+++ b/OpenSim-Source/OpenSim.RegionServer/world/scripting/Script.cs
diff --git a/OpenSim.RegionServer/world/scripting/ScriptFactory.cs b/OpenSim-Source/OpenSim.RegionServer/world/scripting/ScriptFactory.cs
index 4c6d373..4c6d373 100644
--- a/OpenSim.RegionServer/world/scripting/ScriptFactory.cs
+++ b/OpenSim-Source/OpenSim.RegionServer/world/scripting/ScriptFactory.cs
diff --git a/OpenSim.RegionServer/world/scripting/Scripts/FollowRandomAvatar.cs b/OpenSim-Source/OpenSim.RegionServer/world/scripting/Scripts/FollowRandomAvatar.cs
index 6a689ab..6a689ab 100644
--- a/OpenSim.RegionServer/world/scripting/Scripts/FollowRandomAvatar.cs
+++ b/OpenSim-Source/OpenSim.RegionServer/world/scripting/Scripts/FollowRandomAvatar.cs