mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 00:46:02 +08:00
Added POST handler for /sims/ in the grid server
Removed asset/user config in grid mode in the region server Added "create user" command in the user server console Begun buggy code to send sim details to the grid at startup Drank whole pack of red bull in one night and made stupid jokes in SVN logs and C# comments
This commit is contained in:
@@ -1,82 +1,82 @@
|
||||
<?xml version="1.0" ?>
|
||||
<project name="OpenSim.RegionServer" default="build">
|
||||
<target name="build">
|
||||
<echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
|
||||
<mkdir dir="${project::get-base-directory()}/${build.dir}" />
|
||||
<copy todir="${project::get-base-directory()}/${build.dir}">
|
||||
<fileset basedir="${project::get-base-directory()}">
|
||||
</fileset>
|
||||
</copy>
|
||||
<csc target="library" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll">
|
||||
<resources prefix="OpenSim.RegionServer" dynamicprefix="true" >
|
||||
</resources>
|
||||
<sources failonempty="true">
|
||||
<include name="AgentAssetUpload.cs" />
|
||||
<include name="ConsoleCmds.cs" />
|
||||
<include name="Grid.cs" />
|
||||
<include name="OpenSimMain.cs" />
|
||||
<include name="OpenSimNetworkHandler.cs" />
|
||||
<include name="PacketServer.cs" />
|
||||
<include name="QueItem.cs" />
|
||||
<include name="RegionInfo.cs" />
|
||||
<include name="SimClient.cs" />
|
||||
<include name="SimConsole.cs" />
|
||||
<include name="VersionInfo.cs" />
|
||||
<include name="Assets/AssetCache.cs" />
|
||||
<include name="Assets/InventoryCache.cs" />
|
||||
<include name="CAPS/AdminWebFront.cs" />
|
||||
<include name="types/Mesh.cs" />
|
||||
<include name="types/Triangle.cs" />
|
||||
<include name="world/Avatar.cs" />
|
||||
<include name="world/AvatarAnimations.cs" />
|
||||
<include name="world/AvatarClient.cs" />
|
||||
<include name="world/AvatarUpdate.cs" />
|
||||
<include name="world/Entity.cs" />
|
||||
<include name="world/Primitive.cs" />
|
||||
<include name="world/Primitive2.cs" />
|
||||
<include name="world/ScriptEngine.cs" />
|
||||
<include name="world/SurfacePatch.cs" />
|
||||
<include name="world/World.cs" />
|
||||
<include name="world/WorldPacketHandlers.cs" />
|
||||
<include name="world/scripting/IScript.cs" />
|
||||
<include name="world/scripting/IScriptContext.cs" />
|
||||
<include name="world/scripting/IScriptEntity.cs" />
|
||||
<include name="world/scripting/IScriptHandler.cs" />
|
||||
<include name="world/scripting/Script.cs" />
|
||||
<include name="world/scripting/ScriptFactory.cs" />
|
||||
<include name="world/scripting/Scripts/FollowRandomAvatar.cs" />
|
||||
</sources>
|
||||
<references basedir="${project::get-base-directory()}">
|
||||
<lib>
|
||||
<include name="${project::get-base-directory()}" />
|
||||
<include name="${project::get-base-directory()}/${build.dir}" />
|
||||
</lib>
|
||||
<include name="System.dll" />
|
||||
<include name="System.Xml.dll" />
|
||||
<include name="../bin/libsecondlife.dll" />
|
||||
<include name="../bin/Axiom.MathLib.dll" />
|
||||
<include name="../bin/Db4objects.Db4o.dll" />
|
||||
<include name="../bin/OpenSim.Terrain.BasicTerrain.dll" />
|
||||
<include name="../bin/OpenSim.Framework.dll" />
|
||||
<include name="../bin/OpenSim.Framework.Console.dll" />
|
||||
<include name="../bin/OpenSim.GenericConfig.Xml.dll" />
|
||||
<include name="../bin/OpenSim.Physics.Manager.dll" />
|
||||
<include name="../bin/OpenSim.Servers.dll" />
|
||||
</references>
|
||||
</csc>
|
||||
<echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../bin/" />
|
||||
<mkdir dir="${project::get-base-directory()}/../bin/"/>
|
||||
<copy todir="${project::get-base-directory()}/../bin/">
|
||||
<fileset basedir="${project::get-base-directory()}/${build.dir}/" >
|
||||
<include name="*.dll"/>
|
||||
<include name="*.exe"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
</target>
|
||||
<target name="clean">
|
||||
<delete dir="${bin.dir}" failonerror="false" />
|
||||
<delete dir="${obj.dir}" failonerror="false" />
|
||||
</target>
|
||||
<target name="doc" description="Creates documentation.">
|
||||
</target>
|
||||
</project>
|
||||
<?xml version="1.0" ?>
|
||||
<project name="OpenSim.RegionServer" default="build">
|
||||
<target name="build">
|
||||
<echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
|
||||
<mkdir dir="${project::get-base-directory()}/${build.dir}" />
|
||||
<copy todir="${project::get-base-directory()}/${build.dir}">
|
||||
<fileset basedir="${project::get-base-directory()}">
|
||||
</fileset>
|
||||
</copy>
|
||||
<csc target="library" debug="${build.debug}" unsafe="False" define="TRACE" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll">
|
||||
<resources prefix="OpenSim.RegionServer" dynamicprefix="true" >
|
||||
</resources>
|
||||
<sources failonempty="true">
|
||||
<include name="AgentAssetUpload.cs" />
|
||||
<include name="ConsoleCmds.cs" />
|
||||
<include name="Grid.cs" />
|
||||
<include name="OpenSimMain.cs" />
|
||||
<include name="OpenSimNetworkHandler.cs" />
|
||||
<include name="PacketServer.cs" />
|
||||
<include name="QueItem.cs" />
|
||||
<include name="RegionInfo.cs" />
|
||||
<include name="SimClient.cs" />
|
||||
<include name="SimConsole.cs" />
|
||||
<include name="VersionInfo.cs" />
|
||||
<include name="Assets/AssetCache.cs" />
|
||||
<include name="Assets/InventoryCache.cs" />
|
||||
<include name="CAPS/AdminWebFront.cs" />
|
||||
<include name="types/Mesh.cs" />
|
||||
<include name="types/Triangle.cs" />
|
||||
<include name="world/Avatar.cs" />
|
||||
<include name="world/AvatarAnimations.cs" />
|
||||
<include name="world/AvatarClient.cs" />
|
||||
<include name="world/AvatarUpdate.cs" />
|
||||
<include name="world/Entity.cs" />
|
||||
<include name="world/Primitive.cs" />
|
||||
<include name="world/Primitive2.cs" />
|
||||
<include name="world/ScriptEngine.cs" />
|
||||
<include name="world/SurfacePatch.cs" />
|
||||
<include name="world/World.cs" />
|
||||
<include name="world/WorldPacketHandlers.cs" />
|
||||
<include name="world/scripting/IScript.cs" />
|
||||
<include name="world/scripting/IScriptContext.cs" />
|
||||
<include name="world/scripting/IScriptEntity.cs" />
|
||||
<include name="world/scripting/IScriptHandler.cs" />
|
||||
<include name="world/scripting/Script.cs" />
|
||||
<include name="world/scripting/ScriptFactory.cs" />
|
||||
<include name="world/scripting/Scripts/FollowRandomAvatar.cs" />
|
||||
</sources>
|
||||
<references basedir="${project::get-base-directory()}">
|
||||
<lib>
|
||||
<include name="${project::get-base-directory()}" />
|
||||
<include name="${project::get-base-directory()}/${build.dir}" />
|
||||
</lib>
|
||||
<include name="System.dll" />
|
||||
<include name="System.Xml.dll" />
|
||||
<include name="../bin/libsecondlife.dll" />
|
||||
<include name="../bin/Axiom.MathLib.dll" />
|
||||
<include name="../bin/Db4objects.Db4o.dll" />
|
||||
<include name="../bin/OpenSim.Terrain.BasicTerrain.dll" />
|
||||
<include name="../bin/OpenSim.Framework.dll" />
|
||||
<include name="../bin/OpenSim.Framework.Console.dll" />
|
||||
<include name="../bin/OpenSim.GenericConfig.Xml.dll" />
|
||||
<include name="../bin/OpenSim.Physics.Manager.dll" />
|
||||
<include name="../bin/OpenSim.Servers.dll" />
|
||||
</references>
|
||||
</csc>
|
||||
<echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../bin/" />
|
||||
<mkdir dir="${project::get-base-directory()}/../bin/"/>
|
||||
<copy todir="${project::get-base-directory()}/../bin/">
|
||||
<fileset basedir="${project::get-base-directory()}/${build.dir}/" >
|
||||
<include name="*.dll"/>
|
||||
<include name="*.exe"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
</target>
|
||||
<target name="clean">
|
||||
<delete dir="${bin.dir}" failonerror="false" />
|
||||
<delete dir="${obj.dir}" failonerror="false" />
|
||||
</target>
|
||||
<target name="doc" description="Creates documentation.">
|
||||
</target>
|
||||
</project>
|
||||
|
||||
@@ -114,7 +114,6 @@ namespace OpenSim
|
||||
}
|
||||
m_console.WriteLine("Main.cs:Startup() - Loading configuration");
|
||||
this.regionData.InitConfig(this.m_sandbox, this.localConfig);
|
||||
//regionData.SimUUID = new LLUUID(localConfig.GetAttribute("SimUUID")); //don't need as regionData.SimUUID is already set through the above line
|
||||
this.localConfig.Close();//for now we can close it as no other classes read from it , but this should change
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Net;
|
||||
using System.Web;
|
||||
using System.IO;
|
||||
using OpenSim.Framework.Interfaces;
|
||||
using OpenSim.Framework.Utilities;
|
||||
using libsecondlife;
|
||||
@@ -34,7 +37,37 @@ namespace OpenSim
|
||||
public RegionInfo()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void SaveToGrid()
|
||||
{
|
||||
string reqtext;
|
||||
reqtext="<authkey>" + this.GridSendKey + "</authkey>";
|
||||
reqtext+="<sim>";
|
||||
reqtext+="<uuid>" + this.SimUUID.ToString() + "</uuid>";
|
||||
reqtext+="<regionname>" + this.RegionName + "</regionname>";
|
||||
reqtext+="<sim_ip>" + this.IPListenAddr + "</sim_ip>";
|
||||
reqtext+="<sim_port>" + this.IPListenPort.ToString() + "</sim_port>";
|
||||
reqtext+="<region_locx>" + this.RegionLocX.ToString() + "</region_locx>";
|
||||
reqtext+="<region_locy>" + this.RegionLocY.ToString() + "</region_locy>";
|
||||
reqtext+="<estate_id>1</estate_id>";
|
||||
reqtext+="</sim>";
|
||||
|
||||
WebRequest GridSaveReq = WebRequest.Create(this.GridURL + "sims/" + this.SimUUID.ToString());
|
||||
GridSaveReq.Method = "POST";
|
||||
GridSaveReq.ContentType = "text/plaintext";
|
||||
GridSaveReq.ContentLength = reqtext.Length;
|
||||
|
||||
StreamWriter stOut = new StreamWriter(GridSaveReq.GetRequestStream(), System.Text.Encoding.ASCII);
|
||||
stOut.Write(reqtext);
|
||||
stOut.Close();
|
||||
|
||||
StreamReader stIn = new StreamReader(GridSaveReq.GetResponse().GetResponseStream());
|
||||
string GridResponse = stIn.ReadToEnd();
|
||||
stIn.Close();
|
||||
|
||||
OpenSim.Framework.Console.MainConsole.Instance.WriteLine("RegionInfo.CS:SaveToGrid() - Grid said: " + GridResponse);
|
||||
}
|
||||
|
||||
public void InitConfig(bool sandboxMode, IGenericConfig configData)
|
||||
{
|
||||
@@ -122,31 +155,7 @@ namespace OpenSim
|
||||
{
|
||||
//shouldn't be reading this data in here, it should be up to the classes implementing the server interfaces to read what they need from the config object
|
||||
|
||||
// Asset Server URL
|
||||
attri = "";
|
||||
attri = configData.GetAttribute("AssetServerURL");
|
||||
if (attri == "")
|
||||
{
|
||||
this.AssetURL = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Asset server URL: ");
|
||||
configData.SetAttribute("AssetServerURL", this.AssetURL);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.AssetURL = attri;
|
||||
}
|
||||
//Asset Server key
|
||||
attri = "";
|
||||
attri = configData.GetAttribute("AssetServerKey");
|
||||
if (attri == "")
|
||||
{
|
||||
this.AssetSendKey = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Asset server key: ");
|
||||
configData.SetAttribute("AssetServerKey", this.AssetSendKey);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.AssetSendKey = attri;
|
||||
}
|
||||
//Grid Sever URL
|
||||
//Grid Server URL
|
||||
attri = "";
|
||||
attri = configData.GetAttribute("GridServerURL");
|
||||
if (attri == "")
|
||||
@@ -158,6 +167,7 @@ namespace OpenSim
|
||||
{
|
||||
this.GridURL = attri;
|
||||
}
|
||||
|
||||
//Grid Send Key
|
||||
attri = "";
|
||||
attri = configData.GetAttribute("GridSendKey");
|
||||
@@ -170,6 +180,7 @@ namespace OpenSim
|
||||
{
|
||||
this.GridSendKey = attri;
|
||||
}
|
||||
|
||||
//Grid Receive Key
|
||||
attri = "";
|
||||
attri = configData.GetAttribute("GridRecvKey");
|
||||
@@ -181,45 +192,12 @@ namespace OpenSim
|
||||
else
|
||||
{
|
||||
this.GridRecvKey = attri;
|
||||
}
|
||||
//User Server URL
|
||||
attri = "";
|
||||
attri = configData.GetAttribute("UserServerURL");
|
||||
if (attri == "")
|
||||
{
|
||||
this.UserURL = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("User server URL: ");
|
||||
configData.SetAttribute("UserServerURL", this.UserURL);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.UserURL = attri;
|
||||
}
|
||||
//User Send Key
|
||||
attri = "";
|
||||
attri = configData.GetAttribute("UserSendKey");
|
||||
if (attri == "")
|
||||
{
|
||||
this.UserSendKey = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Key to send to user server: ");
|
||||
configData.SetAttribute("UserSendKey", this.UserSendKey);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.UserSendKey = attri;
|
||||
}
|
||||
//User Receive Key
|
||||
attri = "";
|
||||
attri = configData.GetAttribute("UserRecvKey");
|
||||
if (attri == "")
|
||||
{
|
||||
this.UserRecvKey = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Key to expect from user server: ");
|
||||
configData.SetAttribute("UserRecvKey", this.UserRecvKey);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.UserRecvKey = attri;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
this.RegionHandle = Util.UIntsToLong((RegionLocX * 256), (RegionLocY * 256));
|
||||
this.SaveToGrid();
|
||||
configData.Commit();
|
||||
}
|
||||
catch (Exception e)
|
||||
|
||||
Reference in New Issue
Block a user