Hello to everybody (sa turkler icin),
I noticed a problem on the server_status table userpeak column, this one does not produce update the new user record amount in the db.
I share this if people have the same problem as me I know it is a little fix, but maybe it can help some people out.
Sorry for my bad English, I am Dutch.
Here you go The solution: [C#] ServerStatusUpdater.cs - Pastebin.com
For the people that only want to have the method:
Source: ServerStatusUpdater.cs in linenumber 39.Code:private void UpdateOnlineUsers() { TimeSpan Uptime = DateTime.Now - PlusEnvironment.ServerStarted; int UsersOnline = Convert.ToInt32(PlusEnvironment.GetGame().GetClientManager().Count); int RoomCount = PlusEnvironment.GetGame().GetRoomManager().Count; Console.Title = "Baykus Emulator - " + UsersOnline + " users online - " + RoomCount + "geladen kamers - " + Uptime.Days + " dag(en) " + Uptime.Hours + " uur(en) aan"; using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor()) { dbClient.SetQuery("UPDATE `server_status` SET `users_online` = @users, `loaded_rooms` = @loadedRooms LIMIT 1;"); dbClient.AddParameter("users", UsersOnline); dbClient.AddParameter("loadedRooms", RoomCount); dbClient.RunQuery(); } int userPeak; using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor()) { dbClient.SetQuery("SELECT `userpeak` FROM `server_status` LIMIT 1"); userPeak = dbClient.getInteger(); } if (UsersOnline > userPeak) { using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor()) { dbClient.SetQuery("UPDATE `server_status` SET `userpeak` = @userpeak LIMIT 1;"); dbClient.AddParameter("userpeak", UsersOnline); dbClient.RunQuery(); } } }
And maybe people that are better than me in coding could help with performans? Or pascalcases. camelcase that I dit forget.I'm always open for new ideas! Even though it is 6 lines code.
Enjoy !
-Baykus (ctarikc)


Reply With Quote

