SmartlyDressedGames / Unturned-3.x-Community

Community portion of the Unturned-3.x repo. If you have access to the source code you can find it here:
https://github.com/SmartlyDressedGames/Unturned-3.x/
88 stars 18 forks source link

In-game Groups #1456

Closed Keyword65d closed 1 year ago

Keyword65d commented 4 years ago

Hi, I am in the progress of making a plugin but after making an in-game group that a player joins they get automatically kicked if they rejoin the server. This, of course, does not happen when a group is made by a player but then done with the plugin it kicks them for some reason. I would like to know if there is a setting that I am missing or something I need to set to true or false.

SDGNelson commented 4 years ago

My guess is that you are setting their Steam group ID? Probably what is happening is the check with the Steam backend to ensure they are members of the Steam group is failing because the group doesn't exist.

It looks like there isn't a nice way to assign them to a group server-side at the moment aside from messing with the PlayerQuests RPCs to create a fake invite and accept it. I will add helper functions for creating groups and force-assigning players to groups though.

Keyword65d commented 4 years ago

I use GroupManager.getOrAddGroup for creating the group and to assign it.

Player.Player.quests.channel.send("tellSetGroup", ESteamCall.ALL, ESteamPacket.UPDATE_RELIABLE_BUFFER, new object[] { groupInfo.groupID, 0 }); GroupManager.sendGroupInfo(groupInfo);