1 /************************************************************************
3 * voxelands - 3d voxel world sandbox game
4 * Copyright (C) Lisa 'darkrose' Milne 2016 <lisa@ltmnet.com>
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14 * See the GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>
18 ************************************************************************/
30 static int client_connect_defaults()
32 /* TODO: map meshgen triggers, etc */
36 static int client_postconnect()
42 /* TODO: offset this to where the player actually is */
44 for (x
=-128; x
<129; x
+=32) {
45 for (z
=-128; z
<129; z
+=32) {
56 /* initialise the client */
62 /* connect to/start a singleplayer game */
63 int client_connect_singleplayer(char* world
)
65 client_data
.issingle
= 1;
66 client_state(VLSTATE_PLAY
);
68 client_connect_defaults();
70 /* TODO: map triggers */
72 if (world_init(world
)) {
73 client_state(VLSTATE_MENU
);
77 return client_postconnect();
80 /* connect to a multiplayer server */
81 int client_connect_multiplayer(char* address
, char* port
)
83 client_data
.issingle
= 0;
84 client_state(VLSTATE_PLAY
);
86 client_connect_defaults();
88 /* TODO: map triggers */
90 /* TODO: connect to a server */
92 client_state(VLSTATE_MENU
);
96 /* disconnect from a game */
97 void client_disconnect()
99 if (client_data
.issingle
)
102 client_data
.issingle
= 0;