projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rnd-19981016-2
[rocksndiamonds.git]
/
src
/
init.c
diff --git
a/src/init.c
b/src/init.c
index ecafc3b848cc3932394cf38ebf9184248b621782..cbfab54b20dae6f0bb8a34c653630f0e075dd0b1 100644
(file)
--- a/
src/init.c
+++ b/
src/init.c
@@
-23,6
+23,7
@@
#include "gfxload.h"
#include "gifload.h"
#include "network.h"
#include "gfxload.h"
#include "gifload.h"
#include "network.h"
+#include "netserv.h"
#ifdef DEBUG
/*
#ifdef DEBUG
/*
@@
-56,6
+57,14
@@
static void InitElementProperties(void);
void OpenAll(int argc, char *argv[])
{
void OpenAll(int argc, char *argv[])
{
+ if (serveronly)
+ {
+ NetworkServer(server_port, serveronly);
+
+ /* never reached */
+ exit(0);
+ }
+
InitLevelAndPlayerInfo();
InitCounter();
InitLevelAndPlayerInfo();
InitCounter();
@@
-83,6
+92,8
@@
void OpenAll(int argc, char *argv[])
void InitLevelAndPlayerInfo()
{
void InitLevelAndPlayerInfo()
{
+ int i;
+
local_player = &stored_player[0];
if (!LoadLevelInfo()) /* global level info */
local_player = &stored_player[0];
if (!LoadLevelInfo()) /* global level info */
@@
-90,13
+101,21
@@
void InitLevelAndPlayerInfo()
LoadPlayerInfo(PLAYER_SETUP); /* global setup info */
LoadPlayerInfo(PLAYER_LEVEL); /* level specific info */
LoadPlayerInfo(PLAYER_SETUP); /* global setup info */
LoadPlayerInfo(PLAYER_LEVEL); /* level specific info */
+
+ for (i=0; i<MAX_PLAYERS; i++)
+ {
+ stored_player[i].connected = FALSE;
+ stored_player[i].local = FALSE;
+ }
+ local_player->connected = TRUE;
+ local_player->local = TRUE;
}
void InitNetworkServer()
{
int nr_wanted;
}
void InitNetworkServer()
{
int nr_wanted;
- if (
standalone
)
+ if (
!network
)
return;
nr_wanted = Request("Choose player", REQ_PLAYER | REQ_STAY_CLOSED);
return;
nr_wanted = Request("Choose player", REQ_PLAYER | REQ_STAY_CLOSED);