items - ryzom/ryzomcore GitHub Wiki


title: Game Item Manager description: published: true date: 2023-03-01T05:14:25.898Z tags: editor: markdown dateCreated: 2020-11-16T00:19:55.498Z

CGameItem represents the state of a game item on the server. This is sent in two ways to the client. As a summary through the inventory update message or database, and as a CGameItemInfos structure, which compiles the item as POD which can be serialized. The item info window displays the contents of the CGameItemInfos structure. The inventory displays only the summary.

Contents of CGameItemInfos are generally non-changing. In the off-event that an item has any of the entries that are in CGameItemInfos changed (for example, CustomText,) the server must send an ITEM_INFO:REFRESH_VERSION message to the client. The client can then request the updated item info if it has any window open for the item. This roundtrip causes some delay, but is acceptable as it should be an infrequent occurence. Ideally client-initiated changes should be ghosted on the client, so the delay becomes invisible to the player. The info refresh behaviour can be tested by issuing an ITEM:WRITE message to the server.

Values of CGameItem, which change the inventory summary, immediately must flag the inventory of this change. The updated summary will be directly sent for the client inventory slot.

For a guild inventory all clients share the same identical view of the databank. As a side effect, the guild inventory is unable to show whether an item's prerequirements are met by a player.

References to CGameItem in EGS are held through the CGameItemPtr. While this structure currently manages a reference count on the item, items must be deleted cleanly through the CGameItemPtr::deleteItem function, as this reference count may be removed again in the future.

⚠️ **GitHub.com Fallback** ⚠️