--- deliantra/Deliantra-Client/bin/deliantra 2008/03/25 21:11:52 1.33
+++ deliantra/Deliantra-Client/bin/deliantra 2008/05/21 23:35:55 1.43
@@ -101,7 +101,7 @@
use Compress::LZF;
-use DC;
+use DC; BEGIN { $SIG{__DIE__} = sub { DC::fatal Carp::longmess "$@" unless $^S } }
use DC::OpenGL ();
use DC::Protocol;
use DC::DB;
@@ -666,7 +666,6 @@
text => "Accept",
on_activate => sub {
$conn->send ("reply n");
- $STATS_PAGE->hide;
destroy_query_dialog $conn;
0
},
@@ -741,6 +740,8 @@
$MAP = new DC::Map;
$CONN = eval {
+ local $SIG{__DIE__};
+
new DC::Protocol
host => $host,
port => $port || 13327,
@@ -1623,10 +1624,10 @@
}
);
- $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Messages Window Size");
+ $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Message Window Size");
$table->add_at (1, $row++, my $saycmd = new DC::UI::Entry
text => $CFG->{logview_max_par},
- tooltip => "This is maximum number of messages remembered in the Messages window. If the server "
+ tooltip => "This is maximum number of messages remembered in the Message window. If the server "
. "sends more messages than this number, older messages get removed to save memory and "
. "computing time. A value of 0 disables this feature, but that is not recommended.",
on_changed => sub {
@@ -1745,7 +1746,9 @@
}
my %SORT_ORDER = (
- type => undef,
+ type => sub {
+ sort { $a->{type} <=> $b->{type} or $a->{name} cmp $b->{name} } @_
+ },
mtime => sub {
my $NOW = time;
sort {
@@ -2244,10 +2247,17 @@
;
$METASERVER = metaserver_dialog;
- $MESSAGE_WINDOW = new DC::UI::Dockbar (name => 'message_window', title => 'Messages');
+ # the name is changed to not conflict with the older name as users could have hidden it
+ $MESSAGE_WINDOW = new DC::UI::Dockbar
+ name => "message_window2",
+ title => 'Messages',
+ force_w => $::WIDTH * 0.6,
+ force_h => $::HEIGHT * 0.25,
+ ;
+
$MESSAGE_DIST = new DC::MessageDistributor dockbar => $MESSAGE_WINDOW;
- $SETUP_DIALOG->add ($SETUP_NOTEBOOK = new DC::UI::Notebook expand => 1, debug => 1,
+ $SETUP_DIALOG->add ($SETUP_NOTEBOOK = new DC::UI::Notebook expand => 1,
filter => new DC::UI::ScrolledWindow expand => 1, scroll_y => 1);
$SETUP_NOTEBOOK->add_tab (Login => $SETUP_LOGIN = login_setup,
@@ -2275,8 +2285,8 @@
$BUTTONBAR->add (new DC::UI::Flopper text => "Setup", other => $SETUP_DIALOG,
tooltip => "Toggles a dialog where you can configure all aspects of this client.");
- $BUTTONBAR->add (new DC::UI::Flopper text => "Message Window", other => $MESSAGE_WINDOW,
- tooltip => "Toggles the server message log, where the client collects all messages from the server.");
+# $BUTTONBAR->add (new DC::UI::Flopper text => "Message Window", other => $MESSAGE_WINDOW,
+# tooltip => "Toggles the server message log, where the client collects all messages from the server.");
make_gauge_window->show; # XXX: this has to be set before make_stats_window as make_stats_window calls update_stats_window which updated the gauges also X-D
@@ -2288,7 +2298,7 @@
tooltip => "Saves the options chosen in the client setting, server settings and the window layout to be restored on later runs.",
on_activate => sub {
$::CFG->{layout} = DC::UI::get_layout;
- DC::write_cfg "$Deliantra::VARDIR/client.cf";
+ DC::write_cfg;
status "Configuration Saved";
0
},
@@ -2297,7 +2307,6 @@
$BUTTONBAR->add (new DC::UI::Flopper text => "Help!", other => $HELP_WINDOW = help_window,
tooltip => "View Documentation");
-
$BUTTONBAR->add (new DC::UI::Button
text => "Quit",
tooltip => "Terminates the program",
@@ -2423,6 +2432,8 @@
};
{
+ DC::Pod::load_docwiki DC::find_rcfile "docwiki.pst";
+
if (-e "$Deliantra::VARDIR/client.cf") {
DC::read_cfg "$Deliantra::VARDIR/client.cf";
} else {
@@ -2432,6 +2443,14 @@
}
DC::DB::Server::run;
+
+ if ($CFG->{db_schema} < 1) {
+ warn "INFO: upgrading database schema from 0 to 1, mapcache and tilecache will be lost\n";
+ DC::DB::nuke_db;
+ $CFG->{db_schema} = 1;
+ DC::write_cfg;
+ }
+
DC::DB::open_db;
DC::UI::set_layout ($::CFG->{layout});
@@ -2467,6 +2486,7 @@
default => "profile", # default profile
show_tips => 1,
logview_max_par => 1000,
+ shift_fire_stop => 0,
);
while (my ($k, $v) = each %DEF_CFG) {
@@ -2544,6 +2564,7 @@
$startup_done->();
};
+delete $SIG{__DIE__};
EV::loop;
#video_shutdown;