Nite
New Member
- Feb 17, 2012
- 7
- 1
Thank you so much man! I fixed it with your great help! Really appreciate itRoomData.cs Line 87:
Code:if (!string.IsNullOrEmpty(Row["users_now"].ToString())) UsersNow = Convert.ToInt32(Row["users_now"]); else UsersNow = 0;
Change to this:
Code:int intUsers; if(!string.IsNullOrEmpty(Row["users_now"].ToString()) && Int32.TryParse(Row["users_now"].ToString(), out intUsers)) UsersNow = intUsers; else UsersNow = 0;
It could be faulting because the first code is testing to see if the string is Null or Empty, but then it doesn't check to see if its a valid integer when parsing. The 2nd code will do both.
After doing the above you can run these queries as well:
Code:ALTER TABLE `rooms` CHANGE `allow_pets` `allow_pets` INT(1) NOT NULL DEFAULT '0', CHANGE `allow_pets_eat` `allow_pets_eat` INT(1) NOT NULL DEFAULT '0', CHANGE `room_blocking_disabled` `room_blocking_disabled` INT(1) NOT NULL DEFAULT '0', CHANGE `allow_hidewall` `allow_hidewall` INT(1) NOT NULL DEFAULT '0', CHANGE `mute_settings` `mute_settings` INT(1) NOT NULL DEFAULT '1', CHANGE `ban_settings` `ban_settings` INT(1) NOT NULL DEFAULT '1', CHANGE `kick_settings` `kick_settings` INT(1) NOT NULL DEFAULT '1';