added functions for getting names and changing names of things
This commit is contained in:
parent
f73049a854
commit
93596ab81a
@ -159,6 +159,39 @@ sub getPools {
|
|||||||
return keys %{$sessions{$sessionID}{"pools"}};
|
return keys %{$sessions{$sessionID}{"pools"}};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub getDeckName {
|
||||||
|
my ($sessionID, $deckID) = @_;
|
||||||
|
return $sessions{$sessionID}{"decks"}{$deckID}{name};
|
||||||
|
}
|
||||||
|
|
||||||
|
sub getUserName {
|
||||||
|
my ($sessionID, $userID) = @_;
|
||||||
|
return $sessions{$sessionID}{"users"}{$userID}{name};
|
||||||
|
}
|
||||||
|
|
||||||
|
sub getPoolName {
|
||||||
|
my ($sessionID, $poolID) = @_;
|
||||||
|
return $sessions{$sessionID}{"pools"}{$poolID}{name};
|
||||||
|
}
|
||||||
|
|
||||||
|
sub renameDeck {
|
||||||
|
my ($sessionID, $deckID, $newName) = @_;
|
||||||
|
unless (defined($newName)) { return print "ERROR: No name provided"; }
|
||||||
|
$sessions{$sessionID}{"decks"}{$deckID}{name} = $newName;
|
||||||
|
}
|
||||||
|
|
||||||
|
sub renameUser {
|
||||||
|
my ($sessionID, $userID, $newName) = @_;
|
||||||
|
unless (defined($newName)) { return print "ERROR: No name provided"; }
|
||||||
|
$sessions{$sessionID}{"users"}{$userID}{name} = $newName;
|
||||||
|
}
|
||||||
|
|
||||||
|
sub renamePool {
|
||||||
|
my ($sessionID, $poolID, $newName) = @_;
|
||||||
|
unless (defined($newName)) { return print "ERROR: No name provided"; }
|
||||||
|
$sessions{$sessionID}{"pools"}{$poolID}{name} = $newName;
|
||||||
|
}
|
||||||
|
|
||||||
sub addHand {
|
sub addHand {
|
||||||
my ($sessionID, $userID, $handID) = @_;
|
my ($sessionID, $userID, $handID) = @_;
|
||||||
$sessions{$sessionID}{"users"}{$userID}{hands}{$handID} = { cards => [] };
|
$sessions{$sessionID}{"users"}{$userID}{hands}{$handID} = { cards => [] };
|
||||||
|
Loading…
x
Reference in New Issue
Block a user