I've converted my map vote script from Eventscripts into Sourcemod and every so often it crashes our server. I wonder if someone would be able to take a look at the code and tell me what i'm doing wrong
The code for the script is available here :
http://download.playerofgames.net/pievote.zip
In a nutshell the script connects to a MySQL database, inserts map names for the .bsp files it finds in the maps directory, waits a while to show a vote menu, collects all of the votes, then works out the winning map. This works fine for X rounds, then the server falls over and restarts.
I've tracked the problem down to the voteMapPanelHandler which handles the selected responses from the vote menu - when i was testing i selected a map from the menu and the server crashed. My problem is i can't track down exactly where it goes wrong or what bit of code is failing.
I altered the PrintToChatAll function in halflife.inc to call LogToGame for every message that the script produces, but when the server crashes the current logfile is zero bytes. Is there a way i can log directly to the sourcemod logfile so i can trace for errors, or should i be doing something else to trace and debug?
Our server runs on a dedicated Win2k3 machine and runs Mani, Eventscripts and Sourcemod. It's 100% stable at the moment because i've removed this script and gone back to the eventscripts version (the ES version causes half a second worth of freeze when it builds the popup menu which is why i've rewritten it).
Hopefully i'm just not releasing one of the timer handles or the vote panel handle correctly, but i can't see where.
Any help most appreciated!
Edit : mdmp files are available on request if this isn't just me being a noob