Beiträge von devgames
-
-
-
-
"hint" length is only 20
'Esarfa Lord (custom) 1 ' is more than 20 letters
so just raise the hint length
dont work
-
I have a little problem when i combine the sash!
i have this error
SYSERR: Apr 8 15:50:19.516966 :: ChildLoop: AsyncSQL: query failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 (query: INSERT DELAYED INTO log (type, time, who, x, y, what, how, hint, ip, vnum) VALUES('ITEM', NOW(), 1, 959897, 272989, 50000015, 'COMBINE (REFINE SUCCESS)', 'Esarfa Lord (custom) 1 ', errno: 1064)
log.cpp:
C- #include "stdafx.h"
- #include "constants.h"
- #include "config.h"
- #include "log.h"
- #include "char.h"
- #include "desc.h"
- #include "item.h"
- #include "../../common/service.h"
- #include "locale_service.h"
- static char __escape_hint[1024];
- LogManager::LogManager() : m_bIsConnect(false)
- {
- }
- LogManager::~LogManager()
- {
- }
- bool LogManager::Connect(const char * host, const int port, const char * user, const char * pwd, const char * db)
- {
- if (m_sql.Setup(host, user, pwd, db, g_stLocale.c_str(), false, port))
- m_bIsConnect = true;
- return m_bIsConnect;
- }
- void LogManager::Query(const char * c_pszFormat, ...)
- {
- char szQuery[4096];
- va_list args;
- va_start(args, c_pszFormat);
- vsnprintf(szQuery, sizeof(szQuery), c_pszFormat, args);
- va_end(args);
- if (test_server)
- sys_log(0, "LOG: %s", szQuery);
- m_sql.AsyncQuery(szQuery);
- }
- bool LogManager::IsConnected()
- {
- return m_bIsConnect;
- }
- void LogManager::ItemLog(DWORD dwPID, DWORD x, DWORD y, DWORD dwItemID, const char * c_pszText, const char * c_pszHint, const char * c_pszIP, DWORD dwVnum)
- {
- m_sql.EscapeString(__escape_hint, sizeof(__escape_hint), c_pszHint, strlen(c_pszHint));
- Query("INSERT DELAYED INTO log%s (type, time, who, x, y, what, how, hint, ip, vnum) VALUES('ITEM', NOW(), %u, %u, %u, %u, '%s', '%s', '%s', %u)",
- get_table_postfix(), dwPID, x, y, dwItemID, c_pszText, __escape_hint, c_pszIP, dwVnum);
- }
- void LogManager::ItemLog(LPCHARACTER ch, LPITEM item, const char * c_pszText, const char * c_pszHint)
- {
- if (NULL == ch || NULL == item)
- {
- sys_err("character or item nil (ch %p item %p text %s)", get_pointer(ch), get_pointer(item), c_pszText);
- return;
- }
- ItemLog(ch->GetPlayerID(), ch->GetX(), ch->GetY(), item->GetID(),
- NULL == c_pszText ? "" : c_pszText,
- c_pszHint, ch->GetDesc() ? ch->GetDesc()->GetHostName() : "",
- item->GetOriginalVnum());
- }
- void LogManager::ItemLog(LPCHARACTER ch, int itemID, int itemVnum, const char * c_pszText, const char * c_pszHint)
- {
- ItemLog(ch->GetPlayerID(), ch->GetX(), ch->GetY(), itemID, c_pszText, c_pszHint, ch->GetDesc() ? ch->GetDesc()->GetHostName() : "", itemVnum);
- }
- void LogManager::CharLog(DWORD dwPID, DWORD x, DWORD y, DWORD dwValue, const char * c_pszText, const char * c_pszHint, const char * c_pszIP)
- {
- m_sql.EscapeString(__escape_hint, sizeof(__escape_hint), c_pszHint, strlen(c_pszHint));
- Query("INSERT DELAYED INTO log%s (type, time, who, x, y, what, how, hint, ip) VALUES('CHARACTER', NOW(), %u, %u, %u, %u, '%s', '%s', '%s')",
- get_table_postfix(), dwPID, x, y, dwValue, c_pszText, __escape_hint, c_pszIP);
- }
- void LogManager::CharLog(LPCHARACTER ch, DWORD dw, const char * c_pszText, const char * c_pszHint)
- {
- if (ch)
- CharLog(ch->GetPlayerID(), ch->GetX(), ch->GetY(), dw, c_pszText, c_pszHint, ch->GetDesc() ? ch->GetDesc()->GetHostName() : "");
- else
- CharLog(0, 0, 0, dw, c_pszText, c_pszHint, "");
- }
- void LogManager::LoginLog(bool isLogin, DWORD dwAccountID, DWORD dwPID, BYTE bLevel, BYTE bJob, DWORD dwPlayTime)
- {
- Query("INSERT DELAYED INTO loginlog%s (type, time, channel, account_id, pid, level, job, playtime) VALUES (%s, NOW(), %d, %u, %u, %d, %d, %u)",
- get_table_postfix(), isLogin ? "'LOGIN'" : "'LOGOUT'", g_bChannel, dwAccountID, dwPID, bLevel, bJob, dwPlayTime);
- }
- #ifdef __GOLD_AS_LL__
- void LogManager::MoneyLog(BYTE type, DWORD vnum, long long gold)
- #else
- void LogManager::MoneyLog(BYTE type, DWORD vnum, int gold)
- #endif
- {
- if (type == MONEY_LOG_RESERVED || type >= MONEY_LOG_TYPE_MAX_NUM)
- {
- #ifdef __GOLD_AS_LL__
- sys_err("TYPE ERROR: type %d vnum %u gold %lld", type, vnum, gold);
- #else
- sys_err("TYPE ERROR: type %d vnum %u gold %d", type, vnum, gold);
- #endif
- return;
- }
- #ifdef __GOLD_AS_LL__
- Query("INSERT DELAYED INTO money_log%s VALUES (NOW(), %d, %d, %lld)", get_table_postfix(), type, vnum, gold);
- #else
- Query("INSERT DELAYED INTO money_log%s VALUES (NOW(), %d, %d, %d)", get_table_postfix(), type, vnum, gold);
- #endif
- }
- void LogManager::HackLog(const char * c_pszHackName, const char * c_pszLogin, const char * c_pszName, const char * c_pszIP)
- {
- m_sql.EscapeString(__escape_hint, sizeof(__escape_hint), c_pszHackName, strlen(c_pszHackName));
- Query("INSERT INTO hack_log (time, login, name, ip, server, why) VALUES(NOW(), '%s', '%s', '%s', '%s', '%s')", c_pszLogin, c_pszName, c_pszIP, g_stHostname.c_str(), __escape_hint);
- }
- void LogManager::HackLog(const char * c_pszHackName, LPCHARACTER ch)
- {
- if (ch->GetDesc())
- {
- HackLog(c_pszHackName,
- ch->GetDesc()->GetAccountTable().login,
- ch->GetName(),
- ch->GetDesc()->GetHostName());
- }
- }
- void LogManager::HackCRCLog(const char * c_pszHackName, const char * c_pszLogin, const char * c_pszName, const char * c_pszIP, DWORD dwCRC)
- {
- Query("INSERT INTO hack_crc_log (time, login, name, ip, server, why, crc) VALUES(NOW(), '%s', '%s', '%s', '%s', '%s', %u)", c_pszLogin, c_pszName, c_pszIP, g_stHostname.c_str(), c_pszHackName, dwCRC);
- }
- void LogManager::PCBangLoginLog(DWORD dwPCBangID, const char* c_szPCBangIP, DWORD dwPlayerID, DWORD dwPlayTime)
- {
- Query("INSERT INTO pcbang_loginlog (time, pcbang_id, ip, pid, play_time) VALUES (NOW(), %u, '%s', %u, %u)",
- dwPCBangID, c_szPCBangIP, dwPlayerID, dwPlayTime);
- }
- void LogManager::GoldBarLog(DWORD dwPID, DWORD dwItemID, GOLDBAR_HOW eHow, const char* c_pszHint)
- {
- char szHow[32+1];
- switch (eHow)
- {
- case PERSONAL_SHOP_BUY:
- snprintf(szHow, sizeof(szHow), "'BUY'");
- break;
- case PERSONAL_SHOP_SELL:
- snprintf(szHow, sizeof(szHow), "'SELL'");
- break;
- case SHOP_BUY:
- snprintf(szHow, sizeof(szHow), "'SHOP_BUY'");
- break;
- case SHOP_SELL:
- snprintf(szHow, sizeof(szHow), "'SHOP_SELL'");
- break;
- case EXCHANGE_TAKE:
- snprintf(szHow, sizeof(szHow), "'EXCHANGE_TAKE'");
- break;
- case EXCHANGE_GIVE:
- snprintf(szHow, sizeof(szHow), "'EXCHANGE_GIVE'");
- break;
- case QUEST:
- snprintf(szHow, sizeof(szHow), "'QUEST'");
- break;
- default:
- snprintf(szHow, sizeof(szHow), "''");
- break;
- }
- Query("INSERT DELAYED INTO goldlog%s (date, time, pid, what, how, hint) VALUES(CURDATE(), CURTIME(), %u, %u, %s, '%s')",
- get_table_postfix(), dwPID, dwItemID, szHow, c_pszHint);
- }
- void LogManager::CubeLog(DWORD dwPID, DWORD x, DWORD y, DWORD item_vnum, DWORD item_uid, int item_count, bool success)
- {
- Query("INSERT DELAYED INTO cube%s (pid, time, x, y, item_vnum, item_uid, item_count, success) "
- "VALUES(%u, NOW(), %u, %u, %u, %u, %d, %d)",
- get_table_postfix(), dwPID, x, y, item_vnum, item_uid, item_count, success?1:0);
- }
- void LogManager::SpeedHackLog(DWORD pid, DWORD x, DWORD y, int hack_count)
- {
- Query("INSERT INTO speed_hack%s (pid, time, x, y, hack_count) "
- "VALUES(%u, NOW(), %u, %u, %d)",
- get_table_postfix(), pid, x, y, hack_count);
- }
- void LogManager::ChangeNameLog(DWORD pid, const char *old_name, const char *new_name, const char *ip)
- {
- Query("INSERT DELAYED INTO change_name%s (pid, old_name, new_name, time, ip) "
- "VALUES(%u, '%s', '%s', NOW(), '%s') ",
- get_table_postfix(), pid, old_name, new_name, ip);
- }
- void LogManager::GMCommandLog(DWORD dwPID, const char* szName, const char* szIP, BYTE byChannel, const char* szCommand)
- {
- m_sql.EscapeString(__escape_hint, sizeof(__escape_hint), szCommand, strlen(szCommand));
- Query("INSERT DELAYED INTO command_log%s (userid, server, ip, port, username, command, date ) "
- "VALUES(%u, 999, '%s', %u, '%s', '%s', NOW()) ",
- get_table_postfix(), dwPID, szIP, byChannel, szName, __escape_hint);
- }
- void LogManager::RefineLog(DWORD pid, const char* item_name, DWORD item_id, int item_refine_level, int is_success, const char* how)
- {
- m_sql.EscapeString(__escape_hint, sizeof(__escape_hint), item_name, strlen(item_name));
- Query("INSERT INTO refinelog%s (pid, item_name, item_id, step, time, is_success, setType) VALUES(%u, '%s', %u, %d, NOW(), %d, '%s')",
- get_table_postfix(), pid, __escape_hint, item_id, item_refine_level, is_success, how);
- }
- void LogManager::ShoutLog(BYTE bChannel, BYTE bEmpire, const char * pszText)
- {
- m_sql.EscapeString(__escape_hint, sizeof(__escape_hint), pszText, strlen(pszText));
- Query("INSERT INTO shout_log%s VALUES(NOW(), %d, %d,'%s')", get_table_postfix(), bChannel, bEmpire, __escape_hint);
- }
- void LogManager::LevelLog(LPCHARACTER pChar, unsigned int level, unsigned int playhour)
- {
- if (true == LC_IsEurope())
- {
- DWORD aid = 0;
- if (NULL != pChar->GetDesc())
- {
- aid = pChar->GetDesc()->GetAccountTable().id;
- }
- Query("REPLACE INTO levellog%s (name, level, time, account_id, pid, playtime) VALUES('%s', %u, NOW(), %u, %u, %d)",
- get_table_postfix(), pChar->GetName(), level, aid, pChar->GetPlayerID(), playhour);
- }
- else
- {
- Query("REPLACE INTO levellog%s (name, level, time, playtime) VALUES('%s', %u, NOW(), %d)",
- get_table_postfix(), pChar->GetName(), level, playhour);
- }
- }
- void LogManager::BootLog(const char * c_pszHostName, BYTE bChannel)
- {
- Query("INSERT INTO bootlog (time, hostname, channel) VALUES(NOW(), '%s', %d)",
- c_pszHostName, bChannel);
- }
- void LogManager::VCardLog(DWORD vcard_id, DWORD x, DWORD y, const char * hostname, const char * giver_name, const char * giver_ip, const char * taker_name, const char * taker_ip)
- {
- Query("INSERT DELAYED INTO vcard_log (vcard_id, x, y, hostname, giver_name, giver_ip, taker_name, taker_ip) VALUES(%u, %u, %u, '%s', '%s', '%s', '%s', '%s')",
- vcard_id, x, y, hostname, giver_name, giver_ip, taker_name, taker_ip);
- }
- void LogManager::FishLog(DWORD dwPID, int prob_idx, int fish_id, int fish_level, DWORD dwMiliseconds, DWORD dwVnum, DWORD dwValue)
- {
- Query("INSERT INTO fish_log%s VALUES(NOW(), %u, %d, %u, %d, %u, %u, %u)",
- get_table_postfix(),
- dwPID,
- prob_idx,
- fish_id,
- fish_level,
- dwMiliseconds,
- dwVnum,
- dwValue);
- }
- void LogManager::QuestRewardLog(const char * c_pszQuestName, DWORD dwPID, DWORD dwLevel, int iValue1, int iValue2)
- {
- Query("INSERT INTO quest_reward_log%s VALUES('%s',%u,%u,2,%u,%u,NOW())",
- get_table_postfix(),
- c_pszQuestName,
- dwPID,
- dwLevel,
- iValue1,
- iValue2);
- }
- void LogManager::DetailLoginLog(bool isLogin, LPCHARACTER ch)
- {
- if (NULL == ch->GetDesc())
- return;
- if (true == isLogin)
- {
- Query("INSERT INTO loginlog2(type, is_gm, login_time, channel, account_id, pid, ip, client_version) "
- "VALUES('INVALID', %s, NOW(), %d, %u, %u, inet_aton('%s'), '%s')",
- ch->IsGM() == true ? "'Y'" : "'N'",
- g_bChannel,
- ch->GetDesc()->GetAccountTable().id,
- ch->GetPlayerID(),
- ch->GetDesc()->GetHostName(),
- ch->GetDesc()->GetClientVersion());
- }
- else
- {
- Query("SET @i = (SELECT MAX(id) FROM loginlog2 WHERE account_id=%u AND pid=%u)",
- ch->GetDesc()->GetAccountTable().id,
- ch->GetPlayerID());
- Query("UPDATE loginlog2 SET type='VALID', logout_time=NOW(), playtime=TIMEDIFF(logout_time,login_time) WHERE id=@i");
- }
- }
- void LogManager::DragonSlayLog(DWORD dwGuildID, DWORD dwDragonVnum, DWORD dwStartTime, DWORD dwEndTime)
- {
- Query( "INSERT INTO dragon_slay_log%s VALUES( %d, %d, FROM_UNIXTIME(%d), FROM_UNIXTIME(%d) )",
- get_table_postfix(),
- dwGuildID, dwDragonVnum, dwStartTime, dwEndTime);
- }
- void LogManager::HackShieldLog(unsigned long ErrorCode, LPCHARACTER ch)
- {
- struct in_addr st_addr;
- #ifndef __WIN32__
- if (0 == inet_aton(ch->GetDesc()->GetHostName(), &st_addr))
- #else
- unsigned long in_address;
- in_address = inet_addr(ch->GetDesc()->GetHostName());
- st_addr.s_addr = in_address;
- if (INADDR_NONE == in_address)
- #endif
- {
- Query( "INSERT INTO hackshield_log(time, account_id, login, pid, name, reason, ip) "
- "VALUES(NOW(), %u, '%s', %u, '%s', %u, 0)",
- ch->GetDesc()->GetAccountTable().id, ch->GetDesc()->GetAccountTable().login,
- ch->GetPlayerID(), ch->GetName(),
- ErrorCode);
- }
- else
- {
- Query( "INSERT INTO hackshield_log(time, account_id, login, pid, name, reason, ip) "
- "VALUES(NOW(), %u, '%s', %u, '%s', %u, inet_aton('%s'))",
- ch->GetDesc()->GetAccountTable().id, ch->GetDesc()->GetAccountTable().login,
- ch->GetPlayerID(), ch->GetName(),
- ErrorCode,
- ch->GetDesc()->GetHostName());
- }
- }
- #ifdef __GOLD_BARS__
- void LogManager::GoldBarsLog(DWORD dwPlayerID, DWORD dwAID, DWORD dwVnum, int dlCount)
- {
- Query("INSERT INTO voucher_yang_log (player_id, account_id, item_vnum, valoare_yang, data) VALUES('%u', '%u' , '%u' , '%u' , NOW() )" , dwPlayerID, dwAID, dwVnum, dlCount);
- }
- #endif
- #ifdef __VOUCHER_JD__
- void LogManager::JetoaneDragonLog(DWORD dwPlayerID, DWORD dwAID, DWORD dwVnum, int iCount)
- {
- Query("INSERT INTO voucher_jd_log (player_id, account_id, item_vnum, jetoane_dragon, data) VALUES('%u', '%u', '%u', '%u', NOW())", dwPlayerID, dwAID, dwVnum, iCount);
- }
- #endif
- #ifdef __VOUCHER_MD__
- void LogManager::MonedeDragonLog(DWORD dwPlayerID, DWORD dwAID, DWORD dwVnum, int iCount)
- {
- Query("INSERT INTO voucher_md_log (player_id, account_id, item_vnum, monede_dragon, data) VALUES('%u', '%u', '%u', '%u', NOW())", dwPlayerID, dwAID, dwVnum, iCount);
- }
- #endif
- #ifdef __SASH_SYSTEM__
- void LogManager::SashLog(DWORD dwPID, DWORD x, DWORD y, DWORD item_vnum, DWORD item_uid, int item_count, int abs_chance, bool success)
- {
- Query("INSERT DELAYED INTO sash_log%s (pid, time, x, y, item_vnum, item_uid, item_count, item_abs_chance, success) VALUES(%u, NOW(), %u, %u, %u, %u, %d, %d, %d)", get_table_postfix(), dwPID, x, y, item_vnum, item_uid, item_count, abs_chance, success ? 1 : 0);
- }
- #endif
log.h
C- #ifndef __INC_LOG_MANAGER_H__
- #define __INC_LOG_MANAGER_H__
- #include "../../libsql/AsyncSQL.h"
- #include "any_function.h"
- enum GOLDBAR_HOW
- {
- PERSONAL_SHOP_BUY = 1 ,
- PERSONAL_SHOP_SELL = 2 ,
- SHOP_BUY = 3 ,
- SHOP_SELL = 4 ,
- EXCHANGE_TAKE = 5 ,
- EXCHANGE_GIVE = 6 ,
- QUEST = 7 ,
- };
- class LogManager : public singleton<LogManager>
- {
- public:
- LogManager();
- virtual ~LogManager();
- bool IsConnected();
- bool Connect(const char * host, const int port, const char * user, const char * pwd, const char * db);
- void ItemLog(DWORD dwPID, DWORD x, DWORD y, DWORD dwItemID, const char * c_pszText, const char * c_pszHint, const char * c_pszIP, DWORD dwVnum);
- void ItemLog(LPCHARACTER ch, LPITEM item, const char * c_pszText, const char * c_pszHint);
- void ItemLog(LPCHARACTER ch, int itemID, int itemVnum, const char * c_pszText, const char * c_pszHint);
- void CharLog(DWORD dwPID, DWORD x, DWORD y, DWORD dw, const char * c_pszText, const char * c_pszHint, const char * c_pszIP);
- void CharLog(LPCHARACTER ch, DWORD dw, const char * c_pszText, const char * c_pszHint);
- void LoginLog(bool isLogin, DWORD dwAccountID, DWORD dwPID, BYTE bLevel, BYTE bJob, DWORD dwPlayTime);
- #ifdef __GOLD_AS_LL__
- void MoneyLog(BYTE type, DWORD vnum, long long gold);
- #else
- void MoneyLog(BYTE type, DWORD vnum, int gold);
- #endif
- void HackLog(const char * c_pszHackName, const char * c_pszLogin, const char * c_pszName, const char * c_pszIP);
- void HackLog(const char * c_pszHackName, LPCHARACTER ch);
- void HackCRCLog(const char * c_pszHackName, const char * c_pszLogin, const char * c_pszName, const char * c_pszIP, DWORD dwCRC);
- void GoldBarLog(DWORD dwPID, DWORD dwItemID, GOLDBAR_HOW eHow, const char * c_pszHint);
- void PCBangLoginLog(DWORD dwPCBangID, const char * c_szPCBangIP, DWORD dwPlayerID, DWORD dwPlayTime);
- void CubeLog(DWORD dwPID, DWORD x, DWORD y, DWORD item_vnum, DWORD item_uid, int item_count, bool success);
- void GMCommandLog(DWORD dwPID, const char * szName, const char * szIP, BYTE byChannel, const char * szCommand);
- void SpeedHackLog(DWORD pid, DWORD x, DWORD y, int hack_count);
- void ChangeNameLog(DWORD pid, const char * old_name, const char * new_name, const char * ip);
- void RefineLog(DWORD pid, const char * item_name, DWORD item_id, int item_refine_level, int is_success, const char * how);
- void ShoutLog(BYTE bChannel, BYTE bEmpire, const char * pszText);
- void LevelLog(LPCHARACTER pChar, unsigned int level, unsigned int playhour);
- void BootLog(const char * c_pszHostName, BYTE bChannel);
- void VCardLog(DWORD vcard_id, DWORD x, DWORD y, const char * hostname, const char * giver_name, const char * giver_ip, const char * taker_name, const char * taker_ip);
- void FishLog(DWORD dwPID, int prob_idx, int fish_id, int fish_level, DWORD dwMiliseconds, DWORD dwVnum = false, DWORD dwValue = 0);
- void QuestRewardLog(const char * c_pszQuestName, DWORD dwPID, DWORD dwLevel, int iValue1, int iValue2);
- void DetailLoginLog(bool isLogin, LPCHARACTER ch);
- void DragonSlayLog(DWORD dwGuildID, DWORD dwDragonVnum, DWORD dwStartTime, DWORD dwEndTime);
- void HackShieldLog(unsigned long ErrorCode, LPCHARACTER ch);
- #ifdef __GOLD_BARS__
- void GoldBarsLog(DWORD dwAID, DWORD dwPlayerID, DWORD dwVnum, int dlCount);
- #endif
- #ifdef __VOUCHER_JD__
- void JetoaneDragonLog(DWORD dwPlayerID, DWORD dwAID, DWORD dwVnum, int iCount);
- #endif
- #ifdef __VOUCHER_MD__
- void MonedeDragonLog(DWORD dwPlayerID, DWORD dwAID, DWORD dwVnum, int iCount);
- #endif
- #ifdef __SASH_SYSTEM__
- void SashLog(DWORD dwPID, DWORD x, DWORD y, DWORD item_vnum, DWORD item_uid, int item_count, int abs_chance, bool success);
- #endif
- private:
- void Query(const char * c_pszFormat, ...);
- CAsyncSQL m_sql;
- bool m_bIsConnect;
- };
- #endif
my log structure table is:
Code- SET NAMES utf8mb4;
- SET FOREIGN_KEY_CHECKS = 0;
- -- ----------------------------
- -- Table structure for log
- -- ----------------------------
- DROP TABLE IF EXISTS `log`;
- CREATE TABLE `log` (
- `ID` int(11) NULL DEFAULT NULL,
- `type` varchar(20) CHARACTER SET big5 COLLATE big5_bin NULL DEFAULT NULL,
- `time` datetime NULL DEFAULT NULL,
- `who` int(11) NULL DEFAULT NULL,
- `x` int(11) NULL DEFAULT NULL,
- `y` int(11) NULL DEFAULT NULL,
- `what` int(11) NULL DEFAULT NULL,
- `how` varchar(20) CHARACTER SET big5 COLLATE big5_bin NULL DEFAULT NULL,
- `hint` varchar(20) CHARACTER SET big5 COLLATE big5_bin NULL DEFAULT NULL,
- `ip` varchar(30) CHARACTER SET big5 COLLATE big5_bin NULL DEFAULT NULL,
- `vnum` int(50) NULL DEFAULT NULL
- ) ENGINE = MyISAM CHARACTER SET = big5 COLLATE = big5_bin ROW_FORMAT = Dynamic;
- SET FOREIGN_KEY_CHECKS = 1;
-
Update:
Can be compiled with Fliege .VDI
-
actually is my screen....an first of that screenshot i have tundcated my navicat tables.
all items disspair...but sash still there....only visual "bug"
-
i dont know more about this source....i have found it on my mega cloud....is old!
-
Can be compiled with Fliege .VDI
Hi! this is ira source from 2017...i think..is very very clean
In archive you will fiind
CrientSource/extern
ServerSource/extern
Item/Mob/_proto.txt
Item/Mob/_names.txt
Config_ch1
Config_db
Some .py files from client
and
Tools
UpdateInfo:
----------------------------------------------------------------------SERVER SOURCE----------------------------------------------------------------------- General information. Initially, the server source had about 350 files, now only 250. So it's very clean, I just deleted what was useless and never used. The source can be compiled on both Windows and FreeBSD, as well as debug or release modes, as well as amd64 or i386 configuration. I added comments explaining what each function does. Thanks martysama for this, this thing is public, so I thought nobody would be upset if I add. Support and updates are free, I will always help my clients. I will only help you with source-related problems, and within the limits of free time other kinds of issues related to serverfiles/client and so on. Source don't have any explits/backdoors. Evrything is clean, tested, and without security issues. Repository contain a README. It explain how-to-compile, compatibility with other serverfiles issues, removed/changed/deprecated functions and stuff. Fixed all warnings you can have using clang compiler 4.0 Removed all locale from server and client source. And merged in one General changes. I've solved problems with buffer overflow ( Game freezing for certain players, followed by the buffer overflow syserr). I have reviewed the network and the"unknown packet header" issues have been resolved. The default compiler is now CLANG 3.6 to CLANG 4.0 I've replaced the whole building system with CMAKE. Instead of Makefile. Two compile modes are available [Debug / Release]. Public IP is detected automatically, you do not have to set the BIND_IP line in CONFIG. I have completly rewritten the buffer codes using asio::streambuff (Now the buffer capacity is untlimited) Some of the codes have been upgraded using modern coding standards C ++ 11 / C ++ 17. I have replaced the primitives include guards with pragma once. I have rewritten Blend_item using modern coding standards.. etc I have rewritten the whole DBManager using unique_ptr/observer_ptr/shared_ptr Extern upgrades: boost 1.66 devIL 1.8.0 lua 5.0 mysql 5.7.23 cryptopp 7.0.0 minilzo 2.10 gtest removed Obsolete/unused code removed: passpod (login 5), openid (login 4), greet_message, teen packet, locale (ymir, canada, newcibn, japan, brazil), auction, block country, block exception, ip ban, freebsd filemonitor, dev log, monarch, threeway war, speed server, vcard, marble, auth brazil, auth japan, pcbang, germany codes, xtrap, check server, hackshield, billing, version.txt, test codes, shopEX, panama, over9refine, matrix card, limit time, g_IUseLocale, lotto event, mobile, CRC codes, hybrid crypt, over time, koreean hidden commands, hotbackup, stl.h from common folder, login sim, Version2 checK, mobile system, server check/ server key, china event server && china toxification prevent, Useles logs, distribution test tserver, DBString ,spam checK , unsued variables, unused argumnts, unused packets from server client, unused header and source files, I can't describe in words how clean is, i removed evrything which is useless and not used. I not even remeber evrything, that's is just a small 50% summany. List of fixes: belt bug war crash when useing negative numbers mount with full inventory bug dice crash all compile warnings status point bonus change on equipped items bonus change on equipped stones change empire bug scroll bug horse skills bug item swap bug negative HP bug 6/7 bonus on costumes bug all mounts can attack now sql injection in messenger sql injection in guild change empire crash server timers crash party crash dungeon crash cube crash unknown packet header crash affect bug (double affect) sequence mismatch UpdatePacket() double sending charseletct update issues: the stats (HT, ST, Playtime, level) and the parts (armor, head) SAMLL type in ProtoReader messeneger_auth overflow hack Here is write just 40% of the fixes, in 2 years of development and testing source has been tested and fixed over 200 bugs. Defines list: #define MAP_ALLOW_LIMIT 32 here you can set maximum maps per core. #define CAN_SHOUT_MAX_LEVEL 15 here you can set the minimum level to shout #define MAX_STATUS_POINT 100 here you can set the maximum status points #define PARTY_CAN_JOIN_MAX_LEVEL 30 here you can set the difference in level for join party #define MAX_ITEM_INTRO_STACK 200 here you can set the maximum items intro stack #define MAX_MEMBER_INTRO_PARTY 10 here you can set the maximum members allowed intro a party #define CAN_RESET_HERE_TIME 170 here you can set the time needed to wait for reset here after you die #define CAN_RESET_TOWN_TIME 173 here you can set the time needed to wait for reset town after you die #define MAX_LEVEL_POINT_CAN_STEP 90 here you can set the maximum level point can step
-
how i can combine this 2 sys?
Code: char_item.cpp- switch (item->GetVnum())
- {
- case 80003:
- case 80004:
- case 80005:
- case 80006:
- case 80007:
- {
- static const int sGold[5] =
- {
- 50000, ///< 80003
- 100000, ///< 80004
- 500000, ///< 80005
- 1000000, ///< 80006
- 2000000 ///< 80007
- };
- if (IsOpenSafebox() || GetExchange() || GetMyShop() || IsCubeOpen())
- {
- ChatPacket(CHAT_TYPE_INFO, "Nu poti folosi lingouri in timp ce negociezi.");
- return false;
- }
- const int amount = sGold[item->GetVnum() - 80003];
- if ((GOLD_MAX - amount) <= GetGold())
- {
- ChatPacket(CHAT_TYPE_INFO, "Nu poti detine mai mult de 2kkk Yang.");
- return false;
- }
- item->SetCount(item->GetCount() - 1);
- PointChange(POINT_GOLD, amount, true);
- }
- break;
- default:
- break;
- }
-
don;t give me the gold.....(yang):(
-
Hello!
i Have this code for change GoldBars
but i can't fix it:(
i have makes Vouchers but this......
what is wrong here????Code: char.cpp- #ifdef __GOLD_BARS__
- bool CHARACTER::ChangeGoldBars(DWORD dwVnum)
- {
- int dlCount = 0;
- for(int i = 0; i < GOLD_BARS_NUM; i++)
- {
- if(GoldBarsItems[i] == dwVnum)
- {
- dlCount = GoldBarsValue[i];
- break;
- }
- }
- if(dlCount == 0)
- {
- return false;
- }
- SetGold(GetGold() + dlCount);
- TItemTable* pItemTable = ITEM_MANAGER::instance().GetTable(dwVnum);
- if(pItemTable)
- ChatPacket(CHAT_TYPE_INFO , "<SYSTEM> Ai primit [%d] yang!", dlCount);
- LogManager::instance().GoldBarsLog(GetAID() , GetPlayerID() , dwVnum , dlCount);
- }
- #endif
SQL- ']/*
- Navicat MySQL Data Transfer
- Source Server : adc
- Source Server Version : 50533
- Source Host : 192.168.1.254:3306
- Source Database : log
- Target Server Type : MYSQL
- Target Server Version : 50533
- File Encoding : 65001
- Date: 2018-02-25 18:58:52
- */
- SET FOREIGN_KEY_CHECKS=0;
- -- ----------------------------
- -- Table structure for voucher_yang_log
- -- ----------------------------
- DROP TABLE IF EXISTS `voucher_yang_log`;
- CREATE TABLE `voucher_yang_log` (
- `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
- `player_id` int(10) unsigned NOT NULL,
- `account_id` int(10) unsigned NOT NULL,
- `item_vnum` int(10) unsigned NOT NULL,
- `valoare_yang` int(10) unsigned NOT NULL,
- `data` datetime NOT NULL,
- PRIMARY KEY (`id`)
- ) ENGINE=MyISAM AUTO_INCREMENT=16 DEFAULT CHARSET=utf8;
Code: log.cppin char.h Under "public:"
Code: char_item.cpp- #ifdef __GOLD_BARS__
- switch (item->GetVnum())
- {
- case 80003: // 50kk
- case 80004: // 100kk
- case 80005: // 250kk
- case 80006: // 500kk
- case 80007: // 1kkk
- if (ChangeGoldBars(item->GetVnum()))
- {
- item->SetCount(item->GetCount() - 1);
- }
- else
- {
- ChatPacket(CHAT_TYPE_INFO, "[LINGOU] A aparut o eroare. Contactati administratorul.");
- }
- return 1;
- break;
- default:
- break;
- }
- #endif
-
Hi!
can give me someone python part for won sistem?
or all sys [SRC+Python]????