示例#1
0
func SendToAll(packet protocol.Packet) {
	baked := protocol.BakePacket(packet)
	for _, player := range players {
		if player.Authenticated() {
			go player.SendPacketSync(baked)
		}
	}
}
示例#2
0
func SendToAllExcept(exclude Player, packet protocol.Packet) {
	baked := protocol.BakePacket(packet)
	for _, player := range players {
		if player.ID() == exclude.ID() {
			continue
		}
		if player.Authenticated() {
			go player.SendPacketSync(baked)
		}
	}
}