a
    }h4                    @   s   d dl Z d dlZd dlZd dlZd dlZd dlmZ d dlmZ d dl	m
Z
mZmZmZ d dlmZmZmZ d dlmZ d dlmZmZmZmZmZ d dlmZ d d	lmZ e jd
krd dlZG dd dZ dS )    N)close_old_connections)timezone)FifaAccountWorkErrorFifaAccountDisableFifaAccountSuspendFifaAccountBackupCode)BASE_DIRCONSOLE_NAME_LIST	TIME_ZONE)/ARZBAZI_REPORT_TOPIC_AIRPLANE_THREAD_MESSAGE_ID)	new_printset_sbc_statustelegram_send_photoget_image_positionenter_world_xboxs)logout_login)get_db_timentc                   @   s.   e Zd Zdd Zd
ddZeeddd	ZdS )ConsoleErrorUtilsc                 C   s4   ddl m} || _| jj| _| jj| _| jj| _d S )Nr   )PublicMoves)utils.public_movesr   public_movesfifa_account
sbc_workerps4_buttons)selfpublic_moves_instancer    r   LC:\Users\Administrator\Downloads\futplus_django\utils\console_error_utils.py__init__   s
    

zConsoleErrorUtils.__init__NTc           ,   
   C   s>&  |d u rg }d}t d}t |t j}|ddddf }|ddddf }|d	d
d
df }t j|d ddt jd}t d| t d| t d| | jd}	| jd}
| jd}|rt	| j
d|	d d d|
d d d|d d  | d|	rt	| j
d| jj td | j jd7  _| j
jdv r|| jjdkr|t	| j
d t| jddd | jj  | j  d}n| d|	rt	| j
d|	 | j  td d}n| d |	rt	| j
d! | j  td d}nx| d"|	s*| d#|	s*| d$|	s*| d%|	rt	| j
d& t| jd'dd td( | j
jdv r| jjt tjd)d* k rt| jd | jj  | j  nZ| j
jdv r| j  td+ | j  td+ | jd,d- n| j  td d}nh| jtj !t"d.| j
j d/dr
d0|vr
t	| j
d1 | jtj !t"d.| j
j d2dr| j  td | j  td | j#d3d4 td | j$  td | j  td n4t	| j
d5 | j%  td6 | j&  | j  d}n`| d7|	rt	| j
d8 | j'  | jj(}| jj}d9| j_(t | j_| j)  | j*  | jtj !t"d.| j
j d:drtd+ nqq\t	| j
d; t| j| td< d}n| jtj !t"d.| j
j d=drt	| j
d> td | j+  td? | j,  td | j,  td | j-  | j  td | j&  td | j  td+ d}n| d@|	rft	| j
dA tdB | jtj !t"d.| j
j dCds&| jtj !t"d.| j
j dDds&| jtj !t"d.| j
j dEdrj| j.  td | j  td | j*  t/dD ]}| jtj !t"d.| j
j dFds| jtj !t"dGdr qTn| jtj !t"d.| j
j dCds| jtj !t"d.| j
j dDds| jtj !t"d.| j
j dEdr2| j.  td | j  td | j*  q`td d}n| dH|	rt	| j
dI td | j  td< | j0tj !t"d.| j
j dJ td | j  d}
n| dK|	r"t	| j
dL | j,  td | j  td 
nH| jtj !t"d.| j
j dMdsn| jtj !t"d.| j
j dNdrt	| j
dO t| jdPddQ | j1  d}	n| dR|	rt	| j
dS t| jdTdd | jj23  d}	n| dU|		rbt	| j
dV t/d+D ]R}| j*  | jtj !t"d.| j
j dWd	r8 	qPn| j&  td q| j  d}	n| dX|		rt	| j
dY | jj45 }d}|dZk	rt| jdY td[ t6dYnt	| j
d\ n| j
jdv 
rD| jtj !t"d.| j
j d]d
rDt	| j
d^ | j  td+ | j  td+ | jd,d- d}n&| d_|	
s`| d`|	
rt	| j
da | j  td+ | j  td+ | jd,d- d}ndb|vr`dc|vr`| j
jdv r`| dd|	
s| de|	r`t	| j
df | jj7dgkr t| jdh tdi t6dh| j.  td | j  td< | j j7d7  _7d}n
| j
jdv r| dj|	rt	| j
dk | j  td< t| jdl t	| j
dm t/d<D ]B}td( | j-  td+ | j.  td+ | j%  qd}nb| dn|	r`t	| j
do | j  td+ | j  td+ | jd,d- d}n
| dp|rt	| j
dq t| jdr | jj8j9d d ds| j
j: dtt;du tdv n| j
jdv r(| dw|s| dx|r(t	| j
dy t| jdzdd | jj<d+krjt	| j
d{ t| jd{ t=j>j?| j
d|d} | jj8j9d d ds| j
j: d~t;du td[ t6d{n| j j<d7  _<t@d td | j  td | j%  td | j%  td | jA }|rj|Bddu rjt	| j
d tCtDdkr| jjE  td+ | j  nB| j
jdv r| d|	sR| d|	rt	| j
d | j  td+ | j  td+ | jd,d- d}n| jtj !t"d.| j
j ddrt	| j
d | j%  td< d}n| j
jdv rF| jtj !t"d.| j
j ddrFt	| j
d | j%  td d}n$| j
jdv r| d|	rt	| j
d | j%  td+ d}n| d|	rt	| j
d tFtj !t"dd}t	| j
d| d|Bdd   k rd	k rn n| j  nd|Bdd   k rd
k r>n n | j-  td | j  ndd|Bdd   k r`d[k rn n4| j-  td | j-  td | j  n
| j  td+ d}n| d|	r8t	| j
d | j*  | jtj !t"d.| j
j ddr| jj&dd | j  td | j%  td n2| d|	rt	| j
d tj Gd}tHtj !|d t@tj !|d nd}g d}|s|D ]D}| ||	rt	| j
d| d}| j  tdg d} qq|sjtItj !t"d.| j
j dD ]`}| jtj !t"d.| j
j d| drt	| j
d| d}| j  tdg d} qjq| jtj !t"d.| j
j ddrt	| j
d t| jd td[ d}n| d|	rFt	| j
d t| jd | j  td | j%  td | j%  td | jdd td< | J  | j$  td+ | jjKtj !t"d.| j
j d/tj !t"d.| j
j dgdgdr| j%  td | jj&dd | j  td< | jdd | j$  td | j$  td+ | j%  t| jd n(| j$  td | j%  td d}n| j
jdv rd|vr| jtj !t"d.| j
j ddrt	| j
d | j%  td | j%  td d}nz| d|	s| d|	rzt/d+D ]}t	| j
d| | j*  | jtj !t"d.| j
j dds0|dk rht	| j
d d}| j&  td | j  td td qn| d|	r^t	| j
d | jtj !t"d.| j
j dd&r:t	| j
d | jL  td+ t/dgD ].}| j  td | j.  td q| jM  td | j&  td | j  td t	| j
d n| d|	rt	| j
d d}| j&  td | j  td t/dgD ]}| j  td+ qnn| j
jdv rH| d|	rHt	| j
d tFtj !t"d.| j
j dd}tNO|d d |d d  tNPd td dS d|vr| jtj !t"d.| j
j ddrz2tQ| j
tj !t"dd| j
 d| j
j: ddƍ W n   t	| j
dǃ Y n0 t	| j
dȃ t| jdȃ t=j>j?| j
dd} td[ t6dȃn6| d|	s | d|	rt	| j
d˃ t=j>j?| j
dd} zptQ| j
tj !t"dd| j
 d| j
j: d͍ td+ tQ| j
tj !t"dΡd| j
jR d| j
j d| j
 d͍ W n   t	| j
dtST  Y n0 t/d<D ]$}| j-  | j.  td( q| j  tU  tV| jj8| j| j
 tWj>jX| j
ddӍY dkrt	| j
dԃ t| jd˃ td[ | j
jdv rv| j  t6d˃n*t	| j
dՃ t| jdՃ td֡ t6dՃn| d|	rt	| j
d؃ t| jd؃ td١ t6d؃nP| d|	rt/dgD ]}t	| j
d| | j*  | jtj !t"dܡdr | j-  td | j&  td | j&  td | j&  td | j&  td | j&  td | j  tdݡ q np| d|	r0t	| j
d߃ t| jd߃ t/dD ]$}| j-  | j.  td qtU  t6d߃n
| d|	rt	| j
d | jjZrt| jd | j
j[jXdd\ }t]j>j^| j
d\} }!|!r| j
j:| _:|r|j_nd | _`| )  td[ t6d
nr| d|	r.t	| j
d t| jd t/d<D ]$}"| j-  | j.  td qtU  t6d
n| j
jdv r| d|	rt	| j
d t| jd | jj  | j  td 	n| d|	s| d|	s| d|	s| d|	rNt	| j
d | j
jdkr| ja  td+ nN| j
jdv r<| ja  t	| j
d td+ | j  t	| j
d td+ | jd,d- n| d|	rt	| j
d | j-  td | j  td< d}n| j
jdv r| jtj !t"d.| j
j dds| jtj !t"d.| j
j ddrt	| j
d | jb  td t/d<D ]}#td | j*  | jtj !t"d.| j
j dds~| jtj !t"d.| j
j ddrt	| j
d | j%  td qd}n| d|	rt	| j
d t| jd'dd td( | j  d}nJ| j
jdv rP| jtj !t"ddrPt	| j
d t/dD ]}$| j%  td+ q,d}n| d|	rt	| j
d tFtj !t"d.| j
j dd}%| j  td | j%  td n| d|	rt	| j
d  | j-  td | j  td n<| d|	 s| d|	 rz2tQ| j
tj !t"dd| j
 d| j
j: d͍ W n   t	| j
dtST  Y n0 t| jd t	| j
d t=j>j?| j
dd} t/d<D ]$}| j-  | j.  td  qtU  t6dnX| j
jdv !r| d|	!rt| jd t	| j
d | j.  td | j  td< | j  t/d<D ]$}&| j-  | j.  td !qVtU  t6dn| j
jdv "r| jtj !t"dd"r| j jcd7  _ct	| j
d| jjc | jd  td+ | j  td+ d}t| jd	 n| j
jdv "r~| d
|	"sJ| d|	"r~t	| j
d t| jd | jj  | j  n| j
jdv #rl| d|	#rlt	| j
d t/d<D ]}'| j%  td< "q| je }(t/dgD ]4}| je }(|(#r
t	| j
d|(  #q| J  "q|(#sdt	| j
d|( | jd  td | j  td | jjdd d}n| j
jdv #r| d|	#rt	| j
d | j%  td d}n| j
jdv $r| jtj !t"dd$rt	| j
d | j%  td d}n2| d|	$rVt	| j
d | j&  td | j  td+ d}n| j
jdv &r:| d|	&r:t	| j
d t| jddd | jtj !t"dd$s| jjdd | j,  td | jjdd | j,  td | jjd+d | jjd+d tfj>jX| j
jgdh })|)&r|)ji&rz*tjtktldm }*tno|)jip|*}+W nX t6%y } z>t	| j
d| t| jddd td[ d }+W Y d }~n
d }~0 0 tq| tr|+ td | j+  td | j,  td | j  tdB t	| j
d! nt| jd"dd td[ |S (#  Nr   zscreen_shot_tmp.jpgd   i      i@  i  i  i  i  i     )fxfyinterpolationzcropped_error_tmp.jpgzcropped_bottom_buttons_tmp.jpgzcropped_remote_errors_tmp.jpgz(check for errors , cropped_error_text : i  z cropped_bottom_buttons_text : z cropped_remote_errors_tmp : zconnecting to the EA Serversz'error = ea_connecting , waiting time :    )xboxsxbox360   z&more than 1200 time ea connecting waitzrestarting consoleF)update_timeMESSAGE FROM THE FC TEAMzmessage from the fc team : z/Are you sure you want to exit Football Ultimatezerror = exit_ultimatez+Connecting to Ultimate team is not possiblez*You lost your connection to the EA serversz$You have lost your online connectionz$Ea Servers are unavailable right nowz)error = connection lost , 60 second sleepzconnection lost<   -   )minutes   ps4_main	home_mainzutils/z_controls/after_buy_in_list.pngzafter_buy_in_list.pngzerror = after_buy_in_listz!_controls/swap_with_duplicate.png      z can not find swap_with_duplicateg      ?zType the characters you seezerror = captchacaptchaz_controls/captcha.pngzcaptcha solved ...
   z_after_update/scoreboard.pngzerror = first play neededg      @z Please read the agreements belowzuser agrement found   z _after_update/user_agreement.pngz"_after_update/user_agreement_2.pngz"_after_update/user_agreement_3.pngz_controls/home_main.pngz+utils/xbox_public/redeem_your_gift_card.pngz'In order to play Football Ultimate Teamz?error = In order to play Football Ultimate Team , update neededz"_after_update/update_completed.pngzDLC Assets Updatez	dlc errorz!_controls/starter_pack_select.pngz*_controls/delete_club_lets_get_started.pngz#error = need to select starter packzselecting starter pack)r   statusr*   z9please take a few minutes to create a new account or linkzneed to link accountzlink origin accountz&Are you sure you want to leave Sortingz;error = sort items in transfer list needed . sort it later.z%_controls/sort_item_later_confirm.pngz-You must substitute the injured player beforezinjure middle of gamezcan not fixi  zinjuri fixedz!_controls/signin_with_ea_emal.pngz7need to signin to ea account. it`s bug in ea connectionz&The active profile has been signed outz&You must have a Xbox Profile signed inzneed to signin to account 2zkey_duplicate_error.pngzkey_duplicate_error2.pngzkey started playing this onzkey is already playing onzduplicate key found   ztoo many duplicate key foundi  zneeds an updatezgame need update message.zgame update needz+game update need 3, pressing left and rightz.Would you like to switch the active profile tozneed to switch accountz6Your account requires additional authentication on thezneed to monitorzneed looks goodz
console : z need looks good)textmessage_thread_idi  zTry again in a whilezDisconnected from cloud gamingzOerror = Can not find Console. may be console not connected to internet or powerztry to connect to consolezcan not connect to consoleZairplane)r   
error_textz	 airplanez:TASKKILL /F /IM XboxPcApp.exe /FI "USERNAME eq %username%"   status_boolTz+xbox app opened so need to login to accountz$The controller needs to be paired toz+You need to have a signed in profile pairedz#need to pair controller . quit gamez!_controls/pre_order_new_game2.pngz%found first game warm up or pre orderz_controls/side_menu_opened.pngz)side menu level 1 was opened. i close it.z#Choose the plan thats right for youzselect purchase plan.zLevel up your gaming experiencez"level up gaming experince happend.z$utils/xbox_add_account/yes_im_in.pngz5level up gaming experince found yes im in position :    top_lefti  i  z.Replaying this squad will replace your currentz2reply squad special game message appear. close it.z!_controls/confirm_reply_squad.pngg      ?)sleep_afterz%Click or tap here to continue playingzclick on xbox app to continuez	~/DesktopzXbox.lnk)z successfully claimed your rewardzIMPORTANT NOTICEr+   zSquad Battles Completedz+Here are your rewards for the Squad BattleszStay in touchz!Your trade could not be completedz(Use search filters to narrow your searchz$Items are sent to your Transfer ListzBattle the CommunityzComplete Season Objectivesz#Build your squad to complete MomentzSign-in on this devicez(error = message text from the fifa team z_ea_messages/z)error = message image from the fifa team z_controls/not_linked.pngzerror = not linkedzaccount not linkedz(remove some items from your targets listzerror = transfer target fullztransfer target full	transfersZtransfer_targetsz"_controls/transfers_keep_items.png)	wait_timeztransfer target emptyzwho_are_u.pngz_controls/who_are_u.pngz)side menu level 2 was opened. i close it.zPlayer Pickz+Are you sure you want to select this playerz"error = please select loan. try : z_controls/pick_loan_player.pngzpressing up and crossz	ITEM PICKz!pick item appear , select playersz"_controls/item_pick_reveal_all.pngzpick item with reveal all apperz#all select players must be selectedz*are about to sign a loan player to replacez=seems select loan middle starter pack , pressing up and crosszDo you like the Xbox appzlike xbox appz'_controls/do_you_like_xboxapp_later.pngleftzneed reopen xboxappzwindows_expire.pngz_controls/windows_expire.pngzwindows expire z : error)captionmessage_typezerror on send photo : z**Windows Expire. FIX IT**zYour account has been disabledz3Your account has been blocked from this product duez**Account Disable**zAccount Disable )rE   zuser_name_tmp.pngz$Account Disable selected user, name z -  z*error on send telegram photo. traceback : )r   disable_modezreal account disablezfake Account Disablei,  zDevice Suspendedz!**device suspend**!i  z Is your security info up to datez)xbox ad , your_security_info_update 22 , z/utils/xbox_public/your_security_info_update.png   zLimit Reachedz!**limit reached**!   z/This account is suspended from the Xbox networkz**Account Suspend**)is_done)r   zReset Your Passwordzneed reset passwordztemporary network problemz+temporary network problem , restart consolez(in with the account that bought the gamezyou own this game or appz"To play this, youll need to buy itz'this online, make sure you're signed inz%need to open remote play for key userpsz!login with account success step 5z!login with account success step 6z requires Xbox Game Pass Ultimatezcloud gaming foundz_controls/r2_player_search.pngz_controls/r2_recently_met.pngzconnect page found, press r2.z!connect page found, press circle.z4Make it your home Xbox so you can play games you ownz"connection lost . will press crossz)utils/xbox_public/nothing_come_up_yet.pngz>searching for game in store, goes here wrongly, press 7 circle   zAre you still therezare you still here?z _controls/are_you_still_here.pngz<do you want to sync the last saved data we have in the cloudzdata not synced. try to synczSomething wen wrongzFix it at account.live.comzaccount locked zaccount lockedzBYou need this update to use your console, but something went wrongzos update needz6utils/xbox_public/clear_all_filters_game_not_found.pngz!can not find games , try again , zcan not find gamezCThere was a problem signing in, but it should work if you try againzToo many people are signed inz5too many sign in account in console , restart consolezRedeem your gift cardz/redeem your gift card , how goes here ? its bugz!after press 5 circle state found z%after press 5 circle state not found )raise_errorz Discover your next favorite gamez xbox ad , discover favorite gamez%utils/xbox_public/take_the_survey.pngz#xbox remote play ads . press circlezWhich one do you want to usezwhich_want_use appearzLogin Verificationzneed login verificationzlogin verificationz5utils/xbox_public/login_verification_receive_menu.png)fifa_account__id)	timezone_zerror on totp : zbad app codei zlogin verification code successzno app code)scv2imreadcvtColorCOLOR_BGR2GRAYresizeINTER_CUBICimwriter   get_screen_textr   r   compare_textea_connecting_waittimesleepplatformr   r   console_login_utilsrestart_consoleconsole_open_ultimater   crossstatus_change_timer   	localtime	timedelta
close_gamelogin_to_accountgo_to_state	has_imageospathjoinr   Z press_and_release_right_joystickr2circleuprefresh_from_dbr7   saveget_screen_shotoptiondownrightrC   rangewait_for_imagecreate_clubconsole_accounts_utilslink_origin_accountplay_football_utilsZswap_injury_player	Exceptionduplicate_key_countersbc_solver_instancesend_messageconsoler   cant_find_console_counterr   objectscreatesystemxboxs_go_to_appgetlenr	   Zlogin_with_startr   
expanduserprintlistdirerrorswait_for_imagestrianglesquaremousemoveclickr   name_in_console	traceback
format_excr   r   r   filtercountset_account_suspendsbcworker_setlastr   get_or_createend_timelast_run_timelogin_with_keyreset_to_defaultcan_not_find_gamerL   just_find_stater   idfirstapp_codeintr   r
   	timestamppyotpTOTPatr   str),r   excluded_imagesadd_logrD   imgZgray_scale_screenZcrop_errors_boxZcrop_bottom_buttonsZcrop_remote_errorsZcropped_error_textZcropped_bottom_buttons_textZcropped_remote_errors_textZlast_statusZlast_status_timenmnnnresultiiieZopen_xbox_appyes_positiondesktopZea_message_foundZea_messagesmessage_textZmessage_itemZiitriiiieZnot_now_iconiiiiinlast_done_workeraccount_suspendcreatedieeiZiioZconsole_one_iconZiirZiieeZfound_statebackup_codedb_time	totp_coder   r   r   r      s   
	



















































	













-
'











	























	

























&&

&












$



















































































































 













	



























zConsoleErrorUtils.errors)
small_text
large_textc                 C   sP   |  dddd|  ddddddddddv rLdS d	S )
N, z  rG   '
	TF)lowerreplace)r   r   r   r   r   r   rY   o  s
    .zConsoleErrorUtils.compare_text)NT)__name__
__module____qualname__r   r   r   rY   r   r   r   r   r      s   
          [r   )!ri   r[   r   rQ   r   	django.dbr   django.utilsr   accounts.modelsr   r   r   r   futplus.settingsr   r	   r
   sbcr   sbc.public_methodsr   r   r   r   r   accounts.web_login_utilsr   utils.realy_public_methodsr   namer   r   r   r   r   r   <module>   s   
