ref: a0ca553994279c4e1dc005b609b867bbb8b1d725
parent: 8bc5225ec0ff4add6289628929f7d98a7868d33c
author: mkf <mkf@cloud9p.org>
date: Sat May 4 04:34:43 EDT 2024
netclient: simplify some parts, wait→waitbit (plan 9 already defines wait)
--- a/netclient.c
+++ b/netclient.c
@@ -1,6 +1,10 @@
#include "engine.h"
#includde "netclient.h"
+int waitbit; /* 0 is go, 1 is wait */
+int networked; /* 0 is local, 1 is networked */
+int pside; /* Trapper, Glenda */
+
int sockfd;
typedef struct
@@ -213,11 +217,11 @@
}
else if(!strcmp(token[0], "WAIT")
{
- game->wait = 1;
+ game->waitbit = 1;
}
else if(!strcmp(token[0], "INIT")
{
- game->wait = 0;
+ game->waitbit = 0;
game->state = Init;
while(games.state == Init)
{
@@ -239,9 +243,6 @@
grid[p.x][p.y] = Wall;
break;
case 'g':
- if(game->glenda != nil)
- dprint("netproc(): repositioning glenda?\n");
-
tmparr[0] = getpart(tmp, " ", 1);
tmparr[1] = getpart(tmp, " ", 2);
if(tmparr[0] == nil || tmparr[0])
@@ -268,7 +269,7 @@
}
else if(!strcmp(token[0], "TURN")
{
- game->wait = 0;
+ game->waitbit = 0;
}
else if(!strcmp(token[0], "WALL")
{
@@ -313,6 +314,7 @@
{
sysfatal("netproc(): unkown message");
}
+ return msg;
}
char*