mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2026-07-26 18:36:23 +09:00
Merge branch 'aperx' of https://github.com/PHIDIAS0303/ExpCluster into aperx
This commit is contained in:
@@ -191,8 +191,8 @@ export class ControllerPlugin extends BaseControllerPlugin {
|
||||
|
||||
async handleResolvedAssignmentSubscription(request: lib.SubscriptionRequest) {
|
||||
// Check for any missing assignments to be computed on demand
|
||||
const filters = Array.isArray(request.filters) ? request.filters : [request.filters!];
|
||||
if (request.filters && filters.length) {
|
||||
const filters = request.filters.toJSON();
|
||||
if (filters.length) {
|
||||
const missing = filters.filter(name => !this.resolvedAssignments.has(name));
|
||||
if (missing.length) {
|
||||
this.resolvedAssignments.setMany(await this.computeResolvedAssignments(missing));
|
||||
|
||||
@@ -45,7 +45,7 @@ export class InstancePlugin extends BaseInstancePlugin {
|
||||
async onStart() {
|
||||
// We use Date.now() because we need to manually initialise the groups on the lua side
|
||||
await this.instance.sendTo("controller", new lib.SubscriptionRequest(
|
||||
`exp_groups:${messages.GroupUpdatedEvent.name}`, true, Date.now()
|
||||
`exp_groups:${messages.GroupUpdatedEvent.name}`, "subscribe", Date.now()
|
||||
));
|
||||
const groups = await this.instance.sendTo("controller", new messages.GroupListRequest())
|
||||
await this.luaSendInitialGroups(groups);
|
||||
@@ -118,13 +118,13 @@ export class InstancePlugin extends BaseInstancePlugin {
|
||||
|
||||
async subscribePlayerAssignment(playerName: string) {
|
||||
await this.instance.sendTo("controller", new lib.SubscriptionRequest(
|
||||
`exp_groups:${messages.ResolvedAssignmentUpdatedEvent.name}`, true, 0, playerName
|
||||
`exp_groups:${messages.ResolvedAssignmentUpdatedEvent.name}`, "subscribe", 0, lib.SubscriptionFilters.fromShorthand(playerName)
|
||||
));
|
||||
}
|
||||
|
||||
async unsubscribePlayerAssignment(playerName: string) {
|
||||
await this.instance.sendTo("controller", new lib.SubscriptionRequest(
|
||||
`exp_groups:${messages.ResolvedAssignmentUpdatedEvent.name}`, false, 0, playerName
|
||||
`exp_groups:${messages.ResolvedAssignmentUpdatedEvent.name}`, "unsubscribe", 0, lib.SubscriptionFilters.fromShorthand(playerName)
|
||||
));
|
||||
}
|
||||
|
||||
@@ -166,6 +166,6 @@ export class InstancePlugin extends BaseInstancePlugin {
|
||||
}
|
||||
|
||||
async luaSend(receiver: string, json: any) {
|
||||
await this.instance.sendRcon(`/c exp_groups.${receiver}(helpers.json_to_table[=[${JSON.stringify(json)}]=])`, true)
|
||||
await this.instance.sendRcon(`/sc exp_groups.${receiver}(helpers.json_to_table[=[${JSON.stringify(json)}]=])`, true)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@expcluster/permission-groups",
|
||||
"version": "0.1.0",
|
||||
"version": "6.5.0",
|
||||
"description": "Clusterio plugin providing syncing of permission groups",
|
||||
"author": "Cooldude2606 <https://github.com/Cooldude2606>",
|
||||
"license": "MIT",
|
||||
|
||||
@@ -18,7 +18,7 @@ export default function GroupForm({ open, setOpen }: {
|
||||
const group = await control.send(new messages.GroupCreateRequest(
|
||||
values.name, new messages.GroupPermissions(Boolean(values.isBlacklist), [])
|
||||
));
|
||||
navigate(`/exp_groups/${group.id}/view`);
|
||||
navigate(`/permission_groups/${group.id}/view`);
|
||||
setOpen(false);
|
||||
}
|
||||
|
||||
|
||||
@@ -66,9 +66,9 @@ function ExpGroupsPage() {
|
||||
}
|
||||
|
||||
export class WebPlugin extends BaseWebPlugin {
|
||||
groups = new lib.EventSubscriber(messages.GroupUpdatedEvent, this.control);
|
||||
assignments = new lib.EventSubscriber(messages.ManualAssignmentUpdatedEvent, this.control);
|
||||
roleMappings = new lib.EventSubscriber(messages.RoleMappingUpdatedEvent, this.control);
|
||||
groups = new lib.MapSubscriber(messages.GroupUpdatedEvent, this.control);
|
||||
assignments = new lib.MapSubscriber(messages.ManualAssignmentUpdatedEvent, this.control);
|
||||
roleMappings = new lib.MapSubscriber(messages.RoleMappingUpdatedEvent, this.control);
|
||||
|
||||
async init() {
|
||||
this.pages = [
|
||||
|
||||
Reference in New Issue
Block a user