本文整理汇总了C#中BlueSheep.Engine.Types.Message类的典型用法代码示例。如果您正苦于以下问题:C# Message类的具体用法?C# Message怎么用?C# Message使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Message类属于BlueSheep.Engine.Types命名空间,在下文中一共展示了Message类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: JobExperienceMultiUpdateMessageTreatment
public static void JobExperienceMultiUpdateMessageTreatment(Message message, byte[] packetDatas, AccountUC account)
{
JobExperienceMultiUpdateMessage msg = (JobExperienceMultiUpdateMessage)message;
using (BigEndianReader reader = new BigEndianReader(packetDatas))
{
msg.Deserialize(reader);
}
foreach (JobExperience i in msg.experiencesUpdate)
{
foreach (Core.Job.Job j in account.Jobs)
{
if (i.jobId == j.Id)
{
j.Level = i.jobLevel;
j.XP = (int)i.jobXP;
j.XpLevelFloor =(int)i.jobXpLevelFloor;
j.XpNextLevelFloor = (int)i.jobXpNextLevelFloor;
break;
}
}
}
account.ActualizeJobs();
foreach (JobUC j in account.JobsUC)
{
j.populateTreeview();
}
}
示例2: GameActionFightPointsVariationMessageTreatment
public static void GameActionFightPointsVariationMessageTreatment(Message message, byte[] packetDatas, AccountUC account)
{
GameActionFightPointsVariationMessage msg = (GameActionFightPointsVariationMessage)message;
using (BigEndianReader reader = new BigEndianReader(packetDatas))
{
msg.Deserialize(reader);
}
BFighter fighter = (BFighter)account.Fight.GetFighter(msg.targetId);
if (fighter != null)
{
switch (msg.actionId)
{
case 101:
case 102:
case 120:
fighter.ActionPoints = (fighter.ActionPoints + msg.delta);
break;
case 78:
case 127:
case 129:
fighter.MovementPoints = (fighter.MovementPoints + msg.delta);
break;
}
}
}
示例3: NpcDialogQuestionMessageTreatment
public static void NpcDialogQuestionMessageTreatment(Message message, byte[] packetDatas, AccountUC account)
{
NpcDialogQuestionMessage msg = (NpcDialogQuestionMessage)message;
using (BigEndianReader reader = new BigEndianReader(packetDatas))
{
msg.Deserialize(reader);
}
account.Npc.QuestionId = msg.messageId;
int mess = (int)GameData.GetDataObject(D2oFileEnum.NpcMessages, account.Npc.QuestionId).Fields["messageId"];
account.Log(new BotTextInformation("Dialogue : " + BlueSheep.Common.Data.I18N.GetText(mess)), 0);
if (account.Npc.QuestionId == 318 && (int)msg.visibleReplies[0] == 259)
{
//Bank
account.Npc.SendReply(259);
return;
}
if (msg.visibleReplies.Length == 0)
account.Npc.CloseDialog();
account.Npc.Replies.Clear();
account.Npc.Replies = msg.visibleReplies.Select<short, BlueSheep.Core.Npc.NpcReply>((id) => new BlueSheep.Core.Npc.NpcReply(account.Npc.Npcs[account.Npc.Id], id)).ToList();
if (account.Path != null)
{
account.Path.SearchReplies(BlueSheep.Common.Data.I18N.GetText(mess));
}
}
示例4: GameActionFightDispellableEffectMessageTreatment
public static void GameActionFightDispellableEffectMessageTreatment(Message message, byte[] packetDatas, AccountUC account)
{
GameActionFightDispellableEffectMessage msg = (GameActionFightDispellableEffectMessage)message;
using (BigEndianReader reader = new BigEndianReader(packetDatas))
{
msg.Deserialize(reader);
}
if (msg.effect is FightTemporaryBoostStateEffect)
{
FightTemporaryBoostStateEffect effect = (FightTemporaryBoostStateEffect)msg.effect;
if (effect.targetId == account.Fight.Fighter.Id)
{
if (account.Fight.DurationByEffect.ContainsKey(effect.stateId))
account.Fight.DurationByEffect.Remove(effect.stateId);
account.Fight.DurationByEffect.Add(effect.stateId, effect.turnDuration);
}
}
else if (msg.effect is FightTemporaryBoostEffect)
{
FightTemporaryBoostEffect effect = (FightTemporaryBoostEffect)msg.effect;
if (msg.actionId == 168)
((BFighter)account.Fight.Fighter).ActionPoints = account.Fight.Fighter.ActionPoints - effect.delta;
else if (msg.actionId == 169)
((BFighter)account.Fight.Fighter).MovementPoints = account.Fight.Fighter.MovementPoints - effect.delta;
}
}
示例5: NpcDialogQuestionMessageTreatment
public static void NpcDialogQuestionMessageTreatment(Message message, byte[] packetDatas, AccountUC account)
{
NpcDialogQuestionMessage msg = (NpcDialogQuestionMessage)message;
using (BigEndianReader reader = new BigEndianReader(packetDatas))
{
msg.Deserialize(reader);
}
account.Npc.QuestionId = msg.messageId;
int mess = (int)GameData.GetDataObject(D2oFileEnum.NpcMessages, account.Npc.QuestionId).Fields["messageId"];
account.Log(new BotTextInformation("Dialogue : " + BlueSheep.Common.Data.I18N.GetText(mess)), 0);
if (account.Npc.QuestionId == 318 && (int)msg.visibleReplies[0] == 259)
{
//Bank
account.Npc.SendReply(259);
return;
}
else if (account.Npc.QuestionId == 318)
{
account.Log(new ErrorTextInformation("Vous n'êtes pas level 10, vous ne pouvez pas utiliser la banque. Fermeture du dialogue."), 0);
account.Npc.CloseDialog();
}
if (msg.visibleReplies.Length == 0)
account.Npc.CloseDialog();
account.Npc.Replies.Clear();
account.Npc.Replies = msg.visibleReplies.Select<short, BlueSheep.Core.Npc.NpcReply>((id) => new BlueSheep.Core.Npc.NpcReply(account.MapData.Npcs.Find(n => n.contextualId == account.Npc.Id).npcId, id)).ToList();
if (account.Path != null)
{
account.Path.SearchReplies(BlueSheep.Common.Data.I18N.GetText(mess));
}
}
示例6: ChatServerMessageTreatment
public static void ChatServerMessageTreatment(Message message, byte[] packetDatas, AccountUC account)
{
ChatServerMessage msg = (ChatServerMessage)message;
using (BigEndianReader reader = new BigEndianReader(packetDatas))
{
msg.Deserialize(reader);
}
switch ((int)msg.channel)
{
case 0:
account.Log(new GeneralTextInformation(msg.senderName + ": " + msg.content),1);
break;
case 1:
//account.Log(new DofAlertTextInformation("Bienvenue sur DOFUS, dans le Monde des Douze !" + System.Environment.NewLine + "Il est interdit de transmettre votre identifiant ou votre mot de passe."));
break;
case 2:
account.Log(new GuildTextInformation(msg.senderName + ": " + msg.content),1);
break;
case 3:
account.Log(new AllianceTextInformation(msg.senderName + ": " + msg.content),1);
break;
case 5:
account.Log(new CommerceTextInformation(msg.senderName + ": " + msg.content),1);
break;
case 6:
account.Log(new RecrutementTextInformation(msg.senderName + ": " + msg.content),1);
break;
case 9:
account.Log(new PrivateTextInformation("de " + msg.senderName + " : " + msg.content),1);
break;
}
}
示例7: CharacterExperienceGainMessageTreatment
public static void CharacterExperienceGainMessageTreatment(Message message, byte[] packetDatas, AccountUC account)
{
CharacterExperienceGainMessage msg = (CharacterExperienceGainMessage)message;
using (BigEndianReader reader = new BigEndianReader(packetDatas))
{
msg.Deserialize(reader);
}
account.Log(new ActionTextInformation("Experience gagnée : + " + msg.experienceCharacter + " points d'expérience"), 4);
account.CharacterStats.experience += msg.experienceCharacter;
double i = account.CharacterStats.experience - account.CharacterStats.experienceLevelFloor;
double j = account.CharacterStats.experienceNextLevelFloor - account.CharacterStats.experienceLevelFloor;
try
{
int xppercent = (int)((i / j) * 100);
}
catch (Exception ex)
{
}
account.ModifBar(1, (int)account.CharacterStats.experienceNextLevelFloor - (int)account.CharacterStats.experienceLevelFloor, (int)account.CharacterStats.experience - (int)account.CharacterStats.experienceLevelFloor, "Experience");
if (account.Fight != null)
{
account.FightData.xpWon[DateTime.Today] += (int)msg.experienceCharacter;
}
}
示例8: AuthenticationTicketAcceptedMessageTreatment
public static void AuthenticationTicketAcceptedMessageTreatment(Message message, byte[] packetDatas, AccountUC account)
{
if (!account.IsMITM)
{
CharactersListRequestMessage charactersListRequestMessage = new CharactersListRequestMessage();
account.SocketManager.Send(charactersListRequestMessage);
}
}
示例9: GameActionFightDispellableEffectMessageTreatment
public static void GameActionFightDispellableEffectMessageTreatment(Message message, byte[] packetDatas, AccountUC account)
{
GameActionFightDispellableEffectMessage msg = (GameActionFightDispellableEffectMessage)message;
using (BigEndianReader reader = new BigEndianReader(packetDatas))
{
msg.Deserialize(reader);
}
account.FightData.SetEffect(msg.effect, msg.actionId);
}
示例10: GameActionFightLifePointsLostMessageTreatment
public static void GameActionFightLifePointsLostMessageTreatment(Message message, byte[] packetDatas, AccountUC account)
{
GameActionFightLifePointsLostMessage msg = (GameActionFightLifePointsLostMessage)message;
using (BigEndianReader reader = new BigEndianReader(packetDatas))
{
msg.Deserialize(reader);
}
account.FightData.UpdateFighterLifePoints(msg.targetId, -msg.loss);
}
示例11: 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);
}
}
示例12: GameActionFightPointsVariationMessageTreatment
public static void GameActionFightPointsVariationMessageTreatment(Message message, byte[] packetDatas, AccountUC account)
{
GameActionFightPointsVariationMessage msg = (GameActionFightPointsVariationMessage)message;
using (BigEndianReader reader = new BigEndianReader(packetDatas))
{
msg.Deserialize(reader);
}
account.FightData.SetPointsVariation(msg.targetId, msg.actionId, msg.delta);
}
示例13: GameActionFightDeathMessageTreatment
public static void GameActionFightDeathMessageTreatment(Message message, byte[] packetDatas, AccountUC account)
{
GameActionFightDeathMessage msg = (GameActionFightDeathMessage)message;
using (BigEndianReader reader = new BigEndianReader(packetDatas))
{
msg.Deserialize(reader);
}
account.FightData.SetFighterDeath(msg.targetId);
}
示例14: HelloGameMessageTreatment
public static void HelloGameMessageTreatment(Message message, byte[] packetDatas, AccountUC account)
{
if (!account.IsMITM)
{
AuthenticationTicketMessage authenticationTicketMessage = new AuthenticationTicketMessage(GameConstants.Lang,
account.Ticket);
account.SocketManager.Send(authenticationTicketMessage);
}
}
示例15: CharacterSelectedForceMessageTreatment
public static void CharacterSelectedForceMessageTreatment(Message message, byte[] packetDatas, AccountUC account)
{
CharacterSelectedForceMessage msg = (CharacterSelectedForceMessage)message;
using (BigEndianReader reader = new BigEndianReader(packetDatas))
{
msg.Deserialize(reader);
}
CharacterSelectedForceReadyMessage nmsg = new CharacterSelectedForceReadyMessage();
account.SocketManager.Send(nmsg);
}