Open da-van opened 8 years ago
Thanks!
Right now there is no real rank syncing. Whenever a player signs onto the server, I grab their rank prefixes from the server and pipe them to the forum templates. So, their forum username appears as {rank1prefix} {rank2prefix} {playerprefix} {username}
What it should eventually do is create and add them to a linked group on the forum (where the identifier is the rank name and the display name is the rank prefix). This would be synced both ways, so an admin could also add a linked forum user to a server rank by adding them to the linked forum group, and remove their rank by removing them from the linked group. Only the server plugin would be able to create and manage linked groups, so there would be no chance of players getting a rank by creating a user group. furthermore, if a forum user unlinks their forum account, they would be removed from all linked forum groups.
For your other question, this should support every permission plugin out there. If you have one that doesn't work, I will add it in support for it.
Going to make finishing this the top priority for the next release.
Awesome :) I was going to take a look at it as well. I'll let you know if I get anywhere
I've been looking into this but I've hit a pretty big wall. I can't for the life of me figure out how to grab someone's group membership list with MongoDB queries. Any ideas?
Are you trying to get them from the forum side or server side?
You can commit what you have so far, might be easier if I see the actual code.
I've written little code yet. Before getting into it, I was attempting to find where the groups a user is a part of is located in the database. Using MongoDB queries directly in the mongo shell.
On 16 May 2016, at 23:13, Timothy Fike notifications@github.com wrote:
Are you trying to get them from the forum side or server side?
You can commit what you have so far, might be easier if I see the actual code.
— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub
Ohhh, okay.
I'm not really sure the best way using mongo queries. In the forum you would just do Groups.getUserGroups(uid, callback)
.
If you want to test using queries, This should help you get started
userGroups = []
db.objects.find({_key: 'groups:createtime', value: {$regex: /^[^:]*$/}}, {value: true}).forEach(function(group){ if (!!db.objects.find({_key: 'group:'+group.value+':members', value: '1'})) userGroups.push(group.value) })
print(userGroups)
Hey, so your query works great to grab the list of groups that exist, that's no problem. I can see entries for how many members are in each group. Also no issue to get a list of all the users.
The problem is, using queries (or code if you prefer), finding out exactly which groups a particular member is a part of, or finding out a full list of members that are in a specific group.
E.g.
db.objects.find({_key:'user:1'})
will return a lot of information about user 1 but makes no mention of their membership to any groups in NodeBB.
If we were to query the user's yuuid value (which I see you've add to users reigstered with Minecraft Integration) and find the user the uuid belongs to, how are we to determine whether that NodeBB user belongs to the Administrator group or the Registered Member group?
Any ideas? :)
Sorry, seems I overlooked the first code snippet you posted. That returns a list of groups a uid belongs to? What would be the mongo query to do the same thing?
Groups.getUserGroups
does two queries. In mongo, try it like this.
uid = "1"; allGroups = db.objects.find({_key: 'groups:createtime', value: {$regex: /^[^:]*$/}}); userGroups = []; allGroups.forEach(function(group){ if (!!db.objects.find({_key: 'group:'+group.value+':members', value: uid}).length()) userGroups.push(group.value); }); print(userGroups);
Awesome! That does the trick. I have much to learn about MongoDB. :)
Let me know if you have any code to contribute. Going to start working on this for the next few weeks.
How does this work from server to forum and vice versa? What group/rank systems are supported? Any chance on getting support for PexPermissions ranks? :)
Apart from this, absolutely stellar plugin! Amazed at how well it works. Top job!