public static void NpcDialogCreationMessageTreatment(Message message, byte[] packetDatas, AccountUC account) { LeaveDialogMessage msg = (LeaveDialogMessage)message; using (BigEndianReader reader = new BigEndianReader(packetDatas)) { msg.Deserialize(reader); } account.SetStatus(Status.None); }
public static void GameContextRemoveElementMessageTreatment(Message message, byte[] packetDatas, AccountUC account) { ExchangeStartOkNpcShopMessage msg = (ExchangeStartOkNpcShopMessage)message; using (BigEndianReader reader = new BigEndianReader(packetDatas)) { msg.Deserialize(reader); } account.SetStatus(Status.Exchanging); }
public static void LeaveDialogMessageTreatment(Message message, byte[] packetDatas, AccountUC account) { NpcDialogCreationMessage msg = (NpcDialogCreationMessage)message; using (BigEndianReader reader = new BigEndianReader(packetDatas)) { msg.Deserialize(reader); } account.Npc.Id = msg.npcId; account.Npc.Entity = account.MapData.Npcs.FirstOrDefault((npc) => npc.contextualId == msg.npcId); account.SetStatus(Status.Speaking); }
public static void HelloConnectMessageTreatment(Message message, byte[] packetDatas, AccountUC account) { account.SetStatus(Status.None); if (!account.IsMITM) { HelloConnectMessage helloConnectMessage = (HelloConnectMessage)message; using (BigEndianReader reader = new BigEndianReader(packetDatas)) { helloConnectMessage.Deserialize(reader); } sbyte[] credentials = RSAKey.Encrypt(helloConnectMessage.key, account.AccountName, account.AccountPassword, helloConnectMessage.salt); IdentificationMessage msg = new IdentificationMessage(GameConstants.AutoConnect, GameConstants.UseCertificate, GameConstants.UseLoginToken, new Common.Protocol.Types.VersionExtended(GameConstants.Major, GameConstants.Minor, GameConstants.Release, GameConstants.Revision, GameConstants.Patch, GameConstants.BuildType, GameConstants.Install, GameConstants.Technology), GameConstants.Lang, credentials, GameConstants.ServerID, GameConstants.SessionOptionalSalt, new System.Collections.Generic.List<short>() ); account.SocketManager.Send(msg); } account.Log(new ConnectionTextInformation("Identification en cours."), 0); }
public static void GameFightPlacementPossiblePositionsMessageTreatment(Message message, byte[] packetDatas, AccountUC account) { GameFightPlacementPossiblePositionsMessage msg = (GameFightPlacementPossiblePositionsMessage)message; using (BigEndianReader reader = new BigEndianReader(packetDatas)) { msg.Deserialize(reader); } account.SetStatus(Status.Fighting); account.FightData.UpdateTurn(0); if (account.Fight != null) { account.Fight.PlaceCharacter(msg.positionsForChallengers.ToList()); } if (account.WithItemSetBox.Checked == true) { sbyte id = (sbyte)account.PresetStartUpD.Value; InventoryPresetUseMessage msg2 = new InventoryPresetUseMessage((sbyte)(id - 1)); account.SocketManager.Send(msg2); account.Log(new ActionTextInformation("Equipement rapide numero " + Convert.ToString(id)), 5); } GameFightReadyMessage nmsg = new GameFightReadyMessage(true); account.SocketManager.Send(nmsg); account.Log(new BotTextInformation("Send Ready !"), 5); }
public static void GameEntitiesDispositionMessageTreatment(Message message, byte[] packetDatas, AccountUC account) { GameEntitiesDispositionMessage msg = (GameEntitiesDispositionMessage)message; using (BigEndianReader reader = new BigEndianReader(packetDatas)) { msg.Deserialize(reader); } if (account.Fight != null) { msg.dispositions.ToList().ForEach(d => { account.FightData.UpdateFighterCell(d.id, d.cellId); }); } account.SetStatus(Status.Fighting); }
public static void InteractiveUseEndedMessageTreatment(Message message, byte[] packetDatas, AccountUC account) { InteractiveUseEndedMessage msg = (InteractiveUseEndedMessage)message; using (BigEndianReader reader = new BigEndianReader(packetDatas)) { msg.Deserialize(reader); } if (account.Gather.Id == -1) return; account.SetStatus(Status.None); account.Gather.Id = -1; if (account.Path != null) account.Path.PerformFlag(); }