ref: 1e427dbd53788c2eb63b82cc03b830b718ab4b55
parent: a819ccfee4feb6b54932cb1fa6bf848a0ede715c
author: mkf <mkf@cloud9p.org>
date: Wed Jun 5 15:51:53 EDT 2024
srv5: accept PRandom
--- a/srv5.c
+++ b/srv5.c
@@ -545,7 +545,7 @@
int s;
s = atoi(side);
- if(s == 0 || s == 1)
+ if(s == PGlenda || s == PTrapper || s == PRandom)
return s;
die:
@@ -572,7 +572,7 @@
side = strtok(nil, " ");
opts = strtok(nil, " ");
- dprint("newclient(%d): nick: %s, game: %s, side: %s, opts: %s\n", fd, nick, game, side, opts);
+ dprint("newclient(%d): nick: %s, side: %s, game: %s, opts: %s\n", fd, nick, side, game, opts);
if(nick == nil || side == nil || game == nil)
return nil;
@@ -598,12 +598,8 @@
void
makematch(Client *c)
{
- Client *head;
+ Client *head = clients.l->data;
- if(clients.l == nil)
- clients.l = llnew();
-
- head = clients.l->data;
if(head == nil || c->side == head->side)
{
if(c->side == PRandom)