mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 17:32:42 +08:00
* Group type stuff. Nothing spectacular. two packets, sorta almost semi half tiny amount implemented.
This commit is contained in:
@@ -44,6 +44,9 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Groups
|
||||
private Dictionary<LLUUID, GroupList> m_grouplistmap = new Dictionary<LLUUID, GroupList>();
|
||||
private Dictionary<LLUUID, GroupData> m_groupmap = new Dictionary<LLUUID, GroupData>();
|
||||
private Dictionary<LLUUID, IClientAPI> m_iclientmap = new Dictionary<LLUUID, IClientAPI>();
|
||||
private Dictionary<LLUUID, GroupData> m_groupUUIDGroup = new Dictionary<LLUUID, GroupData>();
|
||||
private LLUUID opensimulatorGroupID = new LLUUID("00000000-68f9-1111-024e-222222111123");
|
||||
|
||||
private List<Scene> m_scene = new List<Scene>();
|
||||
|
||||
#region IRegionModule Members
|
||||
@@ -57,6 +60,18 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Groups
|
||||
scene.EventManager.OnNewClient += OnNewClient;
|
||||
scene.EventManager.OnClientClosed += OnClientClosed;
|
||||
scene.EventManager.OnGridInstantMessageToGroupsModule += OnGridInstantMessage;
|
||||
lock (m_groupUUIDGroup)
|
||||
{
|
||||
|
||||
GroupData OpenSimulatorGroup = new GroupData();
|
||||
OpenSimulatorGroup.ActiveGroupTitle = "OpenSimulator Tester";
|
||||
OpenSimulatorGroup.GroupID = opensimulatorGroupID;
|
||||
OpenSimulatorGroup.groupName = "OpenSimulator Testing";
|
||||
OpenSimulatorGroup.ActiveGroupPowers = GroupPowers.LandAllowSetHome;
|
||||
OpenSimulatorGroup.GroupTitles.Add("OpenSimulator Tester");
|
||||
if (!m_groupUUIDGroup.ContainsKey(opensimulatorGroupID))
|
||||
m_groupUUIDGroup.Add(opensimulatorGroupID, OpenSimulatorGroup);
|
||||
}
|
||||
//scene.EventManager.
|
||||
}
|
||||
|
||||
@@ -102,6 +117,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Groups
|
||||
// Subscribe to instant messages
|
||||
client.OnInstantMessage += OnInstantMessage;
|
||||
client.OnAgentDataUpdateRequest += OnAgentDataUpdateRequest;
|
||||
client.OnUUIDGroupNameRequest += HandleUUIDGroupNameRequest;
|
||||
lock (m_iclientmap)
|
||||
{
|
||||
if (!m_iclientmap.ContainsKey(client.AgentId))
|
||||
@@ -109,13 +125,18 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Groups
|
||||
m_iclientmap.Add(client.AgentId, client);
|
||||
}
|
||||
}
|
||||
GroupData OpenSimulatorGroup = new GroupData();
|
||||
OpenSimulatorGroup.ActiveGroupTitle = "OpenSimulator Tester";
|
||||
OpenSimulatorGroup.GroupID = new LLUUID("00000000-68f9-1111-024e-222222111120");
|
||||
OpenSimulatorGroup.GroupMembers.Add(client.AgentId);
|
||||
OpenSimulatorGroup.groupName = "OpenSimulator Testing";
|
||||
OpenSimulatorGroup.ActiveGroupPowers = GroupPowers.LandAllowSetHome;
|
||||
OpenSimulatorGroup.GroupTitles.Add("OpenSimulator Tester");
|
||||
GroupData OpenSimulatorGroup = null;
|
||||
lock (m_groupUUIDGroup)
|
||||
{
|
||||
OpenSimulatorGroup = m_groupUUIDGroup[opensimulatorGroupID];
|
||||
if (!OpenSimulatorGroup.GroupMembers.Contains(client.AgentId))
|
||||
{
|
||||
OpenSimulatorGroup.GroupMembers.Add(client.AgentId);
|
||||
m_groupUUIDGroup[opensimulatorGroupID] = OpenSimulatorGroup;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
lock (m_groupmap)
|
||||
{
|
||||
if (!m_groupmap.ContainsKey(client.AgentId))
|
||||
@@ -124,7 +145,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Groups
|
||||
}
|
||||
}
|
||||
GroupList testGroupList = new GroupList();
|
||||
testGroupList.m_GroupList.Add(new LLUUID("00000000-68f9-1111-024e-222222111120"));
|
||||
testGroupList.m_GroupList.Add(OpenSimulatorGroup.GroupID);
|
||||
|
||||
lock (m_grouplistmap)
|
||||
{
|
||||
@@ -133,7 +154,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Groups
|
||||
m_grouplistmap.Add(client.AgentId, testGroupList);
|
||||
}
|
||||
}
|
||||
m_log.Info("[GROUP]: Adding " + client.Name + " to OpenSimulator Tester group");
|
||||
m_log.Info("[GROUP]: Adding " + client.Name + " to " + OpenSimulatorGroup.groupName + " ");
|
||||
GroupData[] updateGroups = new GroupData[1];
|
||||
updateGroups[0] = OpenSimulatorGroup;
|
||||
|
||||
@@ -201,7 +222,22 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Groups
|
||||
new LLVector3(msg.Position.x, msg.Position.y, msg.Position.z), new LLUUID(msg.RegionID),
|
||||
msg.binaryBucket);
|
||||
}
|
||||
private void HandleUUIDGroupNameRequest(LLUUID id,IClientAPI remote_client)
|
||||
{
|
||||
string groupnamereply = "Unknown";
|
||||
LLUUID groupUUID = LLUUID.Zero;
|
||||
|
||||
lock (m_groupUUIDGroup)
|
||||
{
|
||||
if (m_groupUUIDGroup.ContainsKey(id))
|
||||
{
|
||||
GroupData grp = m_groupUUIDGroup[id];
|
||||
groupnamereply = grp.groupName;
|
||||
groupUUID = grp.GroupID;
|
||||
}
|
||||
}
|
||||
remote_client.SendGroupNameReply(groupUUID, groupnamereply);
|
||||
}
|
||||
private void OnClientClosed(LLUUID agentID)
|
||||
{
|
||||
lock (m_iclientmap)
|
||||
|
||||
@@ -236,6 +236,7 @@ namespace OpenSim.Region.Environment.Modules.World.NPC
|
||||
public event RequestAsset OnRequestAsset;
|
||||
|
||||
public event UUIDNameRequest OnNameFromUUIDRequest;
|
||||
public event UUIDNameRequest OnUUIDGroupNameRequest;
|
||||
|
||||
public event ParcelPropertiesRequest OnParcelPropertiesRequest;
|
||||
public event ParcelDivideRequest OnParcelDivideRequest;
|
||||
@@ -270,6 +271,8 @@ namespace OpenSim.Region.Environment.Modules.World.NPC
|
||||
|
||||
public event ForceReleaseControls OnForceReleaseControls;
|
||||
|
||||
public event RequestObjectPropertiesFamily OnObjectGroupRequest;
|
||||
|
||||
public event DetailedEstateDataRequest OnDetailedEstateDataRequest;
|
||||
public event SetEstateFlagsRequest OnSetEstateFlagsRequest;
|
||||
public event SetEstateTerrainBaseTexture OnSetEstateTerrainBaseTexture;
|
||||
@@ -756,6 +759,10 @@ namespace OpenSim.Region.Environment.Modules.World.NPC
|
||||
public void sendLandParcelOverlay(byte[] data, int sequence_id)
|
||||
{
|
||||
}
|
||||
|
||||
public void SendGroupNameReply(LLUUID groupLLUID, string GroupName)
|
||||
{
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -330,7 +330,30 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
|
||||
|
||||
}
|
||||
public void HandleObjectGroupUpdate(
|
||||
IClientAPI remoteClient, LLUUID GroupID, uint objectLocalID, LLUUID Garbage)
|
||||
{
|
||||
List<EntityBase> EntityList = GetEntities();
|
||||
|
||||
foreach (EntityBase obj in EntityList)
|
||||
{
|
||||
if (obj is SceneObjectGroup)
|
||||
{
|
||||
if (((SceneObjectGroup)obj).LocalId == objectLocalID)
|
||||
{
|
||||
SceneObjectGroup group = (SceneObjectGroup)obj;
|
||||
|
||||
if (m_parentScene.ExternalChecks.ExternalChecksCanEditObject(group.UUID, remoteClient.AgentId))
|
||||
group.SetGroup(GroupID, remoteClient);
|
||||
else
|
||||
remoteClient.SendAgentAlertMessage("You don't have permission to set the group", false);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// Event Handling routine for Attach Object
|
||||
/// </summary>
|
||||
|
||||
@@ -1651,6 +1651,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
|
||||
client.OnSetStartLocationRequest += SetHomeRezPoint;
|
||||
client.OnUndo += m_innerScene.HandleUndo;
|
||||
client.OnObjectGroupRequest += m_innerScene.HandleObjectGroupUpdate;
|
||||
|
||||
EventManager.TriggerOnNewClient(client);
|
||||
}
|
||||
|
||||
@@ -2510,5 +2510,16 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
}
|
||||
}
|
||||
}
|
||||
public void SetGroup(LLUUID GroupID, IClientAPI client)
|
||||
{
|
||||
lock (m_parts)
|
||||
{
|
||||
foreach (SceneObjectPart part in m_parts.Values)
|
||||
{
|
||||
part.SetGroup(GroupID, client);
|
||||
}
|
||||
}
|
||||
ScheduleGroupForFullUpdate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2760,13 +2760,19 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
public void GetProperties(IClientAPI client)
|
||||
{
|
||||
|
||||
client.SendObjectPropertiesReply(LLUUID.Zero, (ulong)CreationDate, CreatorID, LLUUID.Zero, LLUUID.Zero,
|
||||
client.SendObjectPropertiesReply(LLUUID.Zero, (ulong)CreationDate, CreatorID, LLUUID.Zero, GroupID,
|
||||
LLUUID.Zero, (short)InventorySerial, LastOwnerID, UUID, OwnerID,
|
||||
ParentGroup.RootPart.TouchName, new byte[0], ParentGroup.RootPart.SitName, Name, Description,
|
||||
ParentGroup.RootPart.OwnerMask, ParentGroup.RootPart.NextOwnerMask, ParentGroup.RootPart.GroupMask, ParentGroup.RootPart.EveryoneMask,
|
||||
ParentGroup.RootPart.BaseMask);
|
||||
|
||||
}
|
||||
public void SetGroup(LLUUID groupID, IClientAPI client)
|
||||
{
|
||||
GroupID = groupID;
|
||||
GetProperties(client);
|
||||
m_updateFlag = 2;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user