This commit is contained in:
laodaming 2023-08-31 10:15:43 +08:00
parent cf3994d7de
commit 3127be9b85
3 changed files with 8 additions and 3 deletions

View File

@ -27,6 +27,6 @@ const (
WEBSOCKET_RENDER_IMAGE Websocket = "WEBSOCKET_RENDER_IMAGE" //图片渲染消息(1级消息双向通信)
WEBSOCKET_RENDER_IMAGE_ERR Websocket = "WEBSOCKET_RENDER_IMAGE_ERR" //图片渲染失败消息1级消息单向通信
WEBSOCKET_COMBINE_IMAGE Websocket = "WEBSOCKET_COMBINE_IMAGE" //反回合成刀版图消息2级消息单向通信属于 WEBSOCKET_RENDER_IMAGE 消息的子流程)
WEBSOCKET_ASSEMBLE_RENDER_DATA Websocket = "WEBSOCKET_ASSEMBLE_RENDER_DATA" //组装unity需要的数据
WEBSOCKET_SEND_DATA_TO_UNITY Websocket = "WEBSOCKET_SEND_DATA_TO_UNITY" //发送到unity进行渲染
WEBSOCKET_ASSEMBLE_RENDER_DATA Websocket = "WEBSOCKET_ASSEMBLE_RENDER_DATA" //组装unity需要的数据 2级消息单向通信属于 WEBSOCKET_RENDER_IMAGE 消息的子流程)
WEBSOCKET_SEND_DATA_TO_UNITY Websocket = "WEBSOCKET_SEND_DATA_TO_UNITY" //发送到unity进行渲染 2级消息单向通信属于 WEBSOCKET_RENDER_IMAGE 消息的子流程)
)

View File

@ -362,7 +362,7 @@ func (w *wsConnectItem) assembleRenderDataToUnity(taskId string, combineImage st
},
})
//发送运行阶段消息
w.sendToOutChan(w.respondDataFormat(constants.WEBSOCKET_SEND_DATA_TO_UNITY, websocket_data.ToUnityRspMsg{RenderId: info.RenderId}))
w.sendToOutChan(w.respondDataFormat(constants.WEBSOCKET_SEND_DATA_TO_UNITY, websocket_data.AssembleRenderDataRspMsg{RenderId: info.RenderId}))
logx.Info("发送到unity成功,刀版图:", combineImage /*, " 请求unity的数据:", string(postDataBytes)*/)
return nil
}

View File

@ -52,6 +52,11 @@ type CombineProcessTime struct {
UploadCombineImageTakesTime string `json:"upload_combine_image_takes_time"` //上传刀版图耗时
}
// 发送到组装渲染阶段信息返回数据
type AssembleRenderDataRspMsg struct {
RenderId string `json:"render_id"` //渲染id
}
// 发送到unity阶段信息返回数据
type ToUnityRspMsg struct {
RenderId string `json:"render_id"` //渲染id