Exemple #1
0
func SendToAll(packet protocol.Packet) {
	baked := protocol.BakePacket(packet)
	for _, player := range players {
		if player.Authenticated() {
			go player.SendPacketSync(baked)
		}
	}
}
Exemple #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)
		}
	}
}