2015-02-10 21:14:24 +01:00
|
|
|
/*
|
|
|
|
Minetest
|
|
|
|
Copyright (C) 2010-2013 celeron55, Perttu Ahola <celeron55@gmail.com>
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU Lesser General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2.1 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU Lesser General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Lesser General Public License along
|
|
|
|
with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*/
|
|
|
|
|
2017-08-17 22:19:39 +02:00
|
|
|
#pragma once
|
2015-02-10 21:14:24 +01:00
|
|
|
|
2015-10-13 09:57:44 +02:00
|
|
|
#include "irrlichttypes.h"
|
2022-06-05 17:47:38 +02:00
|
|
|
#include "content/subgames.h"
|
2015-02-10 21:14:24 +01:00
|
|
|
|
2020-07-14 19:10:37 +02:00
|
|
|
// Information provided from "main"
|
2017-04-06 16:03:29 +02:00
|
|
|
struct GameParams
|
|
|
|
{
|
2020-07-14 19:10:37 +02:00
|
|
|
GameParams() = default;
|
|
|
|
|
2015-02-10 21:14:24 +01:00
|
|
|
u16 socket_port;
|
|
|
|
std::string world_path;
|
|
|
|
SubgameSpec game_spec;
|
|
|
|
bool is_dedicated_server;
|
|
|
|
};
|
2020-07-14 19:10:37 +02:00
|
|
|
|
2022-06-05 17:47:38 +02:00
|
|
|
enum class ELoginRegister {
|
|
|
|
Any = 0,
|
|
|
|
Login,
|
|
|
|
Register
|
|
|
|
};
|
|
|
|
|
2020-07-14 19:10:37 +02:00
|
|
|
// Information processed by main menu
|
|
|
|
struct GameStartData : GameParams
|
|
|
|
{
|
|
|
|
GameStartData() = default;
|
|
|
|
|
|
|
|
bool isSinglePlayer() const { return address.empty() && !local_server; }
|
|
|
|
|
|
|
|
std::string name;
|
|
|
|
std::string password;
|
|
|
|
std::string address;
|
|
|
|
bool local_server;
|
|
|
|
|
2022-06-05 17:47:38 +02:00
|
|
|
ELoginRegister allow_login_or_register = ELoginRegister::Any;
|
|
|
|
|
2020-07-14 19:10:37 +02:00
|
|
|
// "world_path" must be kept in sync!
|
|
|
|
WorldSpec world_spec;
|
|
|
|
};
|