mirror of
https://github.com/Tha14/toxic.git
synced 2025-06-29 11:56:44 +02:00
Add networking to game engine / add multiplayer chess
This commit is contained in:
@ -373,7 +373,8 @@ void cmd_game(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MA
|
||||
}
|
||||
}
|
||||
|
||||
int ret = game_initialize(self, m, type, force_small);
|
||||
uint32_t id = rand();
|
||||
int ret = game_initialize(self, m, type, id, NULL, 0, force_small);
|
||||
|
||||
switch (ret) {
|
||||
case 0: {
|
||||
@ -386,6 +387,18 @@ void cmd_game(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MA
|
||||
return;
|
||||
}
|
||||
|
||||
case -2: {
|
||||
line_info_add(self, false, NULL, NULL, SYS_MSG, 0, 0, "Game failed to initialize: Network error.");
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
case -3: {
|
||||
line_info_add(self, false, NULL, NULL, SYS_MSG, 0, 0,
|
||||
"Game is multiplayer only. Try the command again in the chat window of the contact you wish to play with.");
|
||||
return;
|
||||
}
|
||||
|
||||
default: {
|
||||
line_info_add(self, false, NULL, NULL, SYS_MSG, 0, 0, "Game failed to initialize (error %d)", ret);
|
||||
return;
|
||||
|
Reference in New Issue
Block a user