コード例 #1
0
ファイル: game.go プロジェクト: jnwhiteh/chunkymonkey
// Send a packet to every player connected to the server
func (game *Game) multicastPacket(packet []byte, except interface{}) {
	for _, player := range game.players {
		if player == except {
			continue
		}

		player.TransmitPacket(packet)
	}
}
コード例 #2
0
ファイル: game.go プロジェクト: b1naryth1ef/chunkymonkey
// Send a packet to every player connected to the server
func (game *Game) multicastPacket(pkt proto.IPacket, except *player.Player) {
	data := game.txPktSerial.SerializePackets(pkt)

	for _, player := range game.players {
		if player == except {
			continue
		}

		player.TransmitPacket(data)
	}
}