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.34 by root, Tue Apr 3 00:21:37 2007 UTC vs.
Revision 1.35 by root, Wed Apr 4 02:07:19 2007 UTC

78 system "cd \Q$PLAYERDIR\E " 78 system "cd \Q$PLAYERDIR\E "
79 . "&& mv \Q$user\E ~\Q$Coro::current\E~deleting~ 2>/dev/null " 79 . "&& mv \Q$user\E ~\Q$Coro::current\E~deleting~ 2>/dev/null "
80 . "&& (rm -rf ~\Q$Coro::current\E~deleting~ &)"; 80 . "&& (rm -rf ~\Q$Coro::current\E~deleting~ &)";
81} 81}
82 82
83sub send_capabilities {
84 my ($ns) = @_;
85
86 return unless $ns->extcmd;
87
88 $ns->ext_event (capabilities =>
89 # id, name, flags (1 == 2d), edge length
90 tileset => [[1, "default 64x64 faceset", 1, 64], [0, "default 32x32 faceset", 1, 32]],
91 );
92}
93
83sub setup { 94sub setup {
84 my ($ns, $args) = @_; 95 my ($ns, $args) = @_;
85 96
86 # run through the cmds of setup 97 # run through the cmds of setup
87 # syntax is setup <cmdname1> <parameter> <cmdname2> <parameter> ... 98 # syntax is setup <cmdname1> <parameter> <cmdname2> <parameter> ...
89 # we send the status of the cmd back, or a FALSE is the cmd is the server unknown 100 # we send the status of the cmd back, or a FALSE is the cmd is the server unknown
90 # The client then must sort this out 101 # The client then must sort this out
91 102
92 my %setup = split / +/, $args; 103 my %setup = split / +/, $args;
93 while (my ($k, $v) = each %setup) { 104 while (my ($k, $v) = each %setup) {
94
95 if ($k eq "sound") { 105 if ($k eq "sound") {
96 $ns->sound ($v); 106 $ns->sound ($v);
97 107
98 } elsif ($k eq "exp64") { 108 } elsif ($k eq "exp64") {
99 $setup{$k} = 1; 109 $setup{$k} = 1;
121 } elsif ($k eq "mapinfocmd") { 131 } elsif ($k eq "mapinfocmd") {
122 $ns->mapinfocmd ($v); 132 $ns->mapinfocmd ($v);
123 133
124 } elsif ($k eq "extcmd") { 134 } elsif ($k eq "extcmd") {
125 $ns->extcmd ($v > 0); 135 $ns->extcmd ($v > 0);
136 send_capabilities $ns;
126 137
127 } elsif ($k eq "extmap") { 138 } elsif ($k eq "extmap") {
128 $ns->extmap ($v); 139 $ns->extmap ($v);
129 140
130 } elsif ($k eq "facecache") { 141 } elsif ($k eq "facecache") {
132 143
133 } elsif ($k eq "faceset") { 144 } elsif ($k eq "faceset") {
134 $ns->faceset (0); 145 $ns->faceset (0);
135 $setup{$k} = 0; 146 $setup{$k} = 0;
136 # $ns->image2 (1) 147 # $ns->image2 (1)
148
149 } elsif ($k eq "tileset") {
150 $setup{$k} = $ns->faceset ($v & 1);
137 151
138 } elsif ($k eq "itemcmd") { 152 } elsif ($k eq "itemcmd") {
139 # Version of the item protocol command to use. Currently, 153 # Version of the item protocol command to use. Currently,
140 # only supported versions are 1 and 2. Using a numeric 154 # only supported versions are 1 and 2. Using a numeric
141 # value will make it very easy to extend this in the future. 155 # value will make it very easy to extend this in the future.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines