aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim.RegionServer
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim.RegionServer')
-rw-r--r--OpenSim.RegionServer/OpenSim.RegionServer.csproj11
-rw-r--r--OpenSim.RegionServer/OpenSimMain.cs13
-rw-r--r--OpenSim.RegionServer/world/World.PacketHandlers.cs39
3 files changed, 35 insertions, 28 deletions
diff --git a/OpenSim.RegionServer/OpenSim.RegionServer.csproj b/OpenSim.RegionServer/OpenSim.RegionServer.csproj
index 8b23336..b4868bd 100644
--- a/OpenSim.RegionServer/OpenSim.RegionServer.csproj
+++ b/OpenSim.RegionServer/OpenSim.RegionServer.csproj
@@ -150,24 +150,19 @@
150 </Compile> 150 </Compile>
151 <Compile Include="SimClient.Grid.cs"> 151 <Compile Include="SimClient.Grid.cs">
152 <SubType>Code</SubType> 152 <SubType>Code</SubType>
153 <DependentUpon>SimClient.cs</DependentUpon>
154 </Compile> 153 </Compile>
155 <Compile Include="SimClient.PacketHandlers.cs"> 154 <Compile Include="SimClient.PacketHandlers.cs">
156 <SubType>Code</SubType> 155 <SubType>Code</SubType>
157 <DependentUpon>SimClient.cs</DependentUpon>
158 </Compile> 156 </Compile>
159 <Compile Include="SimClient.ProcessPackets.cs"> 157 <Compile Include="SimClient.ProcessPackets.cs">
160 <SubType>Code</SubType> 158 <SubType>Code</SubType>
161 <DependentUpon>SimClient.cs</DependentUpon>
162 </Compile> 159 </Compile>
163
164 <Compile Include="SimClientBase.cs"> 160 <Compile Include="SimClientBase.cs">
165 <SubType>Code</SubType> 161 <SubType>Code</SubType>
166 </Compile> 162 </Compile>
167 <Compile Include="UDPServer.cs"> 163 <Compile Include="UDPServer.cs">
168 <SubType>Code</SubType> 164 <SubType>Code</SubType>
169 </Compile> 165 </Compile>
170
171 <Compile Include="VersionInfo.cs"> 166 <Compile Include="VersionInfo.cs">
172 <SubType>Code</SubType> 167 <SubType>Code</SubType>
173 </Compile> 168 </Compile>
@@ -188,14 +183,12 @@
188 </Compile> 183 </Compile>
189 <Compile Include="world\Avatar.Client.cs"> 184 <Compile Include="world\Avatar.Client.cs">
190 <SubType>Code</SubType> 185 <SubType>Code</SubType>
191 <DependentUpon>Avatar.cs</DependentUpon>
192 </Compile> 186 </Compile>
193 <Compile Include="world\Avatar.cs"> 187 <Compile Include="world\Avatar.cs">
194 <SubType>Code</SubType> 188 <SubType>Code</SubType>
195 </Compile> 189 </Compile>
196 <Compile Include="world\Avatar.Update.cs"> 190 <Compile Include="world\Avatar.Update.cs">
197 <SubType>Code</SubType> 191 <SubType>Code</SubType>
198 <DependentUpon>Avatar.cs</DependentUpon>
199 </Compile> 192 </Compile>
200 <Compile Include="world\AvatarAnimations.cs"> 193 <Compile Include="world\AvatarAnimations.cs">
201 <SubType>Code</SubType> 194 <SubType>Code</SubType>
@@ -217,11 +210,9 @@
217 </Compile> 210 </Compile>
218 <Compile Include="world\World.PacketHandlers.cs"> 211 <Compile Include="world\World.PacketHandlers.cs">
219 <SubType>Code</SubType> 212 <SubType>Code</SubType>
220 <DependentUpon>World.cs</DependentUpon>
221 </Compile> 213 </Compile>
222 <Compile Include="world\World.Scripting.cs"> 214 <Compile Include="world\World.Scripting.cs">
223 <SubType>Code</SubType> 215 <SubType>Code</SubType>
224 <DependentUpon>World.cs</DependentUpon>
225 </Compile> 216 </Compile>
226 <Compile Include="world\scripting\IScriptContext.cs"> 217 <Compile Include="world\scripting\IScriptContext.cs">
227 <SubType>Code</SubType> 218 <SubType>Code</SubType>
diff --git a/OpenSim.RegionServer/OpenSimMain.cs b/OpenSim.RegionServer/OpenSimMain.cs
index ce49074..6b89bfe 100644
--- a/OpenSim.RegionServer/OpenSimMain.cs
+++ b/OpenSim.RegionServer/OpenSimMain.cs
@@ -60,7 +60,6 @@ namespace OpenSim
60 //private IGenericConfig remoteConfig; 60 //private IGenericConfig remoteConfig;
61 private PhysicsManager physManager; 61 private PhysicsManager physManager;
62 private Grid GridServers; 62 private Grid GridServers;
63 private World LocalWorld;
64 private AssetCache AssetCache; 63 private AssetCache AssetCache;
65 private InventoryCache InventoryCache; 64 private InventoryCache InventoryCache;
66 private Dictionary<EndPoint, uint> clientCircuits = new Dictionary<EndPoint, uint>(); 65 private Dictionary<EndPoint, uint> clientCircuits = new Dictionary<EndPoint, uint>();
@@ -81,7 +80,7 @@ namespace OpenSim
81 80
82 protected ConsoleBase m_console; 81 protected ConsoleBase m_console;
83 82
84 public OpenSimMain(bool sandBoxMode, bool startLoginServer, string physicsEngine, bool useConfigFile, bool verbose, string configFile) 83 public OpenSimMain(bool sandBoxMode, bool startLoginServer, string physicsEngine, bool useConfigFile, bool silent, string configFile)
85 { 84 {
86 this.configFileSetup = useConfigFile; 85 this.configFileSetup = useConfigFile;
87 m_sandbox = sandBoxMode; 86 m_sandbox = sandBoxMode;
@@ -89,10 +88,16 @@ namespace OpenSim
89 m_physicsEngine = physicsEngine; 88 m_physicsEngine = physicsEngine;
90 m_config = configFile; 89 m_config = configFile;
91 90
92 m_console = new ConsoleBase("region-console-" + Guid.NewGuid().ToString() + ".log", "Region", this, verbose); 91 m_console = new ConsoleBase("region-console-" + Guid.NewGuid().ToString() + ".log", "Region", this, silent);
93 OpenSim.Framework.Console.MainConsole.Instance = m_console; 92 OpenSim.Framework.Console.MainConsole.Instance = m_console;
94 } 93 }
95 94
95 private World m_localWorld;
96 public World LocalWorld
97 {
98 get { return m_localWorld; }
99 }
100
96 /// <summary> 101 /// <summary>
97 /// Performs initialisation of the world, such as loading configuration from disk. 102 /// Performs initialisation of the world, such as loading configuration from disk.
98 /// </summary> 103 /// </summary>
@@ -251,7 +256,7 @@ namespace OpenSim
251 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Initialising world"); 256 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Initialising world");
252 m_console.componentname = "Region " + regionData.RegionName; 257 m_console.componentname = "Region " + regionData.RegionName;
253 258
254 LocalWorld = new World(this.m_udpServer.PacketServer.ClientThreads, regionData, regionData.RegionHandle, regionData.RegionName); 259 m_localWorld = new World(this.m_udpServer.PacketServer.ClientThreads, regionData, regionData.RegionHandle, regionData.RegionName);
255 LocalWorld.InventoryCache = InventoryCache; 260 LocalWorld.InventoryCache = InventoryCache;
256 LocalWorld.AssetCache = AssetCache; 261 LocalWorld.AssetCache = AssetCache;
257 262
diff --git a/OpenSim.RegionServer/world/World.PacketHandlers.cs b/OpenSim.RegionServer/world/World.PacketHandlers.cs
index 2036bc6..3c3548d 100644
--- a/OpenSim.RegionServer/world/World.PacketHandlers.cs
+++ b/OpenSim.RegionServer/world/World.PacketHandlers.cs
@@ -51,40 +51,51 @@ namespace OpenSim.world
51 return true; 51 return true;
52 } 52 }
53 53
54 string fromName = simClient.ClientAvatar.firstname + " " + simClient.ClientAvatar.lastname;
55 byte[] message = inchatpack.ChatData.Message;
56 byte type = inchatpack.ChatData.Type;
57 LLVector3 fromPos = simClient.ClientAvatar.Pos;
58 LLUUID fromAgentID = simClient.AgentID;
59
54 libsecondlife.Packets.ChatFromSimulatorPacket reply = new ChatFromSimulatorPacket(); 60 libsecondlife.Packets.ChatFromSimulatorPacket reply = new ChatFromSimulatorPacket();
55 reply.ChatData.Audible = 1; 61 reply.ChatData.Audible = 1;
56 reply.ChatData.Message = inchatpack.ChatData.Message; 62 reply.ChatData.Message = message;
57 reply.ChatData.ChatType = inchatpack.ChatData.Type; 63 reply.ChatData.ChatType = type;
58 reply.ChatData.SourceType = 1; 64 reply.ChatData.SourceType = 1;
59 reply.ChatData.Position = simClient.ClientAvatar.Pos; 65 reply.ChatData.Position = fromPos;
60 reply.ChatData.FromName = enc.GetBytes(simClient.ClientAvatar.firstname + " " + simClient.ClientAvatar.lastname + "\0"); 66 reply.ChatData.FromName = enc.GetBytes(fromName + "\0");
61 reply.ChatData.OwnerID = simClient.AgentID; 67 reply.ChatData.OwnerID = fromAgentID;
62 reply.ChatData.SourceID = simClient.AgentID; 68 reply.ChatData.SourceID = fromAgentID;
69
63 foreach (SimClient client in m_clientThreads.Values) 70 foreach (SimClient client in m_clientThreads.Values)
64 { 71 {
72 // int dis = Util.fast_distance2d((int)(client.ClientAvatar.Pos.X - simClient.ClientAvatar.Pos.X), (int)(client.ClientAvatar.Pos.Y - simClient.ClientAvatar.Pos.Y));
73 int dis = (int)client.ClientAvatar.Pos.GetDistanceTo(simClient.ClientAvatar.Pos);
74
65 switch (inchatpack.ChatData.Type) 75 switch (inchatpack.ChatData.Type)
66 { 76 {
67 case 0: 77 case 0: // Whisper
68 int dis = Util.fast_distance2d((int)(client.ClientAvatar.Pos.X - simClient.ClientAvatar.Pos.X), (int)(client.ClientAvatar.Pos.Y - simClient.ClientAvatar.Pos.Y));
69 if ((dis < 10) && (dis > -10)) 78 if ((dis < 10) && (dis > -10))
70 { 79 {
71 client.OutPacket(reply); 80 client.OutPacket(reply);
72 } 81 }
73 break; 82 break;
74 case 1: 83 case 1: // Say
75 dis = Util.fast_distance2d((int)(client.ClientAvatar.Pos.X - simClient.ClientAvatar.Pos.X), (int)(client.ClientAvatar.Pos.Y - simClient.ClientAvatar.Pos.Y));
76 if ((dis < 30) && (dis > -30)) 84 if ((dis < 30) && (dis > -30))
77 { 85 {
78 client.OutPacket(reply); 86 client.OutPacket(reply);
79 } 87 }
80 break; 88 break;
81 case 2: 89 case 2: // Shout
82 dis = Util.fast_distance2d((int)(client.ClientAvatar.Pos.X - simClient.ClientAvatar.Pos.X), (int)(client.ClientAvatar.Pos.Y - simClient.ClientAvatar.Pos.Y));
83 if ((dis < 100) && (dis > -100)) 90 if ((dis < 100) && (dis > -100))
84 { 91 {
85 client.OutPacket(reply); 92 client.OutPacket(reply);
86 } 93 }
87 break; 94 break;
95
96 case 0xff: // Broadcast
97 client.OutPacket(reply);
98 break;
88 } 99 }
89 100
90 } 101 }
@@ -147,7 +158,7 @@ namespace OpenSim.world
147 //Uncomment when prim/object UUIDs are random or such 158 //Uncomment when prim/object UUIDs are random or such
148 //2007-03-22 - Randomskk 159 //2007-03-22 - Randomskk
149 //this._primCount--; 160 //this._primCount--;
150 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.VERBOSE,"Deleted UUID " + ent.uuid); 161 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.VERBOSE, "Deleted UUID " + ent.uuid);
151 } 162 }
152 } 163 }
153 } 164 }
@@ -216,7 +227,7 @@ namespace OpenSim.world
216 mapReply.Data[0].MapImageID = new LLUUID("00000000-0000-0000-9999-000000000007"); 227 mapReply.Data[0].MapImageID = new LLUUID("00000000-0000-0000-9999-000000000007");
217 mapReply.Data[0].X = (ushort)m_regInfo.RegionLocX; 228 mapReply.Data[0].X = (ushort)m_regInfo.RegionLocX;
218 mapReply.Data[0].Y = (ushort)m_regInfo.RegionLocY; 229 mapReply.Data[0].Y = (ushort)m_regInfo.RegionLocY;
219 mapReply.Data[0].WaterHeight =(byte) m_regInfo.RegionWaterHeight; 230 mapReply.Data[0].WaterHeight = (byte)m_regInfo.RegionWaterHeight;
220 mapReply.Data[0].Name = _enc.GetBytes(this.m_regionName); 231 mapReply.Data[0].Name = _enc.GetBytes(this.m_regionName);
221 mapReply.Data[0].RegionFlags = 72458694; 232 mapReply.Data[0].RegionFlags = 72458694;
222 mapReply.Data[0].Access = 13; 233 mapReply.Data[0].Access = 13;