diff options
author | Melanie Thielker | 2008-10-24 23:04:55 +0000 |
---|---|---|
committer | Melanie Thielker | 2008-10-24 23:04:55 +0000 |
commit | 64f9f03e9a3cb345ef85e1990bebc3a7cca41c9e (patch) | |
tree | a8398aa3c9234ff4d178ba2031e8180c605b1387 /OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |
parent | * minor: eliminate some mono compiler warnings (diff) | |
download | opensim-SC-64f9f03e9a3cb345ef85e1990bebc3a7cca41c9e.zip opensim-SC-64f9f03e9a3cb345ef85e1990bebc3a7cca41c9e.tar.gz opensim-SC-64f9f03e9a3cb345ef85e1990bebc3a7cca41c9e.tar.bz2 opensim-SC-64f9f03e9a3cb345ef85e1990bebc3a7cca41c9e.tar.xz |
Plumb some more
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs')
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 170 |
1 files changed, 148 insertions, 22 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index b517c13..d40faac 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -273,6 +273,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
273 | 273 | ||
274 | private MapItemRequest handlerMapItemRequest = null; | 274 | private MapItemRequest handlerMapItemRequest = null; |
275 | 275 | ||
276 | private IGroupsModule m_GroupsModule = null; | ||
277 | |||
276 | //private TerrainUnacked handlerUnackedTerrain = null; | 278 | //private TerrainUnacked handlerUnackedTerrain = null; |
277 | 279 | ||
278 | //** | 280 | //** |
@@ -411,6 +413,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
411 | AuthenticateResponse sessionInfo, UUID agentId, UUID sessionId, uint circuitCode, EndPoint proxyEP, | 413 | AuthenticateResponse sessionInfo, UUID agentId, UUID sessionId, uint circuitCode, EndPoint proxyEP, |
412 | ClientStackUserSettings userSettings) | 414 | ClientStackUserSettings userSettings) |
413 | { | 415 | { |
416 | m_GroupsModule = scene.RequestModuleInterface<IGroupsModule>(); | ||
414 | m_moneyBalance = 1000; | 417 | m_moneyBalance = 1000; |
415 | 418 | ||
416 | m_channelVersion = Utils.StringToBytes(scene.GetSimulatorVersion()); | 419 | m_channelVersion = Utils.StringToBytes(scene.GetSimulatorVersion()); |
@@ -6286,10 +6289,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
6286 | //m_log.Warn("[CLIENT]: unhandled ViewerStats packet"); | 6289 | //m_log.Warn("[CLIENT]: unhandled ViewerStats packet"); |
6287 | break; | 6290 | break; |
6288 | 6291 | ||
6289 | case PacketType.CreateGroupRequest: | ||
6290 | // TODO: handle this packet | ||
6291 | //m_log.Warn("[CLIENT]: unhandled CreateGroupRequest packet"); | ||
6292 | break; | ||
6293 | //case PacketType.GenericMessage: | 6292 | //case PacketType.GenericMessage: |
6294 | // TODO: handle this packet | 6293 | // TODO: handle this packet |
6295 | //m_log.Warn("[CLIENT]: unhandled GenericMessage packet"); | 6294 | //m_log.Warn("[CLIENT]: unhandled GenericMessage packet"); |
@@ -6462,10 +6461,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
6462 | 6461 | ||
6463 | case PacketType.ActivateGroup: | 6462 | case PacketType.ActivateGroup: |
6464 | ActivateGroupPacket activateGroupPacket = (ActivateGroupPacket)Pack; | 6463 | ActivateGroupPacket activateGroupPacket = (ActivateGroupPacket)Pack; |
6465 | IGroupsModule grps = m_scene.RequestModuleInterface<IGroupsModule>(); | 6464 | if (m_GroupsModule != null) |
6466 | if (grps != null) | ||
6467 | { | 6465 | { |
6468 | grps.ActivateGroup(this, activateGroupPacket.AgentData.GroupID); | 6466 | m_GroupsModule.ActivateGroup(this, activateGroupPacket.AgentData.GroupID); |
6467 | m_GroupsModule.SendAgentGroupDataUpdate(this); | ||
6469 | } | 6468 | } |
6470 | break; | 6469 | break; |
6471 | 6470 | ||
@@ -6473,8 +6472,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
6473 | GroupTitlesRequestPacket groupTitlesRequest = | 6472 | GroupTitlesRequestPacket groupTitlesRequest = |
6474 | (GroupTitlesRequestPacket)Pack; | 6473 | (GroupTitlesRequestPacket)Pack; |
6475 | 6474 | ||
6476 | IGroupsModule grps2 = m_scene.RequestModuleInterface<IGroupsModule>(); | 6475 | if (m_GroupsModule != null) |
6477 | if (grps2 != null) | ||
6478 | { | 6476 | { |
6479 | GroupTitlesReplyPacket groupTitlesReply = (GroupTitlesReplyPacket)PacketPool.Instance.GetPacket(PacketType.GroupTitlesReply); | 6477 | GroupTitlesReplyPacket groupTitlesReply = (GroupTitlesReplyPacket)PacketPool.Instance.GetPacket(PacketType.GroupTitlesReply); |
6480 | 6478 | ||
@@ -6489,7 +6487,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
6489 | groupTitlesRequest.AgentData.RequestID; | 6487 | groupTitlesRequest.AgentData.RequestID; |
6490 | 6488 | ||
6491 | List<GroupTitlesData> titles = | 6489 | List<GroupTitlesData> titles = |
6492 | grps2.GroupTitlesRequest(this, | 6490 | m_GroupsModule.GroupTitlesRequest(this, |
6493 | groupTitlesRequest.AgentData.GroupID); | 6491 | groupTitlesRequest.AgentData.GroupID); |
6494 | 6492 | ||
6495 | groupTitlesReply.GroupData = | 6493 | groupTitlesReply.GroupData = |
@@ -6520,8 +6518,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
6520 | GroupProfileRequestPacket groupProfileRequest = | 6518 | GroupProfileRequestPacket groupProfileRequest = |
6521 | (GroupProfileRequestPacket)Pack; | 6519 | (GroupProfileRequestPacket)Pack; |
6522 | 6520 | ||
6523 | IGroupsModule grps3 = m_scene.RequestModuleInterface<IGroupsModule>(); | 6521 | if (m_GroupsModule != null) |
6524 | if (grps3 != null) | ||
6525 | { | 6522 | { |
6526 | GroupProfileReplyPacket groupProfileReply = (GroupProfileReplyPacket)PacketPool.Instance.GetPacket(PacketType.GroupProfileReply); | 6523 | GroupProfileReplyPacket groupProfileReply = (GroupProfileReplyPacket)PacketPool.Instance.GetPacket(PacketType.GroupProfileReply); |
6527 | 6524 | ||
@@ -6529,7 +6526,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
6529 | groupProfileReply.GroupData = new GroupProfileReplyPacket.GroupDataBlock(); | 6526 | groupProfileReply.GroupData = new GroupProfileReplyPacket.GroupDataBlock(); |
6530 | groupProfileReply.AgentData.AgentID = AgentId; | 6527 | groupProfileReply.AgentData.AgentID = AgentId; |
6531 | 6528 | ||
6532 | GroupProfileData d = grps3.GroupProfileRequest(this, | 6529 | GroupProfileData d = m_GroupsModule.GroupProfileRequest(this, |
6533 | groupProfileRequest.GroupData.GroupID); | 6530 | groupProfileRequest.GroupData.GroupID); |
6534 | 6531 | ||
6535 | groupProfileReply.GroupData.GroupID = d.GroupID; | 6532 | groupProfileReply.GroupData.GroupID = d.GroupID; |
@@ -6557,11 +6554,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
6557 | GroupMembersRequestPacket groupMembersRequestPacket = | 6554 | GroupMembersRequestPacket groupMembersRequestPacket = |
6558 | (GroupMembersRequestPacket)Pack; | 6555 | (GroupMembersRequestPacket)Pack; |
6559 | 6556 | ||
6560 | IGroupsModule grps4 = m_scene.RequestModuleInterface<IGroupsModule>(); | ||
6561 | List<GroupMembersData> members = | 6557 | List<GroupMembersData> members = |
6562 | grps4.GroupMembersRequest(this, groupMembersRequestPacket.GroupData.GroupID); | 6558 | m_GroupsModule.GroupMembersRequest(this, groupMembersRequestPacket.GroupData.GroupID); |
6563 | 6559 | ||
6564 | if (grps4 != null) | 6560 | if (m_GroupsModule != null) |
6565 | { | 6561 | { |
6566 | GroupMembersReplyPacket groupMembersReply = (GroupMembersReplyPacket)PacketPool.Instance.GetPacket(PacketType.GroupMembersReply); | 6562 | GroupMembersReplyPacket groupMembersReply = (GroupMembersReplyPacket)PacketPool.Instance.GetPacket(PacketType.GroupMembersReply); |
6567 | 6563 | ||
@@ -6608,8 +6604,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
6608 | GroupRoleDataRequestPacket groupRolesRequest = | 6604 | GroupRoleDataRequestPacket groupRolesRequest = |
6609 | (GroupRoleDataRequestPacket)Pack; | 6605 | (GroupRoleDataRequestPacket)Pack; |
6610 | 6606 | ||
6611 | IGroupsModule grps5 = m_scene.RequestModuleInterface<IGroupsModule>(); | 6607 | if (m_GroupsModule != null) |
6612 | if (grps5 != null) | ||
6613 | { | 6608 | { |
6614 | GroupRoleDataReplyPacket groupRolesReply = (GroupRoleDataReplyPacket)PacketPool.Instance.GetPacket(PacketType.GroupRoleDataReply); | 6609 | GroupRoleDataReplyPacket groupRolesReply = (GroupRoleDataReplyPacket)PacketPool.Instance.GetPacket(PacketType.GroupRoleDataReply); |
6615 | 6610 | ||
@@ -6629,7 +6624,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
6629 | groupRolesRequest.GroupData.RequestID; | 6624 | groupRolesRequest.GroupData.RequestID; |
6630 | 6625 | ||
6631 | List<GroupRolesData> titles = | 6626 | List<GroupRolesData> titles = |
6632 | grps5.GroupRoleDataRequest(this, | 6627 | m_GroupsModule.GroupRoleDataRequest(this, |
6633 | groupRolesRequest.GroupData.GroupID); | 6628 | groupRolesRequest.GroupData.GroupID); |
6634 | 6629 | ||
6635 | groupRolesReply.GroupData.RoleCount = | 6630 | groupRolesReply.GroupData.RoleCount = |
@@ -6670,8 +6665,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
6670 | GroupRoleMembersRequestPacket groupRoleMembersRequest = | 6665 | GroupRoleMembersRequestPacket groupRoleMembersRequest = |
6671 | (GroupRoleMembersRequestPacket)Pack; | 6666 | (GroupRoleMembersRequestPacket)Pack; |
6672 | 6667 | ||
6673 | IGroupsModule grps6 = m_scene.RequestModuleInterface<IGroupsModule>(); | 6668 | if (m_GroupsModule != null) |
6674 | if (grps6 != null) | ||
6675 | { | 6669 | { |
6676 | GroupRoleMembersReplyPacket groupRoleMembersReply = (GroupRoleMembersReplyPacket)PacketPool.Instance.GetPacket(PacketType.GroupRoleMembersReply); | 6670 | GroupRoleMembersReplyPacket groupRoleMembersReply = (GroupRoleMembersReplyPacket)PacketPool.Instance.GetPacket(PacketType.GroupRoleMembersReply); |
6677 | groupRoleMembersReply.AgentData = | 6671 | groupRoleMembersReply.AgentData = |
@@ -6684,7 +6678,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
6684 | groupRoleMembersRequest.GroupData.RequestID; | 6678 | groupRoleMembersRequest.GroupData.RequestID; |
6685 | 6679 | ||
6686 | List<GroupRoleMembersData> mappings = | 6680 | List<GroupRoleMembersData> mappings = |
6687 | grps6.GroupRoleMembersRequest(this, | 6681 | m_GroupsModule.GroupRoleMembersRequest(this, |
6688 | groupRoleMembersRequest.GroupData.GroupID); | 6682 | groupRoleMembersRequest.GroupData.GroupID); |
6689 | 6683 | ||
6690 | groupRoleMembersReply.AgentData.TotalPairs = | 6684 | groupRoleMembersReply.AgentData.TotalPairs = |
@@ -6713,6 +6707,108 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
6713 | } | 6707 | } |
6714 | break; | 6708 | break; |
6715 | 6709 | ||
6710 | case PacketType.CreateGroupRequest: | ||
6711 | CreateGroupRequestPacket createGroupRequest = | ||
6712 | (CreateGroupRequestPacket)Pack; | ||
6713 | |||
6714 | if (m_GroupsModule != null) | ||
6715 | { | ||
6716 | CreateGroupReplyPacket createGroupReply = (CreateGroupReplyPacket)PacketPool.Instance.GetPacket(PacketType.CreateGroupReply); | ||
6717 | |||
6718 | createGroupReply.AgentData = | ||
6719 | new CreateGroupReplyPacket.AgentDataBlock(); | ||
6720 | createGroupReply.ReplyData = | ||
6721 | new CreateGroupReplyPacket.ReplyDataBlock(); | ||
6722 | |||
6723 | createGroupReply.AgentData.AgentID = AgentId; | ||
6724 | createGroupReply.ReplyData.GroupID = UUID.Zero; | ||
6725 | |||
6726 | IMoneyModule money = m_scene.RequestModuleInterface<IMoneyModule>(); | ||
6727 | if (money != null && !money.GroupCreationCovered(this)) | ||
6728 | { | ||
6729 | createGroupReply.ReplyData.Success = false; | ||
6730 | createGroupReply.ReplyData.Message = Utils.StringToBytes("You do not have sufficient funds to create a group"); | ||
6731 | OutPacket(createGroupReply, ThrottleOutPacketType.Task); | ||
6732 | break; | ||
6733 | } | ||
6734 | |||
6735 | UUID groupID = m_GroupsModule.CreateGroup(this, | ||
6736 | Utils.BytesToString(createGroupRequest.GroupData.Name), | ||
6737 | Utils.BytesToString(createGroupRequest.GroupData.Charter), | ||
6738 | createGroupRequest.GroupData.ShowInList, | ||
6739 | createGroupRequest.GroupData.InsigniaID, | ||
6740 | createGroupRequest.GroupData.MembershipFee, | ||
6741 | createGroupRequest.GroupData.OpenEnrollment, | ||
6742 | createGroupRequest.GroupData.AllowPublish, | ||
6743 | createGroupRequest.GroupData.MaturePublish); | ||
6744 | if (groupID == UUID.Zero) | ||
6745 | { | ||
6746 | createGroupReply.ReplyData.Success = false; | ||
6747 | createGroupReply.ReplyData.Message = Utils.StringToBytes("We're sorry, but we could not create the requested group. Please try another name"); | ||
6748 | OutPacket(createGroupReply, ThrottleOutPacketType.Task); | ||
6749 | break; | ||
6750 | } | ||
6751 | |||
6752 | if (money != null) | ||
6753 | money.ApplyGroupCreationCharge(AgentId); | ||
6754 | |||
6755 | createGroupReply.ReplyData.Success = true; | ||
6756 | createGroupReply.ReplyData.GroupID = groupID; | ||
6757 | createGroupReply.ReplyData.Message = Utils.StringToBytes("Group created"); | ||
6758 | OutPacket(createGroupReply, ThrottleOutPacketType.Task); | ||
6759 | |||
6760 | // Sync with event queue | ||
6761 | System.Threading.Thread.Sleep(1000); | ||
6762 | |||
6763 | m_GroupsModule.SendAgentGroupDataUpdate(this); | ||
6764 | } | ||
6765 | break; | ||
6766 | |||
6767 | case PacketType.UpdateGroupInfo: | ||
6768 | UpdateGroupInfoPacket updateGroupInfo = | ||
6769 | (UpdateGroupInfoPacket)Pack; | ||
6770 | |||
6771 | if (m_GroupsModule != null) | ||
6772 | { | ||
6773 | m_GroupsModule.UpdateGroupInfo(this, | ||
6774 | updateGroupInfo.GroupData.GroupID, | ||
6775 | Utils.BytesToString(updateGroupInfo.GroupData.Charter), | ||
6776 | updateGroupInfo.GroupData.ShowInList, | ||
6777 | updateGroupInfo.GroupData.InsigniaID, | ||
6778 | updateGroupInfo.GroupData.MembershipFee, | ||
6779 | updateGroupInfo.GroupData.OpenEnrollment, | ||
6780 | updateGroupInfo.GroupData.AllowPublish, | ||
6781 | updateGroupInfo.GroupData.MaturePublish); | ||
6782 | } | ||
6783 | |||
6784 | break; | ||
6785 | |||
6786 | case PacketType.SetGroupAcceptNotices: | ||
6787 | SetGroupAcceptNoticesPacket setGroupAcceptNotices = | ||
6788 | (SetGroupAcceptNoticesPacket)Pack; | ||
6789 | |||
6790 | if (m_GroupsModule != null) | ||
6791 | { | ||
6792 | m_GroupsModule.SetGroupAcceptNotices(this, | ||
6793 | setGroupAcceptNotices.Data.GroupID, | ||
6794 | setGroupAcceptNotices.Data.AcceptNotices, | ||
6795 | setGroupAcceptNotices.NewData.ListInProfile); | ||
6796 | } | ||
6797 | |||
6798 | break; | ||
6799 | |||
6800 | case PacketType.GroupTitleUpdate: | ||
6801 | GroupTitleUpdatePacket groupTitleUpdate = | ||
6802 | (GroupTitleUpdatePacket)Pack; | ||
6803 | |||
6804 | if (m_GroupsModule != null) | ||
6805 | { | ||
6806 | m_GroupsModule.GroupTitleUpdate(this, | ||
6807 | groupTitleUpdate.AgentData.GroupID, | ||
6808 | groupTitleUpdate.AgentData.TitleRoleID); | ||
6809 | } | ||
6810 | |||
6811 | break; | ||
6716 | default: | 6812 | default: |
6717 | m_log.Warn("[CLIENT]: unhandled packet " + Pack.ToString()); | 6813 | m_log.Warn("[CLIENT]: unhandled packet " + Pack.ToString()); |
6718 | break; | 6814 | break; |
@@ -7459,6 +7555,36 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
7459 | OutPacket(p, ThrottleOutPacketType.Task); | 7555 | OutPacket(p, ThrottleOutPacketType.Task); |
7460 | } | 7556 | } |
7461 | 7557 | ||
7558 | public void SendAvatarGroupsReply(UUID avatarID, GroupMembershipData[] data) | ||
7559 | { | ||
7560 | int i; | ||
7561 | |||
7562 | AvatarGroupsReplyPacket p = (AvatarGroupsReplyPacket)PacketPool.Instance.GetPacket(PacketType.AvatarGroupsReply); | ||
7563 | |||
7564 | p.AgentData = new AvatarGroupsReplyPacket.AgentDataBlock(); | ||
7565 | p.AgentData.AgentID = AgentId; | ||
7566 | p.AgentData.AvatarID = avatarID; | ||
7567 | |||
7568 | p.GroupData = new AvatarGroupsReplyPacket.GroupDataBlock[data.Length]; | ||
7569 | i = 0; | ||
7570 | foreach (GroupMembershipData m in data) | ||
7571 | { | ||
7572 | p.GroupData[i] = new AvatarGroupsReplyPacket.GroupDataBlock(); | ||
7573 | p.GroupData[i].GroupPowers = m.GroupPowers; | ||
7574 | p.GroupData[i].AcceptNotices = m.AcceptNotices; | ||
7575 | p.GroupData[i].GroupTitle = Utils.StringToBytes(m.GroupTitle); | ||
7576 | p.GroupData[i].GroupID = m.GroupID; | ||
7577 | p.GroupData[i].GroupName = Utils.StringToBytes(m.GroupName); | ||
7578 | p.GroupData[i].GroupInsigniaID = m.GroupPicture; | ||
7579 | i++; | ||
7580 | } | ||
7581 | |||
7582 | p.NewGroupData = new AvatarGroupsReplyPacket.NewGroupDataBlock(); | ||
7583 | p.NewGroupData.ListInProfile = true; | ||
7584 | |||
7585 | OutPacket(p, ThrottleOutPacketType.Task); | ||
7586 | } | ||
7587 | |||
7462 | public void KillEndDone() | 7588 | public void KillEndDone() |
7463 | { | 7589 | { |
7464 | KillPacket kp = new KillPacket(); | 7590 | KillPacket kp = new KillPacket(); |