Skip to content

Commit

Permalink
UDP muxing option for Web #286 [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
geneotech committed Jun 18, 2024
1 parent 7358639 commit eef2813
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
2 changes: 2 additions & 0 deletions docs/pages/todo/todo_done.md
Original file line number Diff line number Diff line change
Expand Up @@ -6987,3 +6987,5 @@ This will discard your redo history."
- The high frequency shouldnt honestly cause such a drop
- although it does even prevent first bullets or dashes from playing

- Enable gzip compression
- Test on opera
6 changes: 5 additions & 1 deletion hypersomnia/default_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -790,8 +790,12 @@ treat_as_music_sounds_longer_than_secs = 5,

allow_webrtc_clients = true,

-- If true, connections will use only single UDP port.
-- In that case set webrtc_port_range_begin and webrtc_port_range_end to the same value.
webrtc_udp_mux = false,

webrtc_port_range_begin = 9000,
webrtc_port_range_end = 9100,
webrtc_port_range_end = 9010,

-- If > 0, kicks players who do not provide either a Steam or Discord (TODO) session ticket upon connection.
-- Will happen on all ranked servers by default.
Expand Down
7 changes: 5 additions & 2 deletions src/application/setups/server/server_setup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,8 @@ class webrtc_server_detail {
const std::string& signaling_server_url,
const std::vector<rtc::IceServer>& iceServers,
const port_type ports_begin,
const port_type ports_end
const port_type ports_end,
const bool udp_mux
) {
LOG("Web port range: %x-%x", ports_begin, ports_end);
self->config.iceServers = iceServers;
Expand All @@ -411,6 +412,7 @@ class webrtc_server_detail {
#else
self->config.portRangeBegin = { ports_begin };
self->config.portRangeEnd = { ports_end };
self->config.enableIceUdpMux = udp_mux;
#endif

#if USE_WEBSOCKET
Expand Down Expand Up @@ -715,7 +717,8 @@ server_setup::server_setup(
webrtc_signalling_server_url,
::get_ice_servers(),
vars.webrtc_port_range_begin,
vars.webrtc_port_range_end
vars.webrtc_port_range_end,
vars.webrtc_udp_mux
);
}

Expand Down
4 changes: 3 additions & 1 deletion src/application/setups/server/server_vars.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,10 @@ struct server_vars {
std::optional<arena_playtesting_context> playtesting_context;

bool allow_webrtc_clients = true;

bool webrtc_udp_mux = false;
port_type webrtc_port_range_begin = 9000;
port_type webrtc_port_range_end = 9100;
port_type webrtc_port_range_end = 9010;

server_name_type server_name;
address_string_type notified_server_list;
Expand Down

0 comments on commit eef2813

Please sign in to comment.