LoganCSC / MapLand

An android app that allows users to buy and sell fictional properties overlaid on real geography.
0 stars 0 forks source link

Update user credits based on region income #4

Closed barrybecker4 closed 9 years ago

barrybecker4 commented 9 years ago

Initially I was thinking that there would be some sort of timer on the server that would periodically query for all the users and update their credits total. But this has some problems:

Fortunately, I thought of a clever solution. Whenever a user is accessed or a region transfers from one user to another, we will at that time update the credits based on the users current locations (that existed since last access) and the previous time updated. The amount to increment will be the incomes for all regions owned times the number of elapsed time periods. We can even do a fractional time period so the bookkeeping is precise.

barrybecker4 commented 9 years ago

Implemented