本文整理汇总了C#中Messages.PopCollection方法的典型用法代码示例。如果您正苦于以下问题:C# Messages.PopCollection方法的具体用法?C# Messages.PopCollection怎么用?C# Messages.PopCollection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Messages
的用法示例。
在下文中一共展示了Messages.PopCollection方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Invoke
public void Invoke(Network.Session Session, Messages.PacketEvent Packet)
{
foreach (int TargetId in Packet.PopCollection())
{
if (TargetId < 1 || TargetId == Session.Character.Id)
{
continue;
}
if (Session.Character.MessengerFriends.Contains(TargetId))
{
continue;
}
if (!Session.Character.MessengerRequests.Contains(TargetId))
{
continue;
}
if (Session.Character.MessengerFriends.Count >= System.HabboSystem.MessengerManager.GetLimitFriends(Session.Character.Id))
{
Session.WriteComposer(new MessengerErrorComposer(39, 2));
return;
}
Session.Character.MessengerFriends.Add(TargetId);
Session.Character.MessengerRequests.Remove(TargetId);
CharacterStatus Status = System.HabboSystem.CharacterManager.GetStatus(TargetId);
Session.WriteComposer(new FriendListUpdateComposer(Session.Character, new Dictionary<int, int>
{
{
TargetId, (int)MessengerUpdateType.NewFriendship
}
}));
if (Status == CharacterStatus.Online)
{
var TargetSession = System.NetworkSocket.GetSession(TargetId);
if (TargetSession != null)
{
TargetSession.WriteComposer(new FriendListUpdateComposer(TargetSession.Character, new Dictionary<int, int>
{
{
Session.Character.Id, (int)MessengerUpdateType.NewFriendship
}
}));
TargetSession.Character.MessengerFriends.Add(Session.Character.Id);
}
}
System.MySQLManager.InvokeQuery(new MessengerAcceptFriendQuery(TargetId, Session.Character.Id));
}
}