ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/kgsueme/kgsueme/app.pl
(Generate patch)

Comparing kgsueme/kgsueme/app.pl (file contents):
Revision 1.3 by pcg, Wed Jul 30 02:14:21 2003 UTC vs.
Revision 1.4 by pcg, Wed Jul 30 15:14:21 2003 UTC

176sub open_game { 176sub open_game {
177 my ($self, %arg) = @_; 177 my ($self, %arg) = @_;
178 178
179 ($self->{game}{$arg{channel}} ||= new game %arg, conn => $self->{conn}, app => $self) 179 ($self->{game}{$arg{channel}} ||= new game %arg, conn => $self->{conn}, app => $self)
180 ->join; 180 ->join;
181 Scalar::Util::weaken $self->{game}{$arg{channel}};
181 $self->{game}{$arg{channel}}; 182 $self->{game}{$arg{channel}};
182} 183}
183 184
184sub open_room { 185sub open_room {
185 my ($self, %arg) = @_; 186 my ($self, %arg) = @_;
186 187
187 ($self->{room}{$arg{channel}} ||= new room %arg, conn => $self->{conn}, app => $self) 188 ($self->{room}{$arg{channel}} ||= new room %arg, conn => $self->{conn}, app => $self)
188 ->join; 189 ->join;
190 Scalar::Util::weaken $self->{game}{$arg{channel}};
189 $self->{room}{$arg{channel}}; 191 $self->{room}{$arg{channel}};
190} 192}
191 193
192sub open_user { 194sub open_user {
193 my ($self, %arg) = @_; 195 my ($self, %arg) = @_;
194 196
195 ($self->{user}{lc $arg{name}} ||= new user %arg, conn => $self->{conn}, app => $self) 197 ($self->{user}{lc $arg{name}} ||= new user %arg, conn => $self->{conn}, app => $self)
196 ->join; 198 ->join;
199 Scalar::Util::weaken $self->{user}{lc $arg{name}};
197 $self->{user}{lc $arg{name}}; 200 $self->{user}{lc $arg{name}};
198} 201}
199 202
200sub do_command { 203sub do_command {
201 my ($self, $chat, $cmd, $arg, %arg) = @_; 204 my ($self, $chat, $cmd, $arg, %arg) = @_;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines