Repository navigation
Conversation
2fc7012 to
8257eac
Compare
18552f4 to
c89d75d
Compare
|
Draft as this requires PGMDev/PGM#1648 and PGMDev/PGM#1721 |
d58d121 to
7ccfc8f
Compare
ee6c514 to
47d631e
Compare
220237b to
b50ff96
Compare
43f0c45 to
349ad7d
Compare
Signed-off-by: BT <43831917+calcastor@users.noreply.github.com>
Signed-off-by: BT <43831917+calcastor@users.noreply.github.com>
| String TABLE_NAME = "sessions"; | ||
| String TABLE_FIELDS = | ||
| "(id VARCHAR(36) PRIMARY KEY, player VARCHAR(36), disguised BOOL, server VARCHAR(32), start_time BIGINT, end_time BIGINT)"; | ||
| "(id VARCHAR(36) PRIMARY KEY, player VARCHAR(36), disguised BOOL, server VARCHAR(64), start_time BIGINT, end_time BIGINT)"; |
There was a problem hiding this comment.
Was this increased to accommodate longer server IDs? Just flagging that changing the definition here won’t widen the columns in existing databases, so existing setups (OCC) would need a migration or manual change to benefit from it. Would be nice if we added a migration system in Community, but that's kinda out of scope for this PR.
There was a problem hiding this comment.
It was, though I doubt it's absolutely necessary. A migration system would be nice, though existing dbs remain compatible.
| for (boolean ignoreDisguised : new boolean[] {false, true}) { | ||
| SessionData data = | ||
| sessionCache.getIfPresent(new SessionQuery(session.getPlayerId(), ignoreDisguised)); | ||
| if (data != null) data.updateEndDate(session); |
There was a problem hiding this comment.
Hmmm. I think there might still be a race if a player quits while a lookup is loading. updateEndDate() does nothing when the cache entry hasn't loaded yet, so the delayed lookup can then cache the old session with no end time.
Maybe we can track changes during the load and retry if the session was updated before the result came back?
Signed-off-by: BT <43831917+calcastor@users.noreply.github.com>
0b5d5ee to
ba5e59d
Compare
Signed-off-by: applenick <applenick@users.noreply.github.com>
Signed-off-by: applenick <applenick@users.noreply.github.com>
No description provided.