Added SteamInventoryInterface#94
Conversation
| MatchMakingKeyValuePair_t result; | ||
| bool success = matchmaking->GetLobbyDataByIndex((uint64) steamIDLobby, lobbyDataIndex, | ||
| result.m_szKey, 256, result.m_szValue, 256); | ||
| result.m_szKey, 256, result.m_szValue, 8192); |
There was a problem hiding this comment.
What's the reason behind this? The native field has a fixed size of char[256].
There was a problem hiding this comment.
According to the Steamworks Documentation (https://partner.steamgames.com/doc/api/ISteamMatchmaking) the cchValueBufferSize should be set to "k_cubChatMetadataMax" which is the "Maximum size in bytes that chat room, lobby, or chat/lobby member metadata may have.". It's value is "8192", so I thought it should be called with 8192 instead (maybe I misinterpreted this paragraph?).
There was a problem hiding this comment.
Ah, I see. Ok, then the bug is that you shouldn't use MatchMakingKeyValuePair_t for storing the result, because its m_szValue field is only limited to 256 characters.
|
|
||
| private static native String getItemDefinitionPropertyKeys(long pointer, int itemDefinition); /* | ||
| ISteamInventory* inventory = (ISteamInventory*) pointer; | ||
| char *valueBuffer = (char*) malloc(1); |
There was a problem hiding this comment.
I suppose you are leaking memory here.
| uint32 valueBufferSizeOut = 0; | ||
|
|
||
| inventory->GetItemDefinitionProperty((SteamItemDef_t) itemDefinition, NULL, valueBuffer, &valueBufferSizeOut); | ||
| valueBuffer = (char*) malloc(valueBufferSizeOut); |
| uint32 count = 0; | ||
| bool success = false; | ||
| if(inventory->GetResultItems((SteamInventoryResult_t) resultHandle, NULL, &count)) { | ||
| std::vector<SteamItemDetails_t> results; |
There was a problem hiding this comment.
Personally, I'm not a big fan of inviting the STL to the party, but well...
|
FYI I started looking into merging this. I just need to resolve a couple of conflicts with some changes of mine lingering around since a year... |
welcome back to github, brother |
|
Hey @code-disaster just wondering if this is still a possibility of being merged? |
Heyho,
I added the whole ISteamInventory interface as well as its corresponding classes and test methods. I also changed the language level from 7 to 8 to be able to use streams (And Java 1.7 is quite old now) and updated the steamworks sdk to v.1.49.
This closes #92
In order to be able to use the tests you have to upload the "inventoryTestItemDefs.json" inside the steamworks-inventoryservice menu and add a dynamic property for the following "tag_categorie:tag_value" - pair: "weapon:hat"