Utopia42-club / utopia

Utopia42 web-based client
http://utopia42.club/
MIT License
1 stars 0 forks source link

How to avoid conflicts? #5

Closed bakhshandeh closed 4 years ago

bakhshandeh commented 4 years ago

We have one world now and people can edit it at the same time. What will happen when more than one users are editing the world at the same time?

Consider this scenario: 1- User A opens the game and starts to edit it 2- User B also opens the game and starts to edit it at the same location as user A 3- User A saves his updates 4- User B saves his updates In this scenario, the updates for user A will be overwritten by user B.

Solutions:

1- Lock a part of the world when someone is editing it When a user wants to edit a part of the world, he needs to LOCK a 2d matrix first and then start to edit it. When a part of world is locked, just the user who locked it can save the updates for this part. The locks will be release after some time.

2- Allow the users to BUY a part of the world Same as above solution but we will assign the LANDs to the user permanently. So each part of the land will have an owner and just the owner can edit it OR can transfer the ownership to someone else.

Technical issues: We need to update the smart contract and handle the ownership/locks, ... . So everyone should be able to edit just his/her own lands and we need to check this at smart contract level.

bakhshandeh commented 4 years ago

We also need to limit the size of the world. Now the matrix is infinite and there is not any limits for the lands. We need to have a strategy and limit the size of the world.