Second Fix to the new Packets as per Melanie's request.

Signed-off-by: Melanie <melanie@t-data.com>
mysql-performance
Revolution 2010-01-07 23:14:26 -06:00 committed by Melanie
parent b67470af91
commit 452be5e546
1 changed files with 61 additions and 39 deletions

View File

@ -824,40 +824,50 @@ namespace OpenSim.Region.ClientStack.LindenUDP
gmp.ParamList[i++].Parameter = Util.StringToBytes256(val); gmp.ParamList[i++].Parameter = Util.StringToBytes256(val);
} }
OutPacket(gmp, ThrottleOutPacketType.Task); OutPacket(gmp, ThrottleOutPacketType.Task);
} }
public struct GroupActiveProposals
public void SendGroupActiveProposals(IClientAPI sender,UUID agentID, UUID sessionID, UUID groupID, UUID transactionID, string[] VoteID, string[] VoteInitiator, string[] Majority, string[] Quorum, string[] TerseDateID, string[] StartDateTime, string[] EndDateTime, string[] ProposalText)
{ {
int i = 0; public string VoteID;
foreach (string voteID in 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;
foreach (GroupActiveProposals Proposal in Proposals)
{ {
GroupActiveProposalItemReplyPacket GAPIRP = new GroupActiveProposalItemReplyPacket(); GroupActiveProposalItemReplyPacket GAPIRP = new GroupActiveProposalItemReplyPacket();
GAPIRP.AgentData.AgentID = agentID; GAPIRP.AgentData.AgentID = AgentId;
GAPIRP.AgentData.GroupID = groupID; GAPIRP.AgentData.GroupID = groupID;
GAPIRP.TransactionData.TransactionID = transactionID; GAPIRP.TransactionData.TransactionID = transactionID;
GAPIRP.TransactionData.TotalNumItems = ((uint)i+1); GAPIRP.TransactionData.TotalNumItems = ((uint)i+1);
GroupActiveProposalItemReplyPacket.ProposalDataBlock ProposalData = new GroupActiveProposalItemReplyPacket.ProposalDataBlock(); GroupActiveProposalItemReplyPacket.ProposalDataBlock ProposalData = new GroupActiveProposalItemReplyPacket.ProposalDataBlock();
GAPIRP.ProposalData = new GroupActiveProposalItemReplyPacket.ProposalDataBlock[1]; GAPIRP.ProposalData = new GroupActiveProposalItemReplyPacket.ProposalDataBlock[1];
ProposalData.VoteCast = Utils.StringToBytes("false"); ProposalData.VoteCast = Utils.StringToBytes("false");
ProposalData.VoteID = new UUID(VoteID[i]); ProposalData.VoteID = new UUID(Proposal.VoteID);
ProposalData.VoteInitiator = new UUID(VoteInitiator[i]); ProposalData.VoteInitiator = new UUID(Proposal.VoteInitiator);
ProposalData.Majority = (float)Convert.ToInt32(Majority[i]); ProposalData.Majority = (float)Convert.ToInt32(Proposal.Majority);
ProposalData.Quorum = Convert.ToInt32(Quorum[i]); ProposalData.Quorum = Convert.ToInt32(Proposal.Quorum);
ProposalData.TerseDateID = Utils.StringToBytes(TerseDateID[i]); ProposalData.TerseDateID = Utils.StringToBytes(Proposal.TerseDateID);
ProposalData.StartDateTime = Utils.StringToBytes(StartDateTime[i]); ProposalData.StartDateTime = Utils.StringToBytes(Proposal.StartDateTime);
ProposalData.EndDateTime = Utils.StringToBytes(EndDateTime[i]); ProposalData.EndDateTime = Utils.StringToBytes(Proposal.EndDateTime);
ProposalData.ProposalText = Utils.StringToBytes(ProposalText[i]); ProposalData.ProposalText = Utils.StringToBytes(Proposal.ProposalText);
ProposalData.AlreadyVoted = false; ProposalData.AlreadyVoted = false;
GAPIRP.ProposalData[i] = ProposalData; GAPIRP.ProposalData[i] = ProposalData;
OutPacket(GAPIRP, ThrottleOutPacketType.Task); OutPacket(GAPIRP, ThrottleOutPacketType.Task);
i++; i++;
} }
if (VoteID.Length == 0) if (Proposals.Length == 0)
{ {
GroupActiveProposalItemReplyPacket GAPIRP = new GroupActiveProposalItemReplyPacket(); GroupActiveProposalItemReplyPacket GAPIRP = new GroupActiveProposalItemReplyPacket();
GAPIRP.AgentData.AgentID = agentID; GAPIRP.AgentData.AgentID = AgentId;
GAPIRP.AgentData.GroupID = groupID; GAPIRP.AgentData.GroupID = groupID;
GAPIRP.TransactionData.TransactionID = transactionID; GAPIRP.TransactionData.TransactionID = transactionID;
GAPIRP.TransactionData.TotalNumItems = 1; GAPIRP.TransactionData.TotalNumItems = 1;
@ -876,29 +886,41 @@ namespace OpenSim.Region.ClientStack.LindenUDP
GAPIRP.ProposalData[0] = ProposalData; GAPIRP.ProposalData[0] = ProposalData;
OutPacket(GAPIRP, ThrottleOutPacketType.Task); OutPacket(GAPIRP, ThrottleOutPacketType.Task);
} }
} }
public struct GroupVoteHistory
public void SendGroupVoteHistory(IClientAPI sender,UUID agentID, UUID sessionID, UUID groupID, UUID transactionID, string[] VoteID, string[] VoteInitiator, string[] Majority, string[] Quorum, string[] TerseDateID, string[] StartDateTime, string[] EndDateTime, string[] VoteType, string[] VoteResult, string[] ProposalText)
{ {
int i = 0; public string VoteID;
foreach (string voteID in 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;
foreach (GroupVoteHistory Vote in Votes)
{ {
GroupVoteHistoryItemReplyPacket GVHIRP = new GroupVoteHistoryItemReplyPacket(); GroupVoteHistoryItemReplyPacket GVHIRP = new GroupVoteHistoryItemReplyPacket();
GVHIRP.AgentData.AgentID = agentID; GVHIRP.AgentData.AgentID = AgentId;
GVHIRP.AgentData.GroupID = groupID; GVHIRP.AgentData.GroupID = groupID;
GVHIRP.TransactionData.TransactionID = transactionID; GVHIRP.TransactionData.TransactionID = transactionID;
GVHIRP.TransactionData.TotalNumItems = ((uint)i+1); GVHIRP.TransactionData.TotalNumItems = ((uint)i+1);
GVHIRP.HistoryItemData.VoteID = new UUID(VoteID[i]); GVHIRP.HistoryItemData.VoteID = new UUID(Vote.VoteID);
GVHIRP.HistoryItemData.VoteInitiator = new UUID(VoteInitiator[i]); GVHIRP.HistoryItemData.VoteInitiator = new UUID(Vote.VoteInitiator);
GVHIRP.HistoryItemData.Majority = (float)Convert.ToInt32(Majority[i]); GVHIRP.HistoryItemData.Majority = (float)Convert.ToInt32(Vote.Majority);
GVHIRP.HistoryItemData.Quorum = Convert.ToInt32(Quorum[i]); GVHIRP.HistoryItemData.Quorum = Convert.ToInt32(Vote.Quorum);
GVHIRP.HistoryItemData.TerseDateID = Utils.StringToBytes(TerseDateID[i]); GVHIRP.HistoryItemData.TerseDateID = Utils.StringToBytes(Vote.TerseDateID);
GVHIRP.HistoryItemData.StartDateTime = Utils.StringToBytes(StartDateTime[i]); GVHIRP.HistoryItemData.StartDateTime = Utils.StringToBytes(Vote.StartDateTime);
GVHIRP.HistoryItemData.EndDateTime = Utils.StringToBytes(EndDateTime[i]); GVHIRP.HistoryItemData.EndDateTime = Utils.StringToBytes(Vote.EndDateTime);
GVHIRP.HistoryItemData.VoteType = Utils.StringToBytes(VoteType[i]); GVHIRP.HistoryItemData.VoteType = Utils.StringToBytes(Vote.VoteType);
GVHIRP.HistoryItemData.VoteResult = Utils.StringToBytes(VoteResult[i]); GVHIRP.HistoryItemData.VoteResult = Utils.StringToBytes(Vote.VoteResult);
GVHIRP.HistoryItemData.ProposalText = Utils.StringToBytes(ProposalText[i]); GVHIRP.HistoryItemData.ProposalText = Utils.StringToBytes(Vote.ProposalText);
GroupVoteHistoryItemReplyPacket.VoteItemBlock VoteItem = new GroupVoteHistoryItemReplyPacket.VoteItemBlock(); GroupVoteHistoryItemReplyPacket.VoteItemBlock VoteItem = new GroupVoteHistoryItemReplyPacket.VoteItemBlock();
GVHIRP.VoteItem = new GroupVoteHistoryItemReplyPacket.VoteItemBlock[1]; GVHIRP.VoteItem = new GroupVoteHistoryItemReplyPacket.VoteItemBlock[1];
VoteItem.CandidateID = UUID.Zero; VoteItem.CandidateID = UUID.Zero;
@ -908,11 +930,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
OutPacket(GVHIRP, ThrottleOutPacketType.Task); OutPacket(GVHIRP, ThrottleOutPacketType.Task);
i++; i++;
} }
if (VoteID.Length == 0) if (Votes.Length == 0)
{ {
GroupVoteHistoryItemReplyPacket GVHIRP = new GroupVoteHistoryItemReplyPacket(); GroupVoteHistoryItemReplyPacket GVHIRP = new GroupVoteHistoryItemReplyPacket();
GVHIRP.AgentData.AgentID = agentID; GVHIRP.AgentData.AgentID = AgentId;
GVHIRP.AgentData.GroupID = groupID; GVHIRP.AgentData.GroupID = groupID;
GVHIRP.TransactionData.TransactionID = transactionID; GVHIRP.TransactionData.TransactionID = transactionID;
GVHIRP.TransactionData.TotalNumItems = 0; GVHIRP.TransactionData.TotalNumItems = 0;