mirror of
https://github.com/rehlds/rehlds.git
synced 2024-12-28 15:45:46 +03:00
HLTV: Increased rates threshold for recording demofile, rate 100k and updaterate up to 100
This commit is contained in:
parent
361185ffbc
commit
7c5dc890df
@ -90,6 +90,24 @@ void DemoClient::Reconnect()
|
||||
FinishDemo();
|
||||
}
|
||||
|
||||
void DemoClient::SetUpdateRate(int updaterate)
|
||||
{
|
||||
m_DemoChannel.SetUpdateRate(
|
||||
clamp(updaterate,
|
||||
MIN_PROXY_UPDATERATE,
|
||||
MAX_PROXY_UPDATERATE)
|
||||
);
|
||||
}
|
||||
|
||||
void DemoClient::SetRate(int rate)
|
||||
{
|
||||
m_DemoChannel.SetRate(
|
||||
clamp(rate,
|
||||
MIN_PROXY_RATE,
|
||||
MAX_PROXY_RATE)
|
||||
);
|
||||
}
|
||||
|
||||
bool DemoClient::Connect(INetSocket *socket, NetAddress *adr, char *userinfo)
|
||||
{
|
||||
if (IsActive())
|
||||
|
@ -60,6 +60,8 @@ public:
|
||||
void FinishDemo();
|
||||
void SendDatagram();
|
||||
void WriteDatagram(double time, frame_t *frame);
|
||||
void SetUpdateRate(int updaterate);
|
||||
void SetRate(int rate);
|
||||
|
||||
protected:
|
||||
IProxy *m_Proxy;
|
||||
|
@ -904,7 +904,7 @@ bool Proxy::SetMaxClients(int number)
|
||||
|
||||
void Proxy::SetMaxLoss(float maxloss)
|
||||
{
|
||||
m_MaxLoss = Q_clamp(maxloss, 0.0f, 1.0f);
|
||||
m_MaxLoss = clamp(maxloss, 0.0f, 1.0f);
|
||||
}
|
||||
|
||||
int Proxy::GetMaxClients()
|
||||
@ -1162,8 +1162,15 @@ void Proxy::CMD_Record(char *cmdLine)
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_DemoClient.Connect()) {
|
||||
if (m_DemoClient.Connect())
|
||||
{
|
||||
m_DemoClient.SetFileName(params.GetToken(1));
|
||||
|
||||
#ifdef HLTV_FIXES
|
||||
// Increased rate for recording demofile
|
||||
m_DemoClient.SetUpdateRate(m_MaxUpdateRate);
|
||||
m_DemoClient.SetRate(m_MaxRate);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@ -1680,7 +1687,7 @@ void Proxy::CMD_ChatMode(char *cmdLine)
|
||||
return;
|
||||
}
|
||||
|
||||
m_ChatMode = Q_clamp((ChatMode_e)Q_atoi(params.GetToken(1)), CHAT_OFF, CHAT_GLOBAL);
|
||||
m_ChatMode = clamp((ChatMode_e)Q_atoi(params.GetToken(1)), CHAT_OFF, CHAT_GLOBAL);
|
||||
}
|
||||
|
||||
void Proxy::CMD_MaxQueries(char *cmdLine)
|
||||
@ -1946,7 +1953,7 @@ void Proxy::CMD_DispatchMode(char *cmdLine)
|
||||
return;
|
||||
}
|
||||
|
||||
m_DispatchMode = Q_clamp((DispatchMode_e)Q_atoi(params.GetToken(1)), DISPATCH_OFF, DISPATCH_ALL);
|
||||
m_DispatchMode = clamp((DispatchMode_e)Q_atoi(params.GetToken(1)), DISPATCH_OFF, DISPATCH_ALL);
|
||||
}
|
||||
|
||||
bool Proxy::IsValidPassword(int type, char *pw)
|
||||
@ -2454,14 +2461,12 @@ void Proxy::CreateServerInfoString(InfoString *info)
|
||||
|
||||
void Proxy::SetMaxRate(int rate)
|
||||
{
|
||||
// maxrate: 1.000 - 20.000
|
||||
m_MaxRate = Q_clamp(rate, 1000, MAX_PROXY_RATE);
|
||||
m_MaxRate = clamp(rate, MIN_PROXY_RATE, MAX_PROXY_RATE);
|
||||
}
|
||||
|
||||
void Proxy::SetMaxUpdateRate(int updaterate)
|
||||
{
|
||||
// maxupdaterate: 1.0 - 40.0
|
||||
m_MaxUpdateRate = Q_clamp(updaterate, 1, MAX_PROXY_UPDATERATE);
|
||||
m_MaxUpdateRate = clamp(updaterate, MIN_PROXY_UPDATERATE, MAX_PROXY_UPDATERATE);
|
||||
}
|
||||
|
||||
void Proxy::SetDelay(float seconds)
|
||||
@ -2495,7 +2500,7 @@ void Proxy::SetClientTime(double time, bool relative)
|
||||
void Proxy::SetClientTimeScale(float scale)
|
||||
{
|
||||
BitBuffer buf(32);
|
||||
m_ClientTimeScale = Q_clamp(scale, 0.5f, 4.0f);
|
||||
m_ClientTimeScale = clamp(scale, 0.5f, 4.0f);
|
||||
|
||||
buf.WriteByte(svc_timescale);
|
||||
buf.WriteFloat(m_ClientTimeScale);
|
||||
|
@ -45,8 +45,17 @@ class IDirector;
|
||||
class IBaseSystem;
|
||||
|
||||
#define MAX_NAME 32
|
||||
#define MAX_PROXY_RATE 20000
|
||||
#define MAX_PROXY_UPDATERATE 40
|
||||
|
||||
#ifdef HLTV_FIXES
|
||||
const int MAX_PROXY_RATE = 100000;
|
||||
const int MAX_PROXY_UPDATERATE = 100;
|
||||
#else
|
||||
const int MAX_PROXY_RATE = 20000;
|
||||
const int MAX_PROXY_UPDATERATE = 40;
|
||||
#endif
|
||||
|
||||
const int MIN_PROXY_RATE = 1000;
|
||||
const int MIN_PROXY_UPDATERATE = 1;
|
||||
|
||||
#define PROXY_CHALLENGE_LIFE 40.0f
|
||||
#define PROXY_PRIVATE 0x8000
|
||||
|
@ -49,6 +49,8 @@ public:
|
||||
void DownloadFile(char *fileName);
|
||||
void SendDatagram();
|
||||
void ParseHLTV(NetPacket *packet);
|
||||
void SetUpdateRate(int updaterate) {}
|
||||
void SetRate(int rate) {}
|
||||
|
||||
private:
|
||||
enum LocalCommandIDs {
|
||||
|
@ -1201,7 +1201,7 @@ void NetChannel::SetConnected(bool flag)
|
||||
|
||||
void NetChannel::SetRate(int newRate)
|
||||
{
|
||||
m_max_bandwidth_rate = Q_clamp(newRate, 1000, 20000);
|
||||
m_max_bandwidth_rate = Q_clamp(newRate, MIN_NETCHAN_RATE, MAX_NETCHAN_RATE);
|
||||
}
|
||||
|
||||
void NetChannel::GetFlowStats(float *avgInKBSec, float *avgOutKBSec)
|
||||
|
@ -51,6 +51,15 @@ enum
|
||||
MAX_FLOWS
|
||||
};
|
||||
|
||||
// Flow control bytes per second limits
|
||||
#ifdef HLTV_FIXES
|
||||
const int MAX_NETCHAN_RATE = 100000.0f;
|
||||
#else
|
||||
const int MAX_NETCHAN_RATE = 20000.0f;
|
||||
#endif
|
||||
|
||||
const int MIN_NETCHAN_RATE = 1000.0f;
|
||||
|
||||
#define MAX_LATENT 32
|
||||
#define FRAGMENT_MAX_SIZE 1400 // Size of fragmentation buffer internal buffers
|
||||
#define CLIENT_FRAGMENT_SIZE_ONCONNECT 128
|
||||
|
@ -46,6 +46,11 @@ public:
|
||||
virtual bool IsActive() = 0;
|
||||
virtual bool IsHearingVoices() = 0;
|
||||
virtual bool HasChatEnabled() = 0;
|
||||
|
||||
#ifdef HLTV_FIXES
|
||||
virtual void SetUpdateRate(int updaterate) = 0;
|
||||
virtual void SetRate(int rate) = 0;
|
||||
#endif // HLTV_FIXES
|
||||
};
|
||||
|
||||
#define CLIENT_INTERFACE_VERSION "client001"
|
||||
|
Loading…
Reference in New Issue
Block a user