back to scratko.xyz
aboutsummaryrefslogtreecommitdiff
path: root/client/data_decryption.c
diff options
context:
space:
mode:
authorscratko <m@scratko.xyz>2024-08-16 18:10:11 +0300
committerscratko <m@scratko.xyz>2024-08-16 18:10:11 +0300
commiteb90648bdad1443c9cfc72e903a93642e10a0ab7 (patch)
treedc567a9aa834bb0d5f3429e8a38910990d75e4eb /client/data_decryption.c
parent880b8be2c28d761505b2eecc1386919d5add6f2f (diff)
downloaddurak-eb90648bdad1443c9cfc72e903a93642e10a0ab7.tar.gz
durak-eb90648bdad1443c9cfc72e903a93642e10a0ab7.tar.bz2
durak-eb90648bdad1443c9cfc72e903a93642e10a0ab7.zip
Global fixes v2.0
Added spectator mode. Added screen of game result. Added definition of durak. If not all players can replenish their decks, they take cards one at a time in turn.
Diffstat (limited to 'client/data_decryption.c')
-rw-r--r--client/data_decryption.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/client/data_decryption.c b/client/data_decryption.c
index b445454..1054c45 100644
--- a/client/data_decryption.c
+++ b/client/data_decryption.c
@@ -126,14 +126,15 @@ void decrypt_set_position_whose_turn(struct client *cl, char *start_p,
cl->position_whose_turn = decrypt_get_number(start_p, end_p);
}
-void decrypt_set_card_queue(struct client *cl, char *start_p)
+void decrypt_set_card_queue(struct client *cl, char *start_p, char **end_p)
{
int i, j;
- for(i = 0, j = 0; *start_p != '\n'; ++start_p) {
+ for(i = 0, j = 0; *start_p != ':' && *start_p != '\n'; ++start_p) {
/* empty queue */
if(*start_p == '=') {
i = -1;
+ ++start_p;
break;
}
/* delimiter '\' */
@@ -150,6 +151,7 @@ void decrypt_set_card_queue(struct client *cl, char *start_p)
if(i != -1)
cl->cq.card_arr[i][j] = '\0';
cl->cq.card_arr_idx = i;
+ *end_p = start_p;
}
void decrypt_set_card_acceptance_status(struct client *cl, char *start_p)
@@ -167,3 +169,13 @@ void decrypt_set_card_acceptance_status(struct client *cl, char *start_p)
if(!strcmp(tmp_buffer, "not all"))
cl->all_input_cards_accepted = 0;
}
+
+void decrypt_set_spectator_mode(struct client *cl, char *start_p)
+{
+ cl->sp_mode = (enum spectator_mode) decrypt_get_number(start_p, NULL);
+}
+
+void decrypt_set_durak_position(struct client *cl, char *start_p)
+{
+ cl->durak_position = decrypt_get_number(start_p, NULL);
+}