Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Smaller waiting room id #38

Open
ClaudeZsb opened this issue Jul 17, 2023 · 1 comment
Open

Smaller waiting room id #38

ClaudeZsb opened this issue Jul 17, 2023 · 1 comment
Assignees

Comments

@ClaudeZsb
Copy link
Collaborator

ClaudeZsb commented Jul 17, 2023

PlayerGlobal: {
  keySchema: {
    addr: "address",
  },
  schema: {
    roomId: "bytes32",
    gameId: "uint32",
    status: "PlayerStatus",
  },
},

First of all, roomId is reusable. Then a field of 2**256 seems to be too large and produces waste of storage. PlayerGlobal can be limited into just one slot if we use uint128 instead. Then any read or write of this table could be more gas efficient.

@ClaudeZsb ClaudeZsb self-assigned this Jul 19, 2023
@ClaudeZsb ClaudeZsb moved this to Todo in Long-term dev Jul 19, 2023
@aLIEzsss4
Copy link
Collaborator

aLIEzsss4 commented Jul 19, 2023

When displaying the waiting room, if the room owner has not exited, the room will continue to exist. Therefore, we need to add a last updated time for sorting, to ensure active rooms are seen by players.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

2 participants