Server: bail on trying to send empty batch (issue #2020)

This commit is contained in:
Dylan K. Taylor 2018-02-14 09:08:43 +00:00
parent f66928c345
commit 6307952ae9

View File

@ -1891,6 +1891,9 @@ class Server{
* @param bool $immediate
*/
public function batchPackets(array $players, array $packets, bool $forceSync = false, bool $immediate = false){
if(empty($packets)){
throw new \InvalidArgumentException("Cannot send empty batch");
}
Timings::$playerNetworkTimer->startTiming();
$targets = [];