Moving the new group data structures out of LLClientView into GroupData.

The new methods are still not in IClientAPI, so some work remains to be done.
mysql-performance
Melanie 2010-01-08 05:29:29 +00:00
parent 452be5e546
commit 17efecd6c5
2 changed files with 54 additions and 50 deletions

View File

@ -135,4 +135,30 @@ namespace OpenSim.Framework
public bool HasAttachment;
public byte AssetType;
}
public struct GroupVoteHistory
{
public string VoteID;
public string VoteInitiator;
public string Majority;
public string Quorum;
public string TerseDateID;
public string StartDateTime;
public string EndDateTime;
public string VoteType;
public string VoteResult;
public string ProposalText;
}
public struct GroupActiveProposals
{
public string VoteID;
public string VoteInitiator;
public string Majority;
public string Quorum;
public string TerseDateID;
public string StartDateTime;
public string EndDateTime;
public string ProposalText;
}
}

View File

@ -824,21 +824,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
gmp.ParamList[i++].Parameter = Util.StringToBytes256(val);
}
OutPacket(gmp, ThrottleOutPacketType.Task);
}
public struct GroupActiveProposals
{
public string VoteID;
public string VoteInitiator;
public string Majority;
public string Quorum;
public string TerseDateID;
public string StartDateTime;
public string EndDateTime;
public string ProposalText;
}
public void SendGroupActiveProposals(UUID groupID, UUID transactionID, GroupActiveProposals[] Proposals)
{
int i = 0;
{
int i = 0;
foreach (GroupActiveProposals Proposal in Proposals)
{
GroupActiveProposalItemReplyPacket GAPIRP = new GroupActiveProposalItemReplyPacket();
@ -849,20 +839,20 @@ namespace OpenSim.Region.ClientStack.LindenUDP
GAPIRP.TransactionData.TotalNumItems = ((uint)i+1);
GroupActiveProposalItemReplyPacket.ProposalDataBlock ProposalData = new GroupActiveProposalItemReplyPacket.ProposalDataBlock();
GAPIRP.ProposalData = new GroupActiveProposalItemReplyPacket.ProposalDataBlock[1];
ProposalData.VoteCast = Utils.StringToBytes("false");
ProposalData.VoteID = new UUID(Proposal.VoteID);
ProposalData.VoteInitiator = new UUID(Proposal.VoteInitiator);
ProposalData.Majority = (float)Convert.ToInt32(Proposal.Majority);
ProposalData.Quorum = Convert.ToInt32(Proposal.Quorum);
ProposalData.TerseDateID = Utils.StringToBytes(Proposal.TerseDateID);
ProposalData.StartDateTime = Utils.StringToBytes(Proposal.StartDateTime);
ProposalData.EndDateTime = Utils.StringToBytes(Proposal.EndDateTime);
ProposalData.VoteCast = Utils.StringToBytes("false");
ProposalData.VoteID = new UUID(Proposal.VoteID);
ProposalData.VoteInitiator = new UUID(Proposal.VoteInitiator);
ProposalData.Majority = (float)Convert.ToInt32(Proposal.Majority);
ProposalData.Quorum = Convert.ToInt32(Proposal.Quorum);
ProposalData.TerseDateID = Utils.StringToBytes(Proposal.TerseDateID);
ProposalData.StartDateTime = Utils.StringToBytes(Proposal.StartDateTime);
ProposalData.EndDateTime = Utils.StringToBytes(Proposal.EndDateTime);
ProposalData.ProposalText = Utils.StringToBytes(Proposal.ProposalText);
ProposalData.AlreadyVoted = false;
GAPIRP.ProposalData[i] = ProposalData;
OutPacket(GAPIRP, ThrottleOutPacketType.Task);
i++;
}
}
if (Proposals.Length == 0)
{
GroupActiveProposalItemReplyPacket GAPIRP = new GroupActiveProposalItemReplyPacket();
@ -886,40 +876,28 @@ namespace OpenSim.Region.ClientStack.LindenUDP
GAPIRP.ProposalData[0] = ProposalData;
OutPacket(GAPIRP, ThrottleOutPacketType.Task);
}
}
public struct GroupVoteHistory
{
public string VoteID;
public string VoteInitiator;
public string Majority;
public string Quorum;
public string TerseDateID;
public string StartDateTime;
public string EndDateTime;
public string VoteType;
public string VoteResult;
public string ProposalText;
}
public void SendGroupVoteHistory(UUID groupID, UUID transactionID, GroupVoteHistory[] Votes)
{
int i = 0;
{
int i = 0;
foreach (GroupVoteHistory Vote in Votes)
{
GroupVoteHistoryItemReplyPacket GVHIRP = new GroupVoteHistoryItemReplyPacket();
GroupVoteHistoryItemReplyPacket GVHIRP = new GroupVoteHistoryItemReplyPacket();
GVHIRP.AgentData.AgentID = AgentId;
GVHIRP.AgentData.GroupID = groupID;
GVHIRP.TransactionData.TransactionID = transactionID;
GVHIRP.TransactionData.TotalNumItems = ((uint)i+1);
GVHIRP.HistoryItemData.VoteID = new UUID(Vote.VoteID);
GVHIRP.HistoryItemData.VoteInitiator = new UUID(Vote.VoteInitiator);
GVHIRP.HistoryItemData.Majority = (float)Convert.ToInt32(Vote.Majority);
GVHIRP.HistoryItemData.Quorum = Convert.ToInt32(Vote.Quorum);
GVHIRP.HistoryItemData.TerseDateID = Utils.StringToBytes(Vote.TerseDateID);
GVHIRP.HistoryItemData.StartDateTime = Utils.StringToBytes(Vote.StartDateTime);
GVHIRP.HistoryItemData.EndDateTime = Utils.StringToBytes(Vote.EndDateTime);
GVHIRP.HistoryItemData.VoteType = Utils.StringToBytes(Vote.VoteType);
GVHIRP.HistoryItemData.VoteResult = Utils.StringToBytes(Vote.VoteResult);
GVHIRP.TransactionData.TotalNumItems = ((uint)i+1);
GVHIRP.HistoryItemData.VoteID = new UUID(Vote.VoteID);
GVHIRP.HistoryItemData.VoteInitiator = new UUID(Vote.VoteInitiator);
GVHIRP.HistoryItemData.Majority = (float)Convert.ToInt32(Vote.Majority);
GVHIRP.HistoryItemData.Quorum = Convert.ToInt32(Vote.Quorum);
GVHIRP.HistoryItemData.TerseDateID = Utils.StringToBytes(Vote.TerseDateID);
GVHIRP.HistoryItemData.StartDateTime = Utils.StringToBytes(Vote.StartDateTime);
GVHIRP.HistoryItemData.EndDateTime = Utils.StringToBytes(Vote.EndDateTime);
GVHIRP.HistoryItemData.VoteType = Utils.StringToBytes(Vote.VoteType);
GVHIRP.HistoryItemData.VoteResult = Utils.StringToBytes(Vote.VoteResult);
GVHIRP.HistoryItemData.ProposalText = Utils.StringToBytes(Vote.ProposalText);
GroupVoteHistoryItemReplyPacket.VoteItemBlock VoteItem = new GroupVoteHistoryItemReplyPacket.VoteItemBlock();
GVHIRP.VoteItem = new GroupVoteHistoryItemReplyPacket.VoteItemBlock[1];
@ -927,7 +905,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
VoteItem.NumVotes = 0; //TODO: FIX THIS!!!
VoteItem.VoteCast = Utils.StringToBytes("Yes");
GVHIRP.VoteItem[i] = VoteItem;
OutPacket(GVHIRP, ThrottleOutPacketType.Task);
OutPacket(GVHIRP, ThrottleOutPacketType.Task);
i++;
}
if (Votes.Length == 0)