fix
This commit is contained in:
parent
7342c0d72a
commit
cd75ee795f
@ -37,12 +37,10 @@ func isCancelRenderPanic(err any) bool {
|
|||||||
|
|
||||||
// 发送取消上下文消息给unity
|
// 发送取消上下文消息给unity
|
||||||
func sendCancelRenderMsgToUnity(wid string, deadlineTime int64) {
|
func sendCancelRenderMsgToUnity(wid string, deadlineTime int64) {
|
||||||
h := md5.New()
|
|
||||||
h.Write([]byte(fmt.Sprintf("%s_%d", wid, deadlineTime)))
|
|
||||||
data := cancelUnityCtlChanItem{
|
data := cancelUnityCtlChanItem{
|
||||||
Wid: wid,
|
Wid: wid,
|
||||||
DeadlineTime: deadlineTime,
|
DeadlineTime: deadlineTime,
|
||||||
Sign: hex.EncodeToString(h.Sum(nil)),
|
Sign: signMessage(wid, deadlineTime),
|
||||||
}
|
}
|
||||||
select {
|
select {
|
||||||
case cancelUnityCtlChan <- data:
|
case cancelUnityCtlChan <- data:
|
||||||
@ -63,6 +61,13 @@ func DialUdp(ctx context.Context, config config.Config) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 签名消息
|
||||||
|
func signMessage(wid string, deadlineTime int64) string {
|
||||||
|
h := md5.New()
|
||||||
|
h.Write([]byte(fmt.Sprintf("%s_fusen_control_unity_%d", wid, deadlineTime)))
|
||||||
|
return hex.EncodeToString(h.Sum(nil))
|
||||||
|
}
|
||||||
|
|
||||||
// 消费数据
|
// 消费数据
|
||||||
func ConsumeCancelUnityChanMessage(ctx context.Context, conn *net.UDPConn) {
|
func ConsumeCancelUnityChanMessage(ctx context.Context, conn *net.UDPConn) {
|
||||||
defer func() {
|
defer func() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user