Skip to content

Commit 91c71d8

Browse files
committed
2024-08-08T0639Z
1 parent 85ce1a0 commit 91c71d8

17 files changed

Lines changed: 117 additions & 187 deletions

File tree

README.md

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -80,45 +80,49 @@ Game-specific options are specified in the `--config_path` argument, which defau
8080
| ---------------------- | ------------ | ------------------- |
8181
| `--config_path`, `-cp` | `int` | `./GameConfig.toml` |
8282
| `--rcc_port`, `-rp` | `int` | 2005 |
83-
| `--web_port`, `-wp` | `int` | 2006 |
83+
| `--web_port`, `-wp` | `int` | 2005 |
8484
| `--run_client`, `-rc` | `store_true` | N/A |
8585
| `--skip_rcc` | `store_true` | N/A |
8686
| `--skip_rcc_popen` | `store_true` | N/A |
8787
| `--skip_web` | `store_true` | N/A |
8888

8989
### `player`
9090

91-
| Option | Type | Default |
92-
| ------------------- | ----- | ------- |
93-
| `--rcc_host`, `-rh` | `str` | None |
94-
| `--rcc_port`, `-rp` | `int` | 2005 |
95-
| `--web_host`, `-wh` | `str` | N/A |
96-
| `--web_port`, `-wp` | `int` | 2006 |
97-
| `--user_code`, `-u` | `str` | N/A |
91+
| Option | Type | Default |
92+
| ------------------------- | ----- | ------- |
93+
| `--rcc_host`, `-rh`, `-h` | `str` | None |
94+
| `--rcc_port`, `-rp`, `-p` | `int` | 2005 |
95+
| `--web_host`, `-wh` | `str` | N/A |
96+
| `--web_port`, `-wp` | `int` | 2005 |
97+
| `--user_code`, `-u` | `str` | N/A |
9898

9999
### Misc.
100100

101101
Command syntaxes for `studio` and `download` also exists, but haven't been adequately documented yet.
102102

103103
## Network Ports in Use
104104

105-
Anyone can host a server and must leave **two** network ports of their choice accessible.
105+
**To keep it simple: just open port 2005 on both TCP and UDP.**
106+
107+
Anyone can host a server and must leave _both a TCP and UDP network port_ of their choice accessible.
108+
109+
It's possible to connect to a webserver and an RCC server from different hosts. However, I wouldn't recommend it.
106110

107111
### RCC (UDP)
108112

109-
RCC is an acronym for 'Rōblox Cloud Compute', which is the `exe` program we use to run the Rōblox servers. It leaves one (maybe two) relevant port open.
113+
RCC is an acronym for 'Rōblox Cloud Compute', which is the `exe` program we use to run the Rōblox servers. The UDP-based protocol it communicated with built under [RakNet](http://www.raknet.com/).
110114

111115
Host is specified by the `--rcc_host` or `-rh` option.
112116

113-
Port is specified by the `--rcc_port` or `-rp` option **(defaults to 2005)**.
117+
Port is specified by the `--rcc_port` or `-rp` option.
114118

115119
### Webserver (HTTPS)
116120

117121
The webserver is responsible for facilitating player connections and loading in-game assets.
118122

119123
Host is optionally specified by the `--webserver_host` or `-wh` option, in case RCC is hosted elsewhere.
120124

121-
Port is specified by the `--webserver_port` or `-wp` option **(defaults to 2006)**.
125+
Port is specified by the `--webserver_port` or `-wp` option.
122126

123127
## Studio?
124128

@@ -156,13 +160,13 @@ Where `...` is [your command-line prefix](#installation),
156160
### Server
157161

158162
```shell
159-
... server -rp 2005 -wp 2006 --config ./GameConfig.toml
163+
... server -rp 2005 --config ./GameConfig.toml
160164
```
161165

162166
### Player
163167

164168
```shell
165-
... player -rh 172.88.194.43 -rp 2005 -wp 2006
169+
... player -rh 172.88.194.43 -rp 2005
166170
```
167171

168172
## Config File Structure

ReleaseNewVersion.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,4 @@ UpdateAndPush
5959
CreateBinary
6060
CreateZippedDirs
6161

62-
gh release create "$commit_name" --notes "" --title "$release_name" $files -p
62+
gh release create "$release_name" --notes "" $files -p

Source/launcher/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
download,
33
player,
44
server,
5-
studio,
65
)
76

87
from .subparsers.args_aux import (

Source/launcher/routines/_logic.py

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,11 @@ def get_app_base_url(self) -> str:
5252

5353

5454
class bin_ssl_arg_type(bin_arg_type):
55-
web_host: str | None = None
56-
web_port: web_server_logic.port_typ = web_server_logic.port_typ(
57-
port_num=80,
58-
is_ssl=True,
59-
is_ipv6=False,
60-
)
55+
web_host: str
56+
web_port: web_server_logic.port_typ
6157

6258
def send_request(self, path: str, timeout: float = 7) -> http.client.HTTPResponse:
59+
assert self.web_port.port_num is not None
6360
try:
6461
return urllib.request.urlopen(
6562
f'{self.get_base_url()}{path}',
@@ -74,24 +71,21 @@ def send_request(self, path: str, timeout: float = 7) -> http.client.HTTPRespons
7471

7572

7673
class host_arg_type(arg_type):
77-
rcc_host: str | None = None
78-
rcc_port_num: int = 2005
79-
80-
web_host: str | None = None
81-
web_port: web_server_logic.port_typ = web_server_logic.port_typ(
82-
port_num=80,
83-
is_ssl=False,
84-
is_ipv6=False,
85-
), # type: ignore
74+
rcc_host: str
75+
rcc_port_num: int
76+
77+
web_host: str
78+
web_port: web_server_logic.port_typ
8679
user_code: str | None = None
8780
launch_delay: float = 0
8881

8982
def sanitise(self) -> None:
9083
super().sanitise()
9184

92-
self.web_host, self.rcc_host = \
93-
self.web_host or self.rcc_host or 'localhost', \
94-
self.rcc_host or self.web_host or 'localhost'
85+
if self.rcc_host == 'localhost':
86+
self.rcc_host = '127.0.0.1'
87+
elif ':' in self.rcc_host:
88+
self.rcc_host = f'[{self.rcc_host}]'
9589

9690
if self.rcc_host == 'localhost':
9791
self.rcc_host = '127.0.0.1'
@@ -103,7 +97,6 @@ def sanitise(self) -> None:
10397
self.web_host = self.app_host = '127.0.0.1'
10498

10599
elif self.web_host and ':' in self.web_host:
106-
107100
# The ".ipv6-literal.net" replacement only works on Windows and might not translate well on Wine.
108101
# It's strictly necessary for 2021E because some CoreGUI stuff will crash if the BaseUrl doesn't have a dot in it.
109102
unc_ip_str = self.web_host.replace(':', '-')

Source/launcher/routines/clear_appdata.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
import web_server._logic as web_server_logic
2-
import web_server as web_server
3-
41
from . import _logic as logic
52
import dataclasses
63
import threading

Source/launcher/routines/player.py

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
import web_server._logic as web_server_logic
2-
import web_server as web_server
3-
42
from . import _logic as logic
53
import urllib.request
64
import util.resource
@@ -74,14 +72,10 @@ def process(self) -> None:
7472
class arg_type(logic.bin_ssl_arg_type, logic.host_arg_type):
7573
obj_type = obj_type
7674

77-
rcc_host: str = 'localhost'
78-
rcc_port_num: int = 2005
79-
web_host: str | None = None
80-
web_port: web_server_logic.port_typ = web_server_logic.port_typ(
81-
port_num=80,
82-
is_ssl=False,
83-
is_ipv6=False,
84-
), # type: ignore
75+
rcc_host: str
76+
rcc_port_num: int
77+
web_host: str
78+
web_port: web_server_logic.port_typ
8579
user_code: str | None = None
8680
launch_delay: float = 0
8781

@@ -91,7 +85,7 @@ def finalise_user_code(self) -> None:
9185
it needs to be executed after `launch_delay` seconds.
9286
The `sanitise` method gets executed before that delay.
9387
'''
94-
if self.user_code:
88+
if self.user_code is not None:
9589
return
9690
res = self.send_request('/rfd/default-user-code')
9791
self.user_code = str(res.read(), encoding='utf-8')
Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
import web_server._logic as web_server_logic
2-
import web_server as web_server
3-
42
from ..startup_scripts import rcc_server
53
from . import _logic as logic
64
import util.const as const
@@ -148,17 +146,16 @@ def make_rcc_popen(self) -> None:
148146
[
149147
self.get_versioned_path('RCCService.exe'),
150148

151-
f'-placeid:{const.PLACE_ID_CONST}',
149+
f'-PlaceId:{const.PLACE_ID_CONST}',
152150

153-
'-localtest', self.get_versioned_path(
151+
'-LocalTest', self.get_versioned_path(
154152
'GameServer.json',
155153
),
156154

157-
'-settingsfile', self.get_versioned_path(
155+
'-SettingsFile', self.get_versioned_path(
158156
'DevSettingsFile.json',
159157
),
160158

161-
'-port 64989',
162159
*(('-verbose',) if self.local_args.verbose else ()),
163160
],
164161
stdin=subprocess.PIPE,
@@ -182,12 +179,12 @@ def process(self) -> None:
182179
self.make_rcc_popen()
183180

184181

185-
@ dataclasses.dataclass
182+
@dataclasses.dataclass
186183
class arg_type(logic.bin_ssl_arg_type):
187184
obj_type = obj_type
188185

186+
rcc_port_num: int | None
189187
game_config: config.obj_type
190-
rcc_port_num: int = 2005
191188
skip_popen: bool = False
192189
verbose: bool = False
193190
web_port: web_server_logic.port_typ = web_server_logic.port_typ(

Source/launcher/routines/studio.py

Lines changed: 0 additions & 50 deletions
This file was deleted.
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import web_server._logic as web_server_logic
2-
import web_server as web_server
2+
import web_server
33

44
from . import _logic as logic
55
import config.structure
@@ -56,5 +56,6 @@ class arg_type(logic.arg_type):
5656

5757
game_config: config.obj_type
5858
web_ports: list[web_server_logic.port_typ] = dataclasses.field(
59-
default_factory=list)
59+
default_factory=list,
60+
)
6061
verbose: bool = False

Source/launcher/subparsers/_logic.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,12 @@ class launch_mode(enum.Enum):
77
ALWAYS = 'always'
88
SERVER = 'server'
99
PLAYER = 'player'
10-
STUDIO = 'studio'
1110
DOWNLOAD = 'download'
1211

1312

1413
ENABLED_LAUNCH_MODES = {
1514
launch_mode.SERVER,
1615
launch_mode.PLAYER,
17-
# launch_mode.STUDIO, TODO: get some Studio binaries.
1816
launch_mode.DOWNLOAD,
1917
}
2018

0 commit comments

Comments
 (0)