ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/ext/login.ext
(Generate patch)

Comparing deliantra/server/ext/login.ext (file contents):
Revision 1.119 by root, Thu Nov 15 05:54:02 2012 UTC vs.
Revision 1.120 by root, Thu Nov 15 06:00:16 2012 UTC

2 2
3# login handling 3# login handling
4 4
5use Fcntl; 5use Fcntl;
6use Coro::AIO; 6use Coro::AIO;
7use Deliantra::Util ();
7 8
8CONF MAX_DISCONNECT_TIME = 3600; 9CONF MAX_DISCONNECT_TIME = 3600;
9 10
10sub query { 11sub query {
11 my ($ns, $flags, $text) = @_; 12 my ($ns, $flags, $text) = @_;
169 $Coro::current->{desc} = "addme($user) chargen"; 170 $Coro::current->{desc} = "addme($user) chargen";
170 171
171 # just to make sure nothing is left over 172 # just to make sure nothing is left over
172 # normally, nothing is there. 173 # normally, nothing is there.
173 nuke_playerdir $user; 174 nuke_playerdir $user;
174
175 my $pass2 = query $ns, cf::CS_QUERY_HIDEINPUT, "Please type your password again.";
176
177 if ($pass2 ne $pass) {
178 $ns->send_drawinfo (
179 "The passwords do not match, please try again.",
180 cf::NDI_RED
181 );
182 Coro::Timer::sleep 0.5;
183 next;
184 }
185 175
186 my $pl = cf::player::new $user; 176 my $pl = cf::player::new $user;
187 $pl->password (encode_password $pass); 177 $pl->password (encode_password $pass);
188 $pl->connect ($ns); 178 $pl->connect ($ns);
189 my $ob = $pl->ob; 179 my $ob = $pl->ob;
397 ); 387 );
398 next; 388 next;
399 } 389 }
400 } 390 }
401 391
392 my $pass2 = query $ns, cf::CS_QUERY_HIDEINPUT, "Please type your password again.";
393
394 if ($pass2 ne $pass) {
395 $ns->send_drawinfo (
396 "The passwords do not match, please try again.",
397 cf::NDI_RED
398 );
399 Coro::Timer::sleep 0.5;
400 next;
401 }
402
402 last; 403 last;
403 } 404 }
404 405
405 # lock again, too layz to make this nicer 406 # lock again, too layz to make this nicer
406 local $cf::LOGIN_LOCK{$user} = 1; 407 local $cf::LOGIN_LOCK{$user} = 1;
408
407 chargen $ns, $user, $pass; 409 chargen $ns, $user, $pass;
408 login_done $ns->pl; 410 login_done $ns->pl;
409 }); 411 });
410}); 412});
411 413

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines