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

avinationmerge
Tom Grimshaw 2010-07-04 06:51:01 -07:00
commit 14ab22dcd4
11 changed files with 114 additions and 39 deletions

View File

@ -95,6 +95,7 @@ what it is today.
* Mic Bowman * Mic Bowman
* Michelle Argus * Michelle Argus
* Michael Cortez (The Flotsam Project, http://osflotsam.org/) * Michael Cortez (The Flotsam Project, http://osflotsam.org/)
* Micheil Merlin
* Mike Osias (IBM) * Mike Osias (IBM)
* Mike Pitman (IBM) * Mike Pitman (IBM)
* mikkopa/_someone - RealXtend * mikkopa/_someone - RealXtend

View File

@ -156,15 +156,30 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
return; return;
} }
// Force timestamp to server time to avoid "Saved on" headers DateTime dt = DateTime.UtcNow;
// being generated for online users
im.timestamp = (uint)Util.UnixTimeSinceEpoch();
if (dialog == (byte)InstantMessageDialog.MessageFromAgent || // Ticks from UtcNow, but make it look like local. Evil, huh?
dialog == (byte)InstantMessageDialog.MessageFromObject) dt = DateTime.SpecifyKind(dt, DateTimeKind.Local);
try
{ {
im.offline = 1; // Convert that to the PST timezone
TimeZoneInfo timeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById("America/Los_Angeles");
dt = TimeZoneInfo.ConvertTime(dt, timeZoneInfo);
} }
catch
{
m_log.Info("[OFFLINE MESSAGING]: No PST timezone found on this machine. Saving with local timestamp.");
}
// And make it look local again to fool the unix time util
dt = DateTime.SpecifyKind(dt, DateTimeKind.Utc);
im.timestamp = (uint)Util.ToUnixTime(dt);
// If client is null, this message comes from storage and IS offline
if (client != null)
im.offline = 0;
if (m_TransferModule != null) if (m_TransferModule != null)
{ {

View File

@ -192,6 +192,17 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
// Needed for proper state management for stored group // Needed for proper state management for stored group
// invitations // invitations
// //
im.offline = 1;
// Reconstruct imSessionID
if (im.dialog == (byte)InstantMessageDialog.MessageFromAgent)
{
UUID fromAgentID = new UUID(im.fromAgentID);
UUID sessionID = fromAgentID ^ client.AgentId;
im.imSessionID = new Guid(sessionID.ToString());
}
Scene s = FindScene(client.AgentId); Scene s = FindScene(client.AgentId);
if (s != null) if (s != null)
s.EventManager.TriggerIncomingInstantMessage(im); s.EventManager.TriggerIncomingInstantMessage(im);
@ -201,35 +212,37 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
private void UndeliveredMessage(GridInstantMessage im) private void UndeliveredMessage(GridInstantMessage im)
{ {
if (im.dialog == 19) if (im.dialog != (byte)InstantMessageDialog.MessageFromObject &&
im.offline = 1; // We want them pushed out to the server im.dialog != (byte)InstantMessageDialog.MessageFromAgent &&
if ((im.offline != 0) im.dialog != (byte)InstantMessageDialog.GroupNotice &&
&& (!im.fromGroup || (im.fromGroup && m_ForwardOfflineGroupMessages))) im.dialog != (byte)InstantMessageDialog.InventoryOffered)
{ {
// It's not delivered. Make sure the scope id is saved return;
// We don't need the imSessionID here anymore, overwrite it }
Scene scene = FindScene(new UUID(im.fromAgentID));
if (scene == null)
scene = m_SceneList[0];
im.imSessionID = new Guid(scene.RegionInfo.ScopeID.ToString());
bool success = SynchronousRestObjectPoster.BeginPostObject<GridInstantMessage, bool>( // It's not delivered. Make sure the scope id is saved
"POST", m_RestURL+"/SaveMessage/", im); // We don't need the imSessionID here anymore, overwrite it
Scene scene = FindScene(new UUID(im.fromAgentID));
if (scene == null)
scene = m_SceneList[0];
im.imSessionID = new Guid(scene.RegionInfo.ScopeID.ToString());
if (im.dialog == (byte)InstantMessageDialog.MessageFromAgent) bool success = SynchronousRestObjectPoster.BeginPostObject<GridInstantMessage, bool>(
{ "POST", m_RestURL+"/SaveMessage/", im);
IClientAPI client = FindClient(new UUID(im.fromAgentID));
if (client == null)
return;
client.SendInstantMessage(new GridInstantMessage( if (im.dialog == (byte)InstantMessageDialog.MessageFromAgent)
null, new UUID(im.toAgentID), {
"System", new UUID(im.fromAgentID), IClientAPI client = FindClient(new UUID(im.fromAgentID));
(byte)InstantMessageDialog.MessageFromAgent, if (client == null)
"User is not logged in. "+ return;
(success ? "Message saved." : "Message not saved"),
false, new Vector3())); client.SendInstantMessage(new GridInstantMessage(
} null, new UUID(im.toAgentID),
"System", new UUID(im.fromAgentID),
(byte)InstantMessageDialog.MessageFromAgent,
"User is not logged in. "+
(success ? "Message saved." : "Message not saved"),
false, new Vector3()));
} }
} }
} }

View File

@ -805,7 +805,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
imgstream = new MemoryStream(); imgstream = new MemoryStream();
// non-async because we know we have the asset immediately. // non-async because we know we have the asset immediately.
AssetBase mapasset = m_scene.AssetService.Get(m_scene.RegionInfo.lastMapUUID.ToString()); AssetBase mapasset = m_scene.AssetService.Get(m_scene.RegionInfo.RegionSettings.TerrainImageID.ToString());
// Decode image to System.Drawing.Image // Decode image to System.Drawing.Image
if (OpenJPEG.DecodeToImage(mapasset.Data, out managedImage, out image)) if (OpenJPEG.DecodeToImage(mapasset.Data, out managedImage, out image))

View File

@ -1633,7 +1633,7 @@ namespace OpenSim.Region.Framework.Scenes
if (action == DeRezAction.SaveToExistingUserInventoryItem) if (action == DeRezAction.SaveToExistingUserInventoryItem)
permissionToDelete = false; permissionToDelete = false;
// if we want to take a copy,, we also don't want to delete // if we want to take a copy, we also don't want to delete
// Note: after this point, the permissionToTakeCopy flag // Note: after this point, the permissionToTakeCopy flag
// becomes irrelevant. It already includes the permissionToTake // becomes irrelevant. It already includes the permissionToTake
// permission and after excluding no copy items here, we can // permission and after excluding no copy items here, we can
@ -1644,6 +1644,7 @@ namespace OpenSim.Region.Framework.Scenes
if (!permissionToTakeCopy) if (!permissionToTakeCopy)
return; return;
permissionToTake = true;
// Don't delete // Don't delete
permissionToDelete = false; permissionToDelete = false;
} }

View File

@ -3730,8 +3730,11 @@ Console.WriteLine("Scripted Sit ofset {0}", m_pos);
{ {
CollidingMessage.Colliders = colliding; CollidingMessage.Colliders = colliding;
foreach (SceneObjectGroup att in Attachments) lock (m_attachments)
Scene.EventManager.TriggerScriptColliding(att.LocalId, CollidingMessage); {
foreach (SceneObjectGroup att in m_attachments)
Scene.EventManager.TriggerScriptColliding(att.LocalId, CollidingMessage);
}
} }
} }

View File

@ -3252,7 +3252,27 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
msg.imSessionID = new Guid(friendTransactionID.ToString()); // This is the item we're mucking with here msg.imSessionID = new Guid(friendTransactionID.ToString()); // This is the item we're mucking with here
// m_log.Debug("[Scripting IM]: From:" + msg.fromAgentID.ToString() + " To: " + msg.toAgentID.ToString() + " Session:" + msg.imSessionID.ToString() + " Message:" + message); // m_log.Debug("[Scripting IM]: From:" + msg.fromAgentID.ToString() + " To: " + msg.toAgentID.ToString() + " Session:" + msg.imSessionID.ToString() + " Message:" + message);
// m_log.Debug("[Scripting IM]: Filling Session: " + msg.imSessionID.ToString()); // m_log.Debug("[Scripting IM]: Filling Session: " + msg.imSessionID.ToString());
msg.timestamp = (uint)Util.UnixTimeSinceEpoch();// timestamp; DateTime dt = DateTime.UtcNow;
// Ticks from UtcNow, but make it look like local. Evil, huh?
dt = DateTime.SpecifyKind(dt, DateTimeKind.Local);
try
{
// Convert that to the PST timezone
TimeZoneInfo timeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById("America/Los_Angeles");
dt = TimeZoneInfo.ConvertTime(dt, timeZoneInfo);
}
catch
{
// No logging here, as it could be VERY spammy
}
// And make it look local again to fool the unix time util
dt = DateTime.SpecifyKind(dt, DateTimeKind.Utc);
msg.timestamp = (uint)Util.ToUnixTime(dt);
//if (client != null) //if (client != null)
//{ //{
msg.fromAgentName = m_host.Name;//client.FirstName + " " + client.LastName;// fromAgentName; msg.fromAgentName = m_host.Name;//client.FirstName + " " + client.LastName;// fromAgentName;

View File

@ -175,6 +175,9 @@ namespace OpenSim.Services.LLLoginService
private string firstname; private string firstname;
private string lastname; private string lastname;
// Web map
private string mapTileURL;
// Error Flags // Error Flags
private string errorReason; private string errorReason;
private string errorMessage; private string errorMessage;
@ -223,7 +226,7 @@ namespace OpenSim.Services.LLLoginService
public LLLoginResponse(UserAccount account, AgentCircuitData aCircuit, GridUserInfo pinfo, public LLLoginResponse(UserAccount account, AgentCircuitData aCircuit, GridUserInfo pinfo,
GridRegion destination, List<InventoryFolderBase> invSkel, FriendInfo[] friendsList, ILibraryService libService, GridRegion destination, List<InventoryFolderBase> invSkel, FriendInfo[] friendsList, ILibraryService libService,
string where, string startlocation, Vector3 position, Vector3 lookAt, List<InventoryItemBase> gestures, string message, string where, string startlocation, Vector3 position, Vector3 lookAt, List<InventoryItemBase> gestures, string message,
GridRegion home, IPEndPoint clientIP) GridRegion home, IPEndPoint clientIP, string mapTileURL)
: this() : this()
{ {
FillOutInventoryData(invSkel, libService); FillOutInventoryData(invSkel, libService);
@ -239,6 +242,7 @@ namespace OpenSim.Services.LLLoginService
Message = message; Message = message;
BuddList = ConvertFriendListItem(friendsList); BuddList = ConvertFriendListItem(friendsList);
StartLocation = where; StartLocation = where;
MapTileURL = mapTileURL;
FillOutHomeData(pinfo, home); FillOutHomeData(pinfo, home);
LookAt = String.Format("[r{0},r{1},r{2}]", lookAt.X, lookAt.Y, lookAt.Z); LookAt = String.Format("[r{0},r{1},r{2}]", lookAt.X, lookAt.Y, lookAt.Z);
@ -411,6 +415,7 @@ namespace OpenSim.Services.LLLoginService
InitialOutfitHash["folder_name"] = "Nightclub Female"; InitialOutfitHash["folder_name"] = "Nightclub Female";
InitialOutfitHash["gender"] = "female"; InitialOutfitHash["gender"] = "female";
initialOutfit.Add(InitialOutfitHash); initialOutfit.Add(InitialOutfitHash);
mapTileURL = String.Empty;
} }
@ -474,6 +479,9 @@ namespace OpenSim.Services.LLLoginService
responseData["region_x"] = (Int32)(RegionX); responseData["region_x"] = (Int32)(RegionX);
responseData["region_y"] = (Int32)(RegionY); responseData["region_y"] = (Int32)(RegionY);
if (mapTileURL != String.Empty)
responseData["map-server-url"] = mapTileURL;
if (m_buddyList != null) if (m_buddyList != null)
{ {
responseData["buddy-list"] = m_buddyList.ToArray(); responseData["buddy-list"] = m_buddyList.ToArray();
@ -570,6 +578,9 @@ namespace OpenSim.Services.LLLoginService
map["region_x"] = OSD.FromInteger(RegionX); map["region_x"] = OSD.FromInteger(RegionX);
map["region_y"] = OSD.FromInteger(RegionY); map["region_y"] = OSD.FromInteger(RegionY);
if (mapTileURL != String.Empty)
map["map-server-url"] = OSD.FromString(mapTileURL);
if (m_buddyList != null) if (m_buddyList != null)
{ {
map["buddy-list"] = ArrayListToOSDArray(m_buddyList.ToArray()); map["buddy-list"] = ArrayListToOSDArray(m_buddyList.ToArray());
@ -653,7 +664,7 @@ namespace OpenSim.Services.LLLoginService
Hashtable TempHash; Hashtable TempHash;
foreach (InventoryFolderBase InvFolder in folders) foreach (InventoryFolderBase InvFolder in folders)
{ {
if (InvFolder.ParentID == UUID.Zero) if (InvFolder.ParentID == UUID.Zero && InvFolder.Name == "My Inventory")
{ {
rootID = InvFolder.ID; rootID = InvFolder.ID;
} }
@ -921,6 +932,12 @@ namespace OpenSim.Services.LLLoginService
set { home = value; } set { home = value; }
} }
public string MapTileURL
{
get { return mapTileURL; }
set { mapTileURL = value; }
}
public string Message public string Message
{ {
get { return welcomeMessage; } get { return welcomeMessage; }

View File

@ -73,6 +73,7 @@ namespace OpenSim.Services.LLLoginService
protected int m_MinLoginLevel; protected int m_MinLoginLevel;
protected string m_GatekeeperURL; protected string m_GatekeeperURL;
protected bool m_AllowRemoteSetLoginLevel; protected bool m_AllowRemoteSetLoginLevel;
protected string m_MapTileURL;
IConfig m_LoginServerConfig; IConfig m_LoginServerConfig;
@ -100,6 +101,7 @@ namespace OpenSim.Services.LLLoginService
m_AllowRemoteSetLoginLevel = m_LoginServerConfig.GetBoolean("AllowRemoteSetLoginLevel", false); m_AllowRemoteSetLoginLevel = m_LoginServerConfig.GetBoolean("AllowRemoteSetLoginLevel", false);
m_MinLoginLevel = m_LoginServerConfig.GetInt("MinLoginLevel", 0); m_MinLoginLevel = m_LoginServerConfig.GetInt("MinLoginLevel", 0);
m_GatekeeperURL = m_LoginServerConfig.GetString("GatekeeperURI", string.Empty); m_GatekeeperURL = m_LoginServerConfig.GetString("GatekeeperURI", string.Empty);
m_MapTileURL = m_LoginServerConfig.GetString("MapTileURL", string.Empty);
// These are required; the others aren't // These are required; the others aren't
if (accountService == string.Empty || authService == string.Empty) if (accountService == string.Empty || authService == string.Empty)
@ -362,7 +364,7 @@ namespace OpenSim.Services.LLLoginService
// Finally, fill out the response and return it // Finally, fill out the response and return it
// //
LLLoginResponse response = new LLLoginResponse(account, aCircuit, guinfo, destination, inventorySkel, friendsList, m_LibraryService, LLLoginResponse response = new LLLoginResponse(account, aCircuit, guinfo, destination, inventorySkel, friendsList, m_LibraryService,
where, startLocation, position, lookAt, gestures, m_WelcomeMessage, home, clientIP); where, startLocation, position, lookAt, gestures, m_WelcomeMessage, home, clientIP, m_MapTileURL);
m_log.DebugFormat("[LLOGIN SERVICE]: All clear. Sending login response to client."); m_log.DebugFormat("[LLOGIN SERVICE]: All clear. Sending login response to client.");
return response; return response;

Binary file not shown.

View File

@ -134,6 +134,9 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
WelcomeMessage = "Welcome, Avatar!" WelcomeMessage = "Welcome, Avatar!"
AllowRemoteSetLoginLevel = "false" AllowRemoteSetLoginLevel = "false"
; For snowglobe's web map
; MapTileURL = "";
[GridInfoService] [GridInfoService]
; These settings are used to return information on a get_grid_info call. ; These settings are used to return information on a get_grid_info call.