* Fixed nebadon's UserServer crash bug from yesterday.

* Made Estate tools work for estate managers without needing to request admin status First
* Added code to make the Simulator version to be reported in the About box of the client
ThreadPoolClientBranch
Teravus Ovares 2008-02-09 07:53:01 +00:00
parent fc9bdb6c16
commit 07d0f558c4
5 changed files with 51 additions and 5 deletions

View File

@ -427,6 +427,8 @@ namespace OpenSim.Framework.UserManagement
if (userProfile != null) if (userProfile != null)
{ {
// This line needs to be in side the above if statement or the UserServer will crash on some logouts.
m_log.Info("[LOGOUT]: " + userProfile.username + " " + userProfile.surname + " from " + regionhandle + "(" + posx + "," + posy + "," + posz + ")");
userAgent = userProfile.currentAgent; userAgent = userProfile.currentAgent;
if (userAgent != null) if (userAgent != null)
@ -434,7 +436,10 @@ namespace OpenSim.Framework.UserManagement
userAgent.agentOnline = false; userAgent.agentOnline = false;
userAgent.logoutTime = Util.UnixTimeSinceEpoch(); userAgent.logoutTime = Util.UnixTimeSinceEpoch();
userAgent.sessionID = LLUUID.Zero; userAgent.sessionID = LLUUID.Zero;
if (regionid != null)
{
userAgent.currentRegion = regionid; userAgent.currentRegion = regionid;
}
userAgent.currentHandle = regionhandle; userAgent.currentHandle = regionhandle;
userAgent.currentPos = currentPos; userAgent.currentPos = currentPos;
@ -446,9 +451,10 @@ namespace OpenSim.Framework.UserManagement
} }
else else
{ {
m_log.Info("[LOGOUT]: didn't save logout position, currentAgent: " + userAgent.ToString() ); // If currentagent is null, we can't reference it here or the UserServer crashes!
m_log.Info("[LOGOUT]: didn't save logout position: " + userid.ToString());
} }
m_log.Info("[LOGOUT]: " + userProfile.username + " " + userProfile.surname + " from " + regionhandle + "(" + posx + "," + posy + "," + posz + ")" );
} }
else else
{ {

View File

@ -52,6 +52,8 @@ namespace OpenSim.Framework
void Restart(int seconds); void Restart(int seconds);
bool OtherRegionUp(RegionInfo thisRegion); bool OtherRegionUp(RegionInfo thisRegion);
string GetSimulatorVersion();
RegionInfo RegionInfo { get; } RegionInfo RegionInfo { get; }
uint NextLocalId { get; } uint NextLocalId { get; }

View File

@ -87,7 +87,7 @@ namespace OpenSim.Region.ClientStack
private readonly uint m_circuitCode; private readonly uint m_circuitCode;
private int m_moneyBalance; private int m_moneyBalance;
private readonly byte[] m_channelVersion = new byte[] { 0x00 }; // Dummy value needed by libSL private byte[] m_channelVersion = Helpers.StringToField("OpenSimulator 0.5"); // Dummy value needed by libSL
/* protected variables */ /* protected variables */
@ -196,6 +196,8 @@ namespace OpenSim.Region.ClientStack
{ {
m_moneyBalance = 1000; m_moneyBalance = 1000;
m_channelVersion = Helpers.StringToField(scene.GetSimulatorVersion());
m_scene = scene; m_scene = scene;
m_assetCache = assetCache; m_assetCache = assetCache;
@ -609,8 +611,16 @@ namespace OpenSim.Region.ClientStack
{ {
RegionHandshakePacket handshake = (RegionHandshakePacket)PacketPool.Instance.GetPacket(PacketType.RegionHandshake); RegionHandshakePacket handshake = (RegionHandshakePacket)PacketPool.Instance.GetPacket(PacketType.RegionHandshake);
bool estatemanager = false;
LLUUID[] EstateManagers = regionInfo.EstateSettings.estateManagers;
for (int i = 0; i < EstateManagers.Length; i++)
{
if (EstateManagers[i] == AgentId)
estatemanager = true;
}
handshake.RegionInfo.BillableFactor = regionInfo.EstateSettings.billableFactor; handshake.RegionInfo.BillableFactor = regionInfo.EstateSettings.billableFactor;
handshake.RegionInfo.IsEstateManager = false; handshake.RegionInfo.IsEstateManager = estatemanager;
handshake.RegionInfo.TerrainHeightRange00 = regionInfo.EstateSettings.terrainHeightRange0; handshake.RegionInfo.TerrainHeightRange00 = regionInfo.EstateSettings.terrainHeightRange0;
handshake.RegionInfo.TerrainHeightRange01 = regionInfo.EstateSettings.terrainHeightRange1; handshake.RegionInfo.TerrainHeightRange01 = regionInfo.EstateSettings.terrainHeightRange1;
handshake.RegionInfo.TerrainHeightRange10 = regionInfo.EstateSettings.terrainHeightRange2; handshake.RegionInfo.TerrainHeightRange10 = regionInfo.EstateSettings.terrainHeightRange2;

View File

@ -82,6 +82,8 @@ namespace OpenSim.Region.Environment.Scenes
private readonly Timer m_restartTimer = new Timer(15000); // Wait before firing private readonly Timer m_restartTimer = new Timer(15000); // Wait before firing
private int m_incrementsof15seconds = 0; private int m_incrementsof15seconds = 0;
public string m_simulatorVersion = "OpenSimulator 0.5";
protected ModuleLoader m_moduleLoader; protected ModuleLoader m_moduleLoader;
protected StorageManager m_storageManager; protected StorageManager m_storageManager;
protected AgentCircuitManager m_authenticateHandler; protected AgentCircuitManager m_authenticateHandler;
@ -300,6 +302,22 @@ namespace OpenSim.Region.Environment.Scenes
m_statsReporter = new SimStatsReporter(regInfo); m_statsReporter = new SimStatsReporter(regInfo);
m_statsReporter.OnSendStatsResult += SendSimStatsPackets; m_statsReporter.OnSendStatsResult += SendSimStatsPackets;
string OSString = "";
if (System.Environment.OSVersion.Platform != PlatformID.Unix)
{
OSString = System.Environment.OSVersion.ToString();
}
else
{
OSString = Util.ReadEtcIssue();
}
if (OSString.Length > 45)
{
OSString = OSString.Substring(0,45);
}
m_simulatorVersion = "OpenSimulator v0.5-SVN on " + OSString + " ChilTasks:" + m_sendTasksToChild.ToString() + " PhysPrim:" + m_physicalPrim.ToString();
} }
#endregion #endregion
@ -313,6 +331,11 @@ namespace OpenSim.Region.Environment.Scenes
m_eventManager.OnPermissionError += SendPermissionAlert; m_eventManager.OnPermissionError += SendPermissionAlert;
} }
public override string GetSimulatorVersion()
{
return m_simulatorVersion;
}
public override bool OtherRegionUp(RegionInfo otherRegion) public override bool OtherRegionUp(RegionInfo otherRegion)
{ {
// Another region is up. // Another region is up.

View File

@ -167,6 +167,11 @@ namespace OpenSim.Region.Environment.Scenes
} }
public abstract bool OtherRegionUp(RegionInfo thisRegion); public abstract bool OtherRegionUp(RegionInfo thisRegion);
public virtual string GetSimulatorVersion()
{
return "OpenSimulator v0.5 SVN";
}
#endregion #endregion
#region Shutdown #region Shutdown