mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 08:55:56 +08:00
* Mother of all commits:
* Cleaned up copyright notices in AssemblyInfo.cs's * Added Copyright headers to a bunch of files missing them * Replaced several common string instances with a static constant to prevent reallocation of the same strings thousands of times. "" -> String.Empty is the first such candidate.
This commit is contained in:
@@ -88,7 +88,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
|
||||
//type.InvokeMember(EventName, BindingFlags.InvokeMethod, null, m_Script, args);
|
||||
|
||||
//Console.WriteLine("ScriptEngine Executor.ExecuteEvent: \"" + EventName + "\"");
|
||||
//Console.WriteLine("ScriptEngine Executor.ExecuteEvent: \String.Empty + EventName + "\String.Empty);
|
||||
|
||||
if (Events.ContainsKey(EventName) == false)
|
||||
{
|
||||
@@ -112,7 +112,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
|
||||
if (ev == null) // No event by that name!
|
||||
{
|
||||
//Console.WriteLine("ScriptEngine Can not find any event named: \"" + EventName + "\"");
|
||||
//Console.WriteLine("ScriptEngine Can not find any event named: \String.Empty + EventName + "\String.Empty);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
|
||||
|
||||
public LSL_BuiltIn_Commands_Interface m_LSL_Functions;
|
||||
private string _Source = "";
|
||||
private string _Source = String.Empty;
|
||||
public string Source
|
||||
{
|
||||
get
|
||||
|
||||
@@ -297,7 +297,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
|
||||
public int llListen(int channelID, string name, string ID, string msg)
|
||||
{
|
||||
if (ID == "")
|
||||
if (ID == String.Empty)
|
||||
{
|
||||
ID = LLUUID.Zero.ToString();
|
||||
}
|
||||
@@ -338,19 +338,19 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
public string llDetectedName(int number)
|
||||
{
|
||||
NotImplemented("llDetectedName");
|
||||
return "";
|
||||
return String.Empty;
|
||||
}
|
||||
|
||||
public string llDetectedKey(int number)
|
||||
{
|
||||
NotImplemented("llDetectedKey");
|
||||
return "";
|
||||
return String.Empty;
|
||||
}
|
||||
|
||||
public string llDetectedOwner(int number)
|
||||
{
|
||||
NotImplemented("llDetectedOwner");
|
||||
return "";
|
||||
return String.Empty;
|
||||
}
|
||||
|
||||
public int llDetectedType(int number)
|
||||
@@ -693,7 +693,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
return texface.TextureID.ToString();
|
||||
}
|
||||
NotImplemented("llGetTexture");
|
||||
return "";
|
||||
return String.Empty;
|
||||
}
|
||||
|
||||
public void llSetPos(LSL_Types.Vector3 pos)
|
||||
@@ -1175,7 +1175,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
public string llGetPermissionsKey()
|
||||
{
|
||||
NotImplemented("llGetPermissionsKey");
|
||||
return "";
|
||||
return String.Empty;
|
||||
}
|
||||
|
||||
public int llGetPermissions()
|
||||
@@ -1336,7 +1336,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
public string llGetInventoryName(int type, int number)
|
||||
{
|
||||
NotImplemented("llGetInventoryName");
|
||||
return "";
|
||||
return String.Empty;
|
||||
}
|
||||
|
||||
public void llSetScriptState(string name, int run)
|
||||
@@ -1378,13 +1378,13 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
public string llRequestAgentData(string id, int data)
|
||||
{
|
||||
NotImplemented("llRequestAgentData");
|
||||
return "";
|
||||
return String.Empty;
|
||||
}
|
||||
|
||||
public string llRequestInventoryData(string name)
|
||||
{
|
||||
NotImplemented("llRequestInventoryData");
|
||||
return "";
|
||||
return String.Empty;
|
||||
}
|
||||
|
||||
public void llSetDamage(double damage)
|
||||
@@ -1473,7 +1473,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
public string llGetAnimation(string id)
|
||||
{
|
||||
NotImplemented("llGetAnimation");
|
||||
return "";
|
||||
return String.Empty;
|
||||
}
|
||||
|
||||
public void llResetScript()
|
||||
@@ -1495,7 +1495,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
|
||||
public string llGetScriptName()
|
||||
{
|
||||
return "";
|
||||
return String.Empty;
|
||||
}
|
||||
|
||||
public int llGetNumberOfSides()
|
||||
@@ -1534,7 +1534,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
|
||||
public string llGetInventoryKey(string name)
|
||||
{
|
||||
return "";
|
||||
return String.Empty;
|
||||
}
|
||||
|
||||
public void llAllowInventoryDrop(int add)
|
||||
@@ -1592,7 +1592,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
public string llGetOwnerKey(string id)
|
||||
{
|
||||
NotImplemented("llGetOwnerKey");
|
||||
return "";
|
||||
return String.Empty;
|
||||
}
|
||||
|
||||
public LSL_Types.Vector3 llGetCenterOfMass()
|
||||
@@ -1610,14 +1610,14 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
// s = 1;
|
||||
//int c = 0;
|
||||
//LSL_Types.list chunk = new LSL_Types.list();
|
||||
//string chunkString = "";
|
||||
//string chunkString = String.Empty;
|
||||
//foreach (string element in src)
|
||||
//{
|
||||
// c++;
|
||||
// if (c > s)
|
||||
// {
|
||||
// sorted.Add(chunkString, chunk);
|
||||
// chunkString = "";
|
||||
// chunkString = String.Empty;
|
||||
// chunk = new LSL_Types.list();
|
||||
// c = 0;
|
||||
// }
|
||||
@@ -1693,7 +1693,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
}
|
||||
if (index >= src.Length)
|
||||
{
|
||||
return "";
|
||||
return String.Empty;
|
||||
}
|
||||
return src.Data[index].ToString();
|
||||
}
|
||||
@@ -1814,7 +1814,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
|
||||
public string llList2CSV(LSL_Types.list src)
|
||||
{
|
||||
string ret = "";
|
||||
string ret = String.Empty;
|
||||
foreach (object o in src.Data)
|
||||
{
|
||||
ret = ret + o.ToString() + ",";
|
||||
@@ -1968,7 +1968,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
public string llKey2Name(string id)
|
||||
{
|
||||
NotImplemented("llKey2Name");
|
||||
return "";
|
||||
return String.Empty;
|
||||
}
|
||||
|
||||
public void llSetTextureAnim(int mode, int face, int sizex, int sizey, double start, double length, double rate)
|
||||
@@ -2006,7 +2006,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
public string llGetNotecardLine(string name, int line)
|
||||
{
|
||||
NotImplemented("llGetNotecardLine");
|
||||
return "";
|
||||
return String.Empty;
|
||||
}
|
||||
|
||||
public LSL_Types.Vector3 llGetAgentSize(string id)
|
||||
@@ -2257,7 +2257,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
if (AVID != LLUUID.Zero)
|
||||
return AVID.ToString();
|
||||
else
|
||||
return "";
|
||||
return String.Empty;
|
||||
}
|
||||
|
||||
public void llAddToLandPassList(string avatar, double hours)
|
||||
@@ -2289,9 +2289,9 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
{
|
||||
if (src.Length == 0)
|
||||
{
|
||||
return "";
|
||||
return String.Empty;
|
||||
}
|
||||
string ret = "";
|
||||
string ret = String.Empty;
|
||||
foreach (object o in src.Data)
|
||||
{
|
||||
ret = ret + o.ToString() + seperator;
|
||||
@@ -2352,7 +2352,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
if (xmlrpcMod.IsEnabled())
|
||||
{
|
||||
LLUUID channelID = xmlrpcMod.OpenXMLRPCChannel(m_localID, m_itemID);
|
||||
object[] resobj = new object[] { 1, channelID.ToString(), LLUUID.Zero.ToString(), "", 0, "" };
|
||||
object[] resobj = new object[] { 1, channelID.ToString(), LLUUID.Zero.ToString(), String.Empty, 0, String.Empty };
|
||||
m_ScriptEngine.m_EventQueueManager.AddToScriptQueue(m_localID, m_itemID, "remote_data", resobj);
|
||||
}
|
||||
}
|
||||
@@ -2360,7 +2360,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
public string llSendRemoteData(string channel, string dest, int idata, string sdata)
|
||||
{
|
||||
NotImplemented("llSendRemoteData");
|
||||
return "";
|
||||
return String.Empty;
|
||||
}
|
||||
|
||||
public void llRemoteDataReply(string channel, string message_id, string sdata, int idata)
|
||||
@@ -2578,7 +2578,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
public string llGetNumberOfNotecardLines(string name)
|
||||
{
|
||||
NotImplemented("llGetNumberOfNotecardLines");
|
||||
return "";
|
||||
return String.Empty;
|
||||
}
|
||||
|
||||
public LSL_Types.list llGetBoundingBox(string obj)
|
||||
@@ -2600,7 +2600,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
public string llIntegerToBase64(int number)
|
||||
{
|
||||
NotImplemented("llIntegerToBase64");
|
||||
return "";
|
||||
return String.Empty;
|
||||
}
|
||||
|
||||
public int llBase64ToInteger(string str)
|
||||
@@ -2660,7 +2660,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
public string llGetInventoryCreator(string item)
|
||||
{
|
||||
NotImplemented("llGetInventoryCreator");
|
||||
return "";
|
||||
return String.Empty;
|
||||
}
|
||||
|
||||
public void llOwnerSay(string msg)
|
||||
@@ -2828,7 +2828,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
|
||||
public string llXorBase64StringsCorrect(string str1, string str2)
|
||||
{
|
||||
string ret = "";
|
||||
string ret = String.Empty;
|
||||
string src1 = llBase64ToString(str1);
|
||||
string src2 = llBase64ToString(str2);
|
||||
int c = 0;
|
||||
@@ -3002,7 +3002,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
public string osSetDynamicTextureURL(string dynamicID, string contentType, string url, string extraParams,
|
||||
int timer)
|
||||
{
|
||||
if (dynamicID == "")
|
||||
if (dynamicID == String.Empty)
|
||||
{
|
||||
IDynamicTextureManager textureManager = World.RequestModuleInterface<IDynamicTextureManager>();
|
||||
LLUUID createdTexture =
|
||||
|
||||
@@ -429,10 +429,10 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
public override string ToString()
|
||||
{
|
||||
string output;
|
||||
output = "";
|
||||
output = String.Empty;
|
||||
if (m_data.Length == 0)
|
||||
{
|
||||
return "";
|
||||
return String.Empty;
|
||||
}
|
||||
foreach (object o in m_data)
|
||||
{
|
||||
|
||||
@@ -1,3 +1,31 @@
|
||||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSim Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
@@ -10,7 +38,7 @@ using System.Runtime.InteropServices;
|
||||
[assembly : AssemblyConfiguration("")]
|
||||
[assembly : AssemblyCompany("")]
|
||||
[assembly : AssemblyProduct("OpenSim.Region.ScriptEngine.Common")]
|
||||
[assembly : AssemblyCopyright("Copyright © 2007")]
|
||||
[assembly : AssemblyCopyright("Copyright © OpenSimulator.org Developers 2007-2008")]
|
||||
[assembly : AssemblyTrademark("")]
|
||||
[assembly : AssemblyCulture("")]
|
||||
|
||||
|
||||
@@ -148,7 +148,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
|
||||
// Handled by long commands
|
||||
public void timer(uint localID, LLUUID itemID)
|
||||
{
|
||||
//myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "");
|
||||
//myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, String.Empty);
|
||||
}
|
||||
|
||||
public void listen(uint localID, LLUUID itemID)
|
||||
|
||||
@@ -323,7 +323,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
|
||||
// Do we have any scripts in this object at all? If not, return
|
||||
if (m_ScriptEngine.m_ScriptManager.Scripts.ContainsKey(localID) == false)
|
||||
{
|
||||
//Console.WriteLine("Event \"" + FunctionName + "\" for localID: " + localID + ". No scripts found on this localID.");
|
||||
//Console.WriteLine("Event \String.Empty + FunctionName + "\" for localID: " + localID + ". No scripts found on this localID.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -259,7 +259,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
|
||||
//Deliver data to prim's remote_data handler
|
||||
object[] resobj = new object[]
|
||||
{
|
||||
2, rInfo.GetChannelKey().ToString(), rInfo.GetMessageID().ToString(), "",
|
||||
2, rInfo.GetChannelKey().ToString(), rInfo.GetMessageID().ToString(), String.Empty,
|
||||
rInfo.GetIntValue(),
|
||||
rInfo.GetStrVal()
|
||||
};
|
||||
|
||||
@@ -161,7 +161,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
|
||||
catch (ThreadAbortException tae)
|
||||
{
|
||||
string a = tae.ToString();
|
||||
a = "";
|
||||
a = String.Empty;
|
||||
// Expected
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user