Buying game currency
The payment processor verified a payment with its provider, then called a game RPC to credit the player’s balance. Order records were stored separately in PostgreSQL.
System design
On the website, a room was a numbered space on a floor plan. In the game, it was a place where guests could meet. In the marketplace, it was a collectible someone could own.
Explore the system map
Follow a guest action through the clients, services and records that powered the original hotel.
The game sent live actions to Nakama. The website used HTTP for catalog and listing data. A wallet signature authorized a trade on the EVM network.
The game joined a match and exchanged movement messages over its socket. Nakama loaded furniture and permissions from storage and kept the current guests in match state.
The React Native app hosted the same web game. JSON messages requested features such as audio and notifications. The shell called back into the game with results.
Selecting a floor range sent one HTTP request. The hotel service used Prisma to load its floors, room footprints, artwork and collection metadata together.
The wallet signed a trade on the EVM marketplace contract. A listener consumed the execution event and updated the listing index. The website queried that index through the gateway and marketplace API.
The payment processor credited a game balance after verifying payment. A shop purchase could debit that balance and mint an NFT to the player’s blockchain wallet.
Two guests can see each other move because both game clients listen to the same authoritative room match.
The signed-in client calls findMatch. Nakama finds a
running match for the requested space or creates one, then returns
its ID.
The client joins by ID. The server sends the current world state to the new guest and announces their arrival to the other players.
A click in the scene sends OnPlayerSetGoal with tile
coordinates over the match socket.
The server updates the guest’s position in match state and broadcasts the movement. Each Phaser client moves the avatar in its own scene.
A guest leaving a room removed their presence from the match. The floor plan, furniture arrangement and NFT ownership each had their own lifetime.
| Question | Source of truth | How it was used |
|---|---|---|
| Where is room 1001? | Hotel database | The floor explorer drew the room at the tile coordinates assigned by the catalog import. |
| Who is here now? | Nakama match state | The match tracked each guest’s position until they left. |
| What is in the room? | Nakama room storage | Saved furniture placements and permissions were loaded when the room opened. |
| Who owns the token? | NFT collection contract | An on-chain transfer changed the owner. The marketplace kept a separate index of listings. |
Game balances lived in Nakama’s account wallet. Blockchain wallets held tokens. Two purchase paths connected those systems to the player experience.
The payment processor verified a payment with its provider, then called a game RPC to credit the player’s balance. Order records were stored separately in PostgreSQL.
The shop checked and debited the game balance. For a mintable collection, its backend signed the mint, waited for a chain confirmation and recorded the purchase.
These are the original codebases behind the paths above. Open a group to see where each responsibility lived.
Network.ts connected the client to Nakama.
AppView.tsx hosted the WebView and
handled messages between the game and native code.
FindMatch.ts selected or
created matches. PublicSpaceComponent.ts managed
presence, movements and room initialization.
floor-range.service.ts loaded the building, floors,
rooms and collection metadata through Prisma.
listener.service.ts handled listing creation,
execution and cancellation events.
bithotel-casper-contracts.
The portfolio preserves the floor plans and collection artwork from the original platform.
Explore the hotel floors Browse the marketplace