From 2a612c97ad299ae92364d0e182dee349c4f91c38 Mon Sep 17 00:00:00 2001 From: d1str4ught <> Date: Thu, 28 Aug 2025 20:13:58 +0200 Subject: [PATCH] openid removed --- src/common/length.h | 2 - src/game/config.cpp | 24 --- src/game/db.cpp | 317 +-------------------------------------- src/game/db.h | 2 - src/game/input.h | 3 - src/game/input_auth.cpp | 292 ------------------------------------ src/game/input_db.cpp | 42 +----- src/game/packet.h | 19 --- src/game/packet_info.cpp | 1 - 9 files changed, 4 insertions(+), 698 deletions(-) diff --git a/src/common/length.h b/src/common/length.h index 10f01ae..1f9e872 100644 --- a/src/common/length.h +++ b/src/common/length.h @@ -72,8 +72,6 @@ enum EMisc //END_LIMIT_GOLD - OPENID_AUTHKEY_LEN = 32, - SHOP_TAB_NAME_MAX = 32, SHOP_TAB_COUNT_MAX = 3, diff --git a/src/game/config.cpp b/src/game/config.cpp index c585cf9..e3142ce 100644 --- a/src/game/config.cpp +++ b/src/game/config.cpp @@ -126,15 +126,8 @@ bool g_protectNormalPlayer = false; // 범법자가 "평화 bool g_noticeBattleZone = false; // 중립지대에 입장하면 안내메세지를 알려줌 int gPlayerMaxLevel = 99; - bool g_BlockCharCreation = false; - -//OPENID -int openid_server = 0; -char openid_host[256]; -char openid_uri[256]; - bool is_string_true(const char * string) { bool result = 0; @@ -528,23 +521,6 @@ void config_init(const string& st_localeServiceName) g_stAdminPagePassword = value_string; } - //OPENID - TOKEN("WEB_AUTH") - { - const char* line = two_arguments(value_string, openid_host, sizeof(openid_host), openid_uri, sizeof(openid_uri)); - - if (!*openid_host || !*openid_uri) - { - fprintf(stderr, "WEB_AUTH syntax error (ex: WEB_AUTH \n"); - exit(1); - } - - char buf[1024]; - openid_server = 1; - snprintf(buf, sizeof(buf), "WEB_AUTH: %s %s", openid_host, openid_uri); - continue; - } - TOKEN("empire_whisper") { bool b_value = 0; diff --git a/src/game/db.cpp b/src/game/db.cpp index 03a3c47..9440843 100644 --- a/src/game/db.cpp +++ b/src/game/db.cpp @@ -23,7 +23,6 @@ extern bool g_bNoPasspod; extern std::string g_stBlockDate; -extern int openid_server; //중국 passpod 전용 함수 bool CheckPasspod(const char * account) @@ -698,22 +697,9 @@ void DBManager::AnalyzeReturnQuery(SQLMsg * pMsg) if (pMsg->Get()->uiNumRows == 0) { - if (true == LC_IsBrazil()) - { - // 계정이 없으면 새로 만들어야 한다 - ReturnQuery(QID_BRAZIL_CREATE_ID, qi->dwIdent, pinfo, - "INSERT INTO account(login, password, social_id, create_time) " - "VALUES('%s', password('%s'), '0000000', NOW()) ;", - pinfo->login, pinfo->passwd); - - sys_log(0, "[AUTH_BRAZIL] : Create A new AccountID From OnGame"); - } - else - { - sys_log(0, " NOID"); - LoginFailure(d, "NOID"); - M2_DELETE(pinfo); - } + sys_log(0, " NOID"); + LoginFailure(d, "NOID"); + M2_DELETE(pinfo); } else { @@ -898,238 +884,6 @@ void DBManager::AnalyzeReturnQuery(SQLMsg * pMsg) } } break; - case QID_AUTH_LOGIN_OPENID: - { - TPacketCGLogin3 * pinfo = (TPacketCGLogin3 *) qi->pvData; - LPDESC d = DESC_MANAGER::instance().FindByLoginKey(qi->dwIdent); - - if (!d) - { - M2_DELETE(pinfo); - break; - } - //위치 변경 - By SeMinZ - d->SetLogin(pinfo->login); - - sys_log(0, "QID_AUTH_LOGIN_OPENID: START %u %p", qi->dwIdent, get_pointer(d)); - - if (pMsg->Get()->uiNumRows == 0) - { - if (true == LC_IsBrazil()) - { - // 계정이 없으면 새로 만들어야 한다 - ReturnQuery(QID_BRAZIL_CREATE_ID, qi->dwIdent, pinfo, - "INSERT INTO account(login, password, social_id, create_time) " - "VALUES('%s', password('%s'), '0000000', NOW()) ;", - pinfo->login, pinfo->passwd); - - sys_log(0, "[AUTH_BRAZIL] : Create A new AccountID From OnGame"); - } else if (true == LC_IsJapan()) - { - // 계정이 없으면 새로 만들어야 한다 - ReturnQuery(QID_JAPAN_CREATE_ID, qi->dwIdent, pinfo, - "INSERT INTO account(login, password, social_id, create_time) " - "VALUES('%s', password('%s'), '0000000', NOW()) ;", - pinfo->login, "^Aasl@(!$)djl!231fj!&#"); - - sys_log(0, "[AUTH_JAPAN] : Create A new AccountID From OGE"); - } - else - { - sys_log(0, " NOID"); - LoginFailure(d, "NOID"); - M2_DELETE(pinfo); - } - } - else - { - MYSQL_ROW row = mysql_fetch_row(pMsg->Get()->pSQLResult); - int col = 0; - - // PASSWORD('%s'), password, securitycode, social_id, id, status - char szEncrytPassword[45 + 1]; - char szPassword[45 + 1]; - char szMatrixCode[MATRIX_CODE_MAX_LEN + 1]; - char szSocialID[SOCIAL_ID_MAX_LEN + 1]; - char szStatus[ACCOUNT_STATUS_MAX_LEN + 1]; - DWORD dwID = 0; - - if (!row[col]) - { - sys_err("error column %d", col); - M2_DELETE(pinfo); - break; - } - - strlcpy(szEncrytPassword, row[col++], sizeof(szEncrytPassword)); - - if (!row[col]) - { - sys_err("error column %d", col); - M2_DELETE(pinfo); - break; - } - - strlcpy(szPassword, row[col++], sizeof(szPassword)); - - if (!row[col]) - { - *szMatrixCode = '\0'; - col++; - } - else - { - strlcpy(szMatrixCode, row[col++], sizeof(szMatrixCode)); - } - - if (!row[col]) - { - sys_err("error column %d", col); - M2_DELETE(pinfo); - break; - } - - strlcpy(szSocialID, row[col++], sizeof(szSocialID)); - - if (!row[col]) - { - sys_err("error column %d", col); - M2_DELETE(pinfo); - break; - } - - str_to_number(dwID, row[col++]); - - if (!row[col]) - { - sys_err("error column %d", col); - M2_DELETE(pinfo); - break; - } - - strlcpy(szStatus, row[col++], sizeof(szStatus)); - - BYTE bNotAvail = 0; - str_to_number(bNotAvail, row[col++]); - - int aiPremiumTimes[PREMIUM_MAX_NUM]; - memset(&aiPremiumTimes, 0, sizeof(aiPremiumTimes)); - - char szCreateDate[256] = "00000000"; - - if (!g_iUseLocale) - { - str_to_number(aiPremiumTimes[PREMIUM_EXP], row[col++]); - str_to_number(aiPremiumTimes[PREMIUM_ITEM], row[col++]); - str_to_number(aiPremiumTimes[PREMIUM_SAFEBOX], row[col++]); - str_to_number(aiPremiumTimes[PREMIUM_AUTOLOOT], row[col++]); - str_to_number(aiPremiumTimes[PREMIUM_FISH_MIND], row[col++]); - str_to_number(aiPremiumTimes[PREMIUM_MARRIAGE_FAST], row[col++]); - str_to_number(aiPremiumTimes[PREMIUM_GOLD], row[col++]); - } - else - { - str_to_number(aiPremiumTimes[PREMIUM_EXP], row[col++]); - str_to_number(aiPremiumTimes[PREMIUM_ITEM], row[col++]); - str_to_number(aiPremiumTimes[PREMIUM_SAFEBOX], row[col++]); - str_to_number(aiPremiumTimes[PREMIUM_AUTOLOOT], row[col++]); - str_to_number(aiPremiumTimes[PREMIUM_FISH_MIND], row[col++]); - str_to_number(aiPremiumTimes[PREMIUM_MARRIAGE_FAST], row[col++]); - str_to_number(aiPremiumTimes[PREMIUM_GOLD], row[col++]); - - if (LC_IsEurope() || test_server) - { - long retValue = 0; - str_to_number(retValue, row[col]); - - time_t create_time = retValue; - struct tm * tm1; - tm1 = localtime(&create_time); - strftime(szCreateDate, 255, "%Y%m%d", tm1); - - sys_log(0, "Create_Time %d %s", retValue, szCreateDate); - sys_log(0, "Block Time %d ", strncmp(szCreateDate, g_stBlockDate.c_str(), 8)); - } - } - - int nPasswordDiff = strcmp(szEncrytPassword, szPassword); - - if (true == LC_IsBrazil()) - { - nPasswordDiff = 0; // 브라질 버전에서는 비밀번호 체크를 하지 않는다. - } - - //OpenID : OpenID 의 경우, 비밀번호 체크를 하지 않는다. - if (openid_server) - { - nPasswordDiff = 0; - } - - if (nPasswordDiff) - { - LoginFailure(d, "WRONGPWD"); - sys_log(0, " WRONGPWD"); - M2_DELETE(pinfo); - } - else if (bNotAvail) - { - LoginFailure(d, "NOTAVAIL"); - sys_log(0, " NOTAVAIL"); - M2_DELETE(pinfo); - } - else if (DESC_MANAGER::instance().FindByLoginName(pinfo->login)) - { - LoginFailure(d, "ALREADY"); - sys_log(0, " ALREADY"); - M2_DELETE(pinfo); - } - else if (strcmp(szStatus, "OK")) - { - LoginFailure(d, szStatus); - sys_log(0, " STATUS: %s", szStatus); - M2_DELETE(pinfo); - } - else - { - if (LC_IsEurope()) - { - //stBlockData >= 0 == 날짜가 BlockDate 보다 미래 - if (strncmp(szCreateDate, g_stBlockDate.c_str(), 8) >= 0) - { - LoginFailure(d, "BLKLOGIN"); - sys_log(0, " BLKLOGIN"); - M2_DELETE(pinfo); - break; - } - - char szQuery[1024]; - snprintf(szQuery, sizeof(szQuery), "UPDATE account SET last_play=NOW() WHERE id=%u", dwID); - std::unique_ptr msg( DBManager::instance().DirectQuery(szQuery) ); - } - - TAccountTable & r = d->GetAccountTable(); - - r.id = dwID; - trim_and_lower(pinfo->login, r.login, sizeof(r.login)); - strlcpy(r.passwd, pinfo->passwd, sizeof(r.passwd)); - strlcpy(r.social_id, szSocialID, sizeof(r.social_id)); - DESC_MANAGER::instance().ConnectAccount(r.login, d); - - d->SetMatrixCode(szMatrixCode); - - if (!g_bBilling) - { - LoginPrepare(BILLING_FREE, 0, 0, d, pinfo->adwClientKey, aiPremiumTimes); - //By SeMinZ - M2_DELETE(pinfo); - break; - } - - sys_log(0, "QID_AUTH_LOGIN_OPENID: SUCCESS %s", pinfo->login); - } - } - } - break; case QID_BILLING_GET_TIME: { @@ -1432,73 +1186,8 @@ void DBManager::AnalyzeReturnQuery(SQLMsg * pMsg) } } break; - - // END_OF_PCBANG_IP_LIST - case QID_BRAZIL_CREATE_ID : - { - TPacketCGLogin3 * pinfo = (TPacketCGLogin3 *) qi->pvData ; - - if( pMsg->Get()->uiAffectedRows == 0 || pMsg->Get()->uiAffectedRows == (uint32_t)-1 ) - { - LPDESC d = DESC_MANAGER::instance().FindByLoginKey(qi->dwIdent) ; - sys_log(0, "[AUTH_BRAZIL] NOID") ; - sys_log(0, "[AUTH_BRAZIL] : Failed to create a new account %s", pinfo->login) ; - LoginFailure(d, "NOID") ; - M2_DELETE(pinfo); - } - else - { - sys_log(0, "[AUTH_BRAZIL] : Succeed to create a new account %s", pinfo->login) ; - - ReturnQuery(QID_AUTH_LOGIN, qi->dwIdent, pinfo, - "SELECT PASSWORD('%s'),password,securitycode,social_id,id,status,availDt - NOW() > 0," - "UNIX_TIMESTAMP(silver_expire)," - "UNIX_TIMESTAMP(gold_expire)," - "UNIX_TIMESTAMP(safebox_expire)," - "UNIX_TIMESTAMP(autoloot_expire)," - "UNIX_TIMESTAMP(fish_mind_expire)," - "UNIX_TIMESTAMP(marriage_fast_expire)," - "UNIX_TIMESTAMP(money_drop_rate_expire)," - "UNIX_TIMESTAMP(create_time)" - " FROM account WHERE login='%s'", - pinfo->passwd, pinfo->login) ; - } - } - break; - case QID_JAPAN_CREATE_ID : - { - TPacketCGLogin3 * pinfo = (TPacketCGLogin3 *) qi->pvData ; - - if( pMsg->Get()->uiAffectedRows == 0 || pMsg->Get()->uiAffectedRows == (uint32_t)-1 ) - { - LPDESC d = DESC_MANAGER::instance().FindByLoginKey(qi->dwIdent) ; - sys_log(0, "[AUTH_JAPAN] NOID") ; - sys_log(0, "[AUTH_JAPAN] : Failed to create a new account %s", pinfo->login) ; - LoginFailure(d, "NOID") ; - M2_DELETE(pinfo); - } - else - { - sys_log(0, "[AUTH_JAPAN] : Succeed to create a new account %s", pinfo->login) ; - - ReturnQuery(QID_AUTH_LOGIN_OPENID, qi->dwIdent, pinfo, - "SELECT PASSWORD('%s'),password,securitycode,social_id,id,status,availDt - NOW() > 0," - "UNIX_TIMESTAMP(silver_expire)," - "UNIX_TIMESTAMP(gold_expire)," - "UNIX_TIMESTAMP(safebox_expire)," - "UNIX_TIMESTAMP(autoloot_expire)," - "UNIX_TIMESTAMP(fish_mind_expire)," - "UNIX_TIMESTAMP(marriage_fast_expire)," - "UNIX_TIMESTAMP(money_drop_rate_expire)," - "UNIX_TIMESTAMP(create_time)" - " FROM account WHERE login='%s'", - pinfo->passwd, pinfo->login) ; - } - } - break; - default: sys_err("FATAL ERROR!!! Unhandled return query id %d", qi->iType); break; diff --git a/src/game/db.h b/src/game/db.h index bfd05eb..daef6e7 100644 --- a/src/game/db.h +++ b/src/game/db.h @@ -16,7 +16,6 @@ enum QID_SAFEBOX_SIZE, QID_DB_STRING, QID_AUTH_LOGIN, - QID_AUTH_LOGIN_OPENID, QID_LOTTO, QID_HIGHSCORE_REGISTER, QID_HIGHSCORE_SHOW, @@ -37,7 +36,6 @@ enum // END_PROTECT_CHILD_FOR_NEWCIBN QID_BRAZIL_CREATE_ID, - QID_JAPAN_CREATE_ID, }; typedef struct SUseTime diff --git a/src/game/input.h b/src/game/input.h index 9ae928d..896567a 100644 --- a/src/game/input.h +++ b/src/game/input.h @@ -234,7 +234,6 @@ protected: void ChangeName(LPDESC d, const char * data); void AuthLogin(LPDESC d, const char * c_pData); - void AuthLoginOpenID(LPDESC d, const char * c_pData); void ItemAward(const char * c_pData); void ChangeEmpirePriv(const char* c_pData); @@ -366,11 +365,9 @@ class CInputAuth : public CInputProcessor protected: virtual int Analyze(LPDESC d, BYTE bHeader, const char * c_pData); - int auth_OpenID(const char *authKey, const char *ipAddr, char *rID); public: void Login(LPDESC d, const char * c_pData); - void LoginOpenID(LPDESC d, const char * c_pData); //2012.07.19 OpenID : 김용욱 void PasspodAnswer(LPDESC d, const char * c_pData ); }; diff --git a/src/game/input_auth.cpp b/src/game/input_auth.cpp index 5a76cfa..e0fc894 100644 --- a/src/game/input_auth.cpp +++ b/src/game/input_auth.cpp @@ -16,7 +16,6 @@ #endif extern time_t get_global_time(); -extern int openid_server; bool FN_IS_VALID_LOGIN_STRING(const char *str) { @@ -238,289 +237,6 @@ void CInputAuth::Login(LPDESC d, const char * c_pData) } } -void CInputAuth::LoginOpenID(LPDESC d, const char * c_pData) -{ - extern bool Metin2Server_IsInvalid(); - -#ifdef ENABLE_LIMIT_TIME - if (Metin2Server_IsInvalid()) - { - extern void ClearAdminPages(); - ClearAdminPages(); - exit(1); - return; - } -#endif - //OpenID test code. - TPacketCGLogin5 *tempInfo1 = (TPacketCGLogin5 *)c_pData; - - //일본 웹 서버에 인증키 확인 요청을 보낸다. - char* authKey = tempInfo1->authKey; - char returnID[LOGIN_MAX_LEN + 1] = {0}; - - int test_url_get_protocol = auth_OpenID(authKey, inet_ntoa(d->GetAddr().sin_addr), returnID); - - //인증 실패. 에러 처리 - if (0!=test_url_get_protocol) - { - LoginFailure(d, "OpenID Fail"); - return; - } - - TPacketCGLogin3 tempInfo2; - strncpy(tempInfo2.login, returnID, LOGIN_MAX_LEN); - strncpy(tempInfo2.passwd, "0000", PASSWD_MAX_LEN); - for(int i=0;i<4;i++) - tempInfo2.adwClientKey[i] = tempInfo1->adwClientKey[i]; - TPacketCGLogin3 * pinfo = &tempInfo2; - - if (!g_bAuthServer) - { - sys_err ("CInputAuth class is not for game server. IP %s might be a hacker.", - inet_ntoa(d->GetAddr().sin_addr)); - d->DelayedDisconnect(5); - return; - } - - // string 무결성을 위해 복사 - char login[LOGIN_MAX_LEN + 1]; - trim_and_lower(pinfo->login, login, sizeof(login)); - - char passwd[PASSWD_MAX_LEN + 1]; - strlcpy(passwd, pinfo->passwd, sizeof(passwd)); - - sys_log(0, "InputAuth::Login : %s(%d) desc %p", - login, strlen(login), get_pointer(d)); - - // check login string - if (false == FN_IS_VALID_LOGIN_STRING(login)) - { - sys_log(0, "InputAuth::Login : IS_NOT_VALID_LOGIN_STRING(%s) desc %p", - login, get_pointer(d)); - LoginFailure(d, "NOID"); - return; - } - - if (g_bNoMoreClient) - { - TPacketGCLoginFailure failurePacket; - - failurePacket.header = HEADER_GC_LOGIN_FAILURE; - strlcpy(failurePacket.szStatus, "SHUTDOWN", sizeof(failurePacket.szStatus)); - - d->Packet(&failurePacket, sizeof(failurePacket)); - return; - } - - if (DESC_MANAGER::instance().FindByLoginName(login)) - { - LoginFailure(d, "ALREADY"); - return; - } - - DWORD dwKey = DESC_MANAGER::instance().CreateLoginKey(d); - DWORD dwPanamaKey = dwKey ^ pinfo->adwClientKey[0] ^ pinfo->adwClientKey[1] ^ pinfo->adwClientKey[2] ^ pinfo->adwClientKey[3]; - d->SetPanamaKey(dwPanamaKey); - - sys_log(0, "InputAuth::Login : key %u:0x%x login %s", dwKey, dwPanamaKey, login); - - // BRAZIL_AUTH - if (LC_IsBrazil() && !test_server) - { - int result = auth_brazil(login, passwd); - - switch (result) - { - case AUTH_BRAZIL_SERVER_ERR: - case AUTH_BRAZIL_NOID: - LoginFailure(d, "NOID"); - return; - case AUTH_BRAZIL_WRONGPWD: - LoginFailure(d, "WRONGPWD"); - return; - case AUTH_BRAZIL_FLASHUSER: - LoginFailure(d, "FLASH"); - return; - } - } - - TPacketCGLogin3 * p = M2_NEW TPacketCGLogin3; - thecore_memcpy(p, pinfo, sizeof(TPacketCGLogin3)); - - char szPasswd[PASSWD_MAX_LEN * 2 + 1]; - DBManager::instance().EscapeString(szPasswd, sizeof(szPasswd), passwd, strlen(passwd)); - - char szLogin[LOGIN_MAX_LEN * 2 + 1]; - DBManager::instance().EscapeString(szLogin, sizeof(szLogin), login, strlen(login)); - - // CHANNEL_SERVICE_LOGIN - if (Login_IsInChannelService(szLogin)) - { - sys_log(0, "ChannelServiceLogin [%s]", szLogin); - - DBManager::instance().ReturnQuery(QID_AUTH_LOGIN_OPENID, dwKey, p, - "SELECT '%s',password,securitycode,social_id,id,status,availDt - NOW() > 0," - "UNIX_TIMESTAMP(silver_expire)," - "UNIX_TIMESTAMP(gold_expire)," - "UNIX_TIMESTAMP(safebox_expire)," - "UNIX_TIMESTAMP(autoloot_expire)," - "UNIX_TIMESTAMP(fish_mind_expire)," - "UNIX_TIMESTAMP(marriage_fast_expire)," - "UNIX_TIMESTAMP(money_drop_rate_expire)," - "UNIX_TIMESTAMP(create_time)" - " FROM account WHERE login='%s'", - - szPasswd, szLogin); - } - // END_OF_CHANNEL_SERVICE_LOGIN - else - { - DBManager::instance().ReturnQuery(QID_AUTH_LOGIN_OPENID, dwKey, p, - "SELECT PASSWORD('%s'),password,securitycode,social_id,id,status,availDt - NOW() > 0," - "UNIX_TIMESTAMP(silver_expire)," - "UNIX_TIMESTAMP(gold_expire)," - "UNIX_TIMESTAMP(safebox_expire)," - "UNIX_TIMESTAMP(autoloot_expire)," - "UNIX_TIMESTAMP(fish_mind_expire)," - "UNIX_TIMESTAMP(marriage_fast_expire)," - "UNIX_TIMESTAMP(money_drop_rate_expire)," - "UNIX_TIMESTAMP(create_time)" - " FROM account WHERE login='%s'", - szPasswd, szLogin); - } -} - -extern void socket_timeout(socket_t s, long sec, long usec); - -//OpenID -int CInputAuth::auth_OpenID(const char *authKey, const char *ipAddr, char *rID) -{ - //return value - //0 : normal execution - //1 : cannot connect to openid auth server - //2 : socket_write failed - //3 : openid auth server not reply - //4 : Reply Error - //5 : Incorrect auth key. - - extern char openid_host[256]; - extern char openid_uri[256]; - - int port = 80; - - socket_t fd = socket_connect(openid_host, port); - if (fd < 0) - { - sys_err("[auth_OpenID] : could not connect to OpenID server(%s)", openid_host); - return 1; - } - - socket_block(fd); - socket_timeout(fd, 3, 0); - - // send request - { - char request[512]; - int len = snprintf(request, sizeof(request), - //"GET /kyw/gameauth.php?auth_key=%s&ip=%s HTTP/1.1\r\n" - "GET %s?auth_key=%s&ip=%s HTTP/1.1\r\n" - "Host: %s\r\n" - "Connection: Close\r\n\r\n", - //openid_uri, authKey,ipAddr);//"aaaaa", "202.31.212.73"); - //authKey,ipAddr); - //"/kyw/gameauth.php", authKey, ipAddr); - openid_uri, authKey, ipAddr, openid_host); - -//#ifndef OS_WINDOWS -// if (write(fd, request, len) < 0) -//#else - if (socket_write(fd, request, len) < 0) -//#endif - { - sys_err("[auth_OpenID] : could not send auth-request (%s)", authKey); - socket_close(fd); - return 2; - } - } - - // read reply - char reply[1024] = {0}; - int len; -//#ifndef OS_WINDOWS -// len = read(fd, reply, sizeof(reply)); -//#else - len = socket_read(fd, reply, sizeof(reply)); -//#endif - socket_close(fd); - - if (len <= 0) - { - sys_err("[auth_OpenID] : could not recv auth-reply (%s)", authKey); - return 3; - } - - //결과값 파싱 - char buffer[1024]; - strcpy(buffer, reply); - - const char *delim = "\r\n"; - char *last = 0; - char *v = strtok(buffer, delim); - char *result = 0; - - while (v) - { - result = v; - v = strtok(NULL, delim); - } - - - char *id = strtok(result, "%"); - char *success = strtok(NULL, "%"); - - if (!*id || !*success) - { - sys_err("[auth_OpenID] : OpenID AuthServer Reply Error (%s)", reply); - return 4; - } - - if (0 != strcmp("OK", success)) //에러 처리 - { - int returnNumber = 0; - str_to_number(returnNumber, id); - switch (returnNumber) - { - case 1: - sys_err("[auth_OpenID] : AuthKey incorrect"); - break; - case 2: - sys_err("[auth_OpenID] : ip incorrect"); - break; - case 3: - sys_err("[auth_OpenID] : used AuthKey"); - break; - case 4: - sys_err("[auth_OpenID] : AuthKey not delivered"); - break; - case 5: - sys_err("[auth_OpenID] : ip not delivered"); - break; - case 6: - sys_err("[auth_OpenID] : AuthKey time over"); - break; - default: - break; - - return 5; - } - } - - strcpy(rID, id); - - return 0; -} - - int CInputAuth::Analyze(LPDESC d, BYTE bHeader, const char * c_pData) { @@ -547,14 +263,6 @@ int CInputAuth::Analyze(LPDESC d, BYTE bHeader, const char * c_pData) Login(d, c_pData); break; - //2012.07.19 OpenID : 김용욱 - case HEADER_CG_LOGIN5_OPENID: - if (openid_server) - LoginOpenID(d, c_pData); - else - sys_err("HEADER_CG_LOGIN5_OPENID : wrong client access"); - break; - case HEADER_CG_PASSPOD_ANSWER: PasspodAnswer(d, c_pData); break; diff --git a/src/game/input_db.cpp b/src/game/input_db.cpp index 0372514..d9d42bb 100644 --- a/src/game/input_db.cpp +++ b/src/game/input_db.cpp @@ -57,7 +57,6 @@ extern int auction_server; extern void gm_insert(const char * name, BYTE level); extern BYTE gm_get_level(const char * name, const char * host, const char* account ); extern void gm_host_insert(const char * host); -extern int openid_server; #define MAPNAME_DEFAULT "none" @@ -1768,42 +1767,6 @@ void CInputDB::AuthLogin(LPDESC d, const char * c_pData) d->Packet(&ptoc, sizeof(TPacketGCAuthSuccess)); sys_log(0, "AuthLogin result %u key %u", bResult, d->GetLoginKey()); } -void CInputDB::AuthLoginOpenID(LPDESC d, const char * c_pData) -{ - if (!d) - return; - - BYTE bResult = *(BYTE *) c_pData; - - TPacketGCAuthSuccessOpenID ptoc; - - ptoc.bHeader = HEADER_GC_AUTH_SUCCESS_OPENID; - - if (bResult) - { - // Panama 암호화 팩에 필요한 키 보내기 - SendPanamaList(d); - ptoc.dwLoginKey = d->GetLoginKey(); - - //NOTE: AuthSucess보다 먼저 보내야지 안그러면 PHASE Close가 되서 보내지지 않는다.-_- - //Send Client Package CryptKey - { - DESC_MANAGER::instance().SendClientPackageCryptKey(d); - DESC_MANAGER::instance().SendClientPackageSDBToLoadMap(d, MAPNAME_DEFAULT); - } - } - else - { - ptoc.dwLoginKey = 0; - } - - strcpy(ptoc.login, d->GetLogin().c_str()); - - ptoc.bResult = bResult; - - d->Packet(&ptoc, sizeof(TPacketGCAuthSuccessOpenID)); - sys_log(0, "AuthLogin result %u key %u", bResult, d->GetLoginKey()); -} void CInputDB::ChangeEmpirePriv(const char* c_pData) { @@ -2342,10 +2305,7 @@ int CInputDB::Analyze(LPDESC d, BYTE bHeader, const char * c_pData) break; case HEADER_DG_AUTH_LOGIN: - if (openid_server) - AuthLoginOpenID(DESC_MANAGER::instance().FindByHandle(m_dwHandle), c_pData); - else - AuthLogin(DESC_MANAGER::instance().FindByHandle(m_dwHandle), c_pData); + AuthLogin(DESC_MANAGER::instance().FindByHandle(m_dwHandle), c_pData); break; case HEADER_DG_CHANGE_EMPIRE_PRIV: diff --git a/src/game/packet.h b/src/game/packet.h index db7e93a..34a1210 100644 --- a/src/game/packet.h +++ b/src/game/packet.h @@ -92,8 +92,6 @@ enum HEADER_CG_SCRIPT_SELECT_ITEM = 114, // END_OF_SCRIPT_SELECT_ITEM - HEADER_CG_LOGIN5_OPENID = 116, //OpenID : 클라이언트로부터 OpenID 인증키를 받는다. - // HEADER_CG_ROULETTE = 200, // HEADER_CG_RUNUP_MATRIX_ANSWER = 201, @@ -277,8 +275,6 @@ enum HEADER_GC_HYBRIDCRYPT_SDB = 153, // SDB means Supplmentary Data Blocks //HYBRID CRYPT - HEADER_GC_AUTH_SUCCESS_OPENID = 154, - // ROULETTE HEADER_GC_ROULETTE = 200, // END_ROULETTE @@ -549,13 +545,6 @@ typedef struct command_login3 uint32_t adwClientKey[4]; } TPacketCGLogin3; -typedef struct command_login5 -{ - uint8_t header; - char authKey[OPENID_AUTHKEY_LEN + 1]; - uint32_t adwClientKey[4]; -} TPacketCGLogin5; - typedef struct command_matrix_card { uint8_t bHeader; @@ -902,14 +891,6 @@ typedef struct packet_auth_success uint8_t bResult; } TPacketGCAuthSuccess; -typedef struct packet_auth_success_openid -{ - uint8_t bHeader; - uint32_t dwLoginKey; - uint8_t bResult; - char login[LOGIN_MAX_LEN + 1]; -} TPacketGCAuthSuccessOpenID; - typedef struct packet_login_failure { uint8_t header; diff --git a/src/game/packet_info.cpp b/src/game/packet_info.cpp index 1c81e4b..02c04fb 100644 --- a/src/game/packet_info.cpp +++ b/src/game/packet_info.cpp @@ -146,7 +146,6 @@ CPacketInfoCG::CPacketInfoCG() Set(HEADER_CG_LOGIN, sizeof(TPacketCGLogin), "Login", true); Set(HEADER_CG_LOGIN2, sizeof(TPacketCGLogin2), "Login2", true); Set(HEADER_CG_LOGIN3, sizeof(TPacketCGLogin3), "Login3", true); - Set(HEADER_CG_LOGIN5_OPENID, sizeof(TPacketCGLogin5), "Login5", true); //OpenID Set(HEADER_CG_ATTACK, sizeof(TPacketCGAttack), "Attack", true); Set(HEADER_CG_CHAT, sizeof(TPacketCGChat), "Chat", true); Set(HEADER_CG_WHISPER, sizeof(TPacketCGWhisper), "Whisper", true);