mirror of
https://github.com/m1k1o/neko-rooms.git
synced 2026-11-02 22:51:34 -06:00
add implicit control to API.
This commit is contained in:
@@ -319,6 +319,9 @@ components:
|
||||
control_protection:
|
||||
type: boolean
|
||||
example: true
|
||||
implicit_control:
|
||||
type: boolean
|
||||
example: true
|
||||
broadcast_pipeline:
|
||||
type: string
|
||||
screen:
|
||||
@@ -401,6 +404,9 @@ components:
|
||||
control_protection:
|
||||
type: boolean
|
||||
example: true
|
||||
implicit_control:
|
||||
type: boolean
|
||||
example: true
|
||||
|
||||
RoomMember:
|
||||
type: object
|
||||
|
||||
@@ -295,6 +295,12 @@ export interface RoomSettings {
|
||||
* @memberof RoomSettings
|
||||
*/
|
||||
'control_protection'?: boolean;
|
||||
/**
|
||||
*
|
||||
* @type {boolean}
|
||||
* @memberof RoomSettings
|
||||
*/
|
||||
'implicit_control'?: boolean;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
@@ -434,6 +440,12 @@ export interface RoomStats {
|
||||
* @memberof RoomStats
|
||||
*/
|
||||
'control_protection'?: boolean;
|
||||
/**
|
||||
*
|
||||
* @type {boolean}
|
||||
* @memberof RoomStats
|
||||
*/
|
||||
'implicit_control'?: boolean;
|
||||
}
|
||||
/**
|
||||
*
|
||||
|
||||
@@ -65,7 +65,9 @@ type RoomSettings struct {
|
||||
Name string `json:"name"`
|
||||
NekoImage string `json:"neko_image"`
|
||||
MaxConnections uint16 `json:"max_connections"`
|
||||
|
||||
ControlProtection bool `json:"control_protection"`
|
||||
ImplicitControl bool `json:"implicit_control"`
|
||||
|
||||
UserPass string `json:"user_pass"`
|
||||
AdminPass string `json:"admin_pass"`
|
||||
@@ -101,6 +103,10 @@ func (settings *RoomSettings) ToEnv() []string {
|
||||
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" {
|
||||
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 {
|
||||
settings.ControlProtection = true
|
||||
}
|
||||
case "NEKO_IMPLICIT_CONTROL":
|
||||
if ok, _ := strconv.ParseBool(val); ok {
|
||||
settings.ImplicitControl = true
|
||||
}
|
||||
case "NEKO_SCREEN":
|
||||
settings.Screen = val
|
||||
case "NEKO_MAX_FPS":
|
||||
@@ -224,6 +234,7 @@ type RoomStats struct {
|
||||
LastUserLeftAt *time.Time `json:"last_user_left_at"`
|
||||
|
||||
ControlProtection bool `json:"control_protection"`
|
||||
ImplicitControl bool `json:"implicit_control"`
|
||||
}
|
||||
|
||||
type RoomMember struct {
|
||||
|
||||
Reference in New Issue
Block a user