
    i                     B    S SK r SSKJr   " S S\R                  5      rg)    N   )packetc                   l    \ rS rSrSrSr\R                  r\	S\R                  4S j5       r
S rS rSrg)MsgPackPacket   FNc                 <     " S S[         5      nXl        X#l        U$ )ar  Change the default options for msgpack encoding and decoding.

:param dumps_default: a function called for objects that cannot be
                      serialized by default msgpack. The function
                      receives one argument, the object to serialize.
                      It should return a serializable object or a
                      ``msgpack.ExtType`` instance.
:param ext_hook: a function called when a ``msgpack.ExtType`` object is
                 seen during decoding. The function receives two
                 arguments, the code and the data. It should return the
                 decoded object.
c                       \ rS rSrSrSrSrg)4MsgPackPacket.configure.<locals>.CustomMsgPackPacket   N )__name__
__module____qualname____firstlineno__dumps_defaultext_hook__static_attributes__r       T/home/admin/cozy_coffee/venv/lib/python3.13/site-packages/socketio/msgpack_packet.pyCustomMsgPackPacketr
      s     MHr   r   )r   r   r   )clsr   r   r   s       r   	configureMsgPackPacket.configure
   s"    	- 	 -:)'/$""r   c                 p    [         R                  " U R                  5       U R                  R                  S9$ )z#Encode the packet for transmission.)default)msgpackdumps_to_dict	__class__r   )selfs    r   encodeMsgPackPacket.encode    s*    }}T]]_%)^^%A%AC 	Cr   c                     [         R                  " UU R                  R                  S9nUS   U l        UR                  S5      U l        UR                  S5      U l        US   U l        g)zDecode a transmitted package.)r   typedataidnspN)	r   loadsr   r   packet_typegetr%   r&   	namespace)r    encoded_packetdecodeds      r   decodeMsgPackPacket.decode%   sW    --)-)@)@B"6?KK'	++d# r   )r%   r&   r+   r)   )r   r   r   r   uses_binary_eventsr   r   ExtTyper   classmethodr   r!   r.   r   r   r   r   r   r      s<    MH%)GOO # #*C
(r   r   )r    r   Packetr   r   r   r   <module>r5      s     '(FMM '(r   