Merge branch 'master' of ssh://melanie@3dhosting.de/var/git/careminster into careminster
commit
a6c26b093c
|
@ -12454,7 +12454,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
ItemData.Add(ItemDataMap);
|
||||
}
|
||||
|
||||
llsd.Add("ItemData", ItemData);
|
||||
llsd.Add("InventoryData", ItemData);
|
||||
|
||||
eq.Enqueue(BuildEvent("RemoveInventoryItem",
|
||||
llsd), AgentId);
|
||||
|
@ -12498,6 +12498,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
llsd), AgentId);
|
||||
}
|
||||
|
||||
private byte[] EncodeU32(uint val)
|
||||
{
|
||||
byte[] ret = BitConverter.GetBytes(val);
|
||||
if (BitConverter.IsLittleEndian)
|
||||
Array.Reverse(ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public void SendBulkUpdateInventory(InventoryFolderBase[] folders, InventoryItemBase[] items)
|
||||
{
|
||||
IEventQueue eq = Scene.RequestModuleInterface<IEventQueue>();
|
||||
|
@ -12513,6 +12521,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
OSDMap AgentDataMap = new OSDMap(1);
|
||||
AgentDataMap.Add("AgentID", OSD.FromUUID(AgentId));
|
||||
AgentDataMap.Add("SessionID", OSD.FromUUID(SessionId));
|
||||
AgentDataMap.Add("TransactionID", OSD.FromUUID(UUID.Random()));
|
||||
|
||||
OSDArray AgentData = new OSDArray(1);
|
||||
AgentData.Add(AgentDataMap);
|
||||
|
@ -12540,10 +12549,47 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
foreach (InventoryItemBase item in items)
|
||||
{
|
||||
OSDMap ItemDataMap = new OSDMap();
|
||||
|
||||
ItemDataMap.Add("ItemID", OSD.FromUUID(item.ID));
|
||||
ItemDataMap.Add("FolderID", OSD.FromUUID(item.Folder));
|
||||
|
||||
ItemDataMap.Add("CreatorID", OSD.FromUUID(item.CreatorIdAsUuid));
|
||||
ItemDataMap.Add("OwnerID", OSD.FromUUID(item.Owner));
|
||||
ItemDataMap.Add("GroupID", OSD.FromUUID(item.GroupID));
|
||||
ItemDataMap.Add("BaseMask", OSD.FromBinary(EncodeU32((uint)item.BasePermissions)));
|
||||
ItemDataMap.Add("OwnerMask", OSD.FromBinary(EncodeU32((uint)item.CurrentPermissions)));
|
||||
ItemDataMap.Add("GroupMask", OSD.FromBinary(EncodeU32((uint)item.GroupPermissions)));
|
||||
ItemDataMap.Add("EveryoneMask", OSD.FromBinary(EncodeU32((uint)item.EveryOnePermissions)));
|
||||
ItemDataMap.Add("NextOwnerMask", OSD.FromBinary(EncodeU32((uint)item.NextPermissions)));
|
||||
ItemDataMap.Add("GroupOwned", OSD.FromBoolean(item.GroupOwned));
|
||||
ItemDataMap.Add("AssetID", OSD.FromUUID(item.AssetID));
|
||||
ItemDataMap.Add("Type", OSD.FromInteger(item.AssetType));
|
||||
ItemDataMap.Add("InvType", OSD.FromInteger(item.InvType));
|
||||
ItemDataMap.Add("Flags", OSD.FromBinary(EncodeU32((uint)item.Flags)));
|
||||
ItemDataMap.Add("SaleType", OSD.FromInteger((byte)item.SaleType));
|
||||
ItemDataMap.Add("SalePrice", OSD.FromInteger(item.SalePrice));
|
||||
ItemDataMap.Add("Name", OSD.FromString(item.Name));
|
||||
ItemDataMap.Add("Description", OSD.FromString(item.Description));
|
||||
ItemDataMap.Add("CreationDate", OSD.FromInteger(item.CreationDate));
|
||||
|
||||
ItemDataMap.Add("CRC", OSD.FromBinary(EncodeU32(
|
||||
Helpers.InventoryCRC(1000, 0, (sbyte)item.InvType,
|
||||
(sbyte)item.AssetType, item.AssetID,
|
||||
item.GroupID, 100,
|
||||
item.Owner, item.CreatorIdAsUuid,
|
||||
item.ID, item.Folder,
|
||||
(uint)PermissionMask.All, 1, (uint)PermissionMask.All, (uint)PermissionMask.All,
|
||||
(uint)PermissionMask.All)
|
||||
)));
|
||||
ItemDataMap.Add("CallbackID", 0);
|
||||
|
||||
ItemData.Add(ItemDataMap);
|
||||
}
|
||||
|
||||
llsd.Add("ItemData", ItemData);
|
||||
|
||||
eq.Enqueue(BuildEvent("BulkUpdateInventory",
|
||||
llsd), AgentId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -93,8 +93,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage
|
|||
if (config == null)
|
||||
return;
|
||||
|
||||
int refreshminutes = Convert.ToInt32(config.GetString("RefreshTime"));
|
||||
if (refreshminutes <= 0)
|
||||
int refreshminutes = Convert.ToInt32(config.GetString("RefreshTime", "-1"));
|
||||
if (refreshminutes < 0)
|
||||
{
|
||||
m_log.WarnFormat("[MAP IMAGE SERVICE MODULE]: No refresh time given in config. Module disabled.");
|
||||
return;
|
||||
|
@ -117,12 +117,15 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage
|
|||
return;
|
||||
}
|
||||
|
||||
m_refreshTimer.Enabled = true;
|
||||
m_refreshTimer.AutoReset = true;
|
||||
m_refreshTimer.Interval = m_refreshtime;
|
||||
m_refreshTimer.Elapsed += new ElapsedEventHandler(HandleMaptileRefresh);
|
||||
if (m_refreshtime > 0)
|
||||
{
|
||||
m_refreshTimer.Enabled = true;
|
||||
m_refreshTimer.AutoReset = true;
|
||||
m_refreshTimer.Interval = m_refreshtime;
|
||||
m_refreshTimer.Elapsed += new ElapsedEventHandler(HandleMaptileRefresh);
|
||||
}
|
||||
|
||||
m_log.InfoFormat("[MAP IMAGE SERVICE MODULE]: enabled with refresh time {0}min and service object {1}",
|
||||
m_log.InfoFormat("[MAP IMAGE SERVICE MODULE]: enabled with refresh time {0} min and service object {1}",
|
||||
refreshminutes, service);
|
||||
|
||||
m_enabled = true;
|
||||
|
@ -238,4 +241,4 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -64,6 +64,9 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap
|
|||
private bool m_useAntiAliasing = false; // TODO: Make this a config option
|
||||
private bool m_Enabled = false;
|
||||
|
||||
private Bitmap lastImage = null;
|
||||
private DateTime lastImageTime = DateTime.MinValue;
|
||||
|
||||
#region IRegionModule Members
|
||||
|
||||
public void Initialise(IConfigSource source)
|
||||
|
@ -86,14 +89,9 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap
|
|||
|
||||
List<string> renderers = RenderingLoader.ListRenderers(Util.ExecutingDirectory());
|
||||
if (renderers.Count > 0)
|
||||
{
|
||||
m_primMesher = RenderingLoader.LoadRenderer(renderers[0]);
|
||||
m_log.Info("[MAPTILE]: Loaded prim mesher " + m_primMesher.ToString());
|
||||
}
|
||||
m_log.Info("[MAPTILE]: Loaded prim mesher " + renderers[0]);
|
||||
else
|
||||
{
|
||||
m_log.Info("[MAPTILE]: No prim mesher loaded, prim rendering will be disabled");
|
||||
}
|
||||
|
||||
m_scene.RegisterModuleInterface<IMapImageGenerator>(this);
|
||||
}
|
||||
|
@ -126,9 +124,25 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap
|
|||
|
||||
public Bitmap CreateMapTile()
|
||||
{
|
||||
if ((DateTime.Now - lastImageTime).TotalSeconds < 3600)
|
||||
{
|
||||
return lastImage.Clone(new Rectangle(0, 0, 256, 256), lastImage.PixelFormat);
|
||||
}
|
||||
|
||||
List<string> renderers = RenderingLoader.ListRenderers(Util.ExecutingDirectory());
|
||||
if (renderers.Count > 0)
|
||||
{
|
||||
m_primMesher = RenderingLoader.LoadRenderer(renderers[0]);
|
||||
}
|
||||
|
||||
Vector3 camPos = new Vector3(127.5f, 127.5f, 221.7025033688163f);
|
||||
Viewport viewport = new Viewport(camPos, -Vector3.UnitZ, 1024f, 0.1f, (int)Constants.RegionSize, (int)Constants.RegionSize, (float)Constants.RegionSize, (float)Constants.RegionSize);
|
||||
return CreateMapTile(viewport, false);
|
||||
Bitmap tile = CreateMapTile(viewport, false);
|
||||
m_primMesher = null;
|
||||
|
||||
lastImage = tile;
|
||||
lastImageTime = DateTime.Now;
|
||||
return lastImage.Clone(new Rectangle(0, 0, 256, 256), lastImage.PixelFormat);
|
||||
}
|
||||
|
||||
public Bitmap CreateViewImage(Vector3 camPos, Vector3 camDir, float fov, int width, int height, bool useTextures)
|
||||
|
@ -655,4 +669,4 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap
|
|||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4680,12 +4680,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
// agent must not be a god
|
||||
if (presence.GodLevel >= 200) return;
|
||||
|
||||
if (simname == String.Empty)
|
||||
simname = World.RegionInfo.RegionName;
|
||||
|
||||
// agent must be over the owners land
|
||||
if (m_host.OwnerID == World.LandChannel.GetLandObject(
|
||||
presence.AbsolutePosition.X, presence.AbsolutePosition.Y).LandData.OwnerID)
|
||||
{
|
||||
World.RequestTeleportLocation(presence.ControllingClient, simname, new Vector3((float)pos.x, (float)pos.y, (float)pos.z), new Vector3((float)lookAt.x, (float)lookAt.y, (float)lookAt.z), (uint)TeleportFlags.ViaLocation);
|
||||
}
|
||||
else // or must be wearing the prim
|
||||
{
|
||||
if (m_host.ParentGroup.AttachmentPoint != 0 && m_host.OwnerID == presence.UUID)
|
||||
{
|
||||
World.RequestTeleportLocation(presence.ControllingClient, simname, new Vector3((float)pos.x, (float)pos.y, (float)pos.z), new Vector3((float)lookAt.x, (float)lookAt.y, (float)lookAt.z), (uint)TeleportFlags.ViaLocation);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue