#3702 closed defect (fixed)
[PATCH] Lock-teams doesn't lock diplomacy
Reported by: | elexis | Owned by: | elexis |
---|---|---|---|
Priority: | Should Have | Milestone: | Alpha 20 |
Component: | UI & Simulation | Keywords: | patch |
Cc: | Patch: |
Description (last modified by )
The lock-teams setting is currently quite useless. It forces you to be allied with your team members, but still allows changing the diplomacy of enemies to ally (i.e. backstabbing as you cooperate with the enemy).
Currently there is no way to change the teams anyway (you can only change diplomacy, i.e. ally/neutral/enemy, but you will always stay in the same team).
The lock-teams setting must be changed so that it actually enforces diplomacy-lockdown. ---
Also sending tributes to the enemy should be forbidden if locked-diplomacy is enabled, as there is no legitimate use in that situation I can think of. Sending tributes to the enemy is either a mistake or backstabbing/trolling.
Sending resources to the enemy should be allowed for diplomacy-free games though, as you might deal a peace-treaty against resources.
Attachments (4)
Change History (17)
comment:1 by , 8 years ago
Description: | modified (diff) |
---|
comment:2 by , 8 years ago
Keywords: | simple added |
---|---|
Priority: | Must Have → Should Have |
comment:3 by , 8 years ago
Keywords: | review patch added |
---|---|
Milestone: | Alpha 20 → Alpha 21 |
Summary: | Lock-teams doesn't lock diplomacy → [PATCH] Lock-teams doesn't lock diplomacy |
comment:4 by , 8 years ago
by , 8 years ago
Attachment: | menu.js.patch added |
---|
comment:5 by , 8 years ago
Keywords: | review removed |
---|---|
Milestone: | Alpha 21 → Alpha 20 |
For each is deprecated use for(in) or for(of) instead. In general let should be used unless you have a good reason for using var
Thanks for your work so far
comment:6 by , 8 years ago
Also the checks should not only be client-side but also in the simulation. To accomplish that, checks need to be added in "diplomacy" and "attack-request" in g_Commands in Commands.js. This makes sure people can't change their gamecode to ignore your patch (since the player can't change the simulation code of the other players).
With regards to for-each use:
for (let column of ["TributeFood", "TributeWood", "TributeStone", "TributeMetal", "Ally", "Neutral", "Enemy"]) }}
by , 8 years ago
Attachment: | lockedTeams.patch added |
---|
New patch removes for each loops from menu.js and completes the partialy implemented logic for team locking in Player.js
comment:7 by , 8 years ago
Keywords: | review added; simple removed |
---|
comment:8 by , 8 years ago
It's not introduced by your patch, but please don't use let a
, use a more descriptive variable name like in elexis's example :)
by , 8 years ago
Attachment: | lockedTeams3.patch added |
---|
comment:10 by , 8 years ago
The GUI part has been committed.
Now a decision is needed on whether the simple changes and simplifications of the simulation in the patch above are acceptable, or whether we want to change the header of many functions in many files without a real use case just to move 2 early returns from Commands.js
to Player.js
and replace them with a boolean parameter.
If we decide for the latter, then we need to change 5 functions (SetTeams
, SetAllies
, SetNeutral
, SetDiplomacy
, SetDiplomacyIndex
, possible others) in the Player
component and most calls to it (trigger scripts like survival-of-the-fittest
and other components like the Ceasefire
manager and the Player
initialization helper), since sometimes you want to force diplomacy changes from the simulation, sometimes you want to early return if ceasefire is active, sometimes an early return if teams are locked (other times both or neither). Rewrote that idea several times and still find it a bit pointless (maybe I need to give it another try).
The patch above allows all simulation components by default to change diplomacy, unless it was user-sent data from Commands.js
.
comment:12 by , 8 years ago
Keywords: | review removed |
---|
comment:13 by , 7 years ago
See IRC discussion with mimo on 2016-02-16 on the prohibition of sending enemies resources when teams are locked.
My patch stops users from changing diplomacy or tribute to players on other teams but at the same time continues to allow diplomacy with non-aligned players and when teams are not locked.