-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Miscellaneous changes #146
Conversation
Vauff
commented
Dec 25, 2023
- Fixed extend time being applied twice
- Fixed extend votes being able to be rapidly chained when more than one is available
- Allowed Discord webhooks to not override default settings
- Added player IP tracking
- Deduplicated JSON parsing code
- Switched to safer method of string storage in HTTPHeader & TrackedRequest classes
- Added missing header files to VS project files
- Added missing map vote cvars to cs2fixes.cfg
- Made config file formatting consistent
- Some code cleanup in c_http debug command
- Fixed memdbgon.h not being last include in events.cpp
- Fixed !setnextmap not having correct admin flag
- Switched to simpler CON_COMMAND_CHAT macro for most map vote commands
- Fixed extend time being applied twice - Fixed extend votes being able to be rapidly chained when more than one is available
Discord webhooks already have a default avatar/name, sending them in the request only overrides them. This allows the original values to be used.
- Deduplicated JSON parsing code - Switched to safer method of string storage in HTTPHeader & TrackedRequest classes
- Added missing header files to VS project files - Added missing map vote cvars to cs2fixes.cfg - Made config file formatting consistent - Some code cleanup in c_http debug command - Fixed memdbgon.h not being last include in events.cpp - Fixed !setnextmap not having correct admin flag - Switched to simpler CON_COMMAND_CHAT macro for most map vote commands
// Remove port | ||
for (int i = 0; i < ip.length(); i++) | ||
{ | ||
if (ip[i] == ':') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider using ip.find_last_of(':')
instead, this will break if IPv6 in the future.
@@ -129,7 +129,7 @@ void CPlayerManager::OnBotConnected(CPlayerSlot slot) | |||
m_vecPlayers[slot.Get()] = new ZEPlayer(slot, true); | |||
} | |||
|
|||
bool CPlayerManager::OnClientConnected(CPlayerSlot slot, uint64 xuid) | |||
bool CPlayerManager::OnClientConnected(CPlayerSlot slot, uint64 xuid, const char* pszNetworkID) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be a reference instead of a ptr
@@ -127,6 +129,7 @@ class ZEPlayer | |||
float m_flExtendVoteTime; | |||
int m_iFloodTokens; | |||
float m_flLastTalkTime; | |||
std::string m_strIp; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider default initializing member variables in the future
// Allow another extend vote after 2 minutes | ||
new CTimer(120.0f, false, []() | ||
// Allow another extend vote after added time lapses | ||
new CTimer(g_iExtendTimeToAdd * 60.0f, false, []() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
C++std is set to C++ 20, should be using smart pointers... Same with the delete
here