• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
xRisenx

Helbreath SQL (Help needed)

5 posts in this topic

Hello.

Sorry for my bad english :P

I am working on a game and i just started with sql so i would need some help here.
I am working on changing the limit on how much stat i can save in database.
It was TINYINT and thats a range of 0-255, i want to change it to SMALLINT.

And thats when i got into problems, i think i found out what i need to change and i did it,
but it wont save over 255, so i am stuck :(

So i am here asking for some help if anyone would like to help me.

ill post the stuff here if anyone offer their help

Thanks,
xRisenx
0

Share this post


Link to post
Share on other sites
Did you check that your table has been altered successfully? When you try to insert or update values over 255, are you directly executing SQL statements or you're doing it through your application? If it's from your application, did you change the type of the data you're submitting?
0

Share this post


Link to post
Share on other sites
Yea i changed the info in the table to SmallInt.
1 exe sends to another exe that sends it to database.

Game server sends:
player->SetStr( bGetOffsetValue(pData, 46), false );
player->m_iVit = bGetOffsetValue(pData, 47);
player->SetDex( bGetOffsetValue(pData, 48) );
player->SetInt( bGetOffsetValue(pData, 49), false );
player->SetMag( bGetOffsetValue(pData, 50) );
player->m_iCharisma = bGetOffsetValue(pData, 51);

to Login Server that uses this:

else if(IsSame(field[f]->name, "Strenght")) PutOffsetValue(Data, 47, BYTESIZE, atoi(myRow[f]));
else if(IsSame(field[f]->name, "Vitality")) PutOffsetValue(Data, 48, BYTESIZE, atoi(myRow[f]));
else if(IsSame(field[f]->name, "Dexterity")) PutOffsetValue(Data, 49, BYTESIZE, atoi(myRow[f]));
else if(IsSame(field[f]->name, "Intelligence")) PutOffsetValue(Data, 50, BYTESIZE, atoi(myRow[f]));
else if(IsSame(field[f]->name, "Magic")) PutOffsetValue(Data, 51, BYTESIZE, atoi(myRow[f]));
else if(IsSame(field[f]->name, "Agility")) PutOffsetValue(Data, 52, BYTESIZE, atoi(myRow[f]));

Its are more places it sends but thats how it works..

BYTESIZE = 1 = TinyInt
WORDSIZE = 2 = SmallInt

and i changed this to WORDSIZE
else if(IsSame(field[f]->name, "Strenght")) PutOffsetValue(Data, 47, WORDSIZE, atoi(myRow[f]));
else if(IsSame(field[f]->name, "Vitality")) PutOffsetValue(Data, 49, WORDSIZE, atoi(myRow[f]));
else if(IsSame(field[f]->name, "Dexterity")) PutOffsetValue(Data, 51, WORDSIZE, atoi(myRow[f]));
else if(IsSame(field[f]->name, "Intelligence")) PutOffsetValue(Data, 53, WORDSIZE, atoi(myRow[f]));
else if(IsSame(field[f]->name, "Magic")) PutOffsetValue(Data, 55, WORDSIZE, atoi(myRow[f]));
else if(IsSame(field[f]->name, "Agility")) PutOffsetValue(Data, 57, WORDSIZE, atoi(myRow[f]));

So it goes up from 47 to 49 and so on.. cause thats right when WORDSIZE takes 2 slots insted of 1 like BYTESIZE.

And this is only a part of the code..
There are a couple of 100 lines that are linked to this part.

Thanks,
xRisenx
0

Share this post


Link to post
Share on other sites
Honestly, I have no idea of what this code is doing, but something tells me that the bug is in your code and not in the DB. I don't see any SQL in that code either. I don't know what are these functions, but this code is really awkward and seems to be error prone.

Edit: you should provide the code executing the SQL statement. Also, did you try to debug your application? Put a breakpoint to see what data you're actually sending to the DB. Edited by Faelenor
0

Share this post


Link to post
Share on other sites
Here are the full function that saves character info when u log out


void CLoginServer::SaveCharacter(char* Data, MYSQL myConn)
{
char *cp, AccName[15], AccPwd[15], CharName[15], Location[15], MapName[15], BlockDate[25], SaveDate[25],
GuildName[25], GoodGuildName[50], LockedMapName[15], MagicMastery[105], Profile[260], GoodProfile[520], QueryConsult[10000];
sBYTE DownSkillIndex;
BYTE /*STR, DEX, VIT, INT, MAG, AGI,*/ Luck, Sex, Skin, HairStyle,
HairColor, Underwear, HungerStatus, FightzoneNumber,
FightzoneTicketNumber, CrusadeDuty, NItems, NBankItems, SkillMastery;
sWORD MapLocX, MapLocY, GuildRank, GuildID, CharID1, CharID2, CharID3, QuestRewardType;
WORD STR, DEX, VIT, INT, MAG, AGI, Level, Quest, CurQuestCount, SuperAttackLeft, Gizon, w,
IndexForItem, Index;
sDWORD Rating;
long elo;
DWORD HP, MP, SP, Exp, EK, TotalEK, PK, RewardGold, TimeLeftShutUp, TimeLeftRating, TimeLeftForceRecall,
TimeLeftFirmStaminar, QuestID, QuestRewardAmmount, Contribution, WarContribution, SpecialEventID,
ReserveTime, LockedMapTime, CrusadeGUID, ConstructionPoint, DeadPenaltyTime,
PartyID, SpecialAbilityTime, Appr1, Appr2, Appr3, Appr4, ApprColor, SkillSSN, CharID;
uint64 CurItemID;
BOOL Flag, IsQuestCompleted, bIsBankModified;
SYSTEMTIME SaveTime;
st_mysql_res *pQueryResult = NULL;
cItem *ItemInfo;
string itemQuery;
static long charIndexEnd = 252;
//uint32 bench = timeGetTime();
ZeroMemory(CharName, sizeof(CharName));
SafeCopy(CharName, Data, 10);
ZeroMemory(AccName, sizeof(AccName));
SafeCopy(AccName, Data+10, 10);
ZeroMemory(AccPwd, sizeof(AccPwd));
SafeCopy(AccPwd, Data+20, 10);
Flag = (BOOL)bGetOffsetValue(Data, 30);
CharID = GetCharID(CharName, AccName, myConn);
cp = (Data+31);
SaveTime.wYear = wGetOffsetValue(cp, 0);
SaveTime.wMonth = bGetOffsetValue(cp, 2);
SaveTime.wDay = bGetOffsetValue(cp, 3);
SaveTime.wHour = bGetOffsetValue(cp, 4);
SaveTime.wMinute = bGetOffsetValue(cp, 5);
SaveTime.wSecond = bGetOffsetValue(cp, 6);
ZeroMemory(SaveDate, sizeof(SaveDate));
sprintf(SaveDate, "%d-%d-%d %d:%d:%d", SaveTime.wYear, SaveTime.wMonth, SaveTime.wDay, SaveTime.wHour, SaveTime.wMinute, SaveTime.wSecond);
ZeroMemory(Location, sizeof(Location));
SafeCopy(Location, cp+7, 10);
ZeroMemory(MapName, sizeof(MapName));
SafeCopy(MapName, cp+17, 10);
MapLocX = (sWORD)wGetOffsetValue(cp, 27);
MapLocY = (sWORD)wGetOffsetValue(cp, 29);
ZeroMemory(GuildName, sizeof(GuildName));
SafeCopy(GuildName, cp+31, 20);
GuildID = wGetOffsetValue(cp, 51);
GuildRank = (sWORD)wGetOffsetValue(cp, 53);
HP = dwGetOffsetValue(cp, 55);
MP = dwGetOffsetValue(cp, 59);
SP = dwGetOffsetValue(cp, 63);
Level = wGetOffsetValue(cp, 67);
Rating = (sDWORD)dwGetOffsetValue(cp, 69);
STR = bGetOffsetValue(cp, 73);
VIT = bGetOffsetValue(cp, 75);
DEX = bGetOffsetValue(cp, 77);
INT = bGetOffsetValue(cp, 79);
MAG = bGetOffsetValue(cp, 81);
AGI = bGetOffsetValue(cp, 83);
Luck = bGetOffsetValue(cp, 84);
Exp = dwGetOffsetValue(cp, 85);
EK = dwGetOffsetValue(cp, 89);
PK = dwGetOffsetValue(cp, 93);
RewardGold = dwGetOffsetValue(cp, 97);
DownSkillIndex = (sBYTE)bGetOffsetValue(cp, 101);
CharID1 = (sWORD)dwGetOffsetValue(cp, 102);
CharID2 = (sWORD)dwGetOffsetValue(cp, 106);
CharID3 = (sWORD)dwGetOffsetValue(cp, 110);
Sex = bGetOffsetValue(cp, 114);
Skin = bGetOffsetValue(cp, 115);
HairStyle = bGetOffsetValue(cp, 116);
HairColor = bGetOffsetValue(cp, 117);
Underwear = bGetOffsetValue(cp, 118);
HungerStatus = bGetOffsetValue(cp, 119);
TimeLeftShutUp = dwGetOffsetValue(cp, 120);
TimeLeftRating = dwGetOffsetValue(cp, 124);
TimeLeftForceRecall = dwGetOffsetValue(cp, 128);
TimeLeftFirmStaminar = dwGetOffsetValue(cp, 132);
bIsBankModified = (BOOL)bGetOffsetValue(cp, 136);
ZeroMemory(BlockDate, sizeof(BlockDate));
SafeCopy(BlockDate, cp+137, 20);
Quest = wGetOffsetValue(cp, 157);
QuestID = wGetOffsetValue(cp, 159);
CurQuestCount = wGetOffsetValue(cp, 161);
QuestRewardType = (sWORD)wGetOffsetValue(cp, 163);
QuestRewardAmmount = dwGetOffsetValue(cp, 165);
Contribution = dwGetOffsetValue(cp, 169);
WarContribution = dwGetOffsetValue(cp, 173);
IsQuestCompleted = (BOOL)bGetOffsetValue(cp, 177);
SpecialEventID = dwGetOffsetValue(cp, 178);
SuperAttackLeft = wGetOffsetValue(cp, 182);
FightzoneNumber = bGetOffsetValue(cp, 184);
ReserveTime = dwGetOffsetValue(cp, 185);
FightzoneTicketNumber = bGetOffsetValue(cp, 189);
SpecialAbilityTime = dwGetOffsetValue(cp, 190);
ZeroMemory(LockedMapName, sizeof(LockedMapName));
SafeCopy(LockedMapName, cp+194, 10);
LockedMapTime = dwGetOffsetValue(cp, 204);
CrusadeDuty = bGetOffsetValue(cp, 208);
CrusadeGUID = dwGetOffsetValue(cp, 209);
ConstructionPoint = dwGetOffsetValue(cp, 213);
DeadPenaltyTime = dwGetOffsetValue(cp, 217);
PartyID = dwGetOffsetValue(cp, 221);
//PartyID = 0;
Gizon = wGetOffsetValue(cp, 225);
SpecialAbilityTime = dwGetOffsetValue(cp, 227);
Appr1 = wGetOffsetValue(cp, 231);
Appr2 = wGetOffsetValue(cp, 235);
Appr3 = wGetOffsetValue(cp, 239);
Appr4 = wGetOffsetValue(cp, 243);
ApprColor = dwGetOffsetValue(cp, 247);
elo = wGetOffsetValue(cp, 251);
TotalEK = dwGetOffsetValue(cp, 253);
ZeroMemory(MagicMastery, sizeof(MagicMastery));
SafeCopy(MagicMastery, cp+charIndexEnd, 100);
string skillQuery;
skillQuery.append("UPDATE `skill` SET `SkillMastery` = CASE SkillID ");
for (w = 0; w < 24; w++)
{
SkillMastery = bGetOffsetValue(cp, charIndexEnd+100+w);
sprintf(QueryConsult, "WHEN %u THEN %u ", w, SkillMastery);
skillQuery.append(QueryConsult);
}
skillQuery.append("END,");

skillQuery.append("`SkillSSN` = CASE SkillID ");
for (w = 0; w < 24; w++)
{
SkillSSN = dwGetOffsetValue(cp, charIndexEnd+124+(w*4));
sprintf(QueryConsult, "WHEN %u THEN %u ", w, SkillSSN);
skillQuery.append(QueryConsult);
}
skillQuery.append("END ");
sprintf(QueryConsult, "WHERE `CharID` = '%lu' LIMIT 24;", CharID);
skillQuery.append(QueryConsult);
if(ProcessQuery(&myConn, (char*)skillQuery.c_str()) == -1) return;
pQueryResult = mysql_store_result(&myConn);
SAFEFREERESULT(pQueryResult);
NItems = bGetOffsetValue(cp, charIndexEnd+224);
CurItemID = (GetLastInsertedItemID(myConn)+1);
DeleteAllItemsFromChar(CharID, myConn, bIsBankModified);
ItemInfo = new cItem;
if(NItems > 0)
{
itemQuery.append("INSERT INTO `item` ( `CharID` , `ItemName`, `Count` , `ItemType`, `ID1`, `ID2`, `ID3`, `Color`, \
`Effect1`, `Effect2`, `Effect3`, `LifeSpan`, `Attribute`, `Socket1`, `Socket2`, `Socket3`, `ItemEquip`, \
`ItemPosX`, `ItemPosY`, `ItemID`, `ItemPos`) VALUES");
for(w = 0; w < NItems; w++)
{
IndexForItem = (WORD)(charIndexEnd+225 + (w*67));
ZeroMemory(ItemInfo->ItemName, sizeof(ItemInfo->ItemName));
SafeCopy(ItemInfo->ItemName, cp+IndexForItem, 20);
if(strlen(ItemInfo->ItemName) == 0) continue;
ItemInfo->ItemCount = dwGetOffsetValue(cp, (IndexForItem+20));
ItemInfo->TouchEffectType = (sWORD)wGetOffsetValue(cp, (IndexForItem+24));
ItemInfo->TouchEffectValue1 = (sWORD)wGetOffsetValue(cp, (IndexForItem+26));
ItemInfo->TouchEffectValue2 = (sWORD)wGetOffsetValue(cp, (IndexForItem+30));
ItemInfo->TouchEffectValue3 = (sWORD)dwGetOffsetValue(cp, (IndexForItem+34));
ItemInfo->ItemColor = bGetOffsetValue(cp, (IndexForItem+38));
ItemInfo->ItemSpecEffectValue1 = (sWORD)wGetOffsetValue(cp, (IndexForItem+39));
ItemInfo->ItemSpecEffectValue2 = (sWORD)wGetOffsetValue(cp, (IndexForItem+41));
ItemInfo->ItemSpecEffectValue3 = (sWORD)wGetOffsetValue(cp, (IndexForItem+43));
ItemInfo->CurLifeSpan = wGetOffsetValue(cp, (IndexForItem+45));
ItemInfo->Attribute = dwGetOffsetValue(cp, (IndexForItem+47));
ItemInfo->socket1 = bGetOffsetValue(cp, (IndexForItem+51));
ItemInfo->socket2 = bGetOffsetValue(cp, (IndexForItem+52));
ItemInfo->socket3 = bGetOffsetValue(cp, (IndexForItem+53));
ItemInfo->IsItemEquipped = (BOOL)bGetOffsetValue(cp, (IndexForItem+54));
ItemInfo->ItemPosX = (sWORD)wGetOffsetValue(cp, (IndexForItem+55));
ItemInfo->ItemPosY = (sWORD)wGetOffsetValue(cp, (IndexForItem+57));
ItemInfo->ItemUniqueID = ullGetOffsetValue(cp, (IndexForItem+59));
if(ItemInfo->ItemUniqueID == 0){
ItemInfo->ItemUniqueID = CurItemID;
CurItemID++;
}
//ItemInfo->DupItemCode = CheckDupItem(ItemInfo, myConn, FALSE);
ItemInfo->PutItemInBank = FALSE;
if(w) itemQuery.append(",");
sprintf(QueryConsult, "(%lu,'%s',%lu,%d,%d,%d,%d,%d,%d,%d,%d,%u,%lu,",
CharID ,ItemInfo->ItemName,ItemInfo->ItemCount, ItemInfo->TouchEffectType, ItemInfo->TouchEffectValue1, ItemInfo->TouchEffectValue2, ItemInfo->TouchEffectValue3, ItemInfo->ItemColor, ItemInfo->ItemSpecEffectValue1, ItemInfo->ItemSpecEffectValue2, ItemInfo->ItemSpecEffectValue3, ItemInfo->CurLifeSpan, ItemInfo->Attribute);
itemQuery.append(QueryConsult);

if(ItemInfo->socket1 != SG_NONE)
sprintf(QueryConsult, "%u,", ItemInfo->socket1);
else
sprintf(QueryConsult, "NULL,", ItemInfo->socket1);
itemQuery.append(QueryConsult);
if(ItemInfo->socket2 != SG_NONE)
sprintf(QueryConsult, "%u,", ItemInfo->socket2);
else
sprintf(QueryConsult, "NULL,", ItemInfo->socket2);
itemQuery.append(QueryConsult);
if(ItemInfo->socket3 != SG_NONE)
sprintf(QueryConsult, "%u,", ItemInfo->socket3);
else
sprintf(QueryConsult, "NULL,", ItemInfo->socket3);
itemQuery.append(QueryConsult);
sprintf(QueryConsult, "%d,%d,%d,%I64u,'BAG')", ItemInfo->IsItemEquipped, ItemInfo->ItemPosX, ItemInfo->ItemPosY, ItemInfo->ItemUniqueID);
itemQuery.append(QueryConsult);
DeleteItemOnDB(ItemInfo, CharID, myConn);
}
itemQuery.append(";");
if(ProcessQuery(&myConn, (char *) itemQuery.c_str()) == -1) return;
pQueryResult = mysql_store_result(&myConn);
SAFEFREERESULT(pQueryResult);
}
Index = (WORD)(charIndexEnd+225+(NItems*67));
NBankItems = bGetOffsetValue(cp, Index);
if(NBankItems > 0){
itemQuery.clear();
itemQuery.append("INSERT INTO `item` ( `CharID` , `ItemName`, `Count` , `ItemType`, `ID1`, `ID2`, `ID3`, \
`Color`, `Effect1`, `Effect2`, `Effect3`, `LifeSpan`, `Attribute`, `Socket1`, `Socket2`, `Socket3`, `ItemID`, `ItemPos`) VALUES ");
for(w = 0; w < NBankItems; w++){
IndexForItem = (WORD)(Index+1+(w*62));
ZeroMemory(ItemInfo->ItemName, sizeof(ItemInfo->ItemName));
SafeCopy(ItemInfo->ItemName, cp+IndexForItem, 20);
if(strlen(ItemInfo->ItemName) == 0) continue;
ItemInfo->ItemCount = dwGetOffsetValue(cp, (IndexForItem+20));
ItemInfo->TouchEffectType = (sWORD)wGetOffsetValue(cp, (IndexForItem+24));
ItemInfo->TouchEffectValue1 = (sWORD)wGetOffsetValue(cp, (IndexForItem+26));
ItemInfo->TouchEffectValue2 = (sWORD)wGetOffsetValue(cp, (IndexForItem+30));
ItemInfo->TouchEffectValue3 = (sWORD)dwGetOffsetValue(cp, (IndexForItem+34));
ItemInfo->ItemColor = bGetOffsetValue(cp, (IndexForItem+38));
ItemInfo->ItemSpecEffectValue1 = (sWORD)wGetOffsetValue(cp, (IndexForItem+39));
ItemInfo->ItemSpecEffectValue2 = (sWORD)wGetOffsetValue(cp, (IndexForItem+41));
ItemInfo->ItemSpecEffectValue3 = (sWORD)wGetOffsetValue(cp, (IndexForItem+43));
ItemInfo->CurLifeSpan = wGetOffsetValue(cp, (IndexForItem+45));
ItemInfo->Attribute = dwGetOffsetValue(cp, (IndexForItem+47));
ItemInfo->socket1 = bGetOffsetValue(cp, (IndexForItem+51));
ItemInfo->socket2 = bGetOffsetValue(cp, (IndexForItem+52));
ItemInfo->socket3 = bGetOffsetValue(cp, (IndexForItem+53));
ItemInfo->ItemUniqueID = ullGetOffsetValue(cp, (IndexForItem+54));
if(ItemInfo->ItemUniqueID == 0){
ItemInfo->ItemUniqueID = CurItemID;
CurItemID++;
}
//ItemInfo->DupItemCode = CheckDupItem(ItemInfo, myConn, TRUE);
ItemInfo->PutItemInBank = TRUE;
if(w) itemQuery.append(",");
sprintf(QueryConsult, "(%lu,'%s',%lu,%d,%d,%d,%d,%d,%d,%d,%d,%u,%lu,",
CharID ,ItemInfo->ItemName,ItemInfo->ItemCount, ItemInfo->TouchEffectType, ItemInfo->TouchEffectValue1, ItemInfo->TouchEffectValue2, ItemInfo->TouchEffectValue3, ItemInfo->ItemColor, ItemInfo->ItemSpecEffectValue1, ItemInfo->ItemSpecEffectValue2, ItemInfo->ItemSpecEffectValue3, ItemInfo->CurLifeSpan, ItemInfo->Attribute);
itemQuery.append(QueryConsult);

if(ItemInfo->socket1 != SG_NONE)
sprintf(QueryConsult, "%u,", ItemInfo->socket1);
else
sprintf(QueryConsult, "NULL,", ItemInfo->socket1);
itemQuery.append(QueryConsult);
if(ItemInfo->socket2 != SG_NONE)
sprintf(QueryConsult, "%u,", ItemInfo->socket2);
else
sprintf(QueryConsult, "NULL,", ItemInfo->socket2);
itemQuery.append(QueryConsult);
if(ItemInfo->socket3 != SG_NONE)
sprintf(QueryConsult, "%u,", ItemInfo->socket3);
else
sprintf(QueryConsult, "NULL,", ItemInfo->socket3);
itemQuery.append(QueryConsult);
sprintf(QueryConsult, "%I64u, 'WH')", ItemInfo->ItemUniqueID);
itemQuery.append(QueryConsult);
DeleteItemOnDB(ItemInfo, CharID, myConn);
}
itemQuery.append(";");
if(ProcessQuery(&myConn, (char *) itemQuery.c_str()) == -1) return;
pQueryResult = mysql_store_result(&myConn);
SAFEFREERESULT(pQueryResult);
}
SAFEDELETE(ItemInfo);
Index += ((NBankItems*62)+1);
ZeroMemory(Profile, sizeof(Profile));
SafeCopy(Profile, (cp+Index), strlen(cp+Index));
ZeroMemory(QueryConsult, sizeof(QueryConsult));
ZeroMemory(GoodGuildName, sizeof(GoodGuildName));
MakeGoodName(GoodGuildName, GuildName);
ZeroMemory(GoodProfile, sizeof(GoodProfile));
MakeGoodName(GoodProfile, Profile);
sprintf(QueryConsult, "UPDATE `char_database` SET `LastSaveDate` = '%s',`ID1` = '%d',`ID2` = '%d',`ID3` = '%d',`Level` = '%d',`Strenght` = '%d',`Vitality` = '%d',`Dexterity` = '%d',`Intelligence` = '%d',`Magic` = '%d',`Agility` = '%d',`Luck` = '%d',`Exp` = '%lu',`Gender` = '%d',`Skin` = '%d',`HairStyle` = '%d',`HairColor` = '%d',`Underwear` = '%d',`ApprColor` = '%lu',`Appr1` = '%lu',`Appr2` = '%lu',`Appr3` = '%lu',`Appr4` = '%lu',`Nation` = '%s',`MapLoc` = '%s',`LocX` = '%d',`LocY` = '%d',`Profile` = '%s',`Contribution` = '%lu',`LeftSpecTime` = '%lu',`LockMapName` = '%s',`LockMapTime` = '%lu',`BlockDate` = '%s',`GuildName` = '%s',`GuildID` = '%d',`GuildRank` = '%d',`FightNum` = '%d',`FightDate` = '%lu',`FightTicket` = '%d',`QuestNum` = '%u',`QuestID` = '%u',`QuestCount` = '%u',`QuestRewType` = '%d',`QuestRewAmmount` = '%lu',\
`QuestCompleted` = '%d',`EventID` = '%lu',`WarCon` = '%lu',`CruJob` = '%d',`CruID` = '%lu',`CruConstructPoint` = '%lu', `Popularity` = '%li' ,`HP` = '%lu',`MP` = '%lu',`SP` = '%lu',`EK` = '%lu',`PK` = '%lu',`RewardGold` = '%lu',`DownSkillID` = '%d',`Hunger` = '%d',`LeftSAC` = '%u',`LeftShutupTime` = '%lu',`LeftPopTime` = '%lu',`LeftForceRecallTime` = '%lu',`LeftFirmStaminarTime` = '%lu',`LeftDeadPenaltyTime` = '%lu',`MagicMastery` = '%s',`PartyID` = '%lu',`GizonItemUpgradeLeft` = '%lu',`elo` = '%lu',`TotalEK` = '%lu' WHERE `CharID` = '%lu' LIMIT 1;",
SaveDate, CharID1, CharID2, CharID3, Level, STR, VIT, DEX, INT, MAG, AGI, Luck, Exp, Sex, Skin, HairStyle, HairColor, Underwear, ApprColor, Appr1, Appr2, Appr3, Appr4, Location, MapName, MapLocX, MapLocY, GoodProfile, Contribution, SpecialAbilityTime, LockedMapName, LockedMapTime, BlockDate, GoodGuildName, GuildID, GuildRank, FightzoneNumber, ReserveTime, FightzoneTicketNumber, Quest, QuestID, CurQuestCount, QuestRewardType, QuestRewardAmmount, IsQuestCompleted, SpecialEventID, WarContribution, CrusadeDuty, CrusadeGUID, ConstructionPoint, Rating, HP, MP, SP, EK, PK, RewardGold, DownSkillIndex, HungerStatus, SuperAttackLeft, TimeLeftShutUp, TimeLeftRating, TimeLeftForceRecall, TimeLeftFirmStaminar, DeadPenaltyTime, MagicMastery, PartyID, Gizon, elo, TotalEK, CharID);
//PutLogFileList(QueryConsult, "Logs/SaveCharQuery.txt");
if(ProcessQuery(&myConn, QueryConsult) == -1) return;
pQueryResult = mysql_store_result(&myConn);
SAFEFREERESULT(pQueryResult);
//char cTxt[50];
//sprintf(cTxt, "save bench: %u", timeGetTime() - bench);
//PutLogList(cTxt, WARN_MSG);
}
0

Share this post


Link to post
Share on other sites
Sorry... I give up.

I don't want to be rude, but you should learn how to structure your code and make it readable. And learn how to use the debugger.
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0