From 4f91da248868d26951fef39f18a0d9f5c7e28732 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Fri, 14 Nov 2008 05:18:39 +0000 Subject: More groups plumbing --- .../Region/ClientStack/LindenUDP/LLClientView.cs | 98 ++++++++++++++++++++++ .../Environment/Modules/World/NPC/NPCAvatar.cs | 12 +++ .../Region/Examples/SimpleModule/MyNpcCharacter.cs | 12 +++ OpenSim/Region/Interfaces/IGroupsModule.cs | 4 + 4 files changed, 126 insertions(+) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 7eb6ef4..09e4160 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -6867,6 +6867,60 @@ namespace OpenSim.Region.ClientStack.LindenUDP } break; + case PacketType.JoinGroupRequest: + JoinGroupRequestPacket joinGroupRequest = + (JoinGroupRequestPacket)Pack; + + if (m_GroupsModule != null) + { + m_GroupsModule.JoinGroupRequest(this, + joinGroupRequest.GroupData.GroupID); + } + break; + + case PacketType.LeaveGroupRequest: + LeaveGroupRequestPacket leaveGroupRequest = + (LeaveGroupRequestPacket)Pack; + + if (m_GroupsModule != null) + { + m_GroupsModule.LeaveGroupRequest(this, + leaveGroupRequest.GroupData.GroupID); + } + break; + + case PacketType.EjectGroupMemberRequest: + EjectGroupMemberRequestPacket ejectGroupMemberRequest = + (EjectGroupMemberRequestPacket)Pack; + + if (m_GroupsModule != null) + { + foreach (EjectGroupMemberRequestPacket.EjectDataBlock e + in ejectGroupMemberRequest.EjectData) + { + m_GroupsModule.EjectGroupMemberRequest(this, + ejectGroupMemberRequest.GroupData.GroupID, + e.EjecteeID); + } + } + break; + + case PacketType.InviteGroupRequest: + InviteGroupRequestPacket inviteGroupRequest = + (InviteGroupRequestPacket)Pack; + + if (m_GroupsModule != null) + { + foreach (InviteGroupRequestPacket.InviteDataBlock b in + inviteGroupRequest.InviteData) + { + m_GroupsModule.InviteGroupRequest(this, + inviteGroupRequest.GroupData.GroupID, + b.InviteeID, + b.RoleID); + } + } + break; default: m_log.Warn("[CLIENT]: unhandled packet " + Pack); break; @@ -7648,6 +7702,50 @@ namespace OpenSim.Region.ClientStack.LindenUDP OutPacket(p, ThrottleOutPacketType.Task); } + public void SendJoinGroupReply(UUID groupID, bool success) + { + JoinGroupReplyPacket p = (JoinGroupReplyPacket)PacketPool.Instance.GetPacket(PacketType.JoinGroupReply); + + p.AgentData = new JoinGroupReplyPacket.AgentDataBlock(); + p.AgentData.AgentID = AgentId; + + p.GroupData = new JoinGroupReplyPacket.GroupDataBlock(); + p.GroupData.GroupID = groupID; + p.GroupData.Success = success; + + OutPacket(p, ThrottleOutPacketType.Task); + } + + public void SendEjectGroupMemberReply(UUID agentID, UUID groupID, bool success) + { + EjectGroupMemberReplyPacket p = (EjectGroupMemberReplyPacket)PacketPool.Instance.GetPacket(PacketType.EjectGroupMemberReply); + + p.AgentData = new EjectGroupMemberReplyPacket.AgentDataBlock(); + p.AgentData.AgentID = agentID; + + p.GroupData = new EjectGroupMemberReplyPacket.GroupDataBlock(); + p.GroupData.GroupID = groupID; + + p.EjectData = new EjectGroupMemberReplyPacket.EjectDataBlock(); + p.EjectData.Success = success; + + OutPacket(p, ThrottleOutPacketType.Task); + } + + public void SendLeaveGroupReply(UUID agentID, UUID groupID, bool success) + { + LeaveGroupReplyPacket p = (LeaveGroupReplyPacket)PacketPool.Instance.GetPacket(PacketType.LeaveGroupReply); + + p.AgentData = new LeaveGroupReplyPacket.AgentDataBlock(); + p.AgentData.AgentID = agentID; + + p.GroupData = new LeaveGroupReplyPacket.GroupDataBlock(); + p.GroupData.GroupID = groupID; + p.GroupData.Success = success; + + OutPacket(p, ThrottleOutPacketType.Task); + } + public void KillEndDone() { KillPacket kp = new KillPacket(); diff --git a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs index 2792bf8..ba73a31 100644 --- a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs @@ -963,6 +963,18 @@ namespace OpenSim.Region.Environment.Modules.World.NPC { } + public void SendJoinGroupReply(UUID groupID, bool success) + { + } + + public void SendEjectGroupMemberReply(UUID agentID, UUID groupID, bool success) + { + } + + public void SendLeaveGroupReply(UUID agentID, UUID groupID, bool success) + { + } + public void SendAvatarGroupsReply(UUID avatarID, GroupMembershipData[] data) { } diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs index 44ad400..8317fcc 100644 --- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs @@ -968,6 +968,18 @@ namespace OpenSim.Region.Examples.SimpleModule { } + public void SendJoinGroupReply(UUID groupID, bool success) + { + } + + public void SendEjectGroupMemberReply(UUID agentID, UUID groupID, bool succss) + { + } + + public void SendLeaveGroupReply(UUID agentID, UUID groupID, bool success) + { + } + public void SendTerminateFriend(UUID exFriendID) { } diff --git a/OpenSim/Region/Interfaces/IGroupsModule.cs b/OpenSim/Region/Interfaces/IGroupsModule.cs index 4d1b1cc..97c39b7 100644 --- a/OpenSim/Region/Interfaces/IGroupsModule.cs +++ b/OpenSim/Region/Interfaces/IGroupsModule.cs @@ -55,5 +55,9 @@ namespace OpenSim.Region.Interfaces void GroupRoleChanges(IClientAPI remoteClient, UUID GroupID, UUID RoleID, UUID MemberID, uint changes); void GroupNoticeRequest(IClientAPI remoteClient, UUID groupNoticeID); void SendAgentGroupDataUpdate(IClientAPI remoteClient); + void JoinGroupRequest(IClientAPI remoteClient, UUID GroupID); + void LeaveGroupRequest(IClientAPI remoteClient, UUID GroupID); + void EjectGroupMemberRequest(IClientAPI remoteClient, UUID GroupID, UUID EjecteeID); + void InviteGroupRequest(IClientAPI remoteClient, UUID GroupID, UUID InviteeID, UUID RoleID); } } -- cgit v1.1