本文整理汇总了C#中BlueSheep.Interface.AccountUC.ActualizeInventory方法的典型用法代码示例。如果您正苦于以下问题:C# AccountUC.ActualizeInventory方法的具体用法?C# AccountUC.ActualizeInventory怎么用?C# AccountUC.ActualizeInventory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BlueSheep.Interface.AccountUC
的用法示例。
在下文中一共展示了AccountUC.ActualizeInventory方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InventoryContentAndPresetMessageTreatment
public static void InventoryContentAndPresetMessageTreatment(Message message, byte[] packetDatas, AccountUC account)
{
InventoryContentAndPresetMessage msg = (InventoryContentAndPresetMessage)message;
using (BigEndianReader reader = new BigEndianReader(packetDatas))
{
msg.Deserialize(reader);
}
foreach (ObjectItem item in msg.objects)
{
Core.Inventory.Item i = new Core.Inventory.Item(item.Effects.ToList(), item.ObjectGID, item.Position, item.Quantity, item.ObjectUID, account);
account.Inventory.Items.Add(i);
}
account.ActualizeInventory();
account.petsList = new List<Pet>();
foreach (Core.Inventory.Item item in account.Inventory.Items)
{
DataClass itemData = GameData.GetDataObject(D2oFileEnum.Items, item.GID);
if ((int)itemData.Fields["typeId"] == 18)
{
Pet pet = new Pet(item, itemData, account);
account.petsList.Add(pet);
pet.SetFood();
}
}
account.Log(new BotTextInformation("Vos " +
account.petsList.Count + " familiers vous font un gros bisou de la part de BlueSheep."), 5);
if (!account.IsMITM)
{
FriendsGetListMessage friendGetListMessage = new FriendsGetListMessage();
account.SocketManager.Send(friendGetListMessage);
IgnoredGetListMessage ignoredGetListMessage = new IgnoredGetListMessage();
account.SocketManager.Send(ignoredGetListMessage);
SpouseGetInformationsMessage spouseGetInformationsMessage = new SpouseGetInformationsMessage();
account.SocketManager.Send(spouseGetInformationsMessage);
Random random = new Random();
const string hexChars = "0123456789ABCDEF";
string key = string.Empty;
for (int index = 0; index < 20; index++)
{
int randomValue = random.Next(100);
if (randomValue <= 40)
key += (char)(random.Next(26) + 65);
else if (randomValue <= 80)
key += (char)(random.Next(26) + 97);
else
key += (char)(random.Next(10) + 48);
}
int pos = key.Sum(t => t % 16);
key += hexChars[pos % 16];
ClientKeyMessage clientKeyMessage = new ClientKeyMessage(key);
account.SocketManager.Send(clientKeyMessage);
GameContextCreateRequestMessage gameContextCreateRequestMessage = new GameContextCreateRequestMessage();
account.SocketManager.Send(gameContextCreateRequestMessage);
ChannelEnablingMessage channelEnablingMessage = new ChannelEnablingMessage((sbyte)7, false);
account.SocketManager.Send(channelEnablingMessage);
}
}
示例2: ObjectQuantityMessageTreatment
public static void ObjectQuantityMessageTreatment(Message message, byte[] packetDatas, AccountUC account)
{
ObjectQuantityMessage msg = (ObjectQuantityMessage)message;
using (BigEndianReader reader = new BigEndianReader(packetDatas))
{
msg.Deserialize(reader);
}
for (int index = 0; index < account.Inventory.Items.Count; index++)
{
if (account.Inventory.Items[index].UID == msg.objectUID)
{
account.Inventory.Items[index].Quantity = msg.quantity;
account.ActualizeInventory();
}
}
if (account.Running != null)
{
foreach (Pet pet in account.petsList)
pet.SetFood();
}
}
示例3: ObjectDeletedMessageTreatment
public static void ObjectDeletedMessageTreatment(Message message, byte[] packetDatas, AccountUC account)
{
ObjectDeletedMessage objectDeletedMessage = (ObjectDeletedMessage)message;
using (BigEndianReader reader = new BigEndianReader(packetDatas))
{
objectDeletedMessage.Deserialize(reader);
}
for (int index = 0; index < account.Inventory.Items.Count; index++)
{
if (account.Inventory.Items[index].UID == objectDeletedMessage.objectUID)
{
account.Inventory.Items.RemoveAt(index);
break;
}
}
account.ActualizeInventory();
if (account.Running != null)
{
foreach (Pet pet in account.petsList)
pet.SetFood();
}
}