Skip to content

Conversation

@mevernom
Copy link

  • chore: add logos from round4 unions
  • feat: displayName for players

* @param newDisplayName - The new display name to set.
* @returns A transaction object for setting the display name.
*/
public async setDisplayName(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ContractsAPI only calls the contracts to get the data, not handle with the logic of submit transactions.

It is better to directly implement this function in GameManager

public async setDisplayName(
playerAddress: EthAddress,
newDisplayName: string
): Promise<Transaction<TxIntent>> {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please introduce UnconfirmedSetDisplayName


// Function to set the displayName, accessible only by admin or player themselves
function setDisplayName(address player, string memory newDisplayName) public onlyAdminOrSelf(player) {
PlayerProfileStorage storage pps = LibStorage.playerProfileStorage();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

function pps() internal pure returns (PlayerProfileStorage storage) {
return LibStorage.playerProfileStorage();
}

You can directly use pps()


// Function to get the displayName for a given player
function getDisplayName(address player) public view returns (string memory) {
PlayerProfileStorage storage pps = LibStorage.playerProfileStorage();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can directly use pps() here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants