|
18 | 18 | "handle_read_board":8,
|
19 | 19 | "handle_get_winner":9,
|
20 | 20 | "handle_add_winner":10,
|
21 |
| - "handle_set_intro":11, |
22 |
| - "handle_set_outro":12, |
23 |
| - "handle_report_winners":13, |
| 21 | + "handle_reset_winner_data":11, |
| 22 | + "handle_set_outro_message":12, |
| 23 | + "handle_report_winners":13 |
24 | 24 | }
|
25 | 25 |
|
26 | 26 | def client_error_wrapper(error_msg):
|
@@ -81,16 +81,17 @@ def place(self, turn):
|
81 | 81 |
|
82 | 82 | #expects a response that is a 9 byte string representing the board
|
83 | 83 | def read_board(self):
|
84 |
| - self.server_conn.sendall(int.to_bytes(handlers["handle_get_winner"], 4, NET_ORDER)) |
| 84 | + self.server_conn.sendall(int.to_bytes(8, 4, NET_ORDER)) |
85 | 85 | response = self.read_response()
|
| 86 | + print(response) |
86 | 87 |
|
87 |
| - #print the board |
| 88 | + #print the board //TODO convert ascii code from stuff |
88 | 89 | print(' 0 1 2')
|
89 |
| - print('0 %s | %s | %s', response[0], response[1], response[2]) |
| 90 | + print(f'0 {response[0]} | {response[1]} | {response[2]}') |
90 | 91 | print(' ----------------')
|
91 |
| - print('1 %s | %s | %s', response[4], response[5], response[6]) |
| 92 | + print(f'1 {response[3]} | {response[4]} | {response[5]}') |
92 | 93 | print(' ----------------')
|
93 |
| - print('2 %s | %s | %s', response[7], response[8], response[9]) |
| 94 | + print(f'2 {response[6]} | {response[7]} | {response[8]}') |
94 | 95 |
|
95 | 96 | #expects 4 bytes repr. winner, 0 = no one, 1 = X, 2 = O
|
96 | 97 | def get_winner(self):
|
|
0 commit comments