mirror of
https://github.com/m1k1o/neko-rooms.git
synced 2026-11-03 07:01:35 -06:00
add implicit control to API.
This commit is contained in:
@@ -319,6 +319,9 @@ components:
|
|||||||
control_protection:
|
control_protection:
|
||||||
type: boolean
|
type: boolean
|
||||||
example: true
|
example: true
|
||||||
|
implicit_control:
|
||||||
|
type: boolean
|
||||||
|
example: true
|
||||||
broadcast_pipeline:
|
broadcast_pipeline:
|
||||||
type: string
|
type: string
|
||||||
screen:
|
screen:
|
||||||
@@ -401,6 +404,9 @@ components:
|
|||||||
control_protection:
|
control_protection:
|
||||||
type: boolean
|
type: boolean
|
||||||
example: true
|
example: true
|
||||||
|
implicit_control:
|
||||||
|
type: boolean
|
||||||
|
example: true
|
||||||
|
|
||||||
RoomMember:
|
RoomMember:
|
||||||
type: object
|
type: object
|
||||||
|
|||||||
@@ -295,6 +295,12 @@ export interface RoomSettings {
|
|||||||
* @memberof RoomSettings
|
* @memberof RoomSettings
|
||||||
*/
|
*/
|
||||||
'control_protection'?: boolean;
|
'control_protection'?: boolean;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {boolean}
|
||||||
|
* @memberof RoomSettings
|
||||||
|
*/
|
||||||
|
'implicit_control'?: boolean;
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @type {string}
|
* @type {string}
|
||||||
@@ -434,6 +440,12 @@ export interface RoomStats {
|
|||||||
* @memberof RoomStats
|
* @memberof RoomStats
|
||||||
*/
|
*/
|
||||||
'control_protection'?: boolean;
|
'control_protection'?: boolean;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {boolean}
|
||||||
|
* @memberof RoomStats
|
||||||
|
*/
|
||||||
|
'implicit_control'?: boolean;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|||||||
+15
-4
@@ -62,10 +62,12 @@ type RoomResources struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type RoomSettings struct {
|
type RoomSettings struct {
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
NekoImage string `json:"neko_image"`
|
NekoImage string `json:"neko_image"`
|
||||||
MaxConnections uint16 `json:"max_connections"`
|
MaxConnections uint16 `json:"max_connections"`
|
||||||
ControlProtection bool `json:"control_protection"`
|
|
||||||
|
ControlProtection bool `json:"control_protection"`
|
||||||
|
ImplicitControl bool `json:"implicit_control"`
|
||||||
|
|
||||||
UserPass string `json:"user_pass"`
|
UserPass string `json:"user_pass"`
|
||||||
AdminPass string `json:"admin_pass"`
|
AdminPass string `json:"admin_pass"`
|
||||||
@@ -101,6 +103,10 @@ func (settings *RoomSettings) ToEnv() []string {
|
|||||||
env = append(env, "NEKO_CONTROL_PROTECTION=true")
|
env = append(env, "NEKO_CONTROL_PROTECTION=true")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if settings.ImplicitControl {
|
||||||
|
env = append(env, "NEKO_IMPLICIT_CONTROL=true")
|
||||||
|
}
|
||||||
|
|
||||||
if settings.VideoCodec == "VP8" || settings.VideoCodec == "VP9" || settings.VideoCodec == "H264" {
|
if settings.VideoCodec == "VP8" || settings.VideoCodec == "VP9" || settings.VideoCodec == "H264" {
|
||||||
env = append(env, fmt.Sprintf("NEKO_%s=true", strings.ToUpper(settings.VideoCodec)))
|
env = append(env, fmt.Sprintf("NEKO_%s=true", strings.ToUpper(settings.VideoCodec)))
|
||||||
}
|
}
|
||||||
@@ -155,6 +161,10 @@ func (settings *RoomSettings) FromEnv(envs []string) error {
|
|||||||
if ok, _ := strconv.ParseBool(val); ok {
|
if ok, _ := strconv.ParseBool(val); ok {
|
||||||
settings.ControlProtection = true
|
settings.ControlProtection = true
|
||||||
}
|
}
|
||||||
|
case "NEKO_IMPLICIT_CONTROL":
|
||||||
|
if ok, _ := strconv.ParseBool(val); ok {
|
||||||
|
settings.ImplicitControl = true
|
||||||
|
}
|
||||||
case "NEKO_SCREEN":
|
case "NEKO_SCREEN":
|
||||||
settings.Screen = val
|
settings.Screen = val
|
||||||
case "NEKO_MAX_FPS":
|
case "NEKO_MAX_FPS":
|
||||||
@@ -224,6 +234,7 @@ type RoomStats struct {
|
|||||||
LastUserLeftAt *time.Time `json:"last_user_left_at"`
|
LastUserLeftAt *time.Time `json:"last_user_left_at"`
|
||||||
|
|
||||||
ControlProtection bool `json:"control_protection"`
|
ControlProtection bool `json:"control_protection"`
|
||||||
|
ImplicitControl bool `json:"implicit_control"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type RoomMember struct {
|
type RoomMember struct {
|
||||||
|
|||||||
Reference in New Issue
Block a user