o
    n~bv
                     @   s@   d dl Z d dlmZmZ e jdk reZneZG dd deZdS )    N)datetime	timedelta)   c                       sx   e Zd ZdZ fddZedd Zdd Zdd	 Ze	d
d Z
e	dd Ze	dd Ze	dd Ze	dd Z  ZS )GlobalIDz
    Represents a globally unique identifier within the Steam network.
    Guaranteed to be unique across all racks and servers for a given Steam universe.
    c                    sF   t |dkrtt| j| g|R  S tj|i |}tt| | |S )N   )lensuperr   __new__new)clsargskwargsgid	__class__ 9/usr/local/lib/python3.10/dist-packages/steam/globalid.pyr	      s   zGlobalID.__new__c                 C   sJ   t |tst|d}t|tddd  }|d> |d> B |d> B | B S )a  Make new GlobalID

        :param sequence_count: sequence count
        :type sequence_count: :class:`int`
        :param start_time: start date time of server (must be after 2005-01-01)
        :type start_time: :class:`str`, :class:`datetime`
        :param process_id: process id
        :type process_id: :class:`int`
        :param box_id: box id
        :type box_id: :class:`int`
        :return: Global ID integer
        :rtype: :class:`int`
        z%Y-%m-%d %H:%M:%S  r   6   2      )
isinstancer   strptimeinttotal_seconds)sequence_count
start_time
process_idbox_idstart_time_secondsr   r   r   r
      s   
zGlobalID.newc                 O   s   d S )Nr   )selfr   r   r   r   r   __init__+   s   zGlobalID.__init__c                 C   s&   d| j j| jtt| j| j| jf S )Nz>%s(sequence_count=%s, start_time=%s, process_id=%s, box_id=%s))r   __name__r   reprstrr   r   r   r    r   r   r   __repr__.   s   zGlobalID.__repr__c                 C   s   | d@ S )zN
        :return: sequence count for GID
        :rtype: :class:`int`
        i r   r%   r   r   r   r   7   s   zGlobalID.sequence_countc                 C      | d? d@ S )zP
        :return: seconds since 2005-01-01
        :rtype: :class:`int`
        r   i?r   r%   r   r   r   r   ?      zGlobalID.start_time_secondsc                 C   s   t dddt| jd S )zm
        :return: start time of the server that generated this GID
        :rtype: :class:`datetime`
        r   r   )seconds)r   r   r   r%   r   r   r   r   G   s   zGlobalID.start_timec                 C   r'   )zL
        :return: process id of server
        :rtype: :class:`int`
        r      r   r%   r   r   r   r   O   r(   zGlobalID.process_idc                 C   r'   )zH
        :return: box id of server
        :rtype: :class:`int`
        r   i  r   r%   r   r   r   r   W   r(   zGlobalID.box_id)r"   
__module____qualname____doc__r	   staticmethodr
   r!   r&   propertyr   r   r   r   r   __classcell__r   r   r   r   r   
   s"    
	



r   )sysr   r   version_infolongZintBaser   r   r   r   r   r   <module>   s    
