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{ ws.sendRenderResultData(websocket_data.RenderImageRspMsg{
RequestId: requestId, RequestId: requestId,
Image: uploadRes.ResourceUrl, Image: uploadRes.ResourceUrl,
RenderProcessTime: websocket_data.RenderProcessTime{ RenderProcessTime: &websocket_data.RenderProcessTime{
UnityRenderTakesTime: fmt.Sprintf("%dms", unityRenderEndTime-unityRenderBeginTime), UnityRenderTakesTime: fmt.Sprintf("%dms", unityRenderEndTime-unityRenderBeginTime),
UploadUnityRenderImageTakesTime: fmt.Sprintf("%dms", uploadUnityRenderImageTakesTime), 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) { func (w *wsConnectItem) sendRenderResultData(data websocket_data.RenderImageRspMsg) {
//没开启debug //没开启debug
if w.debug == nil { if w.debug == nil {
data.RenderProcessTime = websocket_data.RenderProcessTime{} data.RenderProcessTime = nil
} }
w.sendToOutChan(w.respondDataFormat(constants.WEBSOCKET_RENDER_IMAGE, data)) 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{ w.sendRenderResultData(websocket_data.RenderImageRspMsg{
RequestId: renderImageData.RequestId, RequestId: renderImageData.RequestId,
Image: *resource.ResourceUrl, Image: *resource.ResourceUrl,
RenderProcessTime: websocket_data.RenderProcessTime{ RenderProcessTime: &websocket_data.RenderProcessTime{
UnityRenderTakesTime: "cache", UnityRenderTakesTime: "cache",
UploadUnityRenderImageTakesTime: "cache", UploadUnityRenderImageTakesTime: "cache",
}, },

View File

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