Remove WebSocket defaults from project settings.
Can be manually set, let's not pollute them further. Should also be done for WebRTC.
This commit is contained in:
parent
092b2bd36f
commit
beb87504e0
5 changed files with 14 additions and 35 deletions
|
@ -231,8 +231,9 @@ Error EMWSClient::set_buffers(int p_in_buffer, int p_in_packets, int p_out_buffe
|
|||
}
|
||||
|
||||
EMWSClient::EMWSClient() {
|
||||
_in_buf_size = nearest_shift((int)GLOBAL_GET(WSC_IN_BUF) - 1) + 10;
|
||||
_in_pkt_size = nearest_shift((int)GLOBAL_GET(WSC_IN_PKT) - 1);
|
||||
_in_buf_size = DEF_BUF_SHIFT;
|
||||
_in_pkt_size = DEF_PKT_SHIFT;
|
||||
|
||||
_is_connecting = false;
|
||||
_peer = Ref<EMWSPeer>(memnew(EMWSPeer));
|
||||
/* clang-format off */
|
||||
|
|
|
@ -42,22 +42,6 @@
|
|||
#endif
|
||||
|
||||
void register_websocket_types() {
|
||||
#define _SET_HINT(NAME, _VAL_, _MAX_) \
|
||||
GLOBAL_DEF(NAME, _VAL_); \
|
||||
ProjectSettings::get_singleton()->set_custom_property_info(NAME, PropertyInfo(Variant::INT, NAME, PROPERTY_HINT_RANGE, "2," #_MAX_ ",1,or_greater"));
|
||||
|
||||
// Client buffers project settings
|
||||
_SET_HINT(WSC_IN_BUF, 64, 4096);
|
||||
_SET_HINT(WSC_IN_PKT, 1024, 16384);
|
||||
_SET_HINT(WSC_OUT_BUF, 64, 4096);
|
||||
_SET_HINT(WSC_OUT_PKT, 1024, 16384);
|
||||
|
||||
// Server buffers project settings
|
||||
_SET_HINT(WSS_IN_BUF, 64, 4096);
|
||||
_SET_HINT(WSS_IN_PKT, 1024, 16384);
|
||||
_SET_HINT(WSS_OUT_BUF, 64, 4096);
|
||||
_SET_HINT(WSS_OUT_PKT, 1024, 16384);
|
||||
|
||||
#ifdef JAVASCRIPT_ENABLED
|
||||
EMWSPeer::make_default();
|
||||
EMWSClient::make_default();
|
||||
|
|
|
@ -31,15 +31,9 @@
|
|||
#ifndef WEBSOCKETMACTOS_H
|
||||
#define WEBSOCKETMACTOS_H
|
||||
|
||||
#define WSC_IN_BUF "network/limits/websocket_client/max_in_buffer_kb"
|
||||
#define WSC_IN_PKT "network/limits/websocket_client/max_in_packets"
|
||||
#define WSC_OUT_BUF "network/limits/websocket_client/max_out_buffer_kb"
|
||||
#define WSC_OUT_PKT "network/limits/websocket_client/max_out_packets"
|
||||
|
||||
#define WSS_IN_BUF "network/limits/websocket_server/max_in_buffer_kb"
|
||||
#define WSS_IN_PKT "network/limits/websocket_server/max_in_packets"
|
||||
#define WSS_OUT_BUF "network/limits/websocket_server/max_out_buffer_kb"
|
||||
#define WSS_OUT_PKT "network/limits/websocket_server/max_out_packets"
|
||||
// Defaults per peer buffers, 1024 packets with a shared 65536 bytes payload.
|
||||
#define DEF_PKT_SHIFT 10
|
||||
#define DEF_BUF_SHIFT 16
|
||||
|
||||
/* clang-format off */
|
||||
#define GDCICLASS(CNAME) \
|
||||
|
|
|
@ -336,10 +336,10 @@ Error WSLClient::set_buffers(int p_in_buffer, int p_in_packets, int p_out_buffer
|
|||
}
|
||||
|
||||
WSLClient::WSLClient() {
|
||||
_in_buf_size = nearest_shift((int)GLOBAL_GET(WSC_IN_BUF) - 1) + 10;
|
||||
_in_pkt_size = nearest_shift((int)GLOBAL_GET(WSC_IN_PKT) - 1);
|
||||
_out_buf_size = nearest_shift((int)GLOBAL_GET(WSC_OUT_BUF) - 1) + 10;
|
||||
_out_pkt_size = nearest_shift((int)GLOBAL_GET(WSC_OUT_PKT) - 1);
|
||||
_in_buf_size = DEF_BUF_SHIFT;
|
||||
_in_pkt_size = DEF_PKT_SHIFT;
|
||||
_out_buf_size = DEF_BUF_SHIFT;
|
||||
_out_pkt_size = DEF_PKT_SHIFT;
|
||||
|
||||
_peer.instance();
|
||||
_tcp.instance();
|
||||
|
|
|
@ -298,10 +298,10 @@ Error WSLServer::set_buffers(int p_in_buffer, int p_in_packets, int p_out_buffer
|
|||
}
|
||||
|
||||
WSLServer::WSLServer() {
|
||||
_in_buf_size = nearest_shift((int)GLOBAL_GET(WSS_IN_BUF) - 1) + 10;
|
||||
_in_pkt_size = nearest_shift((int)GLOBAL_GET(WSS_IN_PKT) - 1);
|
||||
_out_buf_size = nearest_shift((int)GLOBAL_GET(WSS_OUT_BUF) - 1) + 10;
|
||||
_out_pkt_size = nearest_shift((int)GLOBAL_GET(WSS_OUT_PKT) - 1);
|
||||
_in_buf_size = DEF_BUF_SHIFT;
|
||||
_in_pkt_size = DEF_PKT_SHIFT;
|
||||
_out_buf_size = DEF_BUF_SHIFT;
|
||||
_out_pkt_size = DEF_PKT_SHIFT;
|
||||
_server.instance();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue