This commit is contained in:
@@ -33,6 +33,7 @@ type Space struct {
|
||||
info.MapBossInfo
|
||||
TimeBoss info.S2C_2022
|
||||
Weather uint32
|
||||
IsTime bool
|
||||
//CanWeather uint32
|
||||
}
|
||||
|
||||
@@ -40,36 +41,8 @@ type Space struct {
|
||||
func NewSpace() *Space {
|
||||
|
||||
ret := &Space{
|
||||
User: csmap.New[uint32, common.PlayerI](
|
||||
// set the number of map shards. the default value is 32.
|
||||
csmap.WithShardCount[uint32, common.PlayerI](32),
|
||||
|
||||
// // if don't set custom hasher, use the built-in maphash.
|
||||
csmap.WithCustomHasher[uint32, common.PlayerI](func(key uint32) uint64 {
|
||||
|
||||
return uint64(key)
|
||||
}),
|
||||
|
||||
// set the total capacity, every shard map has total capacity/shard count capacity. the default value is 0.
|
||||
// csmap.WithSize[string, int](1000),
|
||||
),
|
||||
UserInfo: csmap.New[uint32, info.SimpleInfo](
|
||||
// set the number of map shards. the default value is 32.
|
||||
csmap.WithShardCount[uint32, info.SimpleInfo](32),
|
||||
csmap.WithCustomHasher[uint32, info.SimpleInfo](func(key uint32) uint64 {
|
||||
|
||||
return uint64(key)
|
||||
}),
|
||||
// // if don't set custom hasher, use the built-in maphash.
|
||||
// csmap.WithCustomHasher[string, int](func(key string) uint64 {
|
||||
// hash := fnv.New64a()
|
||||
// hash.Write([]byte(key))
|
||||
// return hash.Sum64()
|
||||
// }),
|
||||
|
||||
// set the total capacity, every shard map has total capacity/shard count capacity. the default value is 0.
|
||||
// csmap.WithSize[string, int](1000),
|
||||
),
|
||||
User: csmap.New[uint32, common.PlayerI](),
|
||||
UserInfo: csmap.New[uint32, info.SimpleInfo](),
|
||||
}
|
||||
|
||||
return ret
|
||||
@@ -111,6 +84,9 @@ func GetSpace(id uint32) *Space {
|
||||
|
||||
r := service.NewMapService().GetData(ret.ID)
|
||||
if r != nil {
|
||||
if r.IsTimeSpace != 0 {
|
||||
ret.IsTime = true
|
||||
}
|
||||
if len(r.WeatherType) > 1 {
|
||||
// ret.CanWeather = 1
|
||||
cool.Cron.CustomFunc(ret, func() {
|
||||
|
||||
Reference in New Issue
Block a user