Skip to content

Commit cbafdf6

Browse files
committed
Fixed non-capped server builds
Fixed the clientstats constructor used when there is no cap (and no stats related to it). Also a minor change to checking whether prort was fixed. Set the server back to uncapped for the repo. I may have to create project definitions for the capped versions later, since this is easily and repeatedly missed. (Cap increased to 500kb total, but commented out.)
1 parent 36c47a5 commit cbafdf6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Main.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,13 @@ static std::vector<BanEntry> banIPList;
5959
// Upload limit for ENTIRE SERVER, TCP + UDP, in bytes
6060
// UDP messages received above this limit will be discarded
6161
// TCP messages received above this limit are still delivered. See TCP_CLIENT_UPLOAD_CAP.
62-
#define TOTAL_UPLOAD_CAP 300000
62+
// #define TOTAL_UPLOAD_CAP 500000
6363

6464
// TCP upload limit for single clients, per second, in bytes.
6565
// TCP messages received above this limit will send the client an error message
6666
// and disconnect them.
6767
// UDP upload limit is not defined.
68-
#define TCP_CLIENT_UPLOAD_CAP 3000
68+
// #define TCP_CLIENT_UPLOAD_CAP 3000
6969

7070
// Set this to 0 for the app to ask the user what port it is, on bootup;
7171
// or to another number to use that by default
@@ -139,7 +139,7 @@ int main()
139139

140140
// Check port settings
141141
int port = FIXEDPORT;
142-
if (port == 0)
142+
if constexpr (FIXEDPORT == 0)
143143
{
144144
std::cout << "Enter port number to begin (default 6121):";
145145

@@ -241,7 +241,7 @@ struct clientstats
241241
clientstats(std::shared_ptr<lacewing::relayserver::client> _c) : c(_c), totalBytesIn(0), totalNumMessagesIn(0)
242242
, bytesIn(0), numMessagesIn(0), exceeded(false), wastedServerMessages(0) {}
243243
#else
244-
clientstats(lacewing::relayserver::client * _c) : c(_c), totalBytesIn(0), totalNumMessagesIn(0),
244+
clientstats(std::shared_ptr<lacewing::relayserver::client> _c) : c(_c), totalBytesIn(0), totalNumMessagesIn(0),
245245
wastedServerMessages(0) {}
246246
#endif
247247
};

0 commit comments

Comments
 (0)