Skip to content
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

Merged
merged 5 commits into from
Dec 26, 2023
Merged

Miscellaneous changes #146

merged 5 commits into from
Dec 26, 2023

Conversation

Vauff
Copy link
Contributor

@Vauff 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

@Vauff Vauff changed the title Misc changes Miscellaneous changes Dec 25, 2023
- 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
@xen-000 xen-000 merged commit d46f89b into main Dec 26, 2023
3 checks passed
@xen-000 xen-000 deleted the misc-changes branch December 26, 2023 21:12
// Remove port
for (int i = 0; i < ip.length(); i++)
{
if (ip[i] == ':')
Copy link

@GXTX GXTX Dec 27, 2023

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)
Copy link

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;
Copy link

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, []()
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants