--- deliantra/server/ext/login.ext 2007/04/02 18:14:24 1.33 +++ deliantra/server/ext/login.ext 2007/04/06 22:57:53 1.37 @@ -80,6 +80,17 @@ . "&& (rm -rf ~\Q$Coro::current\E~deleting~ &)"; } +sub send_capabilities { + my ($ns) = @_; + + return unless $ns->extcmd; + + $ns->ext_event (capabilities => + # id, name, flags (1 == 2d), edge length + tileset => [[1, "default 64x64 faceset", 1, 64], [0, "default 32x32 faceset", 1, 32]], + ); +} + sub setup { my ($ns, $args) = @_; @@ -91,7 +102,6 @@ my %setup = split / +/, $args; while (my ($k, $v) = each %setup) { - if ($k eq "sound") { $ns->sound ($v); @@ -123,6 +133,7 @@ } elsif ($k eq "extcmd") { $ns->extcmd ($v > 0); + send_capabilities $ns; } elsif ($k eq "extmap") { $ns->extmap ($v); @@ -135,6 +146,9 @@ $setup{$k} = 0; # $ns->image2 (1) + } elsif ($k eq "tileset") { + $setup{$k} = $ns->faceset ($v & 1); + } elsif ($k eq "itemcmd") { # Version of the item protocol command to use. Currently, # only supported versions are 1 and 2. Using a numeric @@ -146,8 +160,8 @@ } elsif ($k eq "mapsize") { my ($x, $y) = split /x/, $v; - $ns->mapx ($x = max 9, min cf::MAP_CLIENT_X, $x); - $ns->mapy ($y = max 9, min cf::MAP_CLIENT_Y, $y); + $ns->mapx ($x = max 9, min cf::MAP_CLIENT_X, ($x - 1) | 1); + $ns->mapy ($y = max 9, min cf::MAP_CLIENT_Y, ($y - 1) | 1); $setup{$k} = "${x}x${y}"; @@ -157,6 +171,9 @@ } elsif ($k eq "extendedTextInfos") { $ns->has_readable_type ($v); + } elsif ($k eq "fxix") { + $ns->fxix ($v); + } else { # other commands: # sexp: no idea, probably for oudated servers @@ -338,6 +355,19 @@ cf::NDI_RED ); next; + } + } else { + # unable to load the playerfile: + # check wether the player dir exists, which means the file is corrupted or + # something very similar. + if (!aio_stat cf::player::playerdir $user) { + $ns->send_drawinfo ( + "Unable to retrieve this player. It might be a locked or broken account. " + . "If this is your account, ask a dungeon master for assistance. " + . "Otherwise choose a different login name.", + cf::NDI_RED + ); + next; } }