theace0296 / steamworks-node

A wrapper library to call the steamworks API from NodeJS.
MIT License
24 stars 2 forks source link

Error in SteamWorks.SteamUGC.SetItemTitle api #6

Open pixel-art-boop opened 2 years ago

pixel-art-boop commented 2 years ago

Hello, thank you for your work. I really like this project,but i have some error when i use SteamWorks.SteamUGC.SetItemTitle

This is my code


(async () => {
  if (SteamWorks.SteamAPI.IsSteamRunning()) {
    let ECreateItem_Result = await SteamWorks.SteamUGC.CreateItem(APP_ID, 0);
    console.log(ECreateItem_Result);
    if (ECreateItem_Result.m_eResult == 1) {
      console.log('fileId', ECreateItem_Result.m_nPublishedFileId);

        const updateHandler = SteamWorks.SteamUGC.StartItemUpdate(
        APP_ID,
        ECreateItem_Result.m_nPublishedFileId
      );
      console.log('updateHandler', updateHandler);

      let SetItemTitle = SteamWorks.SteamUGC.SetItemTitle(
        updateHandler,
        'TestTile'
      );

      const SetItemVisibility = SteamWorks.SteamUGC.SetItemVisibility(
        updateHandler,
        0
      );
      console.log(SetItemVisibility);
      let EItemUpdate_Res = await SteamWorks.SteamUGC.SubmitItemUpdate(
        updateHandler,
        'change_note'
      );
      console.log(EItemUpdate_Res);
    }
  }
})();

i got the result

fileId 2876741002
updateHandler 1154345876
false
Call result timed out after 10 seconds!
undefined

the SetItemTitle reutrns false and the SubmitItemUpdate returns undefined,It looks like the handle returned by StartItemUpdate is not correct,because in SteamworksPy i got the handle number is 9388192820997400523, it is very long

Is there any way to make it work?

Thanks!

theace0296 commented 2 years ago

My guess is that because the handle is returned as a unsigned long long (64 bit) it was being truncated to fit in the JS number type (32 bit). With 1.2.0, I added the conversion from unsigned long long to BigInt, which should fix this issue.