Idea

gbacsi avatar image
gbacsi suggested

Legacy CloudScript: Transactional handlers

It would be really nice if an error would not corrupt the player state. An example which is unfortunately not so theoretical and happens too frequently: player calls handler to buy something for virtual currency Handler adds data to player data * Handler subtract virtual currecncy

As a precaution I always put to the "giving" stuff before the "taking away" stuff, exactly because writing player data and updating currency can and will produce an internal server error, and will leave the player data in a corrupted state, because 1 update operation is executed but the other not. So even a retry is not a correct solution.

It would be nice simple to say for any handler that if any exceptions were thrown during execution, the player state is not updated at all. It would be either all or nothing. This way we could safely retry the call from the game client. Or to define a transaction blocks with "begin" and "end".

CloudScript
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

No Comments

·

Write a Comment

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Your Opinion Counts

Share your great idea, or help out by voting for other people's ideas.