mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 08:55:56 +08:00
Merge branch 'master' into careminster
Conflicts: OpenSim/Region/Framework/Interfaces/IEstateModule.cs
This commit is contained in:
@@ -162,7 +162,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||
}
|
||||
}
|
||||
|
||||
protected void InitModule(IConfigSource config)
|
||||
protected virtual void InitModule(IConfigSource config)
|
||||
{
|
||||
IConfig friendsConfig = config.Configs["Friends"];
|
||||
if (friendsConfig != null)
|
||||
@@ -546,7 +546,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||
}
|
||||
}
|
||||
|
||||
private void OnInstantMessage(IClientAPI client, GridInstantMessage im)
|
||||
protected virtual void OnInstantMessage(IClientAPI client, GridInstantMessage im)
|
||||
{
|
||||
if ((InstantMessageDialog)im.dialog == InstantMessageDialog.FriendshipOffered)
|
||||
{
|
||||
|
||||
@@ -50,6 +50,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private int m_levelHGFriends = 0;
|
||||
|
||||
IUserManagement m_uMan;
|
||||
public IUserManagement UserManagementModule
|
||||
{
|
||||
@@ -87,6 +89,21 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||
m_StatusNotifier = new HGStatusNotifier(this);
|
||||
}
|
||||
|
||||
protected override void InitModule(IConfigSource config)
|
||||
{
|
||||
base.InitModule(config);
|
||||
|
||||
// Additionally to the base method
|
||||
IConfig friendsConfig = config.Configs["HGFriendsModule"];
|
||||
if (friendsConfig != null)
|
||||
{
|
||||
m_levelHGFriends = friendsConfig.GetInt("LevelHGFriends", 0);
|
||||
|
||||
// TODO: read in all config variables pertaining to
|
||||
// HG friendship permissions
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IFriendsSimConnector
|
||||
@@ -105,6 +122,35 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||
|
||||
#endregion
|
||||
|
||||
protected override void OnInstantMessage(IClientAPI client, GridInstantMessage im)
|
||||
{
|
||||
if ((InstantMessageDialog)im.dialog == InstantMessageDialog.FriendshipOffered)
|
||||
{
|
||||
// we got a friendship offer
|
||||
UUID principalID = new UUID(im.fromAgentID);
|
||||
UUID friendID = new UUID(im.toAgentID);
|
||||
|
||||
// Check if friendID is foreigner and if principalID has the permission
|
||||
// to request friendships with foreigners. If not, return immediately.
|
||||
if (!UserManagementModule.IsLocalGridUser(friendID))
|
||||
{
|
||||
ScenePresence avatar = null;
|
||||
((Scene)client.Scene).TryGetScenePresence(principalID, out avatar);
|
||||
|
||||
if (avatar == null)
|
||||
return;
|
||||
|
||||
if (avatar.UserLevel < m_levelHGFriends)
|
||||
{
|
||||
client.SendAgentAlertMessage("Unable to send friendship invitation to foreigner. Insufficient permissions.", false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
base.OnInstantMessage(client, im);
|
||||
}
|
||||
|
||||
protected override void OnApproveFriendRequest(IClientAPI client, UUID friendID, List<UUID> callingCardFolders)
|
||||
{
|
||||
// Update the local cache. Yes, we need to do it right here
|
||||
|
||||
@@ -168,12 +168,18 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
sendRegionInfoPacketToAll();
|
||||
}
|
||||
|
||||
public void setEstateTerrainBaseTexture(IClientAPI remoteClient, int corner, UUID texture)
|
||||
public void setEstateTerrainBaseTexture(int level, UUID texture)
|
||||
{
|
||||
setEstateTerrainBaseTexture(null, level, texture);
|
||||
sendRegionHandshakeToAll();
|
||||
}
|
||||
|
||||
public void setEstateTerrainBaseTexture(IClientAPI remoteClient, int level, UUID texture)
|
||||
{
|
||||
if (texture == UUID.Zero)
|
||||
return;
|
||||
|
||||
switch (corner)
|
||||
switch (level)
|
||||
{
|
||||
case 0:
|
||||
Scene.RegionInfo.RegionSettings.TerrainTexture1 = texture;
|
||||
@@ -193,6 +199,11 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
sendRegionInfoPacketToAll();
|
||||
}
|
||||
|
||||
public void setEstateTerrainTextureHeights(int corner, float lowValue, float highValue)
|
||||
{
|
||||
setEstateTerrainTextureHeights(null, corner, lowValue, highValue);
|
||||
}
|
||||
|
||||
public void setEstateTerrainTextureHeights(IClientAPI client, int corner, float lowValue, float highValue)
|
||||
{
|
||||
switch (corner)
|
||||
|
||||
@@ -447,7 +447,10 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
{
|
||||
bool isMember;
|
||||
if (m_groupMemberCache.TryGetValue(avatar, out isMember))
|
||||
{
|
||||
m_groupMemberCache.Update(avatar, isMember, m_groupMemberCacheTimeout);
|
||||
return isMember;
|
||||
}
|
||||
|
||||
IGroupsModule groupsModule = m_scene.RequestModuleInterface<IGroupsModule>();
|
||||
if (groupsModule == null)
|
||||
|
||||
Reference in New Issue
Block a user