ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/kgsueme/bin/kgsueme
Revision: 1.65
Committed: Sun Jun 6 07:55:06 2004 UTC (19 years, 11 months ago) by root
Branch: MAIN
CVS Tags: HEAD
Changes since 1.64: +2 -14 lines
Log Message:
*** empty log message ***

File Contents

# Content
1 #!/usr/bin/perl
2
3 use strict 'vars';
4
5 use Glib;
6 use Gtk2;
7
8 use KGS::Protocol;
9 use KGS::Listener::Debug;
10
11 use Audio::Data;
12 use Audio::Play;
13
14 use IO::Socket::INET;
15 use List::Util;
16 use Errno;
17
18 use Storable;
19 use Carp;
20
21 init Gtk2;
22
23 $SIG{QUIT} = sub { Carp::confess "SIGQUIT" };
24
25 our $HACK = 1; # do NEVER enable. ;)
26 our $DEBUG_EXPOSE = 0;
27
28 if ($HACK) {
29 $KGS::debug = 1;
30 }
31
32 BEGIN {
33 our $VERSION = "0.1";
34
35 our $config;
36 our $LIBDIR = ".";
37
38 use KGS::Constants;
39
40 for (qw(util.pl gtk.pl chat.pl sound.pl user.pl gamelist.pl userlist.pl
41 game.pl room.pl roomlist.pl app.pl)) {
42 require (KGS::Constants::findfile "KGS/kgsueme/$_");
43 die if $@;
44 }
45 }
46
47 if ($ENV{KGSUEME_DEBUG}) {
48 use KGS::Constants;
49
50 my $window = new Gtk2::Window 'toplevel';
51 $window->add (new game::userpanel colour => 0);
52 $window->show_all;
53
54 main Gtk2;
55
56 for (19) {
57 my $game = new game size => $_;
58
59 $game->event_challenge (
60 bless( {
61 type => 0,
62 black => bless( {
63 flags => 2633,
64 name => 'dorkusx'
65 }, 'KGS::User' ),
66 rules => bless( {
67 count => 5,
68 time => 900,
69 timesys => 2,
70 interval => 30,
71 komi => '6.5',
72 size => 19,
73 ruleset => 0,
74 handicap => 2,
75 }, 'KGS::Rules' ),
76 white => bless( {
77 flags => 436220808,
78 name => 'Nerdamus'
79 }, 'KGS::User' )
80 }, 'KGS::Challenge' ));
81
82
83 if (0) {
84 my $data = Storable::retrieve "board2.dat";
85 while (my ($k, $v) = each %$data) {
86 $game->{$k} = $v;
87 }
88 $game->event_update_tree;
89 }
90
91 if (0) {
92 $game->{cur_board} = new KGS::Game::Board;
93
94 $game->{cur_board}{board}[0][0] = MARK_B;
95 $game->{cur_board}{board}[1][1] = MARK_GRAY_B | MARK_SMALL_W;
96 $game->{cur_board}{board}[2][2] = MARK_W | MARK_TRIANGLE;
97 $game->{cur_board}{board}[1][2] = MARK_B | MARK_LABEL;
98 $game->{cur_board}{label}[1][2] = "198";
99 $game->{cur_board}{board}[0][2] = MARK_W | MARK_LABEL;
100 $game->{cur_board}{label}[0][2] = "AWA";
101 $game->{board}->set_board ($game->{cur_board});
102 }
103 }
104 main Gtk2;
105
106 }
107
108 our $app = new app;
109
110 main Gtk2;
111
112 $app->destroy;
113
114 Gtk2->main_iteration while Gtk2->events_pending;
115
116 1;
117
118