1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
   | #-*- coding:Utf-8 -*-
from Tkinter import *
import os
fichier_config= open('config.ini', 'r')
contenu = fichier_config.readlines()
fichier_config.close ()
 
try:
	hostloc = str(contenu[1][0:len(contenu[1])-1]) # emplacement host
	gameloc = str(contenu[2][0:len(contenu[2])-1]) #emplacement game
	ipadress = str(contenu[3][0:len(contenu[3])-1]) #adresse ip
	core = str(contenu[4][0:len(contenu[4])-1])#no version	
 
except:
	print "ERREUR! veuillez verifiez le fichier config.ini"
def patcher(choix) :
        if choix ==1 :
                host= open(hostloc, "a")
                host.close()
                host= open(hostloc, "w")
                host.write('127.0.0.1 localhost\n')
                host.write(ipadress +' l2authd.lineage2.com\n')
                host.write(ipadress +' L2testauthd.lineage2.com\n')
                host.write('216.107.250.194 nprotect.lineage2.com\n')
        elif choix ==2 :                
                os.startfile(gameloc)
 
def config() :
    fenetre2 = Tk()
    fenetre2.title('Modifiez...  ' + core)
    txt1 = Label(fenetre2, text = 'Jeu :').grid(row=0, sticky =E)
    txt2 = Label(fenetre2, text = 'Ip  :').grid(row=1, sticky =E)
    entr1 = Entry(fenetre2).grid(row =0, column =1)
    entr2 = Entry(fenetre2).grid(row= 1, column =1)
    bouton4 =Button(fenetre2, text= '  Ok  ', command =configadd).grid(row=2, column=1, sticky =E)
    fenetre2.mainloop()
    fenetre2.destroy()
def configadd() :
	global entr2
	ipadress = str(entr2.get())
	host= open(hostloc, "a")
        host.close()
        host= open(hostloc, "w")
        host.write('127.0.0.1 localhost\n')
        host.write(ipadress +' l2authd.lineage2.com\n')
	host.write(ipadress +' L2testauthd.lineage2.com\n')
	host.write('216.107.250.194 nprotect.lineage2.com\n')
 
# affichage Tk
fenetre = Tk()
# image
can1 = Canvas(fenetre, width =500, height =250, bg ='gray')
photo = PhotoImage(file ='header.gif')
item = can1.create_image(250, 125, image =photo)
#image
fenetre.title('l2-Luncher by Noquioz  ' + core)
can1.pack()
bouton1 = Button(fenetre, text='Patch', command = (lambda: patcher(1))).pack(side =BOTTOM)
bouton2 = Button(fenetre, text='Play', command = (lambda: patcher(2))).pack(side =BOTTOM)
bouton3 = Button(fenetre, text='Option', command =config).pack(side =BOTTOM)
chaine = Label(fenetre)
chaine.pack()
fenetre.mainloop()
fenetre.destroy() | 
Partager