--- deliantra/server/ext/setup.ext 2008/12/27 01:25:00 1.12 +++ deliantra/server/ext/setup.ext 2010/10/18 09:33:10 1.20 @@ -11,7 +11,7 @@ $ns->ext_msg (capabilities => # id, name, flags (1 == 2d), edge length - tileset => [[1, "default 64x64 faceset", 1, 64], [0, "default 32x32 faceset", 1, 32]], + tileset => [[1, "default 64x64 faceset", 1, 64], [0, "default 32x32 faceset", 1, 32], [2, "default text faceset", 2, 1]], ); } @@ -21,32 +21,17 @@ # run through the cmds of setup # syntax is setup ... # - # we send the status of the cmd back, or a FALSE is the cmd is the server unknown - # The client then must sort this out + # we send the status of the cmd back, or a FALSE is the cmd if the server unknown + # the client then must sort this out my %setup = split / +/, $args; while (my ($k, $v) = each %setup) { if ($k eq "sound") { $ns->sound ($v); - } elsif ($k eq "exp64") { - $setup{$k} = 1; - } elsif ($k eq "spellmon") { $ns->monitor_spells ($v); - } elsif ($k eq "darkness") { - $setup{$k} = 1; - - } elsif ($k eq "map1cmd") { - $ns->mapmode (cf::Map1Cmd) if $v > 0; - - } elsif ($k eq "map1acmd") { - $ns->mapmode (cf::Map1aCmd) if $v > 0; - - } elsif ($k eq "newmapcmd") { - $ns->newmapcmd ($v); - } elsif ($k eq "mapinfocmd") { $ns->mapinfocmd ($v); @@ -54,19 +39,13 @@ $ns->extcmd (min 2, $v); send_capabilities $ns; - } elsif ($k eq "extmap") { - $ns->extmap ($v); - - } elsif ($k eq "facecache") { - $setup{$k} = 1; - } elsif ($k eq "faceset") { $ns->faceset (0); $setup{$k} = 0; # $ns->image2 (1) } elsif ($k eq "tileset") { - $setup{$k} = $ns->faceset ($v & 1); + $setup{$k} = $ns->faceset (int cf::clamp $v, 0, 2); } elsif ($k eq "itemcmd") { # Version of the item protocol command to use. Currently, @@ -92,12 +71,6 @@ } elsif ($k eq "smoothing") { # cfplus-style smoothing $ns->smoothing ($v); - } elsif ($k eq "fxix") { - $setup{$k} = 3; - - } elsif ($k eq "msg") { - $ns->can_msg ($setup{$k} = min 2, $v); - } elsif ($k eq "widget") { # server-side widgets $v = $v > 1; @@ -124,15 +97,26 @@ $setup{$k} = "FALSE"; } - } - - $ns->send_packet (join " ", setup => %setup); - - cf::datalog setup => - request => $args, - reply => \%setup, - client => $ns->version, - ; + } + + # force some mandatory protocol options, most of these + # are for obsolete clients only + $setup{darkness} = 1; + $setup{exp64} = 1; + $setup{extmap} = 1; + $setup{facecache} = 1; + $setup{fxix} = 3; + $setup{map1acmd} = 1; + $setup{map1cmd} = 0; + $setup{msg} = 1; + $setup{newmapcmd} = 1; + + + $ns->send_packet (join " ", setup => %setup); + + cf::datalog setup => + request => $args, + reply => \%setup, + ; }); -