Martysama Source ve ya Filesi Kullananlar için MariaDB Güncellemesi

zodiac160

Üye
Üye
Mesaj
80
Çözümler
3
Beğeni
32
Puan
419
Bilenleriniz var mı yok mu bilmiyorum. Eğer yanlışım hatam varsa düzeltirseniz sevinirim. Martysama filesi ve ya sourcesi kullanıyorum ve mariadb güncellemesi yaparken bi kaç problemlerle karşılaşmıştım. Kullanıcı adı ve şifre yanlış hatası gibi utils.cppde build hataları gibi bi kaç hatalar vardı bunları sizinle paylaşmak istedim.

Öncelikle oyuna start verip oyuna girmeye çalışırken kullanıcı adı ve şifre hatası alanlar arkadaşlar;

game/src/input_auth.cpp
Kod:
aratıp
void CInputAuth::Login(LPDESC d, const char * c_pData)

buluyoruz.

#ifdef __WIN32__
        DBManager::instance().ReturnQuery(QID_AUTH_LOGIN, 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);
#else
        // @fixme138 1. PASSWORD('%s') -> %s 2. szPasswd wrapped inside mysql_hash_password(%s).c_str()
        DBManager::instance().ReturnQuery(QID_AUTH_LOGIN, 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'",
                mysql_hash_password(szPasswd).c_str(), szLogin);
#endif

ve bununla değiştiriyoruz

#ifdef __WIN32__
        DBManager::instance().ReturnQuery(QID_AUTH_LOGIN, 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);
#else
        // @fixme138 1. PASSWORD('%s') -> %s 2. szPasswd wrapped inside mysql_hash_password(%s).c_str()
        DBManager::instance().ReturnQuery(QID_AUTH_LOGIN, 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'",
                mysql_hash_password(szPasswd).c_str(), szLogin);
#endif

utils.cppde build hatası alan arkadaşlarımızda

game/src/utils.cpp
Kod:
en baştadır görüceksiniz. bunu buluyoruz

#include <mysql/mysql.h>
#ifndef SHA1_HASH_SIZE
#define SHA1_HASH_SIZE 20
#endif
#ifdef WIN32
extern "C" void my_make_scrambled_password(char* to, const char* password, size_t pass_len);
#endif
std::string mysql_hash_password(const char* tmp_pwd)
{
    char hash_buf[2 * SHA1_HASH_SIZE + 2] = "";
#ifdef WIN32
    my_make_scrambled_password(hash_buf, tmp_pwd, strlen(tmp_pwd));
#else
    make_scrambled_password(hash_buf, tmp_pwd);
#endif
    return hash_buf;
}

ve değiştiriyoruz

#ifndef __WIN32__
#include <mysql/mysql.h>
#ifndef SHA1_HASH_SIZE
#define SHA1_HASH_SIZE 20
#endif
#ifdef WIN32
extern "C" void my_make_scrambled_password(char *to, const char *password, size_t pass_len);
#endif
std::string mysql_hash_password(const char* tmp_pwd)
{
#ifdef WIN32
    char hash_buf[2 * SHA1_HASH_SIZE + 2] = "";
    my_make_scrambled_password(hash_buf, tmp_pwd, strlen(tmp_pwd));
    return hash_buf;
#else
    std::string s(tmp_pwd);
    return s;
#endif
}
#endif


AsnycSQL.cpp de build hatası alan arkadaşlarımızda

libsql/AsnycSQL.cpp

Kod:
aratıp buluyoruz (145. satırda)

    fprintf(stdout, "AsyncSQL: connected to %s (reconnect %d)\n", m_stHost.c_str(), m_hDB.reconnect);
    
ve değiştiriyoruz

    fprintf(stdout, "AsyncSQL: connected to %s (reconnect)\n", m_stHost.c_str());
 
Geri
Üst