Documentation ¶
Overview ¶
This package will keep the score of territories.
There are two parallel tables of scores, pointing to the same data. One map is used for efficiently mapping from uid to a pointer to the score data, and one linear table is used to traverse the complete list for updates and saves. The reason for this is that there will be a lot of updates of scores, which has to be very efficient. Every such access have to lock the map. Whenever the whole list is traversed periodically, the map must not be locked as it takes some time.
Note that the score entry itself is not locked. That means that there is a small chance that data can be corrupted. The worst case is a failed update, which is acceptable.
The "BalanceScore" is similar to the total score, but it will decay towards a value greater than 0.
Index ¶
Constants ¶
const ( ConfigScoreUpdatePeriod = 1e11 // The perdiod between updates of the database ConfigScoreHalfLife = time.Hour * 24 * 30 // The half life off the score decay ConfigScoreBalHalfLife = time.Hour * 24 * 5 // The half life off the scoreBalance decay ConfigScoreBalanceZero = 10 // The value that ScoreBalance will decay to, which is not 0 ConfigHandicapLimit = 10 // Any more chunks than this will impose a handicap on the score )
Variables ¶
This section is empty.
Functions ¶
Types ¶
This section is empty.