def SetChannel(self, ch): self.SetChannelInfo(ch) self.stream.SetConnectInfo(twix_work.IP, self.ChannelPort(ch, 0), twix_work.IP, self.ChannelPort("LOGIN")) net.SetMarkServer(twix_work.IP, self.ChannelPort("LOGO")) app.SetGuildMarkPath("10.tga") app.SetGuildSymbolPath("10") net.SetServerInfo(self.ChannelPort(ch, 2))
def __OnClickChannel4Button(self): global DEINEIP global AUTHPORT global CH4PORT self.stream.SetConnectInfo(DEINEIP, CH4PORT, DEINEIP, AUTHPORT) net.SetServerInfo("Channel 4") net.SetMarkServer(DEINEIP, CH4PORT) self.serverInfo.SetText("Channel 4") app.SetGuildMarkPath("10.tga") app.SetGuildSymbolPath("10")
def __LoadLoginInfo(self, loginInfoFileName): try: loginInfo={} execfile(loginInfoFileName, loginInfo) except IOError: print(\ "자동 로그인을 하시려면" + loginInfoFileName + "파일을 작성해주세요\n"\ "\n"\ "내용:\n"\ "================================================================\n"\ "addr=주소\n"\ "port=포트\n"\ "id=아이디\n"\ "pwd=비밀번호\n"\ "slot=캐릭터 선택 인덱스 (없거나 -1이면 자동 선택 안함)\n"\ "autoLogin=자동 접속 여부\n" "autoSelect=자동 접속 여부\n" "locale=(ymir) LC_Ymir 일경우 ymir로 작동. 지정하지 않으면 korea로 작동\n" ); id=loginInfo.get("id", "") pwd=loginInfo.get("pwd", "") if self.IS_TEST: try: addr=loginInfo["addr"] port=loginInfo["port"] account_addr=addr account_port=port net.SetMarkServer(addr, port) self.__SetServerInfo(locale.CHANNEL_TEST_SERVER_ADDR % (addr, port)) except: try: addr=serverInfo.TESTADDR["ip"] port=serverInfo.TESTADDR["tcp_port"] net.SetMarkServer(addr, port) self.__SetServerInfo(locale.CHANNEL_TEST_SERVER) except: import exception exception.Abort("LoginWindow.__LoadLoginInfo - 테스트서버 주소가 없습니다") else: addr=loginInfo.get("addr", "") port=loginInfo.get("port", 0) account_addr=loginInfo.get("account_addr", addr) account_port=loginInfo.get("account_port", port) locale = loginInfo.get("locale", "") if addr and port: net.SetMarkServer(addr, port) if locale == "ymir" : net.SetServerInfo("천마 서버") self.serverInfo.SetText("Y:"+addr+":"+str(port)) else: net.SetServerInfo(addr+":"+str(port)) self.serverInfo.SetText("K:"+addr+":"+str(port)) slot=loginInfo.get("slot", 0) isAutoLogin=loginInfo.get("auto", 0) isAutoLogin=loginInfo.get("autoLogin", 0) isAutoSelect=loginInfo.get("autoSelect", 0) self.stream.SetCharacterSlot(slot) self.stream.SetConnectInfo(addr, port, account_addr, account_port) self.stream.isAutoLogin=isAutoLogin self.stream.isAutoSelect=isAutoSelect self.id = None self.pwd = None self.loginnedServer = None self.loginnedChannel = None app.loggined = FALSE self.loginInfo = loginInfo if self.id and self.pwd: app.loggined = TRUE if isAutoLogin: self.Connect(id, pwd) print "==================================================================================" print "자동 로그인: %s - %s:%d %s" % (loginInfoFileName, addr, port, id) print "=================================================================================="
def __OnClickSelectServerButton(self): if IsFullBackImage(): self.GetChild("bg1").Hide() self.GetChild("bg2").Show() regionID = self.__GetRegionID() serverID = self.__GetServerID() channelID = self.__GetChannelID() if (not serverInfo.REGION_DICT.has_key(regionID)): self.PopupNotifyMessage(localeInfo.CHANNEL_SELECT_REGION) return if (not serverInfo.REGION_DICT[regionID].has_key(serverID)): self.PopupNotifyMessage(localeInfo.CHANNEL_SELECT_SERVER) return try: channelDict = serverInfo.REGION_DICT[regionID][serverID]["channel"] except KeyError: return try: state = channelDict[channelID]["state"] except KeyError: self.PopupNotifyMessage(localeInfo.CHANNEL_SELECT_CHANNEL) return # 상태가 FULL 과 같으면 진입 금지 if state == serverInfo.STATE_DICT[3]: self.PopupNotifyMessage(localeInfo.CHANNEL_NOTIFY_FULL) return self.__SaveChannelInfo() try: serverName = serverInfo.REGION_DICT[regionID][serverID]["name"] channelName = serverInfo.REGION_DICT[regionID][serverID]["channel"][channelID]["name"] addrKey = serverInfo.REGION_DICT[regionID][serverID]["channel"][channelID]["key"] if "천마 서버" == serverName: app.ForceSetLocale("ymir", "locale/ymir") elif "쾌도 서버" == serverName: app.ForceSetLocale("we_korea", "locale/we_korea") except: print " ERROR __OnClickSelectServerButton(%d, %d, %d)" % (regionID, serverID, channelID) serverName = localeInfo.CHANNEL_EMPTY_SERVER channelName = localeInfo.CHANNEL_NORMAL % channelID self.__SetServerInfo("%s, %s " % (serverName, channelName)) try: ip = serverInfo.REGION_DICT[regionID][serverID]["channel"][channelID]["ip"] tcp_port = serverInfo.REGION_DICT[regionID][serverID]["channel"][channelID]["tcp_port"] except: import exception exception.Abort("LoginWindow.__OnClickSelectServerButton - 서버 선택 실패") try: account_ip = serverInfo.REGION_AUTH_SERVER_DICT[regionID][serverID]["ip"] account_port = serverInfo.REGION_AUTH_SERVER_DICT[regionID][serverID]["port"] except: account_ip = 0 account_port = 0 try: markKey = regionID*1000 + serverID*10 markAddrValue=serverInfo.MARKADDR_DICT[markKey] net.SetMarkServer(markAddrValue["ip"], markAddrValue["tcp_port"]) app.SetGuildMarkPath(markAddrValue["mark"]) # GUILD_SYMBOL app.SetGuildSymbolPath(markAddrValue["symbol_path"]) # END_OF_GUILD_SYMBOL except: import exception exception.Abort("LoginWindow.__OnClickSelectServerButton - 마크 정보 없음") if app.USE_OPENID and not app.OPENID_TEST : ## 2012.07.19 OpenID : 김용욱 # 채널 선택 화면에서 "확인"(SelectServerButton) 을 눌렀을때, # 로그인 화면으로 넘어가지 않고 바로 서버에 OpenID 인증키를 보내도록 수정 self.stream.SetConnectInfo(ip, tcp_port, account_ip, account_port) self.Connect(0, 0) else : self.stream.SetConnectInfo(ip, tcp_port, account_ip, account_port) self.__OpenLoginBoard()
def __LoadLoginInfo(self, loginInfoFileName): def getValue(element, name, default): if [] != element.getElementsByTagName(name): return element.getElementsByTagName(name).item( 0).firstChild.nodeValue else: return default self.id = None self.pwd = None self.loginnedServer = None self.loginnedChannel = None app.loggined = False self.loginInfo = True from xml.dom.minidom import parse try: f = old_open(loginInfoFileName, "r") dom = parse(f) except: return serverLst = dom.getElementsByTagName("server") if [] != dom.getElementsByTagName("logininfo"): logininfo = dom.getElementsByTagName("logininfo")[0] else: return try: server_name = logininfo.getAttribute("name") channel_idx = int(logininfo.getAttribute("channel_idx")) except: return try: matched = False for k, v in serverInfo.REGION_DICT[0].iteritems(): if v["name"] == server_name: account_addr = serverInfo.REGION_AUTH_SERVER_DICT[0][k][ "ip"] account_port = serverInfo.REGION_AUTH_SERVER_DICT[0][k][ "port"] channel_info = v["channel"][channel_idx] channel_name = channel_info["name"] addr = channel_info["ip"] port = channel_info["tcp_port"] net.SetMarkServer(addr, port) self.stream.SetConnectInfo(addr, port, account_addr, account_port) matched = True break if False == matched: return except: return self.__SetServerInfo("%s, %s " % (server_name, channel_name)) id = getValue(logininfo, "id", "") pwd = getValue(logininfo, "pwd", "") self.idEditLine.SetText(id) self.pwdEditLine.SetText(pwd) slot = getValue(logininfo, "slot", "0") locale = getValue(logininfo, "locale", "") locale_dir = getValue(logininfo, "locale_dir", "") is_auto_login = int(getValue(logininfo, "auto_login", "0")) self.stream.SetCharacterSlot(int(slot)) self.stream.isAutoLogin = is_auto_login self.stream.isAutoSelect = is_auto_login if locale and locale_dir: app.ForceSetLocale(locale, locale_dir) if 0 != is_auto_login: self.Connect(id, pwd) return
def __LoadLoginInfo(self, loginInfoFileName): try: loginInfo = {} execfile(loginInfoFileName, loginInfo) except IOError: print(\ "ÀÚµ¿ ·Î±×ÀÎÀ» ÇϜ÷Ážé" + loginInfoFileName + "ÆÄÀÏÀ» ÀÛŒºÇØÁÖŒŒ¿ä\n"\ "\n"\ "³»¿ë:\n"\ "================================================================\n"\ "addr=ÁÖŒÒ\n"\ "port=Æ÷Æ®\n"\ "id=ŸÆÀ̵ð\n"\ "pwd=ºñ¹Ð¹øÈ£\n"\ "slot=ijž¯ÅÍ Œ±Åà ÀεŠœº (Ÿø°Å³ª -1ÀÌžé ÀÚµ¿ Œ±Åà ŸÈÇÔ)\n"\ "autoLogin=ÀÚµ¿ Á¢ŒÓ ¿©ºÎ\n" "autoSelect=ÀÚµ¿ Á¢ŒÓ ¿©ºÎ\n" "locale=(ymir) LC_Ymir ÀÏ°æ¿ì ymir·Î ÀÛµ¿. ÁöÁ€ÇÏÁö ŸÊÀžžé korea·Î ÀÛµ¿\n" ) id = loginInfo.get("id", "") pwd = loginInfo.get("pwd", "") if self.IS_TEST: try: addr = loginInfo["addr"] port = loginInfo["port"] account_addr = addr account_port = port net.SetMarkServer(addr, port) self.__SetServerInfo(locale.CHANNEL_TEST_SERVER_ADDR % (addr, port)) except: try: addr = serverInfo.TESTADDR["ip"] port = serverInfo.TESTADDR["tcp_port"] net.SetMarkServer(addr, port) self.__SetServerInfo(locale.CHANNEL_TEST_SERVER) except: import exception exception.Abort( "LoginWindow.__LoadLoginInfo - ÅלºÆ®Œ¹ö Á֌Ұ¡ ŸøœÀŽÏŽÙ" ) else: addr = loginInfo.get("addr", "") port = loginInfo.get("port", 0) account_addr = loginInfo.get("account_addr", addr) account_port = loginInfo.get("account_port", port) locale = loginInfo.get("locale", "") if addr and port: net.SetMarkServer(addr, port) if locale == "ymir": net.SetServerInfo("õž¶ Œ¹ö") else: net.SetServerInfo(addr + ":" + str(port)) slot = loginInfo.get("slot", 0) isAutoLogin = loginInfo.get("auto", 0) isAutoLogin = loginInfo.get("autoLogin", 0) isAutoSelect = loginInfo.get("autoSelect", 0) self.stream.SetCharacterSlot(slot) self.stream.SetConnectInfo(addr, port, account_addr, account_port) self.stream.isAutoLogin = isAutoLogin self.stream.isAutoSelect = isAutoSelect self.id = None self.pwd = None self.loginnedServer = None self.loginnedChannel = None app.loggined = FALSE self.loginInfo = loginInfo if self.id and self.pwd: app.loggined = TRUE if isAutoLogin: self.Connect(id, pwd) print "==================================================================================" print "ÀÚµ¿ ·Î±×ÀÎ: %s - %s:%d %s" % (loginInfoFileName, addr, port, id) print "=================================================================================="
def __OnClickSelectServerButton(self): if IsFullBackImage(): self.GetChild("bg1").Show() self.GetChild("bg2").Hide() regionID = self.__GetRegionID() serverID = self.__GetServerID() channelID = self.__GetChannelID() if (not serverInfo.REGION_DICT.has_key(regionID)): self.PopupNotifyMessage(locale.CHANNEL_SELECT_REGION) return if (not serverInfo.REGION_DICT[regionID].has_key(serverID)): self.PopupNotifyMessage(locale.CHANNEL_SELECT_SERVER) return try: channelDict = serverInfo.REGION_DICT[regionID][serverID]["channel"] except KeyError: return try: state = channelDict[channelID]["state"] except KeyError: self.PopupNotifyMessage(locale.CHANNEL_SELECT_CHANNEL) return # »óÅ°¡ FULL °ú °°Àžžé ÁøÀÔ ±ÝÁö if state == serverInfo.STATE_DICT[3]: self.PopupNotifyMessage(locale.CHANNEL_NOTIFY_FULL) return self.__SaveChannelInfo() try: channelName = serverInfo.REGION_DICT[regionID][serverID][ "channel"][channelID]["name"] addrKey = serverInfo.REGION_DICT[regionID][serverID]["channel"][ channelID]["key"] except: print " ERROR __OnClickSelectServerButton(%d, %d, %d)" % ( regionID, serverID, channelID) channelName = locale.CHANNEL_NORMAL % channelID self.__SetServerInfo("%s, %s " % (channelName)) try: ip = serverInfo.REGION_DICT[regionID][serverID]["channel"][ channelID]["ip"] tcp_port = serverInfo.REGION_DICT[regionID][serverID]["channel"][ channelID]["tcp_port"] except: import exception exception.Abort( "LoginWindow.__OnClickSelectServerButton - Œ¹ö Œ±Åà œÇÆÐ") try: account_ip = serverInfo.REGION_AUTH_SERVER_DICT[regionID][ serverID]["ip"] account_port = serverInfo.REGION_AUTH_SERVER_DICT[regionID][ serverID]["port"] except: account_ip = 0 account_port = 0 try: markKey = regionID * 1000 + serverID * 10 markAddrValue = serverInfo.MARKADDR_DICT[markKey] net.SetMarkServer(markAddrValue["ip"], markAddrValue["tcp_port"]) app.SetGuildMarkPath(markAddrValue["mark"]) # GUILD_SYMBOL app.SetGuildSymbolPath(markAddrValue["symbol_path"]) # END_OF_GUILD_SYMBOL except: import exception exception.Abort( "LoginWindow.__OnClickSelectServerButton - ž¶Å© Á€ºž ŸøÀœ") self.stream.SetConnectInfo(ip, tcp_port, account_ip, account_port) self.__OpenLoginBoard()
def __OpenServerBoard(self): global DEINEIP global CH1PORT global AUTHPORT global CH2PORT global CHANNELAZ self.stream.SetConnectInfo(DEINEIP, CH1PORT, DEINEIP, AUTHPORT) net.SetServerInfo("Channel 1") net.SetMarkServer(DEINEIP, CH1PORT) self.serverInfo.SetText("Channel 1") app.SetGuildMarkPath("10.tga") app.SetGuildSymbolPath("10") self.Channel1Button.SetEvent( ui.__mem_func__(self.__OnClickChannel1Button)) self.Channel2Button.SetEvent( ui.__mem_func__(self.__OnClickChannel2Button)) self.Channel3Button.SetEvent( ui.__mem_func__(self.__OnClickChannel3Button)) self.Channel4Button.SetEvent( ui.__mem_func__(self.__OnClickChannel4Button)) if CHANNELAZ == 1: self.Channel2Button.Hide() self.Channel3Button.Hide() self.Channel4Button.Hide() elif CHANNELAZ == 2: self.Channel3Button.Hide() self.Channel4Button.Hide() elif CHANNELAZ == 3: self.Channel4Button.Hide() self.BGBoard.Hide() print "XMAS_SNOW ON" background.EnableSnow(1) self.serverExitButton.SetEvent( ui.__mem_func__(self.__OnClickExitServerButton)) self.serverExitButton.SetText(locale.UI_CLOSE) # RUNUP_MATRIX_AUTH if IsRunupMatrixAuth(): self.matrixQuizBoard.Hide() # RUNUP_MATRIX_AUTH_END # NEWCIBN_PASSPOD_AUTH if IsNEWCIBNPassPodAuth(): self.passpodBoard.Hide() # NEWCIBN_PASSPOD_AUTH_END self.serverBoard.SetPosition(self.xServerBoard, wndMgr.GetScreenHeight()) self.serverBoard.Hide() if self.virtualKeyboard: self.virtualKeyboard.Show() self.AccountBoard.Show() self.AccEditBoard.Hide() self.__LoadACCNames() if app.loggined: self.Connect(self.id, self.pwd) self.connectBoard.Hide() self.loginBoard.Hide() elif not self.stream.isAutoLogin: self.connectBoard.Show() self.loginBoard.Show() ## if users have the login infomation, then don't initialize.2005.9 haho if self.idEditLine == None: self.idEditLine.SetText("") if self.pwdEditLine == None: self.pwdEditLine.SetText("") self.idEditLine.SetFocus() global SKIP_LOGIN_PHASE if SKIP_LOGIN_PHASE: if not self.loginInfo: self.connectBoard.Hide()