View Single Post
DarthNinja
SourceMod Plugin Approver
Join Date: Mar 2009
Location: PreThinkHook()
Old 03-09-2012 , 10:34   Re: [ANY] Map Reporter
Reply With Quote #14

I'll approve this once these changes are made:
  • Your bool on line 15 isn't needed, you can just check if(db == INVALID_HANDLE).
    This will also have the side effect of having the plugin fall back to file logging if the connection is dropped.
  • Your if statement on line 51 should be trashed and the connection code moved to the if statement on line 35.
  • Your cvar check on line 45 will always return true, because calling it in OnPluginStart doesn't give it an option to be changed.
    You should ether check it right before printing the message, or hook the cvar for changes and set a global bool to toggle the advert.
    Also you should be using GetConVarBool not Int.
  • You should also escape szMapName, although that isn't nearly as dangerous as szComment.
  • Your escaped string sizes should be larger then your un-escaped ones. You risk overflowing the string otherwise.
  • Your insert string is also too small since it could be as large as 445 characters if all your other strings are filled (even before what I said about the escaped strings).
That's all I see at the moment.

__________________
DarthNinja is offline