Skip to main content
changed "the" to "that" in the sentence "After you've got all of the loaded..."
Source Link

As to

but what would the method be when the player logged in and you needed to get their inventory etc

You need to look at Managing Sessions and State with PHP or PHP Session Management With Cookies.

In general when the player logs in you'll query the database for all the information needed to hydrate the objects associated with the player, such as their inventory and the properties of the objects contained within. After you've got all of thethat loaded you can store it in the session and updated it as needed, such as removing a used item from inventory. When the session ends you update the database with the final state.

Note: the above could easily run into scaling issues, as keeping large objects and collections of objects in memory becomes expensive, however, it is straightforward to implement, and by the time you become the next WOW you'll either have the experience or enough clout to hire those who do.

As to

but what would the method be when the player logged in and you needed to get their inventory etc

You need to look at Managing Sessions and State with PHP or PHP Session Management With Cookies.

In general when the player logs in you'll query the database for all the information needed to hydrate the objects associated with the player, such as their inventory and the properties of the objects contained within. After you've got all of the loaded you can store it in the session and updated it as needed, such as removing a used item from inventory. When the session ends you update the database with the final state.

Note: the above could easily run into scaling issues, as keeping large objects and collections of objects in memory becomes expensive, however, it is straightforward to implement, and by the time you become the next WOW you'll either have the experience or enough clout to hire those who do.

As to

but what would the method be when the player logged in and you needed to get their inventory etc

You need to look at Managing Sessions and State with PHP or PHP Session Management With Cookies.

In general when the player logs in you'll query the database for all the information needed to hydrate the objects associated with the player, such as their inventory and the properties of the objects contained within. After you've got all of that loaded you can store it in the session and updated it as needed, such as removing a used item from inventory. When the session ends you update the database with the final state.

Note: the above could easily run into scaling issues, as keeping large objects and collections of objects in memory becomes expensive, however, it is straightforward to implement, and by the time you become the next WOW you'll either have the experience or enough clout to hire those who do.

Source Link

As to

but what would the method be when the player logged in and you needed to get their inventory etc

You need to look at Managing Sessions and State with PHP or PHP Session Management With Cookies.

In general when the player logs in you'll query the database for all the information needed to hydrate the objects associated with the player, such as their inventory and the properties of the objects contained within. After you've got all of the loaded you can store it in the session and updated it as needed, such as removing a used item from inventory. When the session ends you update the database with the final state.

Note: the above could easily run into scaling issues, as keeping large objects and collections of objects in memory becomes expensive, however, it is straightforward to implement, and by the time you become the next WOW you'll either have the experience or enough clout to hire those who do.