- val oldTotalCredits =
- if(this._userStateMsg!=null)
- this._userStateMsg.totalCredits
- else
- 0.0D
- // FIXME check these
- if(this._userStateMsg eq null) {
- computeBatch()
- }
- else if(nowYear != eventYear || nowMonth != eventMonth) {
- DEBUG(
- "nowYear(%s) != eventYear(%s) || nowMonth(%s) != eventMonth(%s)",
- nowYear, eventYear,
- nowMonth, eventMonth
- )
- computeBatch()
- }
- else if(this._userStateMsg.latestResourceEventOccurredMillis < rcEvent.getOccurredMillis) {
- DEBUG("this._workingUserState.latestResourceEventOccurredMillis < rcEvent.occurredMillis")
- DEBUG(
- "%s < %s",
- TimeHelpers.toYYYYMMDDHHMMSSSSS(this._userStateMsg.latestResourceEventOccurredMillis),
- TimeHelpers.toYYYYMMDDHHMMSSSSS(rcEvent.getOccurredMillis)
- )
- computeRealtime()
- }
- else {
- DEBUG("OUT OF ORDER! this._workingUserState.latestResourceEventOccurredMillis=%s and rcEvent.occurredMillis=%s",
- TimeHelpers.toYYYYMMDDHHMMSSSSS(this._userStateMsg.latestResourceEventOccurredMillis),
- TimeHelpers.toYYYYMMDDHHMMSSSSS(rcEvent.getOccurredMillis))
-
- computeBatch()
- }
- val newTotalCredits = this._userStateMsg.totalCredits
- if(oldTotalCredits * newTotalCredits < 0)
- aquarium.eventBus ! new BalanceEvent(this._userStateMsg.userID,
- newTotalCredits>=0)