From a45118d35e35c3f46ad165f978efd8d87e0da2b1 Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Fri, 7 Dec 2007 02:00:35 +0000 Subject: [PATCH] added one more command to the console help. --- OpenSim/Framework/RegionInfo.cs | 9 +---- .../Filesystem/RegionLoaderFileSystem.cs | 4 +- OpenSim/Region/Application/OpenSimMain.cs | 4 +- .../Region/Environment/Modules/SunModule.cs | 3 +- .../Environment/Scenes/ScenePresence.cs | 40 ++++++------------- OpenSim/Region/Examples/SimpleApp/MyWorld.cs | 9 +---- 6 files changed, 19 insertions(+), 50 deletions(-) diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs index d94a89097f..5dc11ad53a 100644 --- a/OpenSim/Framework/RegionInfo.cs +++ b/OpenSim/Framework/RegionInfo.cs @@ -48,7 +48,6 @@ namespace OpenSim.Framework public SimpleRegionInfo(uint regionLocX, uint regionLocY, IPEndPoint internalEndPoint, string externalUri) { - m_regionLocX = regionLocX; m_regionLocY = regionLocY; @@ -83,7 +82,6 @@ namespace OpenSim.Framework public string RemotingAddress; - public IPEndPoint ExternalEndPoint { get @@ -99,7 +97,6 @@ namespace OpenSim.Framework // Reset for next check ia = null; - // New method favors IPv4 foreach (IPAddress Adr in Dns.GetHostAddresses(m_externalHostName)) { @@ -111,7 +108,6 @@ namespace OpenSim.Framework ia = Adr; break; } - } return new IPEndPoint(ia, m_internalEndPoint.Port); @@ -209,10 +205,10 @@ namespace OpenSim.Framework return m_estateSettings; } - } public ConfigurationMember configMember; + public RegionInfo(string description, string filename) { configMember = new ConfigurationMember(filename, description, loadConfigurationOptions, handleIncomingConfiguration); @@ -226,13 +222,10 @@ namespace OpenSim.Framework public RegionInfo(uint regionLocX, uint regionLocY, IPEndPoint internalEndPoint, string externalUri) : base(regionLocX, regionLocY, internalEndPoint, externalUri) { - - } public RegionInfo() { - } public RegionInfo(SearializableRegionInfo ConvertFrom) { diff --git a/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs b/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs index 7179a7ff6f..068c7c407a 100644 --- a/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs +++ b/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs @@ -39,6 +39,7 @@ namespace OpenSim.Framework.RegionLoader.Filesystem public void SetIniConfigSource(IniConfigSource configSource) { } + public RegionInfo[] LoadRegions() { string regionConfigPath = Path.Combine(Util.configDir(), "Regions"); @@ -59,14 +60,11 @@ namespace OpenSim.Framework.RegionLoader.Filesystem RegionInfo[] regionInfos = new RegionInfo[configFiles.Length]; for (int i = 0; i < configFiles.Length; i++) { - RegionInfo regionInfo = new RegionInfo("REGION CONFIG #" + (i + 1), configFiles[i]); regionInfos[i] = regionInfo; } - return regionInfos; } - } } diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs index 64fe8df886..d8100c00aa 100644 --- a/OpenSim/Region/Application/OpenSimMain.cs +++ b/OpenSim/Region/Application/OpenSimMain.cs @@ -626,7 +626,7 @@ namespace OpenSim m_log.Error(" alert [First] [Last] [Message] - send an alert to a user. Case sensitive."); m_log.Error(" alert general [Message] - send an alert to all users."); m_log.Error("backup - trigger a simulator backup"); - m_log.Error("change-region - sets the region that many of these commands affect."); + m_log.Error("change-region [name] - sets the region that many of these commands affect."); m_log.Error("command-script [filename] - Execute command in a file."); m_log.Error("debug - debugging commands"); m_log.Error(" packet 0..255 - print incoming/outgoing packets (0=off)"); @@ -638,6 +638,7 @@ namespace OpenSim m_log.Error("permissions [true/false] - turn on/off permissions on the scene"); m_log.Error("quit - equivalent to shutdown."); m_log.Error("restart - disconnects all clients and restarts the sims in the instance."); + m_log.Error("remove-region [name] - remove a region"); m_log.Error("save-xml [filename] - save prims to XML"); m_log.Error("save-xml2 [filename] - save prims to XML using version 2 format"); m_log.Error("script - manually trigger scripts? or script commands?"); @@ -771,7 +772,6 @@ namespace OpenSim } m_regionData.Remove(killScene.RegionInfo); m_sceneManager.CloseScene(killScene); - } break; diff --git a/OpenSim/Region/Environment/Modules/SunModule.cs b/OpenSim/Region/Environment/Modules/SunModule.cs index c941b1e687..2dd5b776ca 100644 --- a/OpenSim/Region/Environment/Modules/SunModule.cs +++ b/OpenSim/Region/Environment/Modules/SunModule.cs @@ -152,7 +152,7 @@ namespace OpenSim.Region.Environment.Modules // sunPhase = 12; // } // sunPhase = sunPhase - 12; - + // // float yValue = 0.1f*(sunPhase); // Console.WriteLine("Computed SunPhase: {0}, yValue: {1}", sunPhase, yValue); // if (yValue > 1.2f) @@ -182,6 +182,5 @@ namespace OpenSim.Region.Environment.Modules // viewertime.TimeInfo.UsecSinceStart = (ulong) Util.UnixTimeSinceEpoch(); // // OutPacket(viewertime); // } - } } \ No newline at end of file diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index 83d3306af2..b8a2555763 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs @@ -77,7 +77,6 @@ namespace OpenSim.Region.Environment.Scenes private LLVector3 lastPhysPos = new LLVector3(); private int m_wearablesSerial = 1; - // Position of agent's camera in world protected Vector3 m_CameraCenter = new Vector3(0, 0, 0); @@ -553,7 +552,7 @@ namespace OpenSim.Region.Environment.Scenes } } - public void HandleAgentUpdate(IClientAPI remoteClient,AgentUpdatePacket agentData ) + public void HandleAgentUpdate(IClientAPI remoteClient, AgentUpdatePacket agentData) { //if (m_isChildAgent) //{ @@ -573,7 +572,6 @@ namespace OpenSim.Region.Environment.Scenes m_CameraCenter.y = agentData.AgentData.CameraCenter.Y; m_CameraCenter.z = agentData.AgentData.CameraCenter.Z; - // Use these three vectors to figure out what the agent is looking at // Convert it to a Matrix and/or Quaternion m_CameraAtAxis.x = agentData.AgentData.CameraAtAxis.X; @@ -632,7 +630,6 @@ namespace OpenSim.Region.Environment.Scenes Quaternion q = new Quaternion(bodyRotation.W, bodyRotation.X, bodyRotation.Y, bodyRotation.Z); bool oldflying = PhysicsActor.Flying; - PhysicsActor.Flying = ((flags & (uint)MainAvatar.ControlFlags.AGENT_CONTROL_FLY) != 0); if (PhysicsActor.Flying != oldflying) { @@ -883,10 +880,10 @@ namespace OpenSim.Region.Environment.Scenes } NewForce newVelocity = new NewForce(); - Vector3 direc = rotation*vec; + Vector3 direc = rotation * vec; direc.Normalize(); - direc = direc*((0.03f)*128f); + direc *= 0.03f * 128f; if (m_physicsActor.Flying) { direc *= 4; @@ -944,15 +941,12 @@ namespace OpenSim.Region.Environment.Scenes if (m_isChildAgent == false) { - /// check for user movement 'forces' (ie commands to move) - if (m_newForce) + if (m_newForce) // user movement 'forces' (ie commands to move) { SendTerseUpdateToAllClients(); m_updateCount = 0; } - - /// check for scripted movement (?) - else if (m_movementflag != 0) + else if (m_movementflag != 0) // scripted movement (?) { m_updateCount++; if (m_updateCount > 3) @@ -961,9 +955,7 @@ namespace OpenSim.Region.Environment.Scenes m_updateCount = 0; } } - - /// check for physics-related movement - else if (lastPhysPos.GetDistanceTo(AbsolutePosition) > 0.02) + else if (lastPhysPos.GetDistanceTo(AbsolutePosition) > 0.02) // physics-related movement { SendTerseUpdateToAllClients(); m_updateCount = 0; @@ -1071,9 +1063,9 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public void SendOwnAppearance( ) + public void SendOwnAppearance() { - SendOwnWearables( ); + SendOwnWearables(); // TODO: remove this once the SunModule is slightly more tested // m_controllingClient.SendViewerTime(m_scene.TimePhase); @@ -1224,7 +1216,6 @@ namespace OpenSim.Region.Environment.Scenes #endregion - public void GrantGodlikePowers(LLUUID agentID, LLUUID sessionID, LLUUID token) { GrantGodlikePowersPacket respondPacket = new GrantGodlikePowersPacket(); @@ -1240,10 +1231,8 @@ namespace OpenSim.Region.Environment.Scenes respondPacket.GrantData = gdb; respondPacket.AgentData = adb; ControllingClient.OutPacket(respondPacket, ThrottleOutPacketType.Task); - - - } + /// /// /// @@ -1267,7 +1256,6 @@ namespace OpenSim.Region.Environment.Scenes m_updateflag = true; - Velocity = new LLVector3(force.X, force.Y, force.Z); m_newForce = true; } @@ -1317,7 +1305,6 @@ namespace OpenSim.Region.Environment.Scenes } } - public override void SetText(string text, Vector3 color, double alpha) { throw new Exception("Can't set Text on avatar."); @@ -1335,14 +1322,13 @@ namespace OpenSim.Region.Environment.Scenes m_physicsActor.OnRequestTerseUpdate += SendTerseUpdateToAllClients; m_physicsActor.OnCollisionUpdate += PhysicsCollisionUpdate; } + private void PhysicsCollisionUpdate(EventArgs e) { - bool isUserMoving = false; - if (Velocity.X > 0 || Velocity.Y > 0) - isUserMoving = true; + bool isUserMoving = Velocity.X > 0 || Velocity.Y > 0; UpdateMovementAnimations(isUserMoving); - } + internal void Close() { RemoveFromPhysicalScene(); @@ -1352,13 +1338,11 @@ namespace OpenSim.Region.Environment.Scenes { m_wearables[wearableId] = wearable; SendOwnWearables(); - } private void SendOwnWearables() { m_controllingClient.SendWearables(m_wearables, m_wearablesSerial++); } - } } diff --git a/OpenSim/Region/Examples/SimpleApp/MyWorld.cs b/OpenSim/Region/Examples/SimpleApp/MyWorld.cs index 535d519172..d5f702d5bd 100644 --- a/OpenSim/Region/Examples/SimpleApp/MyWorld.cs +++ b/OpenSim/Region/Examples/SimpleApp/MyWorld.cs @@ -34,7 +34,6 @@ using OpenSim.Framework.Communications.Cache; using OpenSim.Framework.Servers; using OpenSim.Region.Environment; using OpenSim.Region.Environment.Scenes; -using Avatar=OpenSim.Region.Environment.Scenes.ScenePresence; namespace SimpleApp { @@ -47,7 +46,7 @@ namespace SimpleApp ModuleLoader moduleLoader, bool physicalPrim, bool ChildGetTasks) : base(regionInfo, authen, permissionManager, commsMan, sceneGridService, assetCach, storeMan, httpServer, moduleLoader, false, true, false) { - m_avatars = new List(); + m_avatars = new List(); } public override void LoadWorldMap() @@ -56,9 +55,6 @@ namespace SimpleApp for (int i = 0; i < 65536; i++) { - //int x = i%256; - //int y = i/256; - map[i] = 25f; } @@ -77,8 +73,7 @@ namespace SimpleApp client.OnCompleteMovementToRegion += delegate() { client.SendChatMessage("Welcome to My World.", 1, pos, "System", LLUUID.Zero); }; - - + client.SendRegionHandshake(m_regInfo); } }