Skip to content
This repository has been archived by the owner on Aug 19, 2018. It is now read-only.

Commit

Permalink
Merge branch 'master' into daemons
Browse files Browse the repository at this point in the history
  • Loading branch information
kf6kjg committed Jul 25, 2017
2 parents fae1793 + 65fe4d1 commit 554a4ac
Show file tree
Hide file tree
Showing 31 changed files with 1,129 additions and 503 deletions.
32 changes: 32 additions & 0 deletions .appveyor.yml
@@ -0,0 +1,32 @@
version: 0.9.00.{build}

image: Visual Studio 2017

configuration: Release

cache:
- packages -> **\packages.config

before_build:
- IF EXIST runprebuild.bat runprebuild.bat
- nuget restore Halcyon.sln

build:
parallel: true
verbosity: minimal
project: Halcyon.sln

after_build:
- ps: |
If(Test-Path "bin/OpenSim.Framework.Servers.dll") {
$halcyon_version = (ls bin/OpenSim.Framework.Servers.dll | % versioninfo).ProductVersion
Update-AppveyorBuild -Version "0.$($halcyon_version.Substring(0, $halcyon_version.lastIndexOf('.')))-$env:APPVEYOR_BUILD_NUMBER"
}
- cmd: move bin halcyon

# No tests for now.
test: off

artifacts:
- path: halcyon
name: Halcyon-$(APPVEYOR_BUILD_VERSION)-$(APPVEYOR_REPO_BRANCH)-Windows
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -245,6 +245,7 @@ bin/Terrain/OpenSim.Region.CoreModules.World.Terrain.DefaultEffects.dll
bin/crashes
bin/Grid
bin/GridLogin
bin/Regions-Test
bin2
bin3
bin4
Expand Down
3 changes: 3 additions & 0 deletions InWorldz/Halcyon/Application.cs
Expand Up @@ -65,6 +65,9 @@ public static class Application
//could move our main function into OpenSimMain and kill this class
public static void Main(string[] args)
{
// Under any circumstance other than an explicit exit the exit code should be 1.
Environment.ExitCode = 1;

// First line, hook the appdomain to the crash reporter
AppDomain.CurrentDomain.UnhandledException +=
new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
Expand Down
19 changes: 13 additions & 6 deletions InWorldz/InWorldz.Phlox.Engine/LSLSystemAPI.cs
Expand Up @@ -14500,6 +14500,9 @@ private void WithNotecard(UUID assetID, AssetRequestCallback cb)

public string GetNumberOfNotecardLines(SceneObjectPart part, string name)
{
const int ERROR_DELAY = 100;
const int LONG_DELAY = 50;
const int FAST_DELAY = 25;
TaskInventoryDictionary itemsDictionary = (TaskInventoryDictionary)part.TaskInventory.Clone();

UUID assetID = UUID.Zero;
Expand All @@ -14520,7 +14523,7 @@ public string GetNumberOfNotecardLines(SceneObjectPart part, string name)
{
// => complain loudly, as specified by the LSL docs
ScriptShoutError("Notecard '" + name + "' could not be found.");

ScriptSleep(ERROR_DELAY);
return UUID.Zero.ToString();
}

Expand All @@ -14533,7 +14536,7 @@ public string GetNumberOfNotecardLines(SceneObjectPart part, string name)
{
AsyncCommands.
DataserverPlugin.DataserverReply(reqIdentifier, NotecardCache.GetLines(assetID).ToString());
ScriptSleep(100);
ScriptSleep(FAST_DELAY);
return tid.ToString();
}

Expand All @@ -14542,6 +14545,7 @@ public string GetNumberOfNotecardLines(SceneObjectPart part, string name)
if (a == null || a.Type != 7)
{
ScriptShoutError("Notecard '" + name + "' could not be found.");
ScriptSleep(ERROR_DELAY);
return;
}

Expand All @@ -14552,7 +14556,7 @@ public string GetNumberOfNotecardLines(SceneObjectPart part, string name)

NotecardCache.CacheCheck(); //this must be done in the script engine thread to avoid race conditions

ScriptSleep(100);
ScriptSleep(LONG_DELAY);
return tid.ToString();
}
public string llGetNumberOfNotecardLines(string name)
Expand All @@ -14577,7 +14581,9 @@ public string iwGetLinkNumberOfNotecardLines(int linknumber, string name)

private string GetNotecardSegment(SceneObjectPart part, string name, int line, int startOffset, int maxLength)
{
const int DELAY = 25;
const int LONG_DELAY = 25;
const int FAST_DELAY = 1;
const int LINES_PER_DELAY = 16; // every 16 lines, delay FAST_DELAY

TaskInventoryDictionary itemsDictionary = (TaskInventoryDictionary)part.TaskInventory.Clone();

Expand Down Expand Up @@ -14612,7 +14618,8 @@ private string GetNotecardSegment(SceneObjectPart part, string name, int line, i
{
AsyncCommands.
DataserverPlugin.DataserverReply(reqIdentifier, NotecardCache.GetLine(assetID, line, startOffset, maxLength));
ScriptSleep(DELAY);
if (((line % LINES_PER_DELAY) == 0) && (startOffset == 0))
ScriptSleep(FAST_DELAY);
return tid.ToString();
}

Expand All @@ -14630,7 +14637,7 @@ private string GetNotecardSegment(SceneObjectPart part, string name, int line, i

NotecardCache.CacheCheck(); //this must be done in the script engine thread to avoid race conditions

ScriptSleep(DELAY);
ScriptSleep(LONG_DELAY);
return tid.ToString();
}

Expand Down
4 changes: 3 additions & 1 deletion OpenSim/Base/OpenSim.cs
Expand Up @@ -826,7 +826,9 @@ public void RunCommand(string module, string[] cmdparams)
break;

case "restart":
m_sceneManager.RestartCurrentScene();
// Let's issue a full server shutdown and let the management tools take care of the restart.
// Use a status of 63 (0b00111111) to indicate that this "error" is an explicit restart request and not a real error.
Shutdown(63);
break;

case "predecode-j2k":
Expand Down
6 changes: 6 additions & 0 deletions OpenSim/Framework/Communications/Capabilities/LLSDHelpers.cs
Expand Up @@ -157,6 +157,12 @@ public static object DeserializeOSDMap(Hashtable llsd, object obj)
// the LLSD map/array types in the array need to be deserialized
// but first we need to know the right class to deserialize them into.
}
else if (enumerator.Value is Boolean && field.FieldType == typeof(int))
{
// LLSD booleans aren't actually booleans, they are ints with a value of 0 or 1
int i = (bool)enumerator.Value ? 1 : 0;
field.SetValue(obj, (object)i);
}
else
{
field.SetValue(obj, enumerator.Value);
Expand Down
2 changes: 1 addition & 1 deletion OpenSim/Framework/PluginLoader.cs
Expand Up @@ -217,7 +217,7 @@ private void initialize_plugin_dir_(string dir)
}

suppress_console_output_(true);
Directory.CreateDirectory("addin-db-001\\addin-dir-data");
Directory.CreateDirectory("addin-db-001/addin-dir-data");
AddinManager.Initialize(dir);
AddinManager.Registry.Update(null);
suppress_console_output_(false);
Expand Down
16 changes: 13 additions & 3 deletions OpenSim/Framework/Servers/BaseOpenSimServer.cs
Expand Up @@ -310,13 +310,23 @@ public virtual void Startup()
/// Should be overriden and referenced by descendents if they need to perform extra shutdown processing
/// </summary>
public virtual void Shutdown()
{
// Use a status of 64 (0b01000000) to indicate that this "error" is an explicit shutdown and not a real error.
Shutdown(64);
}

/// <summary>
/// Shutdown the server with the specified exit code.
/// </summary>
/// <param name="exitCode">The exit code to be returned once shutdown has completed.</param>
public void Shutdown(int exitCode)
{
ShutdownSpecific();

m_log.Info("[SHUTDOWN]: Shutdown processing on main thread complete. Exiting...");
RemovePIDFile();
Environment.Exit(0);

Environment.Exit(exitCode);
}

private void HandleQuit(string module, string[] args)
Expand Down
7 changes: 6 additions & 1 deletion OpenSim/Framework/Servers/HttpServer/AsyncHttpRequest.cs
Expand Up @@ -88,7 +88,12 @@ public class AsyncHttpRequest
RequestData.Add("http-method", HttpRequest.HttpMethod);

foreach (string queryname in querystringkeys)
RequestData.Add(queryname, HttpRequest.QueryString[queryname]);
{
// HttpRequest.QueryString.AllKeys returns a one-item array, with a null only,
// if passed something without an '=' in the query, such as URL/?abc or URL/?abc+def
if (queryname != null)
RequestData.Add(queryname, HttpRequest.QueryString[queryname]);
}

foreach (string headername in rHeaders)
headervals[headername] = HttpRequest.Headers[headername];
Expand Down
10 changes: 8 additions & 2 deletions OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
Expand Up @@ -1253,8 +1253,14 @@ private byte[] HandleContentVerbs(OSHttpRequest request, OSHttpResponse response
{
// m_log.DebugFormat(
// "[BASE HTTP SERVER]: Got query paremeter {0}={1}", queryname, request.QueryString[queryname]);
keysvals.Add(queryname, request.QueryString[queryname]);
requestVars.Add(queryname, keysvals[queryname]);

// HttpRequest.QueryString.AllKeys returns a one-item array, with a null only,
// if passed something without an '=' in the query, such as URL/?abc or URL/?abc+def
if (queryname != null)
{
keysvals.Add(queryname, request.QueryString[queryname]);
requestVars.Add(queryname, keysvals[queryname]);
}
}

foreach (string headername in rHeaders)
Expand Down
2 changes: 1 addition & 1 deletion OpenSim/Grid/GridServer/GridServerBase.cs
Expand Up @@ -115,7 +115,7 @@ public object GridServerShutdownHandler(IList args, IPEndPoint remoteClient)
System.Threading.Thread.Sleep(delay * 1000);

// Do this on a new thread so the actual shutdown call returns successfully.
Task.Factory.StartNew(() => Shutdown());
Task.Factory.StartNew(Shutdown);
}
catch (Exception e)
{
Expand Down
5 changes: 5 additions & 0 deletions OpenSim/Grid/GridServer/Program.cs
Expand Up @@ -25,6 +25,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

using System;
using System.Net;
using log4net.Config;
using log4net;
Expand All @@ -40,6 +41,10 @@ public static class Program
public static void Main(string[] args)
{
// Please note that if you are changing something in this function you should check to see if you need to change the other server's Main functions as well.

// Under any circumstance other than an explicit exit the exit code should be 1.
Environment.ExitCode = 1;

ServicePointManager.DefaultConnectionLimit = 12;

// Add the arguments supplied when running the application to the configuration
Expand Down
6 changes: 5 additions & 1 deletion OpenSim/Grid/MessagingServer/Main.cs
Expand Up @@ -70,6 +70,10 @@ public class OpenMessage_Main : BaseOpenSimServer, IGridServiceCore
public static void Main(string[] args)
{
// Please note that if you are changing something in this function you should check to see if you need to change the other server's Main functions as well.

// Under any circumstance other than an explicit exit the exit code should be 1.
Environment.ExitCode = 1;

ServicePointManager.DefaultConnectionLimit = 12;

// Add the arguments supplied when running the application to the configuration
Expand Down Expand Up @@ -189,7 +193,7 @@ public object MessagingServerShutdownHandler(IList args, IPEndPoint remoteClient
System.Threading.Thread.Sleep(delay * 1000);

// Do this on a new thread so the actual shutdown call returns successfully.
Task.Factory.StartNew(() => Shutdown());
Task.Factory.StartNew(Shutdown);
}
catch (Exception e)
{
Expand Down
4 changes: 4 additions & 0 deletions OpenSim/Grid/UserServer/Main.cs
Expand Up @@ -88,6 +88,10 @@ public class OpenUser_Main : BaseOpenSimServer, IGridServiceCore
public static void Main(string[] args)
{
// Please note that if you are changing something in this function you should check to see if you need to change the other server's Main functions as well.

// Under any circumstance other than an explicit exit the exit code should be 1.
Environment.ExitCode = 1;

ServicePointManager.DefaultConnectionLimit = 12;

// Add the arguments supplied when running the application to the configuration
Expand Down
13 changes: 12 additions & 1 deletion OpenSim/Region/CoreModules/Agent/SceneView/SceneView.cs
Expand Up @@ -788,12 +788,23 @@ public void SendPrimUpdates()
{
if (m_updateTimes.ContainsKey(part.LocalId))
{
m_updateTimes.Remove(part.LocalId);
sendKill = true;
// If we are going to send a kill, it is for the complete object.
// We are telling the viewer to nuke everything it knows about ALL of
// the prims, not just the child prim. So we need to remove ALL of the
// prims from m_updateTimes before continuing.
IReadOnlyCollection<SceneObjectPart> sogPrims = part.ParentGroup.GetParts();
foreach (SceneObjectPart prim in sogPrims)
{
m_updateTimes.Remove(prim.LocalId);
}
}
}

//Only send the kill object packet if we have seen this object
//Note: I'm not sure we should be sending a kill at all in this case. -Jim
// The viewer has already hidden the object if outside DD, and the
// KillObject causes the viewer to discard its cache of the objects.
if (sendKill)
m_presence.ControllingClient.SendNonPermanentKillObject(m_presence.Scene.RegionInfo.RegionHandle,
part.ParentGroup.RootPart.LocalId);
Expand Down
9 changes: 7 additions & 2 deletions OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs
Expand Up @@ -506,7 +506,7 @@ public void AsyncHttpRequest(IHttpServer server, string path, OSHttpRequest http
String[] keys = (String[])de.Value;
foreach (String key in keys)
{
if (request.ContainsKey(key))
if ((key != null) && request.ContainsKey(key))
{
string val = (String)request[key];
queryString = queryString + key + "=" + val + "&";
Expand All @@ -518,11 +518,16 @@ public void AsyncHttpRequest(IHttpServer server, string path, OSHttpRequest http
}
}

// Grab the raw unprocessed original query string, if any.
int rawQueryPos = httpRequest.Url.Query.IndexOf('?');
string rawQueryStr = (rawQueryPos < 0) ? httpRequest.Url.Query : httpRequest.Url.Query.Substring(rawQueryPos + 1);

//if this machine is behind DNAT/port forwarding, currently this is being
//set to address of port forwarding router
requestData.headers["x-remote-ip"] = httpRequest.RemoteIPEndPoint.ToString();
requestData.headers["x-path-info"] = pathInfo;
requestData.headers["x-query-string"] = queryString;
requestData.headers["x-query-string"] = rawQueryStr; // raw original (SL-compatible)
requestData.headers["x-query-string-compat"] = queryString; // processed (old Halcyon scripts)
requestData.headers["x-script-url"] = urlData.url;

lock (m_RequestMap)
Expand Down
Expand Up @@ -167,6 +167,7 @@ public void setEstateTerrainBaseTexture(IClientAPI remoteClient, int corner, UUI
break;
}
m_scene.RegionInfo.RegionSettings.Save();
m_scene.MarkMapTileTainted(WorldMapTaintReason.TerrainTextureChange);
}

public void setEstateTerrainTextureHeights(IClientAPI client, int corner, float lowValue, float highValue)
Expand All @@ -191,6 +192,7 @@ public void setEstateTerrainTextureHeights(IClientAPI client, int corner, float
break;
}
m_scene.RegionInfo.RegionSettings.Save();
m_scene.MarkMapTileTainted(WorldMapTaintReason.TerrainTextureChange);
}

private void handleCommitEstateTerrainTextureRequest(IClientAPI remoteClient)
Expand Down
3 changes: 3 additions & 0 deletions OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs
Expand Up @@ -511,6 +511,9 @@ private void EventManager_OnTerrainTick()
m_scene.PhysicsScene.SetTerrain(m_channel.GetFloatsSerialized(), m_channel.IncrementRevisionNumber());
m_scene.SaveTerrain();

// Mark the worldmap as tainted so that the push to the map tile server can happen when the time comes.
m_scene.MarkMapTileTainted(WorldMapTaintReason.TerrainElevationChange);

// Clients who look at the map will never see changes after they looked at the map, so i've commented this out.
//m_scene.CreateTerrainTexture(true);
}
Expand Down
Expand Up @@ -34,6 +34,6 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
public interface IMapTileTerrainRenderer
{
void Initialize(Scene scene, IConfigSource config);
void TerrainToBitmap(Bitmap mapbmp);
void TerrainToBitmap(DirectBitmap mapbmp);
}
}

0 comments on commit 554a4ac

Please sign in to comment.