… | |
… | |
124 | } |
124 | } |
125 | |
125 | |
126 | sub new_game { |
126 | sub new_game { |
127 | my ($self) = @_; |
127 | my ($self) = @_; |
128 | |
128 | |
129 | my $d = $self->{app}{defaults}; |
|
|
130 | |
|
|
131 | my $game = new game conn => $self->{conn}, app => $self->{app}, roomid => $self->{channel}; |
129 | my $game = new game conn => $self->{conn}, app => $self->{app}, roomid => $self->{channel}; |
132 | $game->{challenge}{""} = { |
130 | $game->new_game_challenge; |
133 | gametype => $d->{gametype}, |
|
|
134 | flags => 0, |
|
|
135 | notes => $d->{stones}, |
|
|
136 | rules => { |
|
|
137 | ruleset => $d->{ruleset}, |
|
|
138 | size => $d->{size}, |
|
|
139 | timesys => $d->{timesys}, |
|
|
140 | time => $d->{time}, |
|
|
141 | interval => $d->{timesys} == TIMESYS_BYO_YOMI ? $d->{byo_time} : $d->{can_time}, |
|
|
142 | count => $d->{timesys} == TIMESYS_BYO_YOMI ? $d->{byo_periods} : $d->{can_stones}, |
|
|
143 | }, |
|
|
144 | |
|
|
145 | inlay => $game->{chat}->new_inlay, |
|
|
146 | }; |
|
|
147 | $game->draw_challenge (""); |
|
|
148 | $game->show_all; |
131 | $game->show_all; |
149 | |
132 | |
150 | push @{$self->{new_game}}, $game; |
133 | push @{$self->{new_game}}, $game; |
151 | } |
134 | } |
152 | |
135 | |