StrangeLoopGames / EcoIssues

131 stars 21 forks source link

[0.9.0 staging-1314] Limit reputation payment in Work Party #14269

Closed SlayksWood closed 4 years ago

SlayksWood commented 4 years ago

You can create contract like: image And you can give people more than 10 Reputation per day. image It is necessary to add for checking "Player can give" Reputation. And if player postes Work party change it. So if you add 10 Reputation(it 's max count) in Work Party you can't give reputation from Objectives.

johnkslg commented 4 years ago

Fixed image

beastyn commented 4 years ago

Still can create party with huge reputation payment. Will we limit it? bandicam 2020-01-01 23-41-00-518

Can't check reputation payment properly, because of the client crash for party with reputation payment. (just take party with reputation payment and try to do some work)

System.NullReferenceException: Object reference not set to an instance of an object.
   at Eco.Gameplay.Economy.WorkParties.ReputationPayment.PayUser(Laborer laborer, Single amount)
   at Eco.Gameplay.Economy.WorkParties.ValuePayment.WorkPerformed(Laborer laborer, Single percentPerformed)
   at Eco.Gameplay.Economy.WorkParties.WorkParty.<>c__DisplayClass30_0.<OnWorkPerformed>b__0(Payment x)
   at System.Linq.Enumerable.SelectIListIterator`2.MoveNext()
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.ToArray()
   at Eco.Shared.Utils.StringExtensions.TextList(IEnumerable`1 e, String sep)
   at Eco.Gameplay.Economy.WorkParties.WorkParty.OnWorkPerformed(User user, Work work, Single percentDelta, String message)
   at Eco.Gameplay.Economy.WorkParties.CollectResourcesWork.UpdateWorkDone(User user, Type item, Int32 quantity, String message)
   at Eco.Gameplay.Utils.ItemTracker.ActionPerformed(GameAction action)
   at Eco.Gameplay.Economy.WorkParties.CollectResourcesWork.ActionPerformed(GameAction action)
   at Eco.Shared.Utils.ListExtensions.ForEach[T](IList`1 list, Action`1 action)
   at Eco.Gameplay.Economy.WorkParties.WorkParty.ActionPerformed(GameAction action)
   at Eco.Gameplay.Economy.WorkParties.WorkPartyManager.<>c__DisplayClass6_0.<ActionPerformed>b__1(WorkParty x)
   at Eco.Shared.Utils.EnumerableExtensions.ForEach[T](IEnumerable`1 enumeration, Action`1 action)
   at Eco.Gameplay.GameActions.ActionUtil.ActionPerformed(GameAction action)
   at Eco.Gameplay.GameActions.GameActionManager.TryPerformActions(User user, IEnumerable`1 actions, IEnumerable`1 preTests, IEnumerable`1 postEffects)
   at Eco.Gameplay.GameActions.GameActionManager.TryPerformActions(User user, GameActionPack actionPack, Boolean notify)
   at Eco.Gameplay.GameActions.GameActionManager.TryPerform(GameActionPack pack, Boolean notify)
   at Eco.Gameplay.Items.WorkOrder.TryToContributeItemsResult(User user, ItemStack stack, Int32 maxToContribute, Boolean moveAll)
   at Eco.Gameplay.Items.WorkOrder.TryToContributeItems(Player player, ItemStack stack, Int32 maxToContribute, Boolean moveAll)</size>
WeaselDog commented 4 years ago

The fix does prevent people from giving out more than the max allowed by the server. Posting the contract could also be limited to the daily max allowed. This will help divide it evenly while keeping chat cleaner.
Still need to test when the crash is fixed: https://github.com/StrangeLoopGames/EcoIssues/issues/14267

johnkslg commented 4 years ago

This is working in my local tests, maybe the fixes didn't make it into the staging build somehow? Can you test again in next staging.

image

@WeaselDog Thought about limiting to max per day, but work parties can spawn many days. Thinking we want to let people be able to give more rep at some point, too.

beastyn commented 4 years ago

Still can't check with this crash #14297 But I still can place a huge reputation number.

johnkslg commented 4 years ago

Huge reputation number I'd like to allow, for multi-day work parties (and later, letting people give more reputation). Should be fixed otherwise, crash was fixed.

beastyn commented 4 years ago

Yeap, counting with daily limitation. Will see in playtest how it will eork out.