Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor

avinationmerge
Melanie 2010-10-23 00:20:18 +02:00
commit 9fa915bdef
5 changed files with 49 additions and 37 deletions

View File

@ -3453,7 +3453,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
avp.Sender.IsTrial = false; avp.Sender.IsTrial = false;
avp.Sender.ID = agentID; avp.Sender.ID = agentID;
m_log.DebugFormat("[CLIENT]: Sending appearance for {0} to {1}", agentID.ToString(), AgentId.ToString()); //m_log.DebugFormat("[CLIENT]: Sending appearance for {0} to {1}", agentID.ToString(), AgentId.ToString());
OutPacket(avp, ThrottleOutPacketType.Task); OutPacket(avp, ThrottleOutPacketType.Task);
} }

View File

@ -617,8 +617,6 @@ namespace OpenSim.Region.Framework.Scenes
StatsReporter.OnSendStatsResult += SendSimStatsPackets; StatsReporter.OnSendStatsResult += SendSimStatsPackets;
StatsReporter.OnStatsIncorrect += m_sceneGraph.RecalculateStats; StatsReporter.OnStatsIncorrect += m_sceneGraph.RecalculateStats;
StatsReporter.SetObjectCapacity(RegionInfo.ObjectCapacity);
// Old // Old
/* /*
m_simulatorVersion = simulatorVersion m_simulatorVersion = simulatorVersion
@ -2468,7 +2466,7 @@ namespace OpenSim.Region.Framework.Scenes
} }
catch (Exception e) catch (Exception e)
{ {
m_log.WarnFormat("[SCENE]: Problem casting object: {0}", e.Message); m_log.WarnFormat("[SCENE]: Problem casting object: " + e.ToString());
return false; return false;
} }
@ -3466,7 +3464,7 @@ namespace OpenSim.Region.Framework.Scenes
} }
catch (Exception e) catch (Exception e)
{ {
m_log.DebugFormat("[CONNECTION BEGIN]: Exception verifying presence {0}", e.Message); m_log.ErrorFormat("[CONNECTION BEGIN]: Exception verifying presence " + e.ToString());
return false; return false;
} }
@ -3477,7 +3475,7 @@ namespace OpenSim.Region.Framework.Scenes
} }
catch (Exception e) catch (Exception e)
{ {
m_log.DebugFormat("[CONNECTION BEGIN]: Exception authorizing user {0}", e.Message); m_log.ErrorFormat("[CONNECTION BEGIN]: Exception authorizing user " + e.ToString());
return false; return false;
} }

View File

@ -108,7 +108,7 @@ namespace OpenSim.Region.Framework.Scenes
private int m_activeScripts = 0; private int m_activeScripts = 0;
private int m_scriptLinesPerSecond = 0; private int m_scriptLinesPerSecond = 0;
private int objectCapacity = 45000; private int m_objectCapacity = 45000;
private Scene m_scene; private Scene m_scene;
@ -124,6 +124,7 @@ namespace OpenSim.Region.Framework.Scenes
m_scene = scene; m_scene = scene;
ReportingRegion = scene.RegionInfo; ReportingRegion = scene.RegionInfo;
m_objectCapacity = scene.RegionInfo.ObjectCapacity;
m_report.AutoReset = true; m_report.AutoReset = true;
m_report.Interval = statsUpdatesEveryMS; m_report.Interval = statsUpdatesEveryMS;
m_report.Elapsed += new ElapsedEventHandler(statsHeartBeat); m_report.Elapsed += new ElapsedEventHandler(statsHeartBeat);
@ -271,7 +272,7 @@ namespace OpenSim.Region.Framework.Scenes
SimStats simStats SimStats simStats
= new SimStats( = new SimStats(
ReportingRegion.RegionLocX, ReportingRegion.RegionLocY, regionFlags, (uint)objectCapacity, rb, sb, m_scene.RegionInfo.originRegionID); ReportingRegion.RegionLocX, ReportingRegion.RegionLocY, regionFlags, (uint)m_objectCapacity, rb, sb, m_scene.RegionInfo.originRegionID);
handlerSendStatResult = OnSendStatsResult; handlerSendStatResult = OnSendStatsResult;
if (handlerSendStatResult != null) if (handlerSendStatResult != null)
@ -435,11 +436,6 @@ namespace OpenSim.Region.Framework.Scenes
m_activeScripts = count; m_activeScripts = count;
} }
public void SetObjectCapacity(int objects)
{
objectCapacity = objects;
}
/// <summary> /// <summary>
/// This is for llGetRegionFPS /// This is for llGetRegionFPS
/// </summary> /// </summary>

View File

@ -83,7 +83,6 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule
// private int m_stipend = 1000; // private int m_stipend = 1000;
// private int ObjectCapacity = 45000;
private int ObjectCount = 0; private int ObjectCount = 0;
private int PriceEnergyUnit = 0; private int PriceEnergyUnit = 0;
private int PriceGroupCreate = 0; private int PriceGroupCreate = 0;
@ -135,7 +134,6 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule
public void AddRegion(Scene scene) public void AddRegion(Scene scene)
{ {
// Send ObjectCapacity to Scene.. Which sends it to the SimStatsReporter.
if (m_enabled) if (m_enabled)
{ {
scene.RegisterModuleInterface<IMoneyModule>(this); scene.RegisterModuleInterface<IMoneyModule>(this);

View File

@ -3824,7 +3824,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if (targetPart != null) if (targetPart != null)
{ {
if (parent != 0) { if (parent != 0)
{
parentPrim = m_host.ParentGroup; parentPrim = m_host.ParentGroup;
childPrim = targetPart.ParentGroup; childPrim = targetPart.ParentGroup;
} }
@ -5426,7 +5427,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
} }
} }
} }
else { else
{
object[] array = new object[src.Length]; object[] array = new object[src.Length];
Array.Copy(src.Data, 0, array, 0, src.Length); Array.Copy(src.Data, 0, array, 0, src.Length);
result = new LSL_List(array); result = new LSL_List(array);
@ -6271,7 +6273,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
SetParticleSystem(m_host, rules); SetParticleSystem(m_host, rules);
} }
private void SetParticleSystem(SceneObjectPart part, LSL_List rules) { private void SetParticleSystem(SceneObjectPart part, LSL_List rules)
{
if (rules.Length == 0) if (rules.Length == 0)
@ -7315,7 +7318,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
break; break;
} }
} }
} }
protected void SetPrimParams(SceneObjectPart part, LSL_List rules) protected void SetPrimParams(SceneObjectPart part, LSL_List rules)
@ -8965,17 +8967,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
* Convert separator and spacer lists to C# strings. * Convert separator and spacer lists to C# strings.
* Also filter out null strings so we don't hang. * Also filter out null strings so we don't hang.
*/ */
for (i = 0; i < seplen; i ++) { for (i = 0; i < seplen; i ++)
{
d = separray[i].ToString(); d = separray[i].ToString();
if (d.Length > 0) { if (d.Length > 0)
{
delarray[dellen++] = d; delarray[dellen++] = d;
} }
} }
seplen = dellen; seplen = dellen;
for (i = 0; i < spclen; i ++) { for (i = 0; i < spclen; i ++)
{
d = spcarray[i].ToString(); d = spcarray[i].ToString();
if (d.Length > 0) { if (d.Length > 0)
{
delarray[dellen++] = d; delarray[dellen++] = d;
} }
} }
@ -8983,7 +8989,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
/* /*
* Scan through source string from beginning to end. * Scan through source string from beginning to end.
*/ */
for (i = 0;;) { for (i = 0;;)
{
/* /*
* Find earliest delimeter in src starting at i (if any). * Find earliest delimeter in src starting at i (if any).
@ -8991,13 +8998,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
int earliestDel = -1; int earliestDel = -1;
int earliestSrc = srclen; int earliestSrc = srclen;
string earliestStr = null; string earliestStr = null;
for (j = 0; j < dellen; j ++) { for (j = 0; j < dellen; j ++)
{
d = delarray[j]; d = delarray[j];
if (d != null) { if (d != null)
{
int index = src.IndexOf(d, i); int index = src.IndexOf(d, i);
if (index < 0) { if (index < 0)
{
delarray[j] = null; // delim nowhere in src, don't check it anymore delarray[j] = null; // delim nowhere in src, don't check it anymore
} else if (index < earliestSrc) { }
else if (index < earliestSrc)
{
earliestSrc = index; // where delimeter starts in source string earliestSrc = index; // where delimeter starts in source string
earliestDel = j; // where delimeter is in delarray[] earliestDel = j; // where delimeter is in delarray[]
earliestStr = d; // the delimeter string from delarray[] earliestStr = d; // the delimeter string from delarray[]
@ -9009,7 +9021,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
/* /*
* Output source string starting at i through start of earliest delimeter. * Output source string starting at i through start of earliest delimeter.
*/ */
if (keepNulls || (earliestSrc > i)) { if (keepNulls || (earliestSrc > i))
{
outarray[outlen++] = src.Substring(i, earliestSrc - i); outarray[outlen++] = src.Substring(i, earliestSrc - i);
} }
@ -9021,7 +9034,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
/* /*
* If delimeter was a spacer, output the spacer. * If delimeter was a spacer, output the spacer.
*/ */
if (earliestDel >= seplen) { if (earliestDel >= seplen)
{
outarray[outlen++] = earliestStr; outarray[outlen++] = earliestStr;
} }
@ -9035,7 +9049,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
* Make up an exact-sized output array suitable for an LSL_List object. * Make up an exact-sized output array suitable for an LSL_List object.
*/ */
object[] outlist = new object[outlen]; object[] outlist = new object[outlen];
for (i = 0; i < outlen; i ++) { for (i = 0; i < outlen; i ++)
{
outlist[i] = new LSL_String(outarray[i]); outlist[i] = new LSL_String(outarray[i]);
} }
return new LSL_List(outlist); return new LSL_List(outlist);
@ -10002,12 +10017,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
SortedDictionary<int, float> parameters = new SortedDictionary<int, float>(); SortedDictionary<int, float> parameters = new SortedDictionary<int, float>();
object[] data = rules.Data; object[] data = rules.Data;
for (int i = 0; i < data.Length; ++i) { for (int i = 0; i < data.Length; ++i)
{
int type = Convert.ToInt32(data[i++].ToString()); int type = Convert.ToInt32(data[i++].ToString());
if (i >= data.Length) break; // odd number of entries => ignore the last if (i >= data.Length) break; // odd number of entries => ignore the last
// some special cases: Vector parameters are split into 3 float parameters (with type+1, type+2, type+3) // some special cases: Vector parameters are split into 3 float parameters (with type+1, type+2, type+3)
switch (type) { switch (type)
{
case ScriptBaseClass.CAMERA_FOCUS: case ScriptBaseClass.CAMERA_FOCUS:
case ScriptBaseClass.CAMERA_FOCUS_OFFSET: case ScriptBaseClass.CAMERA_FOCUS_OFFSET:
case ScriptBaseClass.CAMERA_POSITION: case ScriptBaseClass.CAMERA_POSITION:
@ -10213,12 +10230,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
Regex r = new Regex(authregex); Regex r = new Regex(authregex);
int[] gnums = r.GetGroupNumbers(); int[] gnums = r.GetGroupNumbers();
Match m = r.Match(url); Match m = r.Match(url);
if (m.Success) { if (m.Success)
for (int i = 1; i < gnums.Length; i++) { {
for (int i = 1; i < gnums.Length; i++)
{
//System.Text.RegularExpressions.Group g = m.Groups[gnums[i]]; //System.Text.RegularExpressions.Group g = m.Groups[gnums[i]];
//CaptureCollection cc = g.Captures; //CaptureCollection cc = g.Captures;
} }
if (m.Groups.Count == 5) { if (m.Groups.Count == 5)
{
httpHeaders["Authorization"] = String.Format("Basic {0}", Convert.ToBase64String(System.Text.ASCIIEncoding.ASCII.GetBytes(m.Groups[2].ToString() + ":" + m.Groups[3].ToString()))); httpHeaders["Authorization"] = String.Format("Basic {0}", Convert.ToBase64String(System.Text.ASCIIEncoding.ASCII.GetBytes(m.Groups[2].ToString() + ":" + m.Groups[3].ToString())));
url = m.Groups[1].ToString() + m.Groups[4].ToString(); url = m.Groups[1].ToString() + m.Groups[4].ToString();
} }