mirror of
https://forge.murkfall.net/bluesaxman/deckard-and-company.git
synced 2026-03-13 08:54:20 -06:00
Added client side Connection handling and basic UI updating. NO CSS UPDATES YET
This commit is contained in:
@@ -311,7 +311,7 @@ my $server = Net::WebSocket::Server->new(
|
||||
$conn->send_utf8('{"info":"user success"}');
|
||||
}
|
||||
if (defined($messageData->{session})) {
|
||||
unless(defined($conn->{user})) { $conn->send_utf8('{"error":200, "message":Could not join session, no user defined", "request":"user"}'); $conn->send_utf8('{"request":"session"}'); return 0; }
|
||||
unless(defined($conn->{user})) { $conn->send_utf8('{"error":200, "message":"Could not join session, no user defined", "request":"user"}'); $conn->send_utf8('{"request":"session"}'); return 0; }
|
||||
$conn->{session} = $messageData->{session};
|
||||
$conn->send_utf8('{"info":"session success", "request":"join"}');
|
||||
}
|
||||
@@ -346,7 +346,12 @@ my $server = Net::WebSocket::Server->new(
|
||||
$current->send_utf8('{"pools":'.to_json(\%poolStats).'}');
|
||||
# Users Hands
|
||||
my @hands = getHands($sessionID,$conn->{user});
|
||||
$current->send_utf8('{"hands":'.to_json(\@hands).'}');
|
||||
my %handStats = ();
|
||||
for (@hands) {
|
||||
$handStats{$_}{name} = $_;
|
||||
$handStats{$_}{cards} = [];
|
||||
}
|
||||
$current->send_utf8('{"hands":'.to_json(\%handStats).'}');
|
||||
# for each hand
|
||||
for (@hands) {
|
||||
my $handID = $_;
|
||||
|
||||
Reference in New Issue
Block a user