ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/kgsueme/bin/kgsueme
Revision: 1.60
Committed: Sat May 29 06:38:24 2004 UTC (19 years, 11 months ago) by pcg
Branch: MAIN
Changes since 1.59: +27 -20 lines
Log Message:
*** empty log message ***

File Contents

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