} while (true) { //a loop to parse all CMDs in the capsule switch ($CAPSULE->readWord()) { //------------------------- case PCKT_R_WORLD_EOF: echo '[capsuleHandler] End of world server list' . "\n"; break; //------------------------- //------------------------- case PCKT_R_WORLD: echo '[capsuleHandler] New world server' . "\n"; $ipv4 = $CAPSULE->readString(); $port = $CAPSULE->readWord(); $name = $CAPSULE->readString(); $online = $CAPSULE->readBool(); $flag = $CAPSULE->readByte(); $status = $online ? 'online' : 'offline'; echo '-> (Flag ' . $flag . ') ' . $name . ' (' . $ipv4 . ':' . $port . ') is ' . $status . "\n"; $RECONNECT_IP = $ipv4; //TODO: check if it online or not at least, or let the user pick it up $RECONNECT_PORT = $port; //... $RECONNECT = true; //... break; //------------------------- //------------------------- case PCKT_W_ENTER_WORLD_ACK: echo '[capsuleHandler] We got an ACK packet from the server about entering the world!' . "\n"; switch ($CAPSULE->readAck()) {