diff --git a/client/Assets/Scenes/Overworld.unity b/client/Assets/Scenes/Overworld.unity index bb34b2a0..af77fa76 100644 --- a/client/Assets/Scenes/Overworld.unity +++ b/client/Assets/Scenes/Overworld.unity @@ -38,7 +38,7 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0.3708708, g: 0.37838137, b: 0.35725543, a: 1} + m_IndirectSpecularColor: {r: 0.3710032, g: 0.3785125, b: 0.35738343, a: 1} m_UseRadianceAmbientProbe: 0 --- !u!157 &3 LightmapSettings: diff --git a/client/Assets/Scripts/BackendConnection/SocketConnection.cs b/client/Assets/Scripts/BackendConnection/SocketConnection.cs index 789261c4..0e8b0dfa 100644 --- a/client/Assets/Scripts/BackendConnection/SocketConnection.cs +++ b/client/Assets/Scripts/BackendConnection/SocketConnection.cs @@ -270,11 +270,27 @@ private List ParseCampaignsFromResponse(Protobuf.Messages.Campaigns ca levelNumber = (int)level.LevelNumber, campaignId = level.CampaignId, units = levelUnits, - rewards = GetLevelCurrencyRewards(level), + currencyRewards = level.CurrencyRewards.Select(currencyReward => new CurrencyReward + { + currency = GlobalUserData.Instance.AvailableCurrencies.Find(currency => currency.name == currencyReward.Currency.Name), + amount = (int)currencyReward.Amount + }).ToList(), + itemRewards = level.ItemRewards.Select(itemReward => + new ItemReward + { + itemTemplate = GlobalUserData.Instance.AvailableItemTemplates.Find(itemTemplate => itemTemplate.name.ToLower() == itemReward.ItemTemplateName.ToLower()), + amount = (int)itemReward.Amount + }).ToList(), + unitRewards = level.UnitRewards.Select(unitReward => new UnitReward + { + character = availableCharacters.Find(character => character.name.ToLower() == unitReward.CharacterName.ToLower()), + rank = (int)unitReward.Rank, + amount = (int)unitReward.Amount + }).ToList(), + experienceReward = (int)level.ExperienceReward, status = levelStatus }); - if (levelStatus == LevelProgress.Status.Unlocked) { levelStatus = LevelProgress.Status.Locked; @@ -833,13 +849,6 @@ private void AwaitFuseUnitsResponse(byte[] data, Action onSuccess, Action< } } - private Dictionary GetLevelCurrencyRewards(Level level) - { - Dictionary rewards = level.CurrencyRewards.ToDictionary(currencyReward => currencyReward.Currency.Name, currencyReward => (int)currencyReward.Amount); - rewards.Add("Experience", (int)level.ExperienceReward); - return rewards; - } - public void GetKalineAfkRewards(string userId, Action> onAfkRewardsReceived) { GetKalineAfkRewards getKalineAfkRewardsRequest = new GetKalineAfkRewards diff --git a/client/Assets/Scripts/Battle/BattleManager.cs b/client/Assets/Scripts/Battle/BattleManager.cs index 111f7032..7febcc3e 100644 --- a/client/Assets/Scripts/Battle/BattleManager.cs +++ b/client/Assets/Scripts/Battle/BattleManager.cs @@ -211,9 +211,7 @@ private void HandleBattleResult(bool result) Debug.LogError(ex.Message); } GlobalUserData user = GlobalUserData.Instance; - user.AddCurrencies(GetLevelRewards()); - user.User.afkMaxCurrencyReward = LevelProgress.selectedLevelData.afkCurrencyRate; - user.User.afkMaxExperienceReward = LevelProgress.selectedLevelData.afkExperienceRate; + user.AddCurrencies(GetLevelCurrencyRewards()); victorySplash.GetComponentInChildren().Populate(CreateRewardsList()); victorySplash.SetActive(true); victorySplash.GetComponent().Play(); @@ -305,9 +303,14 @@ private void ProcessExecutionsReceived(IEnumerable act } } - private Dictionary GetLevelRewards() + private Dictionary GetLevelCurrencyRewards() { - Dictionary rewards = LevelProgress.selectedLevelData.rewards; + Dictionary rewards = new(); + foreach (var currencyReward in LevelProgress.selectedLevelData.currencyRewards) + { + rewards.Add(currencyReward.currency.name, currencyReward.amount); + } + if (LevelProgress.selectedLevelData.experienceReward > 0) { rewards.Add("Experience", LevelProgress.selectedLevelData.experienceReward); @@ -343,13 +346,26 @@ private List CreateRewardsList() { List rewards = new List(); - foreach (var currencyReward in LevelProgress.selectedLevelData.rewards) + foreach (var currencyReward in LevelProgress.selectedLevelData.currencyRewards) { - if (currencyReward.Value > 0) - { - rewards.Add(new CurrencyUIReward(currencyReward.Key, currencyReward.Value)); - } + rewards.Add(new CurrencyUIReward(currencyReward)); + } + + foreach (var unitReward in LevelProgress.selectedLevelData.unitRewards) + { + rewards.Add(new UnitUIReward(unitReward)); } + + foreach (var itemReward in LevelProgress.selectedLevelData.itemRewards) + { + rewards.Add(new ItemUIReward(itemReward)); + } + + if (LevelProgress.selectedLevelData.experienceReward > 0) + { + rewards.Add(new ExperienceUIReward(LevelProgress.selectedLevelData.experienceReward)); + } + return rewards; } diff --git a/client/Assets/Scripts/Campaign/CurrencyReward.cs b/client/Assets/Scripts/Campaign/CurrencyReward.cs new file mode 100644 index 00000000..73a0276c --- /dev/null +++ b/client/Assets/Scripts/Campaign/CurrencyReward.cs @@ -0,0 +1,5 @@ +public class CurrencyReward +{ + public Currency currency; + public int amount; +} diff --git a/client/Assets/Scripts/Campaign/CurrencyReward.cs.meta b/client/Assets/Scripts/Campaign/CurrencyReward.cs.meta new file mode 100644 index 00000000..d28a81b7 --- /dev/null +++ b/client/Assets/Scripts/Campaign/CurrencyReward.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: be24b8dc199dc44e8aaeb3ab877c1014 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/client/Assets/Scripts/Campaign/ItemReward.cs b/client/Assets/Scripts/Campaign/ItemReward.cs new file mode 100644 index 00000000..b02ae66a --- /dev/null +++ b/client/Assets/Scripts/Campaign/ItemReward.cs @@ -0,0 +1,5 @@ +public class ItemReward +{ + public ItemTemplate itemTemplate; + public int amount; +} diff --git a/client/Assets/Scripts/Campaign/ItemReward.cs.meta b/client/Assets/Scripts/Campaign/ItemReward.cs.meta new file mode 100644 index 00000000..3f8f20d3 --- /dev/null +++ b/client/Assets/Scripts/Campaign/ItemReward.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5970288271232487699b5c332eb142a7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/client/Assets/Scripts/Campaign/LevelData.cs b/client/Assets/Scripts/Campaign/LevelData.cs index ac23f794..0b297480 100644 --- a/client/Assets/Scripts/Campaign/LevelData.cs +++ b/client/Assets/Scripts/Campaign/LevelData.cs @@ -9,13 +9,9 @@ public class LevelData public string campaignId; public List units; - public Dictionary rewards = new Dictionary(); - - // AFK Rewards daily_rate granted - // These are how many a player makes in the maximum timespan available (12h now) - public Dictionary afkCurrencyRate = new Dictionary(); - - public int afkExperienceRate; + public List currencyRewards = new(); + public List itemRewards = new(); + public List unitRewards = new(); public int experienceReward; diff --git a/client/Assets/Scripts/Campaign/UnitReward.cs b/client/Assets/Scripts/Campaign/UnitReward.cs new file mode 100644 index 00000000..a598c813 --- /dev/null +++ b/client/Assets/Scripts/Campaign/UnitReward.cs @@ -0,0 +1,6 @@ +public class UnitReward +{ + public Character character; + public int rank; + public int amount; +} diff --git a/client/Assets/Scripts/Campaign/UnitReward.cs.meta b/client/Assets/Scripts/Campaign/UnitReward.cs.meta new file mode 100644 index 00000000..bedfeee0 --- /dev/null +++ b/client/Assets/Scripts/Campaign/UnitReward.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2485f214e0a8e464492cba2c742cb448 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/client/Assets/Scripts/Protobuf/Gateway.pb.cs b/client/Assets/Scripts/Protobuf/Gateway.pb.cs index 7c5f917a..3ec3ee71 100644 --- a/client/Assets/Scripts/Protobuf/Gateway.pb.cs +++ b/client/Assets/Scripts/Protobuf/Gateway.pb.cs @@ -127,59 +127,65 @@ static GatewayReflection() { "EgwKBG5hbWUYAiABKAkSDAoEdHlwZRgDIAEoCSIpCglDYW1wYWlnbnMSHAoJ", "Y2FtcGFpZ25zGAEgAygLMgkuQ2FtcGFpZ24i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b3BlcmF0aW9uGAQgASgJIj4KClRhZ0V4cGlyZWQSEAoIc2tpbGxf", + "aWQYASABKAkSEQoJdGFyZ2V0X2lkGAIgASgJEgsKA3RhZxgDIAEoCSIYCgVE", + "ZWF0aBIPCgd1bml0X2lkGAEgASgJIkIKC0VuZXJneVJlZ2VuEhEKCXRhcmdl", + "dF9pZBgBIAEoCRIQCghza2lsbF9pZBgCIAEoCRIOCgZhbW91bnQYAyABKAIi", + "RwoMU3RhdE92ZXJyaWRlEhEKCXRhcmdldF9pZBgBIAEoCRIkCg1zdGF0X2Fm", + "ZmVjdGVkGAIgASgLMg0uU3RhdEFmZmVjdGVkKlsKD1NraWxsQWN0aW9uVHlw", + "ZRITCg9BTklNQVRJT05fU1RBUlQQABISCg5FRkZFQ1RfVFJJR0dFUhABEg4K", + "CkVGRkVDVF9ISVQQAhIPCgtFRkZFQ1RfTUlTUxADKlgKBFN0YXQSCgoGSEVB", + "TFRIEAASCgoGRU5FUkdZEAESCgoGQVRUQUNLEAISCwoHREVGRU5TRRADEhQK", + "EERBTUFHRV9SRURVQ1RJT04QBBIJCgVTUEVFRBAFQhSqAhFQcm90b2J1Zi5N", + "ZXNzYWdlc2IGcHJvdG8z")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Protobuf.Messages.SkillActionType), typeof(global::Protobuf.Messages.Stat), }, null, new pbr::GeneratedClrTypeInfo[] { @@ -228,8 +234,10 @@ static GatewayReflection() { new pbr::GeneratedClrTypeInfo(typeof(global::Protobuf.Messages.ItemTemplate), global::Protobuf.Messages.ItemTemplate.Parser, new[]{ "Id", "Name", "Type" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Protobuf.Messages.Campaigns), global::Protobuf.Messages.Campaigns.Parser, new[]{ "Campaigns_" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Protobuf.Messages.Campaign), global::Protobuf.Messages.Campaign.Parser, new[]{ "Id", "SuperCampaignName", "CampaignNumber", "Levels" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Protobuf.Messages.Level), global::Protobuf.Messages.Level.Parser, new[]{ "Id", "CampaignId", "LevelNumber", "Units", "CurrencyRewards", "ExperienceReward" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Protobuf.Messages.Level), global::Protobuf.Messages.Level.Parser, new[]{ "Id", "CampaignId", "LevelNumber", "Units", "CurrencyRewards", "ItemRewards", "UnitRewards", "ExperienceReward", "AttemptCost", "MaxUnits" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Protobuf.Messages.CurrencyReward), global::Protobuf.Messages.CurrencyReward.Parser, new[]{ "Currency", "Amount" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Protobuf.Messages.ItemReward), global::Protobuf.Messages.ItemReward.Parser, new[]{ "ItemTemplateName", "Amount" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Protobuf.Messages.UnitReward), global::Protobuf.Messages.UnitReward.Parser, new[]{ "CharacterName", "Rank", "Amount" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Protobuf.Messages.AfkRewards), global::Protobuf.Messages.AfkRewards.Parser, new[]{ "AfkRewards_" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Protobuf.Messages.AfkReward), global::Protobuf.Messages.AfkReward.Parser, new[]{ "Currency", "Amount" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Protobuf.Messages.Error), global::Protobuf.Messages.Error.Parser, new[]{ "Reason" }, null, null, null, null), @@ -13351,7 +13359,11 @@ public Level(Level other) : this() { levelNumber_ = other.levelNumber_; units_ = other.units_.Clone(); currencyRewards_ = other.currencyRewards_.Clone(); + itemRewards_ = other.itemRewards_.Clone(); + unitRewards_ = other.unitRewards_.Clone(); experienceReward_ = other.experienceReward_; + attemptCost_ = other.attemptCost_.Clone(); + maxUnits_ = other.maxUnits_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } @@ -13419,8 +13431,30 @@ public uint LevelNumber { get { return currencyRewards_; } } + /// Field number for the "item_rewards" field. + public const int ItemRewardsFieldNumber = 6; + private static readonly pb::FieldCodec _repeated_itemRewards_codec + = pb::FieldCodec.ForMessage(50, global::Protobuf.Messages.ItemReward.Parser); + private readonly pbc::RepeatedField itemRewards_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField ItemRewards { + get { return itemRewards_; } + } + + /// Field number for the "unit_rewards" field. + public const int UnitRewardsFieldNumber = 7; + private static readonly pb::FieldCodec _repeated_unitRewards_codec + = pb::FieldCodec.ForMessage(58, global::Protobuf.Messages.UnitReward.Parser); + private readonly pbc::RepeatedField unitRewards_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField UnitRewards { + get { return unitRewards_; } + } + /// Field number for the "experience_reward" field. - public const int ExperienceRewardFieldNumber = 6; + public const int ExperienceRewardFieldNumber = 9; private uint experienceReward_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] @@ -13431,6 +13465,29 @@ public uint ExperienceReward { } } + /// Field number for the "attempt_cost" field. + public const int AttemptCostFieldNumber = 10; + private static readonly pb::FieldCodec _repeated_attemptCost_codec + = pb::FieldCodec.ForMessage(82, global::Protobuf.Messages.CurrencyCost.Parser); + private readonly pbc::RepeatedField attemptCost_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField AttemptCost { + get { return attemptCost_; } + } + + /// Field number for the "max_units" field. + public const int MaxUnitsFieldNumber = 8; + private uint maxUnits_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public uint MaxUnits { + get { return maxUnits_; } + set { + maxUnits_ = value; + } + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { @@ -13451,7 +13508,11 @@ public bool Equals(Level other) { if (LevelNumber != other.LevelNumber) return false; if(!units_.Equals(other.units_)) return false; if(!currencyRewards_.Equals(other.currencyRewards_)) return false; + if(!itemRewards_.Equals(other.itemRewards_)) return false; + if(!unitRewards_.Equals(other.unitRewards_)) return false; if (ExperienceReward != other.ExperienceReward) return false; + if(!attemptCost_.Equals(other.attemptCost_)) return false; + if (MaxUnits != other.MaxUnits) return false; return Equals(_unknownFields, other._unknownFields); } @@ -13464,7 +13525,600 @@ public override int GetHashCode() { if (LevelNumber != 0) hash ^= LevelNumber.GetHashCode(); hash ^= units_.GetHashCode(); hash ^= currencyRewards_.GetHashCode(); + hash ^= itemRewards_.GetHashCode(); + hash ^= unitRewards_.GetHashCode(); if (ExperienceReward != 0) hash ^= ExperienceReward.GetHashCode(); + hash ^= attemptCost_.GetHashCode(); + if (MaxUnits != 0) hash ^= MaxUnits.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Id.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Id); + } + if (CampaignId.Length != 0) { + output.WriteRawTag(18); + output.WriteString(CampaignId); + } + if (LevelNumber != 0) { + output.WriteRawTag(24); + output.WriteUInt32(LevelNumber); + } + units_.WriteTo(output, _repeated_units_codec); + currencyRewards_.WriteTo(output, _repeated_currencyRewards_codec); + itemRewards_.WriteTo(output, _repeated_itemRewards_codec); + unitRewards_.WriteTo(output, _repeated_unitRewards_codec); + if (MaxUnits != 0) { + output.WriteRawTag(64); + output.WriteUInt32(MaxUnits); + } + if (ExperienceReward != 0) { + output.WriteRawTag(72); + output.WriteUInt32(ExperienceReward); + } + attemptCost_.WriteTo(output, _repeated_attemptCost_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Id.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Id); + } + if (CampaignId.Length != 0) { + output.WriteRawTag(18); + output.WriteString(CampaignId); + } + if (LevelNumber != 0) { + output.WriteRawTag(24); + output.WriteUInt32(LevelNumber); + } + units_.WriteTo(ref output, _repeated_units_codec); + currencyRewards_.WriteTo(ref output, _repeated_currencyRewards_codec); + itemRewards_.WriteTo(ref output, _repeated_itemRewards_codec); + unitRewards_.WriteTo(ref output, _repeated_unitRewards_codec); + if (MaxUnits != 0) { + output.WriteRawTag(64); + output.WriteUInt32(MaxUnits); + } + if (ExperienceReward != 0) { + output.WriteRawTag(72); + output.WriteUInt32(ExperienceReward); + } + attemptCost_.WriteTo(ref output, _repeated_attemptCost_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (Id.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Id); + } + if (CampaignId.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(CampaignId); + } + if (LevelNumber != 0) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(LevelNumber); + } + size += units_.CalculateSize(_repeated_units_codec); + size += currencyRewards_.CalculateSize(_repeated_currencyRewards_codec); + size += itemRewards_.CalculateSize(_repeated_itemRewards_codec); + size += unitRewards_.CalculateSize(_repeated_unitRewards_codec); + if (ExperienceReward != 0) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(ExperienceReward); + } + size += attemptCost_.CalculateSize(_repeated_attemptCost_codec); + if (MaxUnits != 0) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(MaxUnits); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(Level other) { + if (other == null) { + return; + } + if (other.Id.Length != 0) { + Id = other.Id; + } + if (other.CampaignId.Length != 0) { + CampaignId = other.CampaignId; + } + if (other.LevelNumber != 0) { + LevelNumber = other.LevelNumber; + } + units_.Add(other.units_); + currencyRewards_.Add(other.currencyRewards_); + itemRewards_.Add(other.itemRewards_); + unitRewards_.Add(other.unitRewards_); + if (other.ExperienceReward != 0) { + ExperienceReward = other.ExperienceReward; + } + attemptCost_.Add(other.attemptCost_); + if (other.MaxUnits != 0) { + MaxUnits = other.MaxUnits; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Id = input.ReadString(); + break; + } + case 18: { + CampaignId = input.ReadString(); + break; + } + case 24: { + LevelNumber = input.ReadUInt32(); + break; + } + case 34: { + units_.AddEntriesFrom(input, _repeated_units_codec); + break; + } + case 42: { + currencyRewards_.AddEntriesFrom(input, _repeated_currencyRewards_codec); + break; + } + case 50: { + itemRewards_.AddEntriesFrom(input, _repeated_itemRewards_codec); + break; + } + case 58: { + unitRewards_.AddEntriesFrom(input, _repeated_unitRewards_codec); + break; + } + case 64: { + MaxUnits = input.ReadUInt32(); + break; + } + case 72: { + ExperienceReward = input.ReadUInt32(); + break; + } + case 82: { + attemptCost_.AddEntriesFrom(input, _repeated_attemptCost_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Id = input.ReadString(); + break; + } + case 18: { + CampaignId = input.ReadString(); + break; + } + case 24: { + LevelNumber = input.ReadUInt32(); + break; + } + case 34: { + units_.AddEntriesFrom(ref input, _repeated_units_codec); + break; + } + case 42: { + currencyRewards_.AddEntriesFrom(ref input, _repeated_currencyRewards_codec); + break; + } + case 50: { + itemRewards_.AddEntriesFrom(ref input, _repeated_itemRewards_codec); + break; + } + case 58: { + unitRewards_.AddEntriesFrom(ref input, _repeated_unitRewards_codec); + break; + } + case 64: { + MaxUnits = input.ReadUInt32(); + break; + } + case 72: { + ExperienceReward = input.ReadUInt32(); + break; + } + case 82: { + attemptCost_.AddEntriesFrom(ref input, _repeated_attemptCost_codec); + break; + } + } + } + } + #endif + + } + + [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] + public sealed partial class CurrencyReward : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CurrencyReward()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Protobuf.Messages.GatewayReflection.Descriptor.MessageTypes[46]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CurrencyReward() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CurrencyReward(CurrencyReward other) : this() { + currency_ = other.currency_ != null ? other.currency_.Clone() : null; + amount_ = other.amount_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public CurrencyReward Clone() { + return new CurrencyReward(this); + } + + /// Field number for the "currency" field. + public const int CurrencyFieldNumber = 1; + private global::Protobuf.Messages.Currency currency_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Protobuf.Messages.Currency Currency { + get { return currency_; } + set { + currency_ = value; + } + } + + /// Field number for the "amount" field. + public const int AmountFieldNumber = 2; + private ulong amount_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ulong Amount { + get { return amount_; } + set { + amount_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as CurrencyReward); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(CurrencyReward other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Currency, other.Currency)) return false; + if (Amount != other.Amount) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (currency_ != null) hash ^= Currency.GetHashCode(); + if (Amount != 0UL) hash ^= Amount.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (currency_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Currency); + } + if (Amount != 0UL) { + output.WriteRawTag(16); + output.WriteUInt64(Amount); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (currency_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Currency); + } + if (Amount != 0UL) { + output.WriteRawTag(16); + output.WriteUInt64(Amount); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (currency_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Currency); + } + if (Amount != 0UL) { + size += 1 + pb::CodedOutputStream.ComputeUInt64Size(Amount); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(CurrencyReward other) { + if (other == null) { + return; + } + if (other.currency_ != null) { + if (currency_ == null) { + Currency = new global::Protobuf.Messages.Currency(); + } + Currency.MergeFrom(other.Currency); + } + if (other.Amount != 0UL) { + Amount = other.Amount; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (currency_ == null) { + Currency = new global::Protobuf.Messages.Currency(); + } + input.ReadMessage(Currency); + break; + } + case 16: { + Amount = input.ReadUInt64(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (currency_ == null) { + Currency = new global::Protobuf.Messages.Currency(); + } + input.ReadMessage(Currency); + break; + } + case 16: { + Amount = input.ReadUInt64(); + break; + } + } + } + } + #endif + + } + + [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] + public sealed partial class ItemReward : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ItemReward()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Protobuf.Messages.GatewayReflection.Descriptor.MessageTypes[47]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ItemReward() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ItemReward(ItemReward other) : this() { + itemTemplateName_ = other.itemTemplateName_; + amount_ = other.amount_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ItemReward Clone() { + return new ItemReward(this); + } + + /// Field number for the "item_template_name" field. + public const int ItemTemplateNameFieldNumber = 1; + private string itemTemplateName_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string ItemTemplateName { + get { return itemTemplateName_; } + set { + itemTemplateName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "amount" field. + public const int AmountFieldNumber = 2; + private uint amount_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public uint Amount { + get { return amount_; } + set { + amount_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ItemReward); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ItemReward other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (ItemTemplateName != other.ItemTemplateName) return false; + if (Amount != other.Amount) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (ItemTemplateName.Length != 0) hash ^= ItemTemplateName.GetHashCode(); + if (Amount != 0) hash ^= Amount.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -13483,23 +14137,13 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - if (Id.Length != 0) { + if (ItemTemplateName.Length != 0) { output.WriteRawTag(10); - output.WriteString(Id); - } - if (CampaignId.Length != 0) { - output.WriteRawTag(18); - output.WriteString(CampaignId); - } - if (LevelNumber != 0) { - output.WriteRawTag(24); - output.WriteUInt32(LevelNumber); + output.WriteString(ItemTemplateName); } - units_.WriteTo(output, _repeated_units_codec); - currencyRewards_.WriteTo(output, _repeated_currencyRewards_codec); - if (ExperienceReward != 0) { - output.WriteRawTag(48); - output.WriteUInt32(ExperienceReward); + if (Amount != 0) { + output.WriteRawTag(16); + output.WriteUInt32(Amount); } if (_unknownFields != null) { _unknownFields.WriteTo(output); @@ -13511,23 +14155,13 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Id.Length != 0) { + if (ItemTemplateName.Length != 0) { output.WriteRawTag(10); - output.WriteString(Id); - } - if (CampaignId.Length != 0) { - output.WriteRawTag(18); - output.WriteString(CampaignId); - } - if (LevelNumber != 0) { - output.WriteRawTag(24); - output.WriteUInt32(LevelNumber); + output.WriteString(ItemTemplateName); } - units_.WriteTo(ref output, _repeated_units_codec); - currencyRewards_.WriteTo(ref output, _repeated_currencyRewards_codec); - if (ExperienceReward != 0) { - output.WriteRawTag(48); - output.WriteUInt32(ExperienceReward); + if (Amount != 0) { + output.WriteRawTag(16); + output.WriteUInt32(Amount); } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -13539,19 +14173,11 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; - if (Id.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Id); - } - if (CampaignId.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(CampaignId); - } - if (LevelNumber != 0) { - size += 1 + pb::CodedOutputStream.ComputeUInt32Size(LevelNumber); + if (ItemTemplateName.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(ItemTemplateName); } - size += units_.CalculateSize(_repeated_units_codec); - size += currencyRewards_.CalculateSize(_repeated_currencyRewards_codec); - if (ExperienceReward != 0) { - size += 1 + pb::CodedOutputStream.ComputeUInt32Size(ExperienceReward); + if (Amount != 0) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(Amount); } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); @@ -13561,23 +14187,15 @@ public int CalculateSize() { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(Level other) { + public void MergeFrom(ItemReward other) { if (other == null) { return; } - if (other.Id.Length != 0) { - Id = other.Id; - } - if (other.CampaignId.Length != 0) { - CampaignId = other.CampaignId; - } - if (other.LevelNumber != 0) { - LevelNumber = other.LevelNumber; + if (other.ItemTemplateName.Length != 0) { + ItemTemplateName = other.ItemTemplateName; } - units_.Add(other.units_); - currencyRewards_.Add(other.currencyRewards_); - if (other.ExperienceReward != 0) { - ExperienceReward = other.ExperienceReward; + if (other.Amount != 0) { + Amount = other.Amount; } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -13595,27 +14213,11 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { - Id = input.ReadString(); - break; - } - case 18: { - CampaignId = input.ReadString(); - break; - } - case 24: { - LevelNumber = input.ReadUInt32(); - break; - } - case 34: { - units_.AddEntriesFrom(input, _repeated_units_codec); - break; - } - case 42: { - currencyRewards_.AddEntriesFrom(input, _repeated_currencyRewards_codec); + ItemTemplateName = input.ReadString(); break; } - case 48: { - ExperienceReward = input.ReadUInt32(); + case 16: { + Amount = input.ReadUInt32(); break; } } @@ -13634,27 +14236,11 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 10: { - Id = input.ReadString(); - break; - } - case 18: { - CampaignId = input.ReadString(); + ItemTemplateName = input.ReadString(); break; } - case 24: { - LevelNumber = input.ReadUInt32(); - break; - } - case 34: { - units_.AddEntriesFrom(ref input, _repeated_units_codec); - break; - } - case 42: { - currencyRewards_.AddEntriesFrom(ref input, _repeated_currencyRewards_codec); - break; - } - case 48: { - ExperienceReward = input.ReadUInt32(); + case 16: { + Amount = input.ReadUInt32(); break; } } @@ -13665,21 +14251,21 @@ public void MergeFrom(pb::CodedInputStream input) { } [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class CurrencyReward : pb::IMessage + public sealed partial class UnitReward : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CurrencyReward()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new UnitReward()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::Protobuf.Messages.GatewayReflection.Descriptor.MessageTypes[46]; } + get { return global::Protobuf.Messages.GatewayReflection.Descriptor.MessageTypes[48]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -13690,7 +14276,7 @@ public sealed partial class CurrencyReward : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public CurrencyReward() { + public UnitReward() { OnConstruction(); } @@ -13698,36 +14284,49 @@ public CurrencyReward() { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public CurrencyReward(CurrencyReward other) : this() { - currency_ = other.currency_ != null ? other.currency_.Clone() : null; + public UnitReward(UnitReward other) : this() { + characterName_ = other.characterName_; + rank_ = other.rank_; amount_ = other.amount_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public CurrencyReward Clone() { - return new CurrencyReward(this); + public UnitReward Clone() { + return new UnitReward(this); } - /// Field number for the "currency" field. - public const int CurrencyFieldNumber = 1; - private global::Protobuf.Messages.Currency currency_; + /// Field number for the "character_name" field. + public const int CharacterNameFieldNumber = 1; + private string characterName_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Protobuf.Messages.Currency Currency { - get { return currency_; } + public string CharacterName { + get { return characterName_; } set { - currency_ = value; + characterName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "rank" field. + public const int RankFieldNumber = 2; + private uint rank_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public uint Rank { + get { return rank_; } + set { + rank_ = value; } } /// Field number for the "amount" field. public const int AmountFieldNumber = 3; - private ulong amount_; + private uint amount_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public ulong Amount { + public uint Amount { get { return amount_; } set { amount_ = value; @@ -13737,19 +14336,20 @@ public ulong Amount { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { - return Equals(other as CurrencyReward); + return Equals(other as UnitReward); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(CurrencyReward other) { + public bool Equals(UnitReward other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } - if (!object.Equals(Currency, other.Currency)) return false; + if (CharacterName != other.CharacterName) return false; + if (Rank != other.Rank) return false; if (Amount != other.Amount) return false; return Equals(_unknownFields, other._unknownFields); } @@ -13758,8 +14358,9 @@ public bool Equals(CurrencyReward other) { [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; - if (currency_ != null) hash ^= Currency.GetHashCode(); - if (Amount != 0UL) hash ^= Amount.GetHashCode(); + if (CharacterName.Length != 0) hash ^= CharacterName.GetHashCode(); + if (Rank != 0) hash ^= Rank.GetHashCode(); + if (Amount != 0) hash ^= Amount.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -13778,13 +14379,17 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else - if (currency_ != null) { + if (CharacterName.Length != 0) { output.WriteRawTag(10); - output.WriteMessage(Currency); + output.WriteString(CharacterName); } - if (Amount != 0UL) { + if (Rank != 0) { + output.WriteRawTag(16); + output.WriteUInt32(Rank); + } + if (Amount != 0) { output.WriteRawTag(24); - output.WriteUInt64(Amount); + output.WriteUInt32(Amount); } if (_unknownFields != null) { _unknownFields.WriteTo(output); @@ -13796,13 +14401,17 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (currency_ != null) { + if (CharacterName.Length != 0) { output.WriteRawTag(10); - output.WriteMessage(Currency); + output.WriteString(CharacterName); } - if (Amount != 0UL) { + if (Rank != 0) { + output.WriteRawTag(16); + output.WriteUInt32(Rank); + } + if (Amount != 0) { output.WriteRawTag(24); - output.WriteUInt64(Amount); + output.WriteUInt32(Amount); } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); @@ -13814,11 +14423,14 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; - if (currency_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Currency); + if (CharacterName.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(CharacterName); } - if (Amount != 0UL) { - size += 1 + pb::CodedOutputStream.ComputeUInt64Size(Amount); + if (Rank != 0) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(Rank); + } + if (Amount != 0) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(Amount); } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); @@ -13828,17 +14440,17 @@ public int CalculateSize() { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(CurrencyReward other) { + public void MergeFrom(UnitReward other) { if (other == null) { return; } - if (other.currency_ != null) { - if (currency_ == null) { - Currency = new global::Protobuf.Messages.Currency(); - } - Currency.MergeFrom(other.Currency); + if (other.CharacterName.Length != 0) { + CharacterName = other.CharacterName; } - if (other.Amount != 0UL) { + if (other.Rank != 0) { + Rank = other.Rank; + } + if (other.Amount != 0) { Amount = other.Amount; } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); @@ -13857,14 +14469,15 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { - if (currency_ == null) { - Currency = new global::Protobuf.Messages.Currency(); - } - input.ReadMessage(Currency); + CharacterName = input.ReadString(); + break; + } + case 16: { + Rank = input.ReadUInt32(); break; } case 24: { - Amount = input.ReadUInt64(); + Amount = input.ReadUInt32(); break; } } @@ -13883,14 +14496,15 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 10: { - if (currency_ == null) { - Currency = new global::Protobuf.Messages.Currency(); - } - input.ReadMessage(Currency); + CharacterName = input.ReadString(); + break; + } + case 16: { + Rank = input.ReadUInt32(); break; } case 24: { - Amount = input.ReadUInt64(); + Amount = input.ReadUInt32(); break; } } @@ -13915,7 +14529,7 @@ public sealed partial class AfkRewards : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::Protobuf.Messages.GatewayReflection.Descriptor.MessageTypes[47]; } + get { return global::Protobuf.Messages.GatewayReflection.Descriptor.MessageTypes[49]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -14094,7 +14708,7 @@ public sealed partial class AfkReward : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::Protobuf.Messages.GatewayReflection.Descriptor.MessageTypes[48]; } + get { return global::Protobuf.Messages.GatewayReflection.Descriptor.MessageTypes[50]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -14330,7 +14944,7 @@ public sealed partial class Error : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::Protobuf.Messages.GatewayReflection.Descriptor.MessageTypes[49]; } + get { return global::Protobuf.Messages.GatewayReflection.Descriptor.MessageTypes[51]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -14520,7 +15134,7 @@ public sealed partial class Boxes : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::Protobuf.Messages.GatewayReflection.Descriptor.MessageTypes[50]; } + get { return global::Protobuf.Messages.GatewayReflection.Descriptor.MessageTypes[52]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -14699,7 +15313,7 @@ public sealed partial class Box : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::Protobuf.Messages.GatewayReflection.Descriptor.MessageTypes[51]; } + get { return global::Protobuf.Messages.GatewayReflection.Descriptor.MessageTypes[53]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -15041,7 +15655,7 @@ public sealed partial class RankWeights : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::Protobuf.Messages.GatewayReflection.Descriptor.MessageTypes[52]; } + get { return global::Protobuf.Messages.GatewayReflection.Descriptor.MessageTypes[54]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -15268,7 +15882,7 @@ public sealed partial class CurrencyCost : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::Protobuf.Messages.GatewayReflection.Descriptor.MessageTypes[53]; } + get { return global::Protobuf.Messages.GatewayReflection.Descriptor.MessageTypes[55]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -15504,7 +16118,7 @@ public sealed partial class UserAndUnit : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::Protobuf.Messages.GatewayReflection.Descriptor.MessageTypes[54]; } + get { return global::Protobuf.Messages.GatewayReflection.Descriptor.MessageTypes[56]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -15749,7 +16363,7 @@ public sealed partial class BattleResult : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::Protobuf.Messages.GatewayReflection.Descriptor.MessageTypes[55]; } + get { return global::Protobuf.Messages.GatewayReflection.Descriptor.MessageTypes[57]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -16011,7 +16625,7 @@ public sealed partial class State : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::Protobuf.Messages.GatewayReflection.Descriptor.MessageTypes[56]; } + get { return global::Protobuf.Messages.GatewayReflection.Descriptor.MessageTypes[58]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -16190,7 +16804,7 @@ public sealed partial class BattleUnit : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::Protobuf.Messages.GatewayReflection.Descriptor.MessageTypes[57]; } + get { return global::Protobuf.Messages.GatewayReflection.Descriptor.MessageTypes[59]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -16565,7 +17179,7 @@ public sealed partial class Step : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::Protobuf.Messages.GatewayReflection.Descriptor.MessageTypes[58]; } + get { return global::Protobuf.Messages.GatewayReflection.Descriptor.MessageTypes[60]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -16781,7 +17395,7 @@ public sealed partial class Action : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::Protobuf.Messages.GatewayReflection.Descriptor.MessageTypes[59]; } + get { return global::Protobuf.Messages.GatewayReflection.Descriptor.MessageTypes[61]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -17438,7 +18052,7 @@ public sealed partial class StatAffected : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::Protobuf.Messages.GatewayReflection.Descriptor.MessageTypes[60]; } + get { return global::Protobuf.Messages.GatewayReflection.Descriptor.MessageTypes[62]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -17665,7 +18279,7 @@ public sealed partial class SkillAction : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::Protobuf.Messages.GatewayReflection.Descriptor.MessageTypes[61]; } + get { return global::Protobuf.Messages.GatewayReflection.Descriptor.MessageTypes[63]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -17955,7 +18569,7 @@ public sealed partial class ExecutionReceived : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::Protobuf.Messages.GatewayReflection.Descriptor.MessageTypes[62]; } + get { return global::Protobuf.Messages.GatewayReflection.Descriptor.MessageTypes[64]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -18191,7 +18805,7 @@ public sealed partial class ModifierReceived : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::Protobuf.Messages.GatewayReflection.Descriptor.MessageTypes[63]; } + get { return global::Protobuf.Messages.GatewayReflection.Descriptor.MessageTypes[65]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -18501,7 +19115,7 @@ public sealed partial class TagReceived : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::Protobuf.Messages.GatewayReflection.Descriptor.MessageTypes[64]; } + get { return global::Protobuf.Messages.GatewayReflection.Descriptor.MessageTypes[66]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -18765,7 +19379,7 @@ public sealed partial class ModifierExpired : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::Protobuf.Messages.GatewayReflection.Descriptor.MessageTypes[65]; } + get { return global::Protobuf.Messages.GatewayReflection.Descriptor.MessageTypes[67]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -19075,7 +19689,7 @@ public sealed partial class TagExpired : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::Protobuf.Messages.GatewayReflection.Descriptor.MessageTypes[66]; } + get { return global::Protobuf.Messages.GatewayReflection.Descriptor.MessageTypes[68]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -19339,7 +19953,7 @@ public sealed partial class Death : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::Protobuf.Messages.GatewayReflection.Descriptor.MessageTypes[67]; } + get { return global::Protobuf.Messages.GatewayReflection.Descriptor.MessageTypes[69]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -19529,7 +20143,7 @@ public sealed partial class EnergyRegen : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::Protobuf.Messages.GatewayReflection.Descriptor.MessageTypes[68]; } + get { return global::Protobuf.Messages.GatewayReflection.Descriptor.MessageTypes[70]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -19793,7 +20407,7 @@ public sealed partial class StatOverride : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::Protobuf.Messages.GatewayReflection.Descriptor.MessageTypes[69]; } + get { return global::Protobuf.Messages.GatewayReflection.Descriptor.MessageTypes[71]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] diff --git a/client/Assets/Scripts/Shared/RewardsUIContainer.cs b/client/Assets/Scripts/Shared/RewardsUIContainer.cs index e65b1c92..0a16a761 100644 --- a/client/Assets/Scripts/Shared/RewardsUIContainer.cs +++ b/client/Assets/Scripts/Shared/RewardsUIContainer.cs @@ -18,7 +18,7 @@ public void Populate(List rewards) GameObject rewardUIItem = Instantiate(rewardItemUIPrefab, gameObject.transform); rewardUIItem.GetComponent().sprite = reward.Sprite(); rewardUIItem.GetComponentInChildren().text = reward.Amount().ToString(); - rewardUIItemDictionary.Add(reward.RewardType(), rewardUIItem); + rewardUIItemDictionary.Add(reward.GetName(), rewardUIItem); }); gameObject.SetActive(true); } diff --git a/client/Assets/Scripts/Shared/UIReward.cs b/client/Assets/Scripts/Shared/UIReward.cs index bf271c94..b21191b3 100644 --- a/client/Assets/Scripts/Shared/UIReward.cs +++ b/client/Assets/Scripts/Shared/UIReward.cs @@ -5,33 +5,38 @@ public abstract class UIReward { public Sprite Sprite() { - return GlobalUserData.Instance.AvailableCurrencies.Single(currency => currency.name == RewardType()).image; + return RewardType() switch + { + "experience" => GlobalUserData.Instance.AvailableCurrencies.Single(currency => currency.name == "Experience").image, + "item" => ((ItemUIReward)this).itemReward.itemTemplate.icon, + "unit" => ((UnitUIReward)this).unitReward.character.defaultSprite, + "currency" => ((CurrencyUIReward)this).currencyReward.currency.image, + _ => throw new System.Exception("Reward type " + RewardType() + " not recognized") + }; } public abstract int Amount(); - public abstract string RewardType(); + public abstract string GetName(); } public class CurrencyUIReward : UIReward { - private string currency; - private int amount; + public CurrencyReward currencyReward; - public CurrencyUIReward(string currency, int amount) + public CurrencyUIReward(CurrencyReward currencyReward) { - this.currency = currency; - this.amount = amount; + this.currencyReward = currencyReward; } - public override int Amount() { return amount; } - - public override string RewardType() { return currency; } + public override int Amount() { return currencyReward.amount; } + public override string RewardType() { return "currency"; } + public override string GetName() { return currencyReward.currency.name; } } public class ExperienceUIReward : UIReward { - private int value; + private readonly int value; public ExperienceUIReward(int amount) { @@ -40,10 +45,32 @@ public ExperienceUIReward(int amount) public override int Amount() { return value; } public override string RewardType() { return "experience"; } + public override string GetName() { return "Experience"; } +} + +public class ItemUIReward : UIReward +{ + public ItemReward itemReward; + + public ItemUIReward(ItemReward itemReward) + { + this.itemReward = itemReward; + } + + public override int Amount() { return itemReward.amount; } + public override string RewardType() { return "item"; } + public override string GetName() { return itemReward.itemTemplate.name; } } -//// When we implement item rewards: -// public class ItemUIReward : UIReward { -// public Item item; -// public int amount; -// } +public class UnitUIReward : UIReward +{ + public UnitReward unitReward; + public UnitUIReward(UnitReward unitReward) + { + this.unitReward = unitReward; + } + + public override int Amount() { return unitReward.amount; } + public override string RewardType() { return "unit"; } + public override string GetName() { return unitReward.character.name; } +} diff --git a/gateway.proto b/gateway.proto index 2f9fc423..60314d2e 100644 --- a/gateway.proto +++ b/gateway.proto @@ -297,12 +297,27 @@ option csharp_namespace = "Protobuf.Messages"; uint32 level_number = 3; repeated Unit units = 4; repeated CurrencyReward currency_rewards = 5; - uint32 experience_reward = 6; + repeated ItemReward item_rewards = 6; + repeated UnitReward unit_rewards = 7; + uint32 experience_reward = 9; + repeated CurrencyCost attempt_cost = 10; + uint32 max_units = 8; } message CurrencyReward { Currency currency = 1; - uint64 amount = 3; + uint64 amount = 2; + } + + message ItemReward { + string item_template_name = 1; + uint32 amount = 2; + } + + message UnitReward { + string character_name = 1; + uint32 rank = 2; + uint32 amount = 3; } message AfkRewards {