From 5b4d7922ea304f638b6a9bd0a324abefd1403ec1 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Wed, 14 May 2008 06:58:32 +0000 Subject: * Adding the very bare minimum for the client to register user as having the group OpenSimulator Tester. This allows us to start examining and implementing the vary many unhandled group packets. --- .../Region/ClientStack/LindenUDP/LLClientView.cs | 24 +++++++++++ .../Modules/Avatar/Groups/GroupsModule.cs | 47 +++++----------------- .../Environment/Modules/World/NPC/NPCAvatar.cs | 6 +++ .../Region/Examples/SimpleModule/MyNpcCharacter.cs | 5 +++ 4 files changed, 44 insertions(+), 38 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 32432b4..395d555 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -5758,6 +5758,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP OutPacket(avatarSitResponse, ThrottleOutPacketType.Task); } + public void SendAdminResponse(LLUUID Token, uint AdminLevel) { GrantGodlikePowersPacket respondPacket = new GrantGodlikePowersPacket(); @@ -5773,6 +5774,29 @@ namespace OpenSim.Region.ClientStack.LindenUDP respondPacket.AgentData = adb; OutPacket(respondPacket, ThrottleOutPacketType.Task); } + + public void SendGroupMembership(GroupData[] GroupMembership) + { + AgentGroupDataUpdatePacket Groupupdate = new AgentGroupDataUpdatePacket(); + AgentGroupDataUpdatePacket.GroupDataBlock[] Groups = new AgentGroupDataUpdatePacket.GroupDataBlock[GroupMembership.Length]; + for (int i = 0; i < GroupMembership.Length; i++) + { + AgentGroupDataUpdatePacket.GroupDataBlock Group = new AgentGroupDataUpdatePacket.GroupDataBlock(); + Group.AcceptNotices = GroupMembership[i].AcceptNotices; + Group.Contribution = GroupMembership[i].contribution; + Group.GroupID = GroupMembership[i].GroupID; + Group.GroupInsigniaID = GroupMembership[i].GroupPicture; + Group.GroupName = Helpers.StringToField(GroupMembership[i].groupName); + Group.GroupPowers = GroupMembership[i].groupPowers; + Groups[i] = Group; + Groupupdate.GroupData = Groups; + + } + Groupupdate.AgentData.AgentID = AgentId; + OutPacket(Groupupdate, ThrottleOutPacketType.Task); + + } + public ClientInfo GetClientInfo() { //MainLog.Instance.Verbose("CLIENT", "GetClientInfo BGN"); diff --git a/OpenSim/Region/Environment/Modules/Avatar/Groups/GroupsModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Groups/GroupsModule.cs index 0030350..5e87b49 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/Groups/GroupsModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/Groups/GroupsModule.cs @@ -29,6 +29,7 @@ using System; using System.Collections.Generic; using System.Reflection; using libsecondlife; +using libsecondlife.Packets; using log4net; using Nini.Config; using OpenSim.Framework; @@ -98,12 +99,6 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Groups private void OnNewClient(IClientAPI client) { - // All friends establishment protocol goes over instant message - // There's no way to send a message from the sim - // to a user to 'add a friend' without causing dialog box spam - // - // The base set of friends are added when the user signs on in their XMLRPC response - // Generated by LoginService. The friends are retreived from the database by the UserManager // Subscribe to instant messages client.OnInstantMessage += OnInstantMessage; @@ -140,6 +135,12 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Groups } } m_log.Info("[GROUP]: Adding " + client.Name + " to OpenSimulator Tester group"); + GroupData[] updateGroups = new GroupData[1]; + updateGroups[0] = OpenSimulatorGroup; + + client.SendGroupMembership(updateGroups); + + } private void OnAgentDataUpdateRequest(IClientAPI remoteClient, LLUUID AgentID, LLUUID SessionID) @@ -150,8 +151,8 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Groups LLUUID ActiveGroupID = LLUUID.Zero; uint ActiveGroupPowers = 0; - string ActiveGroupName = ""; - string ActiveGroupTitle = ""; + string ActiveGroupName = "OpenSimulator Tester"; + string ActiveGroupTitle = "I IZ N0T"; bool foundUser = false; @@ -240,35 +241,5 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Groups } } - public class GroupData - { - public string ActiveGroupTitle; - public LLUUID GroupID; - public List GroupMembers; - public string groupName; - public uint groupPowers = (uint) (GroupPowers.LandAllowLandmark | GroupPowers.LandAllowSetHome); - public List GroupTitles; - - public GroupData() - { - GroupTitles = new List(); - GroupMembers = new List(); - } - public GroupPowers ActiveGroupPowers - { - set { groupPowers = (uint) value; } - get { return (GroupPowers) groupPowers; } - } - } - - public class GroupList - { - public List m_GroupList; - - public GroupList() - { - m_GroupList = new List(); - } - } } \ No newline at end of file diff --git a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs index 3126f1c..f37e12a 100644 --- a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs @@ -102,6 +102,12 @@ namespace OpenSim.Region.Environment.Modules.World.NPC { } + + public void SendGroupMembership(GroupData[] GroupMembership) + { + + } + public LLUUID GetDefaultAnimation(string name) { return LLUUID.Zero; diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs index 68f3ecb..6087857 100644 --- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs @@ -583,6 +583,11 @@ namespace OpenSim.Region.Examples.SimpleModule } + public void SendGroupMembership(GroupData[] GroupMembership) + { + + } + private void Update() { frame++; -- cgit v1.1