public static void OnKickUser(dynamic message, SyncService s, SyncRoom room) { if (s.Permissions == UserPermissionLevel.OWNER) { SyncService target = room.GetServiceByNickname((string)message.TargetNickname); var res = new { CommandType = CommandType.KICKUSER.Value }; target.SendMessage(JsonConvert.SerializeObject(res)); target.Disconnect(); } }
public static void OnUpgradeUserPermissions(dynamic message, SyncService s, SyncRoom room) { if (s.Permissions == UserPermissionLevel.OWNER) { SyncService target = room.GetServiceByNickname((string)message.TargetNickname); if ((bool)message.Upgrade) { target.Permissions = UserPermissionLevel.TRUSTED; } else { target.Permissions = UserPermissionLevel.VIEWER; } } }