10/31/2008, 23:47
|
#2
|
elite*gold: 0
Join Date: Dec 2007
Posts: 618
Received Thanks: 213
|
Quote:
Originally Posted by Rechocto
so! here's how to fix it!
go into General.cs, and search for "public unsafe General()"
under that you will find "DataBase.Connect(DBUserName, DBUserPass);"
under that line add:
Code:
DataBase.Connection.StateChange += new StateChangeEventHandler(State_Changed);
then directly ABOVE "public unsafe General()" add:
Code:
static void State_Changed(object sender, StateChangeEventArgs e)
{
Ini Config = new Ini(System.Windows.Forms.Application.StartupPath + @"\Config.ini");
string DBUserName = Config.ReadValue("Server", "DBUserName");
string DBUserPass = Config.ReadValue("Server", "DBUserPass");
if (e.CurrentState == ConnectionState.Closed) //no need for a timer to fix login freeze?
DataBase.Connect(DBUserName, DBUserPass);
}
the end.
|
the fix.
|
|
|