* removed unused new-login.dat

* cleared up verbose/noverbose/disableOutput douple negation confusion in ConsoleBase
* 2d chat radius is now 3d chat sphere
* removed unused fast 2d radius calc
* added chat type 0xFF : broadcast (no sphere checking)
* OpenSimMain now exposes its LocalWorld
This commit is contained in:
lbsa71
2007-05-16 17:12:17 +00:00
parent bd6e69b97c
commit 6056247ac3
10 changed files with 194 additions and 282 deletions

View File

@@ -150,24 +150,19 @@
</Compile>
<Compile Include="SimClient.Grid.cs">
<SubType>Code</SubType>
<DependentUpon>SimClient.cs</DependentUpon>
</Compile>
<Compile Include="SimClient.PacketHandlers.cs">
<SubType>Code</SubType>
<DependentUpon>SimClient.cs</DependentUpon>
</Compile>
<Compile Include="SimClient.ProcessPackets.cs">
<SubType>Code</SubType>
<DependentUpon>SimClient.cs</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="SimClientBase.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="UDPServer.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="VersionInfo.cs">
<SubType>Code</SubType>
</Compile>
@@ -188,14 +183,12 @@
</Compile>
<Compile Include="world\Avatar.Client.cs">
<SubType>Code</SubType>
<DependentUpon>Avatar.cs</DependentUpon>
</Compile>
<Compile Include="world\Avatar.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="world\Avatar.Update.cs">
<SubType>Code</SubType>
<DependentUpon>Avatar.cs</DependentUpon>
</Compile>
<Compile Include="world\AvatarAnimations.cs">
<SubType>Code</SubType>
@@ -217,11 +210,9 @@
</Compile>
<Compile Include="world\World.PacketHandlers.cs">
<SubType>Code</SubType>
<DependentUpon>World.cs</DependentUpon>
</Compile>
<Compile Include="world\World.Scripting.cs">
<SubType>Code</SubType>
<DependentUpon>World.cs</DependentUpon>
</Compile>
<Compile Include="world\scripting\IScriptContext.cs">
<SubType>Code</SubType>

View File

@@ -60,7 +60,6 @@ namespace OpenSim
//private IGenericConfig remoteConfig;
private PhysicsManager physManager;
private Grid GridServers;
private World LocalWorld;
private AssetCache AssetCache;
private InventoryCache InventoryCache;
private Dictionary<EndPoint, uint> clientCircuits = new Dictionary<EndPoint, uint>();
@@ -81,7 +80,7 @@ namespace OpenSim
protected ConsoleBase m_console;
public OpenSimMain(bool sandBoxMode, bool startLoginServer, string physicsEngine, bool useConfigFile, bool verbose, string configFile)
public OpenSimMain(bool sandBoxMode, bool startLoginServer, string physicsEngine, bool useConfigFile, bool silent, string configFile)
{
this.configFileSetup = useConfigFile;
m_sandbox = sandBoxMode;
@@ -89,10 +88,16 @@ namespace OpenSim
m_physicsEngine = physicsEngine;
m_config = configFile;
m_console = new ConsoleBase("region-console-" + Guid.NewGuid().ToString() + ".log", "Region", this, verbose);
m_console = new ConsoleBase("region-console-" + Guid.NewGuid().ToString() + ".log", "Region", this, silent);
OpenSim.Framework.Console.MainConsole.Instance = m_console;
}
private World m_localWorld;
public World LocalWorld
{
get { return m_localWorld; }
}
/// <summary>
/// Performs initialisation of the world, such as loading configuration from disk.
/// </summary>
@@ -251,7 +256,7 @@ namespace OpenSim
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Initialising world");
m_console.componentname = "Region " + regionData.RegionName;
LocalWorld = new World(this.m_udpServer.PacketServer.ClientThreads, regionData, regionData.RegionHandle, regionData.RegionName);
m_localWorld = new World(this.m_udpServer.PacketServer.ClientThreads, regionData, regionData.RegionHandle, regionData.RegionName);
LocalWorld.InventoryCache = InventoryCache;
LocalWorld.AssetCache = AssetCache;

View File

@@ -51,40 +51,51 @@ namespace OpenSim.world
return true;
}
string fromName = simClient.ClientAvatar.firstname + " " + simClient.ClientAvatar.lastname;
byte[] message = inchatpack.ChatData.Message;
byte type = inchatpack.ChatData.Type;
LLVector3 fromPos = simClient.ClientAvatar.Pos;
LLUUID fromAgentID = simClient.AgentID;
libsecondlife.Packets.ChatFromSimulatorPacket reply = new ChatFromSimulatorPacket();
reply.ChatData.Audible = 1;
reply.ChatData.Message = inchatpack.ChatData.Message;
reply.ChatData.ChatType = inchatpack.ChatData.Type;
reply.ChatData.Message = message;
reply.ChatData.ChatType = type;
reply.ChatData.SourceType = 1;
reply.ChatData.Position = simClient.ClientAvatar.Pos;
reply.ChatData.FromName = enc.GetBytes(simClient.ClientAvatar.firstname + " " + simClient.ClientAvatar.lastname + "\0");
reply.ChatData.OwnerID = simClient.AgentID;
reply.ChatData.SourceID = simClient.AgentID;
reply.ChatData.Position = fromPos;
reply.ChatData.FromName = enc.GetBytes(fromName + "\0");
reply.ChatData.OwnerID = fromAgentID;
reply.ChatData.SourceID = fromAgentID;
foreach (SimClient client in m_clientThreads.Values)
{
// int dis = Util.fast_distance2d((int)(client.ClientAvatar.Pos.X - simClient.ClientAvatar.Pos.X), (int)(client.ClientAvatar.Pos.Y - simClient.ClientAvatar.Pos.Y));
int dis = (int)client.ClientAvatar.Pos.GetDistanceTo(simClient.ClientAvatar.Pos);
switch (inchatpack.ChatData.Type)
{
case 0:
int dis = Util.fast_distance2d((int)(client.ClientAvatar.Pos.X - simClient.ClientAvatar.Pos.X), (int)(client.ClientAvatar.Pos.Y - simClient.ClientAvatar.Pos.Y));
case 0: // Whisper
if ((dis < 10) && (dis > -10))
{
client.OutPacket(reply);
}
break;
case 1:
dis = Util.fast_distance2d((int)(client.ClientAvatar.Pos.X - simClient.ClientAvatar.Pos.X), (int)(client.ClientAvatar.Pos.Y - simClient.ClientAvatar.Pos.Y));
case 1: // Say
if ((dis < 30) && (dis > -30))
{
client.OutPacket(reply);
}
break;
case 2:
dis = Util.fast_distance2d((int)(client.ClientAvatar.Pos.X - simClient.ClientAvatar.Pos.X), (int)(client.ClientAvatar.Pos.Y - simClient.ClientAvatar.Pos.Y));
case 2: // Shout
if ((dis < 100) && (dis > -100))
{
client.OutPacket(reply);
}
break;
case 0xff: // Broadcast
client.OutPacket(reply);
break;
}
}
@@ -147,7 +158,7 @@ namespace OpenSim.world
//Uncomment when prim/object UUIDs are random or such
//2007-03-22 - Randomskk
//this._primCount--;
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.VERBOSE,"Deleted UUID " + ent.uuid);
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.VERBOSE, "Deleted UUID " + ent.uuid);
}
}
}
@@ -216,7 +227,7 @@ namespace OpenSim.world
mapReply.Data[0].MapImageID = new LLUUID("00000000-0000-0000-9999-000000000007");
mapReply.Data[0].X = (ushort)m_regInfo.RegionLocX;
mapReply.Data[0].Y = (ushort)m_regInfo.RegionLocY;
mapReply.Data[0].WaterHeight =(byte) m_regInfo.RegionWaterHeight;
mapReply.Data[0].WaterHeight = (byte)m_regInfo.RegionWaterHeight;
mapReply.Data[0].Name = _enc.GetBytes(this.m_regionName);
mapReply.Data[0].RegionFlags = 72458694;
mapReply.Data[0].Access = 13;