public static async Task <ImposeInfo> RefreshImposeAsync(this IPacketWriter writer) { var packet = await writer.SendCommandAsync(12400); if (packet == null) { return(null); } return(ImposeInfo.Parse(JToken.Parse(packet.Message))); }
public static ImposeInfo Parse(JToken token) { var result = new ImposeInfo(); var imposedto = token["imposedto"]; result.OfficeLevel = (int)imposedto["officelv"]; result.LegionImposeTech = (int)imposedto["legionimposetech"]; result.HouseLevel = (int)imposedto["houseslv"]; result.Copper = (int)imposedto["copper"]; result.AreaProsperity = (int)imposedto["areaprosper"]; result.CountingLevel = (int)imposedto["countinglv"]; result.ImposeNum = (int)imposedto["imposenum"]; result.ImposeMaxNum = (int)imposedto["imposemaxnum"]; result.MoneyFactoryLevel = (int)imposedto["moneyfactorylv"]; result.ForceImposeCost = (int)imposedto["forceimposecost"]; result.Loyalty = (int)imposedto["loyalty"]; result.CanImpose = (bool)imposedto["imposecdusable"]; int cd = (int)imposedto["lastimposetime"]; result.imposeCooldown = new Cooldown(cd); return(result); }
public ImposeTaskHelper(IPacketWriter writer, IPlayerInfo info, ImposeInfo impose) { this.writer = writer; this.info = info; this.impose = impose; }