I have been handed this sledmore :
So, here are two simple fixes. (both in GroupManager.cs)
Replace both methods;
GetGroupUsersByString
GetGroupRequestsByString
With:
Maybe you should check things, instead of been a total arse to people
internal List<GroupUser> GetGroupUsersByString(Group Group, String SearchVal, uint Req)
{
var Users = new List<GroupUser>();
if (string.IsNullOrWhiteSpace(SearchVal))
{
if (Req == 0)
foreach (GroupUser U in Group.Members.Values)
Users.Add(U);
else
foreach (GroupUser U in Group.Admins.Values)
Users.Add(U);
}
else
{
using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().getQueryreactor())
{
dbClient.setQuery("SELECT id FROM users WHERE username LIKE @query");
dbClient.addParameter("query", "%" + SearchVal + "%");
DataTable Table = dbClient.getTable();
if (Table == null)
{
if (Req == 0)
foreach (GroupUser U in Group.Members.Values)
Users.Add(U);
else
foreach (GroupUser U in Group.Admins.Values)
Users.Add(U);
}
else
{
foreach (DataRow Row in Table.Rows)
{
if (Group.Members.ContainsKey((uint)Row[0]))
Users.Add(Group.Members[(uint)Row[0]]);
}
}
}
}
return Users;
}
internal List<uint> GetGroupRequestsByString(Group Group, String SearchVal, uint Req)
{
if (string.IsNullOrWhiteSpace(SearchVal))
return Group.Requests;
var Users = new List<uint>();
using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().getQueryreactor())
{
dbClient.setQuery("SELECT id FROM users WHERE username LIKE @query");
dbClient.addParameter("query", "%" + SearchVal + "%");
DataTable Table = dbClient.getTable();
if (Table != null)
{
foreach (DataRow Row in Table.Rows)
{
if (Group.Requests.Contains((uint)Row[0]))
Users.Add((uint)Row[0]);
}
}
}
return Users;
}
Well I'm sorry it just gets annoying.
@Sledmore posted this on another forum.
Hey.
So I check Habboons log files daily to see if there is anything I can fix and to improve the emulator, well today I'd found a user had accidentally typed a message in the groups searching input box, which was logged as a MySQL error. Well with further inspection I could drop any tables such (just like the old navigator issue, with the search query not being sanitized).
So, here are two simple fixes. (both in GroupManager.cs)
Replace both methods;
- GetGroupUsersByString
- GetGroupRequestsByString
With:
PHP:
internal List<GroupUser> GetGroupUsersByString(Group Group, String SearchVal, uint Req)
{
var Users = new List<GroupUser>();
if (string.IsNullOrWhiteSpace(SearchVal))
{
if (Req == 0)
foreach (GroupUser U in Group.Members.Values)
Users.Add(U);
else
foreach (GroupUser U in Group.Admins.Values)
Users.Add(U);
}
else
{
using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().getQueryreactor())
{
dbClient.setQuery("SELECT id FROM users WHERE username LIKE @query");
dbClient.addParameter("query", "%" + SearchVal + "%");
DataTable Table = dbClient.getTable();
if (Table == null)
{
if (Req == 0)
foreach (GroupUser U in Group.Members.Values)
Users.Add(U);
else
foreach (GroupUser U in Group.Admins.Values)
Users.Add(U);
}
else
{
foreach (DataRow Row in Table.Rows)
{
if (Group.Members.ContainsKey((uint)Row[0]))
Users.Add(Group.Members[(uint)Row[0]]);
}
}
}
}
return Users;
}
internal List<uint> GetGroupRequestsByString(Group Group, String SearchVal, uint Req)
{
if (string.IsNullOrWhiteSpace(SearchVal))
return Group.Requests;
var Users = new List<uint>();
using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().getQueryreactor())
{
dbClient.setQuery("SELECT id FROM users WHERE username LIKE @query");
dbClient.addParameter("query", "%" + SearchVal + "%");
DataTable Table = dbClient.getTable();
if (Table != null)
{
foreach (DataRow Row in Table.Rows)
{
if (Group.Requests.Contains((uint)Row[0]))
Users.Add((uint)Row[0]);
}
}
}
return Users;
}
You're welcome.
What about diamond or a third currency support?
Currently I am developing the room promos.
Except for the fact that if you check the development section, Ive made alot of progress.. Lmfao
Here is 1 fix:
http://forum.ragezone.com/f353/plus-emu-fixed-979954/
RoomUserManager.cs
Comment it ou delete this line and paste this above/instead:if (room.GetGameMap().IsValidStep2(User, new Vector2D(User.X, User.Y), new Vector2D(User.SetX, User.SetY), (User.GoalX == User.SetX && User.GoalY == User.SetY), User.AllowOverride))
Credits to Bjork for fix.if (room.GetGameMap().CanWalk(User.SetX, User.SetY, User.AllowOverride) || User.RidingHorse == true)
List of commands?
I have Skybird + IlluminaCMS but if I go to the client it doesn't connect, all settings are good, firewall.. ports..
Does someone know how to fix it? (there are no errors, it just doesn't connect)
I have error in the Query caught. Any helps ? Also the DB dosen't execute successfully.