Fixing issues #282 where players can bypass max username length by
editing their storage. I added a sanitization on the server side to
avoid all kind of cheat on the username as we can't trust clients
Previous patch modified largeModifier to increase it. It boosted
attacker loss but also increased speed a lot (not intentional). We now
declare two different modifier for speed and for attacker loss. Attacker
loss should remain the same.
Speed was brought as before (to slow down a bit huge players). Except
instead of sqrt (exponent 1/2) we do exponent 0.6. So the speed modifier
decreases a bit faster with size (to disadvantage a bit huge players who
are invincible right now)
Co-authored-by: ilan schemoul <ilanschemoul@gmail.com>
More costly (start at 1.5M), increase cost cap (4.5M), biggest timeout
(5s->10s), much lower chance to stop hydrogen (70%->10%), triple
construction time (10s->30s) otherwise it's trivial to build a SAM right
before a nuke hits
Slightly decrease flat land advantage (in certain cases it feels almost
instataneous otherwise)
To calculate speed bonus use 4*attackTroops instead of 5 (people keep
complaining than small numbers of troops take crazy amount of lands
veryn quick)
Slightly increase minimum multiplier for attacker loss, to make
snowballing a little bit slower.
I only slightly modified numbers because the meta is fun it's just too
quick on certain cases.
We previously had a system where lobbyLifetime = gameCreationRate * 2
It was to always have one lobby ready.
With dynamic timer (start if enough player or timer's over) we cannot
rely on this system (which used setInterval) so we have one lobby and
check every 100ms if we need to create another lobby.
Might add 100ms+time of creating a lobby ms latency. Which is fine I
guess.
- **improve and fix dynamic lobby**
- **Revert "Change BorderTiles from Array to Set (#230)"**
I'm obviously forced to include the revert patch otherwise I can't
compile. but you should first merge PR dedicated to revert before tthis
If the port of destination and of source have same owner it means a
player captures port of another player, we cease all trade that happens
inside same country.
Also added a check in the canTrade code to be more reliable and correct
even outside of the specific case of capturing a port.
create endpoint to load archived game. when joining game client first
checks if the game is active, if not it requests the game archive from
the server. the archive is sent to LocalServer to replay the game
locally. Every 10 ticks a hash is stored on the archive, and during
replay the LocalServer verifies this hash.