mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
screen size retype one struct.
This commit is contained in:
parent
31eb743a5d
commit
51577ecff4
@ -23,11 +23,8 @@ func (h *RoomHandler) screenConfiguration(w http.ResponseWriter, r *http.Request
|
|||||||
return utils.HttpInternalServerError().WithInternalMsg("unable to get screen configuration")
|
return utils.HttpInternalServerError().WithInternalMsg("unable to get screen configuration")
|
||||||
}
|
}
|
||||||
|
|
||||||
return utils.HttpSuccess(w, ScreenConfigurationPayload{
|
payload := ScreenConfigurationPayload(*size)
|
||||||
Width: size.Width,
|
return utils.HttpSuccess(w, payload)
|
||||||
Height: size.Height,
|
|
||||||
Rate: size.Rate,
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *RoomHandler) screenConfigurationChange(w http.ResponseWriter, r *http.Request) error {
|
func (h *RoomHandler) screenConfigurationChange(w http.ResponseWriter, r *http.Request) error {
|
||||||
@ -36,21 +33,13 @@ func (h *RoomHandler) screenConfigurationChange(w http.ResponseWriter, r *http.R
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := h.desktop.SetScreenSize(types.ScreenSize{
|
size := types.ScreenSize(*data)
|
||||||
Width: data.Width,
|
if err := h.desktop.SetScreenSize(size); err != nil {
|
||||||
Height: data.Height,
|
|
||||||
Rate: data.Rate,
|
|
||||||
}); err != nil {
|
|
||||||
return utils.HttpUnprocessableEntity("cannot set screen size").WithInternalErr(err)
|
return utils.HttpUnprocessableEntity("cannot set screen size").WithInternalErr(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
h.sessions.Broadcast(
|
payload := message.ScreenSize(*data)
|
||||||
event.SCREEN_UPDATED,
|
h.sessions.Broadcast(event.SCREEN_UPDATED, payload, nil)
|
||||||
message.ScreenSize{
|
|
||||||
Width: data.Width,
|
|
||||||
Height: data.Height,
|
|
||||||
Rate: data.Rate,
|
|
||||||
}, nil)
|
|
||||||
|
|
||||||
return utils.HttpSuccess(w, data)
|
return utils.HttpSuccess(w, data)
|
||||||
}
|
}
|
||||||
|
@ -13,21 +13,11 @@ func (h *MessageHandlerCtx) screenSet(session types.Session, payload *message.Sc
|
|||||||
return errors.New("is not the admin")
|
return errors.New("is not the admin")
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := h.desktop.SetScreenSize(types.ScreenSize{
|
data := types.ScreenSize(*payload)
|
||||||
Width: payload.Width,
|
if err := h.desktop.SetScreenSize(data); err != nil {
|
||||||
Height: payload.Height,
|
|
||||||
Rate: payload.Rate,
|
|
||||||
}); err != nil {
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
h.sessions.Broadcast(
|
h.sessions.Broadcast(event.SCREEN_UPDATED, payload, nil)
|
||||||
event.SCREEN_UPDATED,
|
|
||||||
message.ScreenSize{
|
|
||||||
Width: payload.Width,
|
|
||||||
Height: payload.Height,
|
|
||||||
Rate: payload.Rate,
|
|
||||||
}, nil)
|
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -42,11 +42,7 @@ func (h *MessageHandlerCtx) systemInit(session types.Session) error {
|
|||||||
message.SystemInit{
|
message.SystemInit{
|
||||||
SessionId: session.ID(),
|
SessionId: session.ID(),
|
||||||
ControlHost: controlHost,
|
ControlHost: controlHost,
|
||||||
ScreenSize: message.ScreenSize{
|
ScreenSize: message.ScreenSize(*size),
|
||||||
Width: size.Width,
|
|
||||||
Height: size.Height,
|
|
||||||
Rate: size.Rate,
|
|
||||||
},
|
|
||||||
Sessions: sessions,
|
Sessions: sessions,
|
||||||
ImplicitHosting: h.sessions.ImplicitHosting(),
|
ImplicitHosting: h.sessions.ImplicitHosting(),
|
||||||
ScreencastEnabled: h.capture.Screencast().Enabled(),
|
ScreencastEnabled: h.capture.Screencast().Enabled(),
|
||||||
|
Loading…
Reference in New Issue
Block a user