#NEWLINE# def initialize( self ) : #NEWLINE# #INDENT# if ( self . type == 'CDN' ) : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# self . session_key = CryptoUtil . create_session_key ( ) #NEWLINE# crypted_key = CryptoUtil . rsa_encrypt ( self . session_key ) #NEWLINE# url = ( 'http://%s:%s/initsession/' % ( self . host , self . port ) ) #NEWLINE# payload = dict ( sessionkey = self ) #NEWLINE# if self . app_ticket : #NEWLINE# #INDENT# payload [ 'appticket' ] = CryptoUtil . symmetric_encrypt ( self . app_ticket , self . session_key ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# payload [ 'anonymoususer' ] = 1 #NEWLINE# payload [ 'steamid' ] = self . steamid . steamid #NEWLINE# #UNINDENT# r = self . session . post ( url , payload ) #NEWLINE# if ( r . status_code != 200 ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# sessionkv = vdf . loads ( r . content ) [ 'response' ] #NEWLINE# self . csid = sessionkv [ 'csid' ] #NEWLINE# self . session_id = ( int ( sessionkv [ 'sessionid' ] ) & 18446744073709551615 ) #NEWLINE# self . req_counter = int ( sessionkv [ 'req-counter' ] ) #NEWLINE# return True