mirror of
https://github.com/genxium/DelayNoMore
synced 2025-10-09 08:36:52 +00:00
Optimized jsexport by tailored resolv lib.
This commit is contained in:
@@ -5,6 +5,17 @@ import (
|
||||
"jsexport/battle"
|
||||
)
|
||||
|
||||
func toPbRenderFrame(rdf *battle.RoomDownsyncFrame) {
|
||||
if nil == rdf {
|
||||
return nil
|
||||
}
|
||||
ret := &pb.RoomDownsyncFrame{
|
||||
Id: rdf.Id,
|
||||
PlayersArr: make([]pb.PlayerDownsync, len(rdf.PlayersArr)),
|
||||
MeleeBullets: make([]pb.MeleeBullet, len(rdf.MeleeBullets)),
|
||||
}
|
||||
}
|
||||
|
||||
func toPbPlayers(modelInstances map[int32]*Player, withMetaInfo bool) map[int32]*pb.PlayerDownsync {
|
||||
toRet := make(map[int32]*pb.PlayerDownsync, 0)
|
||||
if nil == modelInstances {
|
||||
@@ -39,7 +50,7 @@ func toPbPlayers(modelInstances map[int32]*Player, withMetaInfo bool) map[int32]
|
||||
return toRet
|
||||
}
|
||||
|
||||
func toJsPlayers(modelInstances map[int32]*Player, withMetaInfo bool) map[int32]*battle.PlayerDownsync {
|
||||
func toJsPlayers(modelInstances map[int32]*Player) map[int32]*battle.PlayerDownsync {
|
||||
toRet := make(map[int32]*battle.PlayerDownsync, 0)
|
||||
if nil == modelInstances {
|
||||
return toRet
|
||||
@@ -63,11 +74,6 @@ func toJsPlayers(modelInstances map[int32]*Player, withMetaInfo bool) map[int32]
|
||||
Score: last.Score,
|
||||
Removed: last.Removed,
|
||||
}
|
||||
if withMetaInfo {
|
||||
toRet[k].Name = last.Name
|
||||
toRet[k].DisplayName = last.DisplayName
|
||||
toRet[k].Avatar = last.Avatar
|
||||
}
|
||||
}
|
||||
|
||||
return toRet
|
||||
|
Reference in New Issue
Block a user