finalburnneo / FBNeo

FinalBurn Neo - We are Team FBNeo.
http://neo-source.com
Other
879 stars 354 forks source link

Kaillera error with long game filenames #1793

Closed dangonzilla closed 3 weeks ago

dangonzilla commented 1 month ago

Hi, The kaillera servers and clients have a 127 maximum character limitation for creating games and if the name has more than 127 characters the game can't be created for playing online.

FBNeoKOF98Hack-

FBNeo_Roms_Name_Error_Kaillera

I attach you the 47 Arcade game list from FBNeo with that problem. It also happens with other console and microcomputer games (if you need the full FBNeo list I can make it for you) :

FBNeo_Roms_Name_Error_Kaillera.txt

In the Kaillera name list I've detected that there are some information that could be deleted and that it's not about the game title and it's from the FBNeo note information (the one marked in red in the picture), the name part within brackets (for example : [Hack, Other versions are selected in the dipswitch] or [Hack, Bootleg, Imperfect Protection Emulation]). If you don't add that information in Kaillera instead of 47 Arcade games there would only be 15 games with more than 127 characters that they would need to cut their names with another way.

FBNeoKOF98Hack

Can you fix it, please?

Thank you very much!

taoenwen commented 1 month ago

I will try to address this issue you mentioned as soon as possible.

taoenwen commented 4 weeks ago

@dangonzilla Hi,

I keep the game to 127 display characters ...

I've tested it initially and the problem should be fixed, please try it as well, thanks!

https://github.com/finalburnneo/FBNeo/commit/f18747e837e62b60e46cf5e13454051a1b977588

image

dangonzilla commented 3 weeks ago

Hi, we've tested the new build but sadly it doesn't work. Moreover you have tested it with a kaillera version from 2002 deprecated and with errors. When the 2nd player tries to enter the kaillera room, it gives the error like if we didn't have the rom. Even if I try to play it alone the FBNeo emulator crashes with that very old Kaillera version :

KailleraError1

I attach you a more recent kaillera client that it's the one often used by people who play online :

kailleraclient-2023.zip

Anyways, using your FBNeo modification with the recent kaillera client (or any other one) the problem of not being able to create the game room for having the name more than 127 characters still occurs.

KailleraError

Fortunately I've reviewed the FBNeo source code and I modified the scrn.cpp file managing to remove the additional bracket infomation (example : [Hack, Other versions are selected in the dipswitch]) at the kaillera names so they are shorter :

char* DecorateKailleraGameName(UINT32 nBurnDrv)
{
    static char szDecoratedName[256];
    UINT32 nOldBurnDrv = nBurnDrvActive;

    nBurnDrvActive = nBurnDrv;

    const char* s1 = "";
    const char* s2 = "";

    s1 = BurnDrvGetTextA(DRV_FULLNAME);

    s2 = BurnDrvGetTextA(DRV_NAME);

    snprintf(szDecoratedName, sizeof(szDecoratedName), "%s - %s", s1, s2);

    nBurnDrvActive = nOldBurnDrv;
    return szDecoratedName;
}

I also attach you the already edited source code (scrn.cpp) in a zip file so you can add it to the FBNeo emulator :

scrn.cpp.zip

With all that we manage to get all the FBNeo games including the console and microcomputer ones with less than 127 characters in kaillera so they can be played online except only 17 Arcade games that can be found at this file that would need to be manually abbreviated at their names :

FBNeo_17_Roms_Name_Error_Kaillera.txt

Thanks!

taoenwen commented 3 weeks ago

I think I know what I'm missing.

https://github.com/finalburnneo/FBNeo/commit/c0ccf872eb586b85669c797202836e7a86f95347

Then we can discard some of the extreme cases of FuallName rather than miss out on some other useful information; after all, we left ShortName intact.

Please go ahead and test it if you have the time, and I have a small apology for taking up your time, in addition to my thanks.

barbudreadmon commented 3 weeks ago

Imho, "decoration" should be removed from the names used for kaillera.

taoenwen commented 3 weeks ago

Imho, "decoration" should be removed from the names used for kaillera.

I will deal with it tonight: FullName - ShortName

taoenwen commented 3 weeks ago

https://github.com/finalburnneo/FBNeo/commit/98366e13dcf7949f1f093582057e30018e879a7c

Kaillera game name : FullName - ShortName

dangonzilla commented 3 weeks ago

Thank you very much. Now all the games are working online through Kaillera with the fixed names without decoration.

We've found a weird error. When you add the 17 Arcade games with longnames (the list that I sent you) to favorite section, some strange characters are added causing that their names have more than 127 characters in the Kaillera favorite list (depending from the favorite games added the error appears in some games or not randomly) causing not being able to be played online. On the other hand, if you choose those same games from the Kaillera normal complete list you can create the game room of those games and play without problems. I remark in red the strange characters in this picture :

Favorites-Error

But there is a game that can't be played in any way online even though it isn't in the favorite list because it always appears with 129 characters, the "ng" characters from "Ying" are unnecessary :

Knights of Valour Super Heroes / Sanguo Zhan Ji Fengyun Zaiqi / Sangoku Senki Super Heroes (SANGO EX+) (ver. 201 'Ying - kovytzy

Thank you very much!

taoenwen commented 3 weeks ago

Thank you very much. Now all the games are working online through Kaillera with the fixed names without decoration.

We've found a weird error. When you add the 17 Arcade games with longnames (the list that I sent you) to favorite section, some strange characters are added causing that their names have more than 127 characters in the Kaillera favorite list (depending from the favorite games added the error appears in some games or not randomly) causing not being able to be played online. On the other hand, if you choose those same games from the Kaillera normal complete list you can create the game room of those games and play without problems. I remark in red the strange characters in this picture :

Favorites-Error

But there is a game that can't be played in any way online even though it isn't in the favorite list because it always appears with 129 characters, the "ng" characters from "Ying" are unnecessary :

Knights of Valour Super Heroes / Sanguo Zhan Ji Fengyun Zaiqi / Sangoku Senki Super Heroes (SANGO EX+) (ver. 201 'Ying - kovytzy

Thank you very much!

Roger that, I'll look into it further.

taoenwen commented 3 weeks ago

We've found a weird error. When you add the 17 Arcade games with longnames (the list that I sent you) to favorite section, some strange characters are added causing that their names have more than 127 characters in the Kaillera favorite list (depending from the favorite games added the error appears in some games or not randomly) causing not being able to be played online. On the other hand, if you choose those same games from the Kaillera normal complete list you can create the game room of those games and play without problems. I remark in red the strange characters in this picture : But there is a game that can't be played in any way online even though it isn't in the favorite list because it always appears with 129 characters, the "ng" characters from "Ying" are unnecessary :

After initializing the string, it never happens again and can be considered resolved.

image image

Knights of Valour Super Heroes / Sanguo Zhan Ji Fengyun Zaiqi / Sangoku Senki Super Heroes (SANGO EX+) (ver. 201 'Ying - kovytzy

Special handling has been done for fields that are not accepted by the server, and it is working well so far.

image

@dangonzilla Hi, I finished testing on my side, please test it too if you have time, thanks!

https://github.com/finalburnneo/FBNeo/commit/5431651ef2a5ed0346978be7a672de246c1b1d26

dangonzilla commented 3 weeks ago

Hi,

I've tested the latest version available for download with the modification done later by dinkc64. I've noticed that the long names are now limited to 125 characters instead of 127 characters. The game "Knights of Valour Super Heroes / Sanguo Zhan Ji Fengyun Zaiqi / Sangoku Senki Super Heroes (SANGO EX+) (ver. 201 'Yitong Zhongyuan', China) - kovytzy" is now working on some kailleraclient.dll but it doesn't work with every one of them because of the ' character gives problems on some of them. I don't know if the previous solution done by you would work better in all Kaillera client since it removed the problematic character ' and moreover it mantained the 127 characters for all games but I couldn't test it.

Regarding to the problematic games added in Favorite section the problems are still there randomly depending on how many games are in Favorite and the order they were added. I attach you a Favorite file with the 17 problematic games and if you test them one by one in Kaillera you will see that some of them have some strange characters in their names at the end and they don't run. It's not problematic since they can be selected from the Kaillera complete list but the Favorites error is still there.

FBNeo-17_Favorites.zip

Thank you very much.

dangonzilla commented 3 weeks ago

I've downloaded your modification without the dinkc64 changes (I hope he doesn't get angry because of that), I've done a compilation for testing it and it gives a much better solution and it works with all the kaillera clients and all the problematic games at the Favorites section works perfectly because it doesn't have the ' character. Could you revert the changes, please?

taoenwen commented 3 weeks ago

I've downloaded your modification without the dinkc64 changes (I hope he doesn't get angry because of that), I've done a compilation for testing it and it gives a much better solution and it works with all the kaillera clients and all the problematic games at the Favorites section works perfectly because it doesn't have the ' character. Could you revert the changes, please?

OK

Igor-Arabe commented 3 weeks ago

I can't check this on kaillera now, But i think the problem is: ' should be \' in gameName string.

struct BurnDriver BurnDrvkovytzy = {
    "kovytzy", NULL, "pgm", NULL, "1999",
    "Knights of Valour Super Heroes / Sanguo Zhan Ji Fengyun Zaiqi / Sangoku Senki Super Heroes (SANGO EX+) (ver. 201 \'Yitong Zhongyuan\', China)\0", "Imperfect Protection Emulation", "IGS", "PolyGameMaster",
    L"Knights of Valour Super Heroes\0\u4e09\u56fd\u6218\u7eaa \u98ce\u4e91\u518d\u8d77\0\u4e09\u570b\u6230\u7d00 \u98a8\u96f2\u518d\u8d77\0\u4e09\u570b\u6230\u7d00 Super Heroes (SANGO EX+) (ver. 201 \'\u4e00\u7edf\u4e2d\u539f\', China)\0", NULL, NULL, NULL,
    BDF_GAME_WORKING, 4, HARDWARE_IGS_PGM | HARDWARE_IGS_USE_ARM_CPU, GBF_SCRFIGHT, 0,
    NULL, kovytzyRomInfo, kovytzyRomName, NULL, NULL, NULL, NULL, pgmInputInfo, kovassgDIPInfo,
    kovytzyInit, pgmExit, pgmFrame, pgmDraw, pgmScan, &nPgmPalRecalc, 0x900,
    448, 224, 4, 3
};
taoenwen commented 3 weeks ago

I can't check this on kaillera now, But i think the problem is: ' should be \' in gameName string.

@Igor-Arabe Hi,At first I thought so too, but in fact this was not the case, and I tested this problem a very large number of times until it was analyzed byte by byte in the buffer, after which memset was used to remove some unnecessary content.

image

Apparently the background of the picture is a running kovytzy and confirms that the problem has been solved.

@dangonzilla And sorry for the long wait, thanks for taking the time to test.

https://github.com/finalburnneo/FBNeo/commit/b0c6031afedead89e0b44e65626496ed9ab9997c

dangonzilla commented 3 weeks ago

Hi,

I've just test the new version and all the games work perfectly in Kaillera now. The kovytzy game and the Favorites problem are fully solved. It also works with the recent Kaillera clients.

Thank you very much for solving it!

taoenwen commented 3 weeks ago

You are welcome!

dinkc64 commented 3 weeks ago

Hi, I want to investigate this bug a little deeper (for academic purposes), and would like to know which kaillera client caused a failure with "kovytzy" in the previous days' fbn? Thanks :)

dinkc64 commented 3 weeks ago

Hi @dangonzilla, please test w/kaillera again using the latest exe

dangonzilla commented 3 weeks ago

Hi @dinkc64,

I tested the latest version and all is still working fine with the long names of the games in Kaillera :)

Thank you!