back to scratko.xyz
aboutsummaryrefslogtreecommitdiff
path: root/client/data_decryption.c
diff options
context:
space:
mode:
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);
+}