EventGenRec netGen[MAX_SCREENS] = {
{ NULL, 0, FT_read, -1, NetGenFunc, EM_net, 0, "\0", 0, HEADER_SIZE3 } };
-//static char netBuf[64];
-//static int netBufSize, netBufGoal = HEADER_SIZE3;
-ExtFunc void make_netGen(void)
-{
- int i;
-
- for (i = 1; i <= MAX_SCREENS; i++)
- memcpy(netGen+i, &netGen[0], sizeof(EventGenRec));
-} //Make_netGen
-
-
-ExtFunc int InitiateConnection(char *hostStr, char *portStr)
+ExtFunc int InitiateConnection(char *hostStr, short port)
{ //connect to host
struct sockaddr_in addr;
struct hostent *host;
- short port;
-// make_netGen();
AtExit(CloseNet);
- if (portStr)
- port = atoi(portStr); /* XXX Error checking */
- else
- port = DEFAULT_PORT;
host = gethostbyname(hostStr);
if (!host)
die("gethostbyname");
goto again;
}
AddEventGen(&netGen[0]);
- totalPlayers = 0;
+ totalPlayers = 1;
return 0;
} //InitiateConnection
}
case NP_gamedata:
{
- fprintf(stderr, ": %d\n", event.type);
+ memcpy(&Game, event.u.net.data, event.u.net.size);
+ SRandom(Game.seed);
break;
}
case NP_newPlayer: