This commit is contained in:
laodaming 2023-11-02 10:10:22 +08:00
parent 496a56be5d
commit 1bd606a89c
4 changed files with 6 additions and 6 deletions

View File

@ -99,7 +99,7 @@ func (l *RenderNotifyLogic) RenderNotify(req *types.RenderNotifyReq, userinfo *a
ws.sendRenderResultData(websocket_data.RenderImageRspMsg{
RequestId: requestId,
Image: uploadRes.ResourceUrl,
RenderProcessTime: websocket_data.RenderProcessTime{
RenderProcessTime: &websocket_data.RenderProcessTime{
UnityRenderTakesTime: fmt.Sprintf("%dms", unityRenderEndTime-unityRenderBeginTime),
UploadUnityRenderImageTakesTime: fmt.Sprintf("%dms", uploadUnityRenderImageTakesTime),
},

View File

@ -61,7 +61,7 @@ func (w *wsConnectItem) sendRenderDataToUnityStepResponseMessage(requestId strin
func (w *wsConnectItem) sendRenderResultData(data websocket_data.RenderImageRspMsg) {
//没开启debug
if w.debug == nil {
data.RenderProcessTime = websocket_data.RenderProcessTime{}
data.RenderProcessTime = nil
}
w.sendToOutChan(w.respondDataFormat(constants.WEBSOCKET_RENDER_IMAGE, data))
}

View File

@ -258,7 +258,7 @@ func (w *wsConnectItem) renderImage(renderImageData websocket_data.RenderImageRe
w.sendRenderResultData(websocket_data.RenderImageRspMsg{
RequestId: renderImageData.RequestId,
Image: *resource.ResourceUrl,
RenderProcessTime: websocket_data.RenderProcessTime{
RenderProcessTime: &websocket_data.RenderProcessTime{
UnityRenderTakesTime: "cache",
UploadUnityRenderImageTakesTime: "cache",
},

View File

@ -28,9 +28,9 @@ type TemplateTagColor struct {
// websocket发送渲染完的数据
type RenderImageRspMsg struct {
RequestId string `json:"request_id"`
Image string `json:"image"` //渲染结果图片
RenderProcessTime RenderProcessTime `json:"render_process_time"` //流程耗时
RequestId string `json:"request_id"`
Image string `json:"image"` //渲染结果图片
RenderProcessTime *RenderProcessTime `json:"render_process_time"` //流程耗时
}
type RenderProcessTime struct {
UnityRenderTakesTime string `json:"unity_render_takes_time"` //unity渲染用时