CFC-Servers / CFC-Servers/cfc_time

Figure out how to properly add a time delta per-player

Open
#23 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Lua
Stars
9
Forks
2
PR merge metrics
No merged PRs in 30d

Description

Right now if a player joins 1 second before the batch update, they'll get an extra `updateInterval - 1` seconds.

We could set their duration to `now - joined` but I like the idea of it always being additive instead of definitive.

Once we fix this, we can also fix the issue where if the timer stops then starts, some players would get _way more_ time than they earned (if they joined well after the timer stopped) because the timer will always add `now - lastUpdate` seconds to every player.

Contributor guide

No contributing guide indexed for this repository

Research direction

No file or test is named. Trace the batch update and timer stop/start paths described in the issue, then reproduce both timing cases: a player joining just before an update and a player joining while the timer is stopped. Done means each player receives only the additive time they earned in both cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.