1 | # |
1 | # |
2 | # This file is part of Deliantra, the Roguelike Realtime MMORPG. |
2 | # This file is part of Deliantra, the Roguelike Realtime MMORPG. |
3 | # |
3 | # |
4 | # Copyright (©) 2006,2007,2008,2009,2010,2011 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
4 | # Copyright (©) 2006,2007,2008,2009,2010,2011,2012 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
5 | # |
5 | # |
6 | # Deliantra is free software: you can redistribute it and/or modify it under |
6 | # Deliantra is free software: you can redistribute it and/or modify it under |
7 | # the terms of the Affero GNU General Public License as published by the |
7 | # the terms of the Affero GNU General Public License as published by the |
8 | # Free Software Foundation, either version 3 of the License, or (at your |
8 | # Free Software Foundation, either version 3 of the License, or (at your |
9 | # option) any later version. |
9 | # option) any later version. |
… | |
… | |
108 | our $RANDOMDIR = "$LOCALDIR/random"; |
108 | our $RANDOMDIR = "$LOCALDIR/random"; |
109 | our $BDBDIR = "$LOCALDIR/db"; |
109 | our $BDBDIR = "$LOCALDIR/db"; |
110 | our $PIDFILE = "$LOCALDIR/pid"; |
110 | our $PIDFILE = "$LOCALDIR/pid"; |
111 | our $RUNTIMEFILE = "$LOCALDIR/runtime"; |
111 | our $RUNTIMEFILE = "$LOCALDIR/runtime"; |
112 | |
112 | |
113 | our %RESOURCE; # unused |
113 | #our %RESOURCE; # unused |
114 | |
114 | |
115 | our $OUTPUT_RATE_MIN = 3000; |
115 | our $OUTPUT_RATE_MIN = 3000; |
116 | our $OUTPUT_RATE_MAX = 1000000; |
116 | our $OUTPUT_RATE_MAX = 1000000; |
117 | |
117 | |
118 | our $MAX_LINKS = 32; # how many chained exits to follow |
118 | our $MAX_LINKS = 32; # how many chained exits to follow |
… | |
… | |
3514 | |
3514 | |
3515 | { |
3515 | { |
3516 | my $res = $facedata->{resource}; |
3516 | my $res = $facedata->{resource}; |
3517 | |
3517 | |
3518 | while (my ($name, $info) = each %$res) { |
3518 | while (my ($name, $info) = each %$res) { |
3519 | if (defined $info->{type}) { |
3519 | if (defined (my $type = $info->{type})) { |
|
|
3520 | # TODO: different hash - must free and use new index, or cache ixface data queue |
3520 | my $idx = (cf::face::find $name) || cf::face::alloc $name; |
3521 | my $idx = (cf::face::find $name) || cf::face::alloc $name; |
3521 | |
3522 | |
3522 | cf::face::set_data $idx, 0, $info->{data}, $info->{hash}; |
3523 | cf::face::set_data $idx, 0, $info->{data}, $info->{hash}; |
3523 | cf::face::set_type $idx, $info->{type}; |
3524 | cf::face::set_type $idx, $type; |
|
|
3525 | cf::face::set_meta $idx, $type & 1 ? undef : $info->{meta}; # any keys left are stashed into meta unless prepended |
3524 | } else { |
3526 | } else { |
3525 | $RESOURCE{$name} = $info; # unused |
3527 | # $RESOURCE{$name} = $info; # unused |
3526 | } |
3528 | } |
3527 | |
3529 | |
3528 | cf::cede_to_tick; |
3530 | cf::cede_to_tick; |
3529 | } |
3531 | } |
3530 | } |
3532 | } |
… | |
… | |
3666 | |
3668 | |
3667 | sub main { |
3669 | sub main { |
3668 | cf::init_globals; # initialise logging |
3670 | cf::init_globals; # initialise logging |
3669 | |
3671 | |
3670 | LOG llevInfo, "Welcome to Deliantra, v" . VERSION; |
3672 | LOG llevInfo, "Welcome to Deliantra, v" . VERSION; |
3671 | LOG llevInfo, "Copyright (C) 2005-2011 Marc Alexander Lehmann / Robin Redeker / the Deliantra team."; |
3673 | LOG llevInfo, "Copyright (C) 2005-2012 Marc Alexander Lehmann / Robin Redeker / the Deliantra team."; |
3672 | LOG llevInfo, "Copyright (C) 1994 Mark Wedel."; |
3674 | LOG llevInfo, "Copyright (C) 1994 Mark Wedel."; |
3673 | LOG llevInfo, "Copyright (C) 1992 Frank Tore Johansen."; |
3675 | LOG llevInfo, "Copyright (C) 1992 Frank Tore Johansen."; |
3674 | |
3676 | |
3675 | $Coro::current->prio (Coro::PRIO_MAX); # give the main loop max. priority |
3677 | $Coro::current->prio (Coro::PRIO_MAX); # give the main loop max. priority |
3676 | |
3678 | |