Merge branch 'master' into presence-refactor

This merge was very conflicted. I think I got them all, but I can't be sure.
I had to merge to master or risk divergence to the point of unmergeability.
This commit is contained in:
Melanie
2010-01-16 00:05:08 +00:00
56 changed files with 2913 additions and 531 deletions

View File

@@ -78,5 +78,13 @@ namespace OpenSim.Framework
/// </summary>
public UUID SessionID;
public byte State;
public Vector3 ClientAgentPosition;
public bool UseClientAgentPosition;
public AgentUpdateArgs()
{
UseClientAgentPosition = false;
}
}
}

View File

@@ -552,8 +552,9 @@ namespace OpenSim.Framework.Console
}
}
// A console that processes commands internally
//
/// <summary>
/// A console that processes commands internally
/// </summary>
public class CommandConsole : ConsoleBase
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@@ -574,6 +575,9 @@ namespace OpenSim.Framework.Console
Output(s);
}
/// <summary>
/// Display a command prompt on the console and wait for user input
/// </summary>
public void Prompt()
{
string line = ReadLine(m_defaultPrompt + "# ", true, true);

View File

@@ -36,8 +36,9 @@ using log4net;
namespace OpenSim.Framework.Console
{
// A console that uses cursor control and color
//
/// <summary>
/// A console that uses cursor control and color
/// </summary>
public class LocalConsole : CommandConsole
{
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@@ -85,30 +86,70 @@ namespace OpenSim.Framework.Console
history.Add(text);
}
/// <summary>
/// Set the cursor row.
/// </summary>
///
/// <param name="top">
/// Row to set. If this is below 0, then the row is set to 0. If it is equal to the buffer height or greater
/// then it is set to one less than the height.
/// </param>
/// <returns>
/// The new cursor row.
/// </returns>
private int SetCursorTop(int top)
{
if (top >= 0 && top < System.Console.BufferHeight)
{
System.Console.CursorTop = top;
return top;
}
else
{
return System.Console.CursorTop;
}
// From at least mono 2.4.2.3, window resizing can give mono an invalid row and column values. If we try
// to set a cursor row position with a currently invalid column, mono will throw an exception.
// Therefore, we need to make sure that the column position is valid first.
int left = System.Console.CursorLeft;
if (left < 0)
System.Console.CursorLeft = 0;
else if (left >= System.Console.BufferWidth)
System.Console.CursorLeft = System.Console.BufferWidth - 1;
if (top < 0)
top = 0;
if (top >= System.Console.BufferHeight)
top = System.Console.BufferHeight - 1;
System.Console.CursorTop = top;
return top;
}
/// <summary>
/// Set the cursor column.
/// </summary>
///
/// <param name="left">
/// Column to set. If this is below 0, then the column is set to 0. If it is equal to the buffer width or greater
/// then it is set to one less than the width.
/// </param>
/// <returns>
/// The new cursor column.
/// </returns>
private int SetCursorLeft(int left)
{
if (left >= 0 && left < System.Console.BufferWidth)
{
System.Console.CursorLeft = left;
return left;
}
else
{
return System.Console.CursorLeft;
}
// From at least mono 2.4.2.3, window resizing can give mono an invalid row and column values. If we try
// to set a cursor column position with a currently invalid row, mono will throw an exception.
// Therefore, we need to make sure that the row position is valid first.
int top = System.Console.CursorTop;
if (top < 0)
System.Console.CursorTop = 0;
else if (top >= System.Console.BufferHeight)
System.Console.CursorTop = System.Console.BufferHeight - 1;
if (left < 0)
left = 0;
if (left >= System.Console.BufferWidth)
left = System.Console.BufferWidth - 1;
System.Console.CursorLeft = left;
return left;
}
private void Show()
@@ -128,21 +169,21 @@ namespace OpenSim.Framework.Console
{
y--;
new_y--;
System.Console.CursorLeft = 0;
System.Console.CursorTop = System.Console.BufferHeight-1;
SetCursorLeft(0);
SetCursorTop(System.Console.BufferHeight - 1);
System.Console.WriteLine(" ");
}
y=SetCursorTop(y);
System.Console.CursorLeft = 0;
y = SetCursorTop(y);
SetCursorLeft(0);
if (echo)
System.Console.Write("{0}{1}", prompt, cmdline);
else
System.Console.Write("{0}", prompt);
SetCursorLeft(new_x);
SetCursorTop(new_y);
SetCursorLeft(new_x);
}
}
@@ -162,8 +203,7 @@ namespace OpenSim.Framework.Console
System.Console.Write(" ");
y = SetCursorTop(y);
System.Console.CursorLeft = 0;
SetCursorLeft(0);
}
}
catch (Exception)
@@ -252,7 +292,7 @@ namespace OpenSim.Framework.Console
}
y = SetCursorTop(y);
System.Console.CursorLeft = 0;
SetCursorLeft(0);
int count = cmdline.Length + prompt.Length;
@@ -260,7 +300,7 @@ namespace OpenSim.Framework.Console
System.Console.Write(" ");
y = SetCursorTop(y);
System.Console.CursorLeft = 0;
SetCursorLeft(0);
WriteLocalText(text, level);
@@ -299,7 +339,7 @@ namespace OpenSim.Framework.Console
echo = e;
int historyLine = history.Count;
System.Console.CursorLeft = 0; // Needed for mono
SetCursorLeft(0); // Needed for mono
System.Console.Write(" "); // Needed for mono
lock (cmdline)
@@ -339,7 +379,7 @@ namespace OpenSim.Framework.Console
cmdline.Remove(cp-1, 1);
cp--;
System.Console.CursorLeft = 0;
SetCursorLeft(0);
y = SetCursorTop(y);
System.Console.Write("{0}{1} ", prompt, cmdline);
@@ -387,7 +427,7 @@ namespace OpenSim.Framework.Console
cp++;
break;
case ConsoleKey.Enter:
System.Console.CursorLeft = 0;
SetCursorLeft(0);
y = SetCursorTop(y);
System.Console.WriteLine("{0}{1}", prompt, cmdline);
@@ -424,4 +464,4 @@ namespace OpenSim.Framework.Console
}
}
}
}
}

View File

@@ -36,10 +36,10 @@ namespace OpenSim.Framework
public enum EstateAccessCodex : uint
{
AccessOptions = 17,
AllowedGroups = 18,
EstateBans = 20,
EstateManagers = 24
AccessOptions = 1,
AllowedGroups = 2,
EstateBans = 4,
EstateManagers = 8
}
[Flags]public enum TeleportFlags : uint

View File

@@ -300,6 +300,34 @@ namespace OpenSim.Framework
OnSave(this);
}
public void AddEstateUser(UUID avatarID)
{
if (avatarID == UUID.Zero)
return;
if (!l_EstateAccess.Contains(avatarID))
l_EstateAccess.Add(avatarID);
}
public void RemoveEstateUser(UUID avatarID)
{
if (l_EstateAccess.Contains(avatarID))
l_EstateAccess.Remove(avatarID);
}
public void AddEstateGroup(UUID avatarID)
{
if (avatarID == UUID.Zero)
return;
if (!l_EstateGroups.Contains(avatarID))
l_EstateGroups.Add(avatarID);
}
public void RemoveEstateGroup(UUID avatarID)
{
if (l_EstateGroups.Contains(avatarID))
l_EstateGroups.Remove(avatarID);
}
public void AddEstateManager(UUID avatarID)
{
if (avatarID == UUID.Zero)

View File

@@ -135,4 +135,30 @@ namespace OpenSim.Framework
public bool HasAttachment;
public byte AssetType;
}
public struct GroupVoteHistory
{
public string VoteID;
public string VoteInitiator;
public string Majority;
public string Quorum;
public string TerseDateID;
public string StartDateTime;
public string EndDateTime;
public string VoteType;
public string VoteResult;
public string ProposalText;
}
public struct GroupActiveProposals
{
public string VoteID;
public string VoteInitiator;
public string Majority;
public string Quorum;
public string TerseDateID;
public string StartDateTime;
public string EndDateTime;
public string ProposalText;
}
}

View File

@@ -467,7 +467,7 @@ namespace OpenSim.Framework
public delegate void EjectUserUpdate(IClientAPI client, UUID parcelowner,uint flags, UUID target);
public delegate void NewUserReport(IClientAPI client, string regionName,UUID abuserID, byte catagory, byte checkflags, string details, UUID objectID, Vector3 postion, byte reportType ,UUID screenshotID, string summery, UUID reporter);
public delegate void NewUserReport(IClientAPI client, string regionName,UUID abuserID, byte catagory, byte checkflags, string details, UUID objectID, Vector3 postion, byte reportType ,UUID screenshotID, string Summary, UUID reporter);
public delegate void GodUpdateRegionInfoUpdate(IClientAPI client, float BillableFactor, ulong EstateID, ulong RegionFlags, byte[] SimName,int RedirectX, int RedirectY);
@@ -1069,25 +1069,25 @@ namespace OpenSim.Framework
event PlacesQuery OnPlacesQuery;
event FindAgentUpdate OnFindAgentEvent;
event TrackAgentUpdate OnTrackAgentEvent;
event NewUserReport OnUserReportEvent;
event SaveStateHandler OnSaveStateEvent;
event FindAgentUpdate OnFindAgent;
event TrackAgentUpdate OnTrackAgent;
event NewUserReport OnUserReport;
event SaveStateHandler OnSaveState;
event GroupAccountSummaryRequest OnGroupAccountSummaryRequest;
event GroupAccountDetailsRequest OnGroupAccountDetailsRequest;
event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest;
event FreezeUserUpdate OnParcelFreezeUserEvent;
event EjectUserUpdate OnParcelEjectUserEvent;
event FreezeUserUpdate OnParcelFreezeUser;
event EjectUserUpdate OnParcelEjectUser;
event ParcelBuyPass OnParcelBuyPass;
event ParcelGodMark OnParcelGodMark;
event GroupActiveProposalsRequest OnGroupActiveProposalsRequest;
event GroupVoteHistoryRequest OnGroupVoteHistoryRequest;
event SimWideDeletesDelegate OnSimWideDeletes;
event SendPostcard OnSendPostcard;
event MuteListEntryUpdate OnUpdateMuteListEntryEvent;
event MuteListEntryRemove OnRemoveMuteListEntryEvent;
event GodlikeMessage onGodlikeMessageEvent;
event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdateEvent;
event MuteListEntryUpdate OnUpdateMuteListEntry;
event MuteListEntryRemove OnRemoveMuteListEntry;
event GodlikeMessage onGodlikeMessage;
event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdate;
/// <summary>
/// Set the debug level at which packet output should be printed to console.
@@ -1271,7 +1271,7 @@ namespace OpenSim.Framework
void SendHealth(float health);
void SendEstateManagersList(UUID invoice, UUID[] EstateManagers, uint estateID);
void SendEstateList(UUID invoice, int code, UUID[] Data, uint estateID);
void SendBannedUserList(UUID invoice, EstateBan[] banlist, uint estateID);
@@ -1446,7 +1446,12 @@ namespace OpenSim.Framework
void SendUserInfoReply(bool imViaEmail, bool visible, string email);
void SendUseCachedMuteList();
void SendMuteListUpdate(string filename);
void SendMuteListUpdate(string filename);
void SendGroupActiveProposals(UUID groupID, UUID transactionID, GroupActiveProposals[] Proposals);
void SendGroupVoteHistory(UUID groupID, UUID transactionID, GroupVoteHistory[] Votes);
void KillEndDone();

View File

@@ -32,7 +32,6 @@ namespace OpenSim.Framework
{
public interface ILoginServiceToRegionsConnector
{
bool RegionLoginsEnabled { get; }
void LogOffUserFromGrid(ulong regionHandle, UUID AvatarID, UUID RegionSecret, string message);
bool NewUserConnection(ulong regionHandle, AgentCircuitData agent, out string reason);
RegionInfo RequestClosestRegion(string region);

View File

@@ -32,7 +32,7 @@ namespace OpenSim.Framework
{
public class MainServer
{
private static BaseHttpServer instance;
private static BaseHttpServer instance = null;
private static Dictionary<uint, BaseHttpServer> m_Servers =
new Dictionary<uint, BaseHttpServer>();
@@ -46,7 +46,7 @@ namespace OpenSim.Framework
{
if (port == 0)
return Instance;
if (port == Instance.Port)
if (instance != null && port == Instance.Port)
return Instance;
if (m_Servers.ContainsKey(port))