name5566 / leaf

A game server framework in Go (golang)
Apache License 2.0
5.26k stars 1.31k forks source link

deeclone的调用 #160

Closed 15951836388 closed 5 years ago

15951836388 commented 5 years ago

image

1、这里deeclone放在了user.go的外面,是有什么有意吗? 放到user.go里面了,好像也没什么影响。

2、这里的的user.go,能不能换成skeleton.Go?

3、如果不能换的话,所有的user能不能共用1个g.LinearContext?感觉每个user都创建g.LinearContext,有点浪费

name5566 commented 5 years ago
  1. 因为是两个不同的 goroutine
  2. user.Go 能够保证 goroutine 的执行顺序
  3. 这种消耗不用考虑,意义不大
15951836388 commented 5 years ago

1.如果deeclone放到user.go里面会引发什么样的问题?因为并没有改变userdata的数据,应该不会有问题吧?

name5566 commented 5 years ago

很难保证这一点。