Jump to content

Recommended Posts

  • Replies 8
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

.sql file?

Okey, but i think the problem somewhere in source.

http://pastebin.com/nPewvUhW

 

In clientmanagerplayer.cpp

see this:

 

queryLen = snprintf(queryStr, sizeof(queryStr), 
            "INSERT INTO player%s "
            "(id, account_id, name, level, st, ht, dx, iq, "
            "job, voice, dir, x, y, z, "
            "hp, mp, random_hp, random_sp, stat_point, stamina, part_base, part_main, part_hair, part_acce, gold, playtime, "
            "skill_level, quickslot) "
            "VALUES(0, %u, '%s', %d, %d, %d, %d, %d, "
            "%d, %d, %d, %d, %d, %d, %d, "
            "%d, %d, %d, %d, %d, %d, %d, %d, 0, %lld, 0, ",

%lld <-- This is the gold. If i write this to 0, it's working, but that's a very very poor fix, i have to find the problem's real cause.

Edit: It's not caused by the gold int-->long long. It's worked me for a long time, maybe a new system wrong it. Example Offlineshop.

Link to comment
https://metin2.dev/topic/11046-4629785096512077824/#findComment-64761
Share on other sites

You need to check if all the placeholders (not sure how to call them, but i'm talking about the %d etc) match the variable type you're feeding it. Example:

unsigned long long tmp = 50;

snprintf("INERT INTO test (gold, time) VALUES (%d, NOW())")

 

This will give you the error you're getting because it overflows. The correct format specifier would be %ulld.

Make sure all the format specifiers and variables match each other and you shouldn't get the error anymore.

Link to comment
https://metin2.dev/topic/11046-4629785096512077824/#findComment-64764
Share on other sites

morion, yes, but it's a very very poor fix, i wrote it.

DangIt, i think all match, but i tried with %d and works. But it shouldn't!

tables.h:

 

typedef struct SPlayerTable
	{
[...]
long long    gold;

index.php?q=aHR0cDovL2tlcGZlbHRvbHRlcy5o

It should work with %lld not %d... Why?

Link to comment
https://metin2.dev/topic/11046-4629785096512077824/#findComment-64768
Share on other sites

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.