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.33 by root, Mon Apr 2 18:14:24 2007 UTC vs.
Revision 1.37 by root, Fri Apr 6 22:57:53 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.
144 $setup{$k} = $ns->itemcmd; 158 $setup{$k} = $ns->itemcmd;
145 159
146 } elsif ($k eq "mapsize") { 160 } elsif ($k eq "mapsize") {
147 my ($x, $y) = split /x/, $v; 161 my ($x, $y) = split /x/, $v;
148 162
149 $ns->mapx ($x = max 9, min cf::MAP_CLIENT_X, $x); 163 $ns->mapx ($x = max 9, min cf::MAP_CLIENT_X, ($x - 1) | 1);
150 $ns->mapy ($y = max 9, min cf::MAP_CLIENT_Y, $y); 164 $ns->mapy ($y = max 9, min cf::MAP_CLIENT_Y, ($y - 1) | 1);
151 165
152 $setup{$k} = "${x}x${y}"; 166 $setup{$k} = "${x}x${y}";
153 167
154 } elsif ($k eq "extendedMapInfos") { 168 } elsif ($k eq "extendedMapInfos") {
155 $ns->ext_mapinfos ($v); 169 $ns->ext_mapinfos ($v);
156 170
157 } elsif ($k eq "extendedTextInfos") { 171 } elsif ($k eq "extendedTextInfos") {
158 $ns->has_readable_type ($v); 172 $ns->has_readable_type ($v);
173
174 } elsif ($k eq "fxix") {
175 $ns->fxix ($v);
159 176
160 } else { 177 } else {
161 # other commands: 178 # other commands:
162 # sexp: no idea, probably for oudated servers 179 # sexp: no idea, probably for oudated servers
163 # tick: more stupidity, server should sned a tick per tick 180 # tick: more stupidity, server should sned a tick per tick
337 . "(check for Numlock and other semi-obvious error sources).", 354 . "(check for Numlock and other semi-obvious error sources).",
338 cf::NDI_RED 355 cf::NDI_RED
339 ); 356 );
340 next; 357 next;
341 } 358 }
359 } else {
360 # unable to load the playerfile:
361 # check wether the player dir exists, which means the file is corrupted or
362 # something very similar.
363 if (!aio_stat cf::player::playerdir $user) {
364 $ns->send_drawinfo (
365 "Unable to retrieve this player. It might be a locked or broken account. "
366 . "If this is your account, ask a dungeon master for assistance. "
367 . "Otherwise choose a different login name.",
368 cf::NDI_RED
369 );
370 next;
371 }
342 } 372 }
343 373
344 # the rest of this function is character creation 374 # the rest of this function is character creation
345 375
346 # just to make sure nothing is left over 376 # just to make sure nothing is left over

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines