… | |
… | |
105 | $ns->send_drawinfo ( |
105 | $ns->send_drawinfo ( |
106 | "That username is currently used in another login session. " |
106 | "That username is currently used in another login session. " |
107 | . "Chose another, or wait till the other session has ended.", |
107 | . "Chose another, or wait till the other session has ended.", |
108 | cf::NDI_RED |
108 | cf::NDI_RED |
109 | ); |
109 | ); |
110 | } elsif ($user =~ /^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,17}$/) { |
110 | } elsif ($user =~ /^[a-zA-Z0-9][a-zA-Z0-9\-_]{2,17}\z/) { |
111 | last; |
111 | last; |
112 | } else { |
112 | } else { |
113 | $ns->send_drawinfo ( |
113 | $ns->send_drawinfo ( |
114 | "Your username contains illegal characters " |
114 | "Your username contains illegal characters " |
115 | . "(only a-z, A-Z and 0-9 are allowed), " |
115 | . "(only a-z, A-Z and 0-9 are allowed), " |
… | |
… | |
283 | } else { |
283 | } else { |
284 | $ob->reply (undef, |
284 | $ob->reply (undef, |
285 | "Ok, quitting, hope to see you again.", |
285 | "Ok, quitting, hope to see you again.", |
286 | cf::NDI_UNIQUE | cf::NDI_RED); |
286 | cf::NDI_UNIQUE | cf::NDI_RED); |
287 | $pl->ns->flush; |
287 | $pl->ns->flush; |
288 | $pl->quit_character; |
288 | cf::async { $pl->quit_character }; |
289 | } |
289 | } |
290 | }); |
290 | }); |
291 | }; |
291 | }; |
292 | |
292 | |
293 | cf::object->attach ( |
293 | cf::object->attach ( |