Почему с сервера кикает? Internal там че то такое




Какое ядро

\pocketmine\network\Network
кинь файл

Легче ядро поменять

За тебя кодеры 24serv кодят?

чел, в лайте фикс в три строки пэха

LiteCore

Спойлер <?php /* * * ____ _ _ __ __ _ __ __ ____ * | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \ * | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) | * | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/ * |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_| * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * @author PocketMine Team * @link http://www.pocketmine.net/ * * */ /** * Network-related classes */ namespace pocketmine\network; use InvalidArgumentException; use InvalidStateException; use pocketmine\network\mcpe\protocol\AddEntityPacket; use pocketmine\network\mcpe\protocol\AddHangingEntityPacket; use pocketmine\network\mcpe\protocol\AddItemEntityPacket; use pocketmine\network\mcpe\protocol\AddItemPacket; use pocketmine\network\mcpe\protocol\AddPaintingPacket; use pocketmine\network\mcpe\protocol\AddPlayerPacket; use pocketmine\network\mcpe\protocol\AdventureSettingsPacket; use pocketmine\network\mcpe\protocol\AnimatePacket; use pocketmine\network\mcpe\protocol\AvailableCommandsPacket; use pocketmine\network\mcpe\protocol\BatchPacket; use pocketmine\network\mcpe\protocol\BlockEntityDataPacket; use pocketmine\network\mcpe\protocol\BlockEventPacket; use pocketmine\network\mcpe\protocol\BossEventPacket; use pocketmine\network\mcpe\protocol\BlockPickRequestPacket; use pocketmine\network\mcpe\protocol\ChangeDimensionPacket; use pocketmine\network\mcpe\protocol\ChunkRadiusUpdatedPacket; use pocketmine\network\mcpe\protocol\ClientboundMapItemDataPacket; use pocketmine\network\mcpe\protocol\ClientToServerHandshakePacket; use pocketmine\network\mcpe\protocol\CommandBlockUpdatePacket; use pocketmine\network\mcpe\protocol\CommandStepPacket; use pocketmine\network\mcpe\protocol\ContainerClosePacket; use pocketmine\network\mcpe\protocol\ContainerOpenPacket; use pocketmine\network\mcpe\protocol\ContainerSetContentPacket; use pocketmine\network\mcpe\protocol\ContainerSetDataPacket; use pocketmine\network\mcpe\protocol\ContainerSetSlotPacket; use pocketmine\network\mcpe\protocol\CraftingDataPacket; use pocketmine\network\mcpe\protocol\CraftingEventPacket; use pocketmine\network\mcpe\protocol\CameraPacket; use pocketmine\network\mcpe\protocol\DataPacket; use pocketmine\network\mcpe\protocol\DisconnectPacket; use pocketmine\network\mcpe\protocol\DropItemPacket; use pocketmine\network\mcpe\protocol\EntityEventPacket; use pocketmine\network\mcpe\protocol\ExplodePacket; use pocketmine\network\mcpe\protocol\FullChunkDataPacket; use pocketmine\network\mcpe\protocol\HurtArmorPacket; use pocketmine\network\mcpe\protocol\ProtocolInfo; use pocketmine\network\mcpe\protocol\InteractPacket; use pocketmine\network\mcpe\protocol\InventoryActionPacket; use pocketmine\network\mcpe\protocol\ItemFrameDropItemPacket; use pocketmine\network\mcpe\protocol\LevelEventPacket; use pocketmine\network\mcpe\protocol\LevelSoundEventPacket; use pocketmine\network\mcpe\protocol\LoginPacket; use pocketmine\network\mcpe\protocol\MapInfoRequestPacket; use pocketmine\network\mcpe\protocol\MobArmorEquipmentPacket; use pocketmine\network\mcpe\protocol\MobEquipmentPacket; use pocketmine\network\mcpe\protocol\MobEffectPacket; use pocketmine\network\mcpe\protocol\MoveEntityPacket; use pocketmine\network\mcpe\protocol\MovePlayerPacket; use pocketmine\network\mcpe\protocol\PlaySoundPacket; use pocketmine\network\mcpe\protocol\PlayStatusPacket; use pocketmine\network\mcpe\protocol\PlayerActionPacket; use pocketmine\network\mcpe\protocol\EntityFallPacket; use pocketmine\network\mcpe\protocol\PlayerInputPacket; use pocketmine\network\mcpe\protocol\PlayerListPacket; use pocketmine\network\mcpe\protocol\RemoveBlockPacket; use pocketmine\network\mcpe\protocol\RemoveEntityPacket; use pocketmine\network\mcpe\protocol\ReplaceItemInSlotPacket; use pocketmine\network\mcpe\protocol\RequestChunkRadiusPacket; use pocketmine\network\mcpe\protocol\ResourcePackChunkDataPacket; use pocketmine\network\mcpe\protocol\ResourcePackChunkRequestPacket; use pocketmine\network\mcpe\protocol\ResourcePackClientResponsePacket; use pocketmine\network\mcpe\protocol\ResourcePackDataInfoPacket; use pocketmine\network\mcpe\protocol\ResourcePackStackPacket; use pocketmine\network\mcpe\protocol\ResourcePacksInfoPacket; use pocketmine\network\mcpe\protocol\RespawnPacket; use pocketmine\network\mcpe\protocol\RiderJumpPacket; use pocketmine\network\mcpe\protocol\SetCommandsEnabledPacket; use pocketmine\network\mcpe\protocol\SetDifficultyPacket; use pocketmine\network\mcpe\protocol\SetEntityDataPacket; use pocketmine\network\mcpe\protocol\SetEntityLinkPacket; use pocketmine\network\mcpe\protocol\SetEntityMotionPacket; use pocketmine\network\mcpe\protocol\SetHealthPacket; use pocketmine\network\mcpe\protocol\SetPlayerGameTypePacket; use pocketmine\network\mcpe\protocol\SetSpawnPositionPacket; use pocketmine\network\mcpe\protocol\SetTimePacket; use pocketmine\network\mcpe\protocol\SetTitlePacket; use pocketmine\network\mcpe\protocol\ServerToClientHandshakePacket; use pocketmine\network\mcpe\protocol\ShowCreditsPacket; use pocketmine\network\mcpe\protocol\SpawnExperienceOrbPacket; use pocketmine\network\mcpe\protocol\StartGamePacket; use pocketmine\network\mcpe\protocol\StopSoundPacket; use pocketmine\network\mcpe\protocol\TakeItemEntityPacket; use pocketmine\network\mcpe\protocol\TextPacket; use pocketmine\network\mcpe\protocol\TransferPacket; use pocketmine\network\mcpe\protocol\UpdateAttributesPacket; use pocketmine\network\mcpe\protocol\UpdateBlockPacket; use pocketmine\network\mcpe\protocol\UpdateTradePacket; use pocketmine\network\mcpe\protocol\UseItemPacket; use pocketmine\Player; use pocketmine\Server; use pocketmine\utils\BinaryStream; use pocketmine\utils\MainLogger; use SplFixedArray; use Throwable; use UnexpectedValueException; use function spl_object_hash; class Network { public static $BATCH_THRESHOLD = 512; /** @var SplFixedArray */ private $packetPool; /** @var Server */ private $server; /** @var SourceInterface[] */ private $interfaces = []; /** @var AdvancedSourceInterface[] */ private $advancedInterfaces = []; private $upload = 0; private $download = 0; private $name; /** * Network constructor. * * @param Server $server */ public function __construct(Server $server){ $this->registerPackets(); $this->server = $server; } /** * @param $upload * @param $download */ public function addStatistics($upload, $download){ $this->upload += $upload; $this->download += $download; } /** * @return int */ public function getUpload(){ return $this->upload; } /** * @return int */ public function getDownload(){ return $this->download; } public function resetStatistics(){ $this->upload = 0; $this->download = 0; } /** * @return SourceInterface[] */ public function getInterfaces(){ return $this->interfaces; } public function processInterfaces(){ foreach($this->interfaces as $interface){ $interface->process(); } } /** * @deprecated * @param SourceInterface $interface */ public function processInterface(SourceInterface $interface) : void{ $interface->process(); } /** * @param SourceInterface $interface */ public function registerInterface(SourceInterface $interface){ $interface->start(); $this->interfaces[$hash = spl_object_hash($interface)] = $interface; if($interface instanceof AdvancedSourceInterface){ $this->advancedInterfaces[$hash] = $interface; $interface->setNetwork($this); } $interface->setName($this->name); } /** * @param SourceInterface $interface */ public function unregisterInterface(SourceInterface $interface){ unset($this->interfaces[$hash = spl_object_hash($interface)], $this->advancedInterfaces[$hash]); } /** * Sets the server name shown on each interface Query * * @param string $name */ public function setName($name){ $this->name = (string) $name; foreach($this->interfaces as $interface){ $interface->setName($this->name); } } public function getName(){ return $this->name; } public function updateName(){ foreach($this->interfaces as $interface){ $interface->setName($this->name); } } /** * @param int $id 0-255 * @param string $class */ public function registerPacket($id, $class){ $this->packetPool[$id] = new $class; } /** * @return Server */ public function getServer(){ return $this->server; } /** @var int[] */ private $packetsFloodFilter; /** * @param BatchPacket $packet * @param Player $player */ public function processBatch(BatchPacket $packet, Player $player){ $rawLen = strlen($packet->payload); if($rawLen === 0){ throw new \InvalidArgumentException("BatchPacket payload is empty or packet decode error"); }elseif($rawLen < 3){ throw new \InvalidArgumentException("Not enough bytes, expected zlib header"); } $str = zlib_decode($packet->payload, 1024 * 1024 * 2); //Max 2MB $len = strlen($str); if($len === 0){ throw new InvalidStateException("Decoded BatchPacket payload is empty"); } $stream = new BinaryStream($str); $count = 0; $packetsCounter = []; $isFiltered = false; while(!$stream->feof()){ if($count++ >= 500){ throw new UnexpectedValueException("Too many packets in a single batch"); } $buf = $stream->getString(); if(($pk = $this->getPacket(ord($buf[0]))) !== null){ if(!$pk->canBeBatched()){ throw new UnexpectedValueException("Received invalid " . get_class($pk) . " inside BatchPacket"); } @$packetsCounter[$pk::NETWORK_ID]++; if(@$packetsCounter[$pk::NETWORK_ID] > 300){ //TODO: говнокод $isFiltered = true; } $pk->setBuffer($buf, 1); $pk->decode(); if(!$pk->feof() and !$pk->mayHaveUnreadBytes()){ $remains = substr($pk->buffer, $pk->offset); $this->server->getLogger()->debug("Still " . strlen($remains) . " bytes unread in " . $pk->getName() . ": 0x" . bin2hex($remains)); } $player->handleDataPacket($pk); } } if($isFiltered){ if (@$this->packetsFloodFilter[$player->getAddress()] < 15){ @$this->packetsFloodFilter[$player->getAddress()]++; }else{ unset($this->packetsFloodFilter[$player->getAddress()]); $this->blockAddress($player->getAddress(), 150); } }else{ unset($this->packetsFloodFilter[$player->getAddress()]); } } /** * @param $id * * @return DataPacket */ public function getPacket($id){ /** @var DataPacket $class */ $class = $this->packetPool[$id]; if($class !== null){ return clone $class; } return null; } /** * @param string $address * @param int $port * @param string $payload */ public function sendPacket($address, $port, $payload){ foreach($this->advancedInterfaces as $interface){ $interface->sendRawPacket($address, $port, $payload); } } /** * Blocks an IP address from the main interface. Setting timeout to -1 will block it forever * * @param string $address * @param int $timeout */ public function blockAddress($address, $timeout = 300){ foreach($this->advancedInterfaces as $interface){ $interface->blockAddress($address, $timeout); } } /** * Unblocks an IP address from the main interface. * * @param string $address */ public function unblockAddress($address){ foreach($this->advancedInterfaces as $interface){ $interface->unblockAddress($address); } } private function registerPackets(){ $this->packetPool = new SplFixedArray(256); $this->registerPacket(ProtocolInfo::ADD_ENTITY_PACKET, AddEntityPacket::class); $this->registerPacket(ProtocolInfo::ADD_HANGING_ENTITY_PACKET, AddHangingEntityPacket::class); $this->registerPacket(ProtocolInfo::ADD_ITEM_ENTITY_PACKET, AddItemEntityPacket::class); $this->registerPacket(ProtocolInfo::ADD_ITEM_PACKET, AddItemPacket::class); $this->registerPacket(ProtocolInfo::ADD_PAINTING_PACKET, AddPaintingPacket::class); $this->registerPacket(ProtocolInfo::ADD_PLAYER_PACKET, AddPlayerPacket::class); $this->registerPacket(ProtocolInfo::ADVENTURE_SETTINGS_PACKET, AdventureSettingsPacket::class); $this->registerPacket(ProtocolInfo::ANIMATE_PACKET, AnimatePacket::class); $this->registerPacket(ProtocolInfo::AVAILABLE_COMMANDS_PACKET, AvailableCommandsPacket::class); $this->registerPacket(ProtocolInfo::BLOCK_ENTITY_DATA_PACKET, BlockEntityDataPacket::class); $this->registerPacket(ProtocolInfo::BLOCK_EVENT_PACKET, BlockEventPacket::class); $this->registerPacket(ProtocolInfo::BOSS_EVENT_PACKET, BossEventPacket::class); $this->registerPacket(ProtocolInfo::CAMERA_PACKET, CameraPacket::class); $this->registerPacket(ProtocolInfo::CHANGE_DIMENSION_PACKET, ChangeDimensionPacket::class); $this->registerPacket(ProtocolInfo::CHUNK_RADIUS_UPDATED_PACKET, ChunkRadiusUpdatedPacket::class); $this->registerPacket(ProtocolInfo::CLIENTBOUND_MAP_ITEM_DATA_PACKET, ClientboundMapItemDataPacket::class); $this->registerPacket(ProtocolInfo::CLIENT_TO_SERVER_HANDSHAKE_PACKET, ClientToServerHandshakePacket::class); $this->registerPacket(ProtocolInfo::COMMAND_STEP_PACKET, CommandStepPacket::class); $this->registerPacket(ProtocolInfo::CONTAINER_CLOSE_PACKET, ContainerClosePacket::class); $this->registerPacket(ProtocolInfo::CONTAINER_OPEN_PACKET, ContainerOpenPacket::class); $this->registerPacket(ProtocolInfo::CONTAINER_SET_CONTENT_PACKET, ContainerSetContentPacket::class); $this->registerPacket(ProtocolInfo::CONTAINER_SET_DATA_PACKET, ContainerSetDataPacket::class); $this->registerPacket(ProtocolInfo::CONTAINER_SET_SLOT_PACKET, ContainerSetSlotPacket::class); $this->registerPacket(ProtocolInfo::CRAFTING_DATA_PACKET, CraftingDataPacket::class); $this->registerPacket(ProtocolInfo::CRAFTING_EVENT_PACKET, CraftingEventPacket::class); $this->registerPacket(ProtocolInfo::DISCONNECT_PACKET, DisconnectPacket::class); $this->registerPacket(ProtocolInfo::DROP_ITEM_PACKET, DropItemPacket::class); $this->registerPacket(ProtocolInfo::ENTITY_EVENT_PACKET, EntityEventPacket::class); $this->registerPacket(ProtocolInfo::EXPLODE_PACKET, ExplodePacket::class); $this->registerPacket(ProtocolInfo::FULL_CHUNK_DATA_PACKET, FullChunkDataPacket::class); $this->registerPacket(ProtocolInfo::HURT_ARMOR_PACKET, HurtArmorPacket::class); $this->registerPacket(ProtocolInfo::INTERACT_PACKET, InteractPacket::class); $this->registerPacket(ProtocolInfo::INVENTORY_ACTION_PACKET, InventoryActionPacket::class); $this->registerPacket(ProtocolInfo::ITEM_FRAME_DROP_ITEM_PACKET, ItemFrameDropItemPacket::class); $this->registerPacket(ProtocolInfo::LEVEL_EVENT_PACKET, LevelEventPacket::class); $this->registerPacket(ProtocolInfo::LEVEL_SOUND_EVENT_PACKET, LevelSoundEventPacket::class); $this->registerPacket(ProtocolInfo::LOGIN_PACKET, LoginPacket::class); $this->registerPacket(ProtocolInfo::MAP_INFO_REQUEST_PACKET, MapInfoRequestPacket::class); $this->registerPacket(ProtocolInfo::MOB_ARMOR_EQUIPMENT_PACKET, MobArmorEquipmentPacket::class); $this->registerPacket(ProtocolInfo::MOB_EFFECT_PACKET, MobEffectPacket::class); $this->registerPacket(ProtocolInfo::MOB_EQUIPMENT_PACKET, MobEquipmentPacket::class); $this->registerPacket(ProtocolInfo::MOVE_ENTITY_PACKET, MoveEntityPacket::class); $this->registerPacket(ProtocolInfo::MOVE_PLAYER_PACKET, MovePlayerPacket::class); $this->registerPacket(ProtocolInfo::ENTITY_FALL_PACKET, EntityFallPacket::class); $this->registerPacket(ProtocolInfo::PLAYER_ACTION_PACKET, PlayerActionPacket::class); $this->registerPacket(ProtocolInfo::PLAYER_INPUT_PACKET, PlayerInputPacket::class); $this->registerPacket(ProtocolInfo::PLAYER_LIST_PACKET, PlayerListPacket::class); $this->registerPacket(ProtocolInfo::PLAY_STATUS_PACKET, PlayStatusPacket::class); $this->registerPacket(ProtocolInfo::REMOVE_BLOCK_PACKET, RemoveBlockPacket::class); $this->registerPacket(ProtocolInfo::REMOVE_ENTITY_PACKET, RemoveEntityPacket::class); $this->registerPacket(ProtocolInfo::REPLACE_ITEM_IN_SLOT_PACKET, ReplaceItemInSlotPacket::class); $this->registerPacket(ProtocolInfo::REQUEST_CHUNK_RADIUS_PACKET, RequestChunkRadiusPacket::class); $this->registerPacket(ProtocolInfo::RESOURCE_PACKS_INFO_PACKET, ResourcePacksInfoPacket::class); $this->registerPacket(ProtocolInfo::RESOURCE_PACK_CHUNK_REQUEST_PACKET, ResourcePackChunkRequestPacket::class); $this->registerPacket(ProtocolInfo::RESOURCE_PACK_CHUNK_DATA_PACKET, ResourcePackChunkDataPacket::class); $this->registerPacket(ProtocolInfo::RESOURCE_PACK_CLIENT_RESPONSE_PACKET, ResourcePackClientResponsePacket::class); $this->registerPacket(ProtocolInfo::RESOURCE_PACK_DATA_INFO_PACKET, ResourcePackDataInfoPacket::class); $this->registerPacket(ProtocolInfo::RESOURCE_PACK_STACK_PACKET, ResourcePackStackPacket::class); $this->registerPacket(ProtocolInfo::RESPAWN_PACKET, RespawnPacket::class); $this->registerPacket(ProtocolInfo::RIDER_JUMP_PACKET, RiderJumpPacket::class); $this->registerPacket(ProtocolInfo::SHOW_CREDITS_PACKET, ShowCreditsPacket::class); $this->registerPacket(ProtocolInfo::SERVER_TO_CLIENT_HANDSHAKE_PACKET, ServerToClientHandshakePacket::class); $this->registerPacket(ProtocolInfo::SET_COMMANDS_ENABLED_PACKET, SetCommandsEnabledPacket::class); $this->registerPacket(ProtocolInfo::SET_DIFFICULTY_PACKET, SetDifficultyPacket::class); $this->registerPacket(ProtocolInfo::SET_ENTITY_DATA_PACKET, SetEntityDataPacket::class); $this->registerPacket(ProtocolInfo::SET_ENTITY_LINK_PACKET, SetEntityLinkPacket::class); $this->registerPacket(ProtocolInfo::SET_ENTITY_MOTION_PACKET, SetEntityMotionPacket::class); $this->registerPacket(ProtocolInfo::SET_HEALTH_PACKET, SetHealthPacket::class); $this->registerPacket(ProtocolInfo::SET_PLAYER_GAME_TYPE_PACKET, SetPlayerGameTypePacket::class); $this->registerPacket(ProtocolInfo::SET_SPAWN_POSITION_PACKET, SetSpawnPositionPacket::class); $this->registerPacket(ProtocolInfo::SET_TIME_PACKET, SetTimePacket::class); $this->registerPacket(ProtocolInfo::SPAWN_EXPERIENCE_ORB_PACKET, SpawnExperienceOrbPacket::class); $this->registerPacket(ProtocolInfo::START_GAME_PACKET, StartGamePacket::class); $this->registerPacket(ProtocolInfo::TAKE_ITEM_ENTITY_PACKET, TakeItemEntityPacket::class); $this->registerPacket(ProtocolInfo::TEXT_PACKET, TextPacket::class); $this->registerPacket(ProtocolInfo::TRANSFER_PACKET, TransferPacket::class); $this->registerPacket(ProtocolInfo::UPDATE_ATTRIBUTES_PACKET, UpdateAttributesPacket::class); $this->registerPacket(ProtocolInfo::UPDATE_BLOCK_PACKET, UpdateBlockPacket::class); $this->registerPacket(ProtocolInfo::UPDATE_TRADE_PACKET, UpdateTradePacket::class); $this->registerPacket(ProtocolInfo::USE_ITEM_PACKET, UseItemPacket::class); $this->registerPacket(ProtocolInfo::BLOCK_PICK_REQUEST_PACKET, BlockPickRequestPacket::class); $this->registerPacket(ProtocolInfo::COMMAND_BLOCK_UPDATE_PACKET, CommandBlockUpdatePacket::class); $this->registerPacket(ProtocolInfo::PLAY_SOUND_PACKET, PlaySoundPacket::class); $this->registerPacket(ProtocolInfo::SET_TITLE_PACKET, SetTitlePacket::class); $this->registerPacket(ProtocolInfo::STOP_SOUND_PACKET, StopSoundPacket::class); $this->registerPacket(0xfe, BatchPacket::class); } }

Файл скинуть не смог

Network.php (18,5 КБ)
попробуй заменить, хз




. ок

а это уже твое ядро немного калл

Для тебя я не чел

Для какой версии?

Ядро? 1.1.0-1.1.9 LiteCore

Попробуй это ядро LiteCore-1.0.8 & PHP-8.0

Так оно же хуже не?

Попробуй