congif from .cell/cell.toml
Some checks failed
Build and Deploy / build-macos (push) Failing after 10s
Build and Deploy / build-windows (CLANG64) (push) Has been cancelled
Build and Deploy / package-dist (push) Has been cancelled
Build and Deploy / deploy-itch (push) Has been cancelled
Build and Deploy / deploy-gitea (push) Has been cancelled
Build and Deploy / build-linux (push) Has been cancelled

This commit is contained in:
2025-05-31 15:55:24 -05:00
parent aab0a56349
commit 7711c644a0
3 changed files with 29 additions and 1 deletions

7
.cell/cell.toml Normal file
View File

@@ -0,0 +1,7 @@
# Cell configuration
# ENet service interval in seconds
ENETSERVICE = 0.05
# Reply timeout in seconds
REPLYTIMEOUT = 30

2
.gitignore vendored
View File

@@ -20,4 +20,4 @@ icon.ico
steam/
subprojects/*/
build_dbg/
.cell
modules/

View File

@@ -232,6 +232,27 @@ globalThis.use = function use(file, ...args) {
return ret
}
var configPath = '.cell/cell.toml'
if (io.exists(configPath)) {
try {
var toml = use('toml')
var configText = io.slurp(configPath)
var config = toml.decode(configText)
// Override defaults with config values
if (config.ENETSERVICE !== undefined) {
ENETSERVICE = config.ENETSERVICE
log.system(`Loaded ENETSERVICE from config: ${ENETSERVICE}`)
}
if (config.REPLYTIMEOUT !== undefined) {
REPLYTIMEOUT = config.REPLYTIMEOUT
log.system(`Loaded REPLYTIMEOUT from config: ${REPLYTIMEOUT}`)
}
} catch (err) {
log.error(`Failed to load config from ${configPath}: ${err}`)
}
}
globalThis.json = use('json')
var time = use('time')