mirror of
https://github.com/CPunch/gopenfusion.git
synced 2026-02-08 03:40:03 +00:00
send chat packets to *all* players
This commit is contained in:
@@ -46,6 +46,16 @@ func (server *ShardServer) sendOthersPacket(plr *entity.Player, typeID uint32, p
|
||||
return nil
|
||||
}
|
||||
|
||||
// sends a packet to all peers in the given chunks
|
||||
func (server *ShardServer) sendAllPacket(plr *entity.Player, typeID uint32, pkt ...interface{}) error {
|
||||
chunks := server.getViewableChunks(plr.Chunk)
|
||||
for _, chunk := range chunks {
|
||||
chunk.SendPacket(typeID, pkt...)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (server *ShardServer) removeEntityFromChunks(chunks []*entity.Chunk, this entity.Entity) {
|
||||
for _, chunk := range chunks {
|
||||
for e := range chunk.Entities {
|
||||
|
||||
Reference in New Issue
Block a user