2017-08-08 23:49:20 +02:00
|
|
|
from .packet import Packet
|
|
|
|
|
|
|
|
from minecraft.networking.types import (
|
2017-09-20 00:30:51 +02:00
|
|
|
VarInt, Long
|
2017-08-08 23:49:20 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
|
2017-08-24 03:14:53 +02:00
|
|
|
class AbstractKeepAlivePacket(Packet):
|
2017-08-08 23:49:20 +02:00
|
|
|
packet_name = "keep alive"
|
2017-09-20 00:30:51 +02:00
|
|
|
get_definition = staticmethod(lambda context: [
|
|
|
|
{'keep_alive_id': Long} if context.protocol_version >= 339
|
|
|
|
else {'keep_alive_id': VarInt}
|
|
|
|
])
|
2017-08-24 03:14:53 +02:00
|
|
|
|
|
|
|
|
|
|
|
# This alias is retained for backward compatibility:
|
|
|
|
KeepAlivePacket = AbstractKeepAlivePacket
|