From 4471629964c044bd1aa4800fc157231f30a87a36 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Fri, 5 Sep 2003 10:38:34 +0000 Subject: [PATCH] Introduced multichannel support (it was rather just a trivial fix). --- README | 5 ----- tetrinet.c | 5 ++++- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/README b/README index 9f010ed..402ffc0 100644 --- a/README +++ b/README @@ -19,11 +19,6 @@ This program is public domain, and may be modified and distributed without limitation. -Compatibility -------------- -This client does not support "channels". - - Requirements ------------ You must be using a 50-line text display to run this version of Tetrinet; diff --git a/tetrinet.c b/tetrinet.c index 5f7e4f4..05d5ffc 100644 --- a/tetrinet.c +++ b/tetrinet.c @@ -24,6 +24,7 @@ int windows_mode = 0; /* Try to be just like the Windows version? */ int noslide = 0; /* Disallow piece sliding? */ int my_playernum = -1; /* What player number are we? */ +char *my_nick; /* And what is our nick? */ WinInfo winlist[MAXWINLIST]; /* Winners' list from server */ int server_sock; /* Socket for server communication */ int dispmode; /* Current display mode */ @@ -92,6 +93,8 @@ void parse(char *buf) if (s = strtok(NULL, " ")) my_playernum = atoi(s); /* Note: players[my_playernum-1] is set in init() */ + /* But that doesn't work when joining other channel. */ + players[my_playernum-1] = strdup(my_nick); } else if (strcmp(cmd, "playerjoin") == 0) { int player; @@ -570,7 +573,7 @@ io=&tty_interface; /* because Xwin isn't done yet */ return 1; } } else if (!nick) { - nick = av[i]; + my_nick = nick = av[i]; } else if (!server) { server = av[i]; } else { -- 2.11.4.GIT