User Group Issue

Parsov

Member
May 18, 2016
315
206
Hello there Devbest community!
A weird thing that I've been having for a long time now. Everytime a user makes a group a user automatically joins that group and has rights... Without even joining?

I did these:

SQL:
SET@@global.sql_mode='';

Tried removing groups and then adding them again into the SQL.

Didn't help. I have a feeling it's because of the time of the VDS but I just want to be sure.

Thanks!
Post automatically merged:

Added this into Groups but I don't think this is the thing causing it.

C#:
public void CreateGroupChat(Group group)
        {
            if (group.HasChat == true)
                return;
            using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
            {
                dbClient.SetQuery("UPDATE groups SET `has_chat` = '1' WHERE id = @gid");
                dbClient.AddParameter("gid", group.Id);
                dbClient.RunQuery();
            }
            group.HasChat = true;
            List<GameClient> GroupMembers = (from Client in PlusEnvironment.GetGame().GetClientManager().GetClients.ToList() where Client != null && Client.GetHabbo() != null && this.IsMember(Client.GetHabbo().Id) select Client).ToList();
            foreach (GameClient Client in GroupMembers)
            {
                if (Client == null)
                    continue;
                Client.SendMessage(new FriendListUpdateComposer(group, 1));
            }

        }
 
Last edited:

Joe

Well-Known Member
Jun 10, 2012
4,090
1,918
Hello there Devbest community!
A weird thing that I've been having for a long time now. Everytime a user makes a group a user automatically joins that group and has rights... Without even joining?

I did these:

SQL:
SET@@global.sql_mode='';

Tried removing groups and then adding them again into the SQL.

Didn't help. I have a feeling it's because of the time of the VDS but I just want to be sure.

Thanks!
Post automatically merged:

Added this into Groups but I don't think this is the thing causing it.

C#:
public void CreateGroupChat(Group group)
        {
            if (group.HasChat == true)
                return;
            using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
            {
                dbClient.SetQuery("UPDATE groups SET `has_chat` = '1' WHERE id = @gid");
                dbClient.AddParameter("gid", group.Id);
                dbClient.RunQuery();
            }
            group.HasChat = true;
            List<GameClient> GroupMembers = (from Client in PlusEnvironment.GetGame().GetClientManager().GetClients.ToList() where Client != null && Client.GetHabbo() != null && this.IsMember(Client.GetHabbo().Id) select Client).ToList();
            foreach (GameClient Client in GroupMembers)
            {
                if (Client == null)
                    continue;
                Client.SendMessage(new FriendListUpdateComposer(group, 1));
            }

        }
What emulator?
 

Parsov

Member
May 18, 2016
315
206
So the user gets rights even when they’re not in the group? Or when they join the group they get rights?
As soon as you make the group it shows "2 Memebers" One of them is yourself and one of them is a user it's always the same user though and they have rights.

You must be registered for see images attach


You must be registered for see images attach


That's the images. I've done some explaining on one. It's pretty weird.
Post automatically merged:

Issue No 2: Let's say there is 2 users in the group it shows 3 users. When you remove one of them it says 2 users when there is only 1 user in the group.
 
Last edited:

JayC

Always Learning
Aug 8, 2013
5,493
1,398
You didn't truncate one of your group memberships table.

Truncate your groups table and your group memberships table. It was holding information about users and groups previously in there
 

Parsov

Member
May 18, 2016
315
206
You didn't truncate one of your group memberships table.

Truncate your groups table and your group memberships table. It was holding information about users and groups previously in there
That may be the issue I think? I moved databases could that be the issue?
Post automatically merged:

You didn't truncate one of your group memberships table.

Truncate your groups table and your group memberships table. It was holding information about users and groups previously in there
Why thank you there. I didn't know this could be the issue. Much obliged!!! ;) helped me alot.
 
Last edited:

Users who are viewing this thread

Top