Skip to content

Commit c05d602

Browse files
committed
2024-08-06T0617Z
1 parent a7cfba8 commit c05d602

3 files changed

Lines changed: 60 additions & 17 deletions

File tree

README.md

Lines changed: 51 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,9 @@ This is current as of 2024-08-06. Some options might be different in future vers
171171

172172
#### `metadata.config_version_wildcard`
173173

174-
Resolves to a wildcard.
174+
Resolves to a wildcard; defaults to `"*"`.
175175

176-
_Wildcard_ which matches against the `GIT_RELEASE_VERSION` internal constant. Useful for protecting changes in config structure between RFD versions. If not included, the value is "\*".
176+
Matches against the `GIT_RELEASE_VERSION` internal constant. Useful for protecting changes in config structure between RFD versions.
177177

178178
#### `server_assignment.players.maximum`
179179

@@ -241,17 +241,25 @@ rbxl_uri = 'https://archive.org/download/uncopylocked-roblox/Uncopylocked%20Robl
241241

242242
#### `game_setup.place_file.enable_saveplace`
243243

244-
Resolves to type `bool`.
244+
Resolves to type `bool`; defaults to false.
245245

246246
When game:SavePlace() is called, overwrites the place at `rbxl_uri`. Doesn't work if `rbxl_uri` points to an online resource.
247247

248248
#### `game_setup.asset_cache.dir_path`
249249

250250
Resolves to type `path_str`. Relative paths are traced from the directory where the config file is placed.
251251

252+
#### `game_setup.asset_cache.clear_on_start`
253+
254+
Resolves to type `bool`; defaults to false.
255+
256+
If true, deletes cache from assets which should redirect so that the config file remains correct.
257+
252258
#### `game_setup.persistence.clear_on_start`
253259

254-
Resolves to type `bool`.
260+
Resolves to type `bool`; defaults to false.
261+
262+
If true, clears all persistent data before starting a new server.
255263

256264
#### `game_setup.persistence.sqlite_path`
257265

@@ -278,18 +286,42 @@ end
278286

279287
Resolves to type `(str) -> bool`.
280288

289+
```
290+
check_user_allowed = '''
291+
function(user_code) -- string -> bool
292+
return true
293+
end
294+
'''
295+
```
296+
281297
#### `server_core.retrieve_username`
282298

283299
Resolves to type `(str) -> str`.
284300

285301
Only gets called the first time a new user joins. Otherwise, RFD checks for a cached value in [the `sqlite` database](#game_setuppersistencesqlite_path).
286302

303+
```
304+
retrieve_username = '''
305+
function(user_code)
306+
return user_code
307+
end
308+
'''
309+
```
310+
287311
#### `server_core.retrieve_user_id`
288312

289313
Resolves to type `(str) -> int`.
290314

291315
Only gets called the first time a new user joins. Otherwise, RFD checks for a cached value in [the `sqlite` database](#game_setuppersistencesqlite_path).
292316

317+
```
318+
retrieve_user_id = '''
319+
function(user_code)
320+
return math.random(1, 16777216)
321+
end
322+
'''
323+
```
324+
293325
#### `server_core.retrieve_avatar_type`
294326

295327
Resolves to type `(str) -> Enum.HumanoidRigType`.
@@ -298,19 +330,19 @@ Where Rōblox [`Enum.HumanoidRigType`](https://create.roblox.com/docs/reference/
298330

299331
```
300332
retrieve_avatar_type = '''
301-
function(user_code) -- str -> str
333+
function(user_code)
302334
return 'R15'
303335
end
304336
'''
305337
```
306338

307339
#### `server_core.retrieve_avatar_items`
308340

309-
Resolves to type `(str) -> list[int]`.
341+
Resolves to type `(str) -> [int]`.
310342

311343
```
312344
retrieve_avatar_items = '''
313-
function(user_code) -- str -> [str]
345+
function(user_code)
314346
return {
315347
10726856854,
316348
9482991343,
@@ -341,7 +373,7 @@ Resolves to type `(str) -> util.types.structs.avatar_scales`.
341373

342374
```
343375
retrieve_avatar_scales = '''
344-
function(user_code) -- str -> {[str]: number}
376+
function(user_code)
345377
return {
346378
height = 1,
347379
width = 0.8,
@@ -360,7 +392,7 @@ Resolves to type `(str) -> util.types.structs.avatar_colors`.
360392

361393
```
362394
retrieve_avatar_colors = '''
363-
function(user_code) -- str -> {[str]: number}
395+
function(user_code)
364396
return {
365397
head = 315,
366398
left_arm = 315,
@@ -381,7 +413,7 @@ Key is the group id. Value is the rank.
381413

382414
```
383415
retrieve_groups = '''
384-
function(user_code) -- str -> str
416+
function(user_code)
385417
return {
386418
['1200769'] = 255;
387419
['2868472'] = 255;
@@ -399,6 +431,14 @@ end
399431

400432
Resolves to type `(str) -> int`.
401433

434+
```
435+
retrieve_account_age = '''
436+
function(user_code) -- str -> int
437+
return 6969
438+
end
439+
'''
440+
```
441+
402442
#### `server_core.retrieve_default_funds`
403443

404444
Resolves to type `(str) -> int`.
@@ -407,7 +447,7 @@ Established the amount of funds that a player receives when they join a server f
407447

408448
```
409449
retrieve_default_funds = '''
410-
function(user_code) -- str -> int
450+
function(user_code)
411451
return 6969
412452
end
413453
'''

Source/config/structure.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class asset_cache(allocateable.obj_type):
3232

3333
class persistence(allocateable.obj_type):
3434
sqlite_path: wrappers.path_str
35-
clear_on_start: bool
35+
clear_on_start: bool = False
3636

3737
roblox_version: util.versions.rōblox
3838
startup_script: str = ''

Source/util/ssl.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,17 +105,20 @@ def __init__(self) -> None:
105105
def issue_cert(self, *identities: str) -> trustme.LeafCert:
106106
cert: trustme.LeafCert = self.ca.issue_cert(*identities)
107107

108-
# Writes the certificate that the server should use.
108+
# Writes the certificate(s) that the server should use.
109109
self.server_pem_path = self.prepare_file_path('server', 'pem')
110110
for i, blob in enumerate(cert.cert_chain_pems):
111-
# blob.write_to_path(path=self.server_pem_path, append=True)
112-
blob.write_to_path(path=self.server_pem_path, append=(i > 0))
111+
blob.write_to_path(
112+
path=self.server_pem_path,
113+
append=(i > 0),
114+
)
113115

114116
# Writes the private key that the server should use.
115117
self.server_key_path = self.prepare_file_path('server', 'key')
116118
cert.private_key_pem.write_to_path(
117-
# path=self.server_key_path, append=True)
118-
path=self.server_key_path, append=False)
119+
path=self.server_key_path,
120+
append=False,
121+
)
119122

120123
return cert
121124

0 commit comments

Comments
 (0)