2024-10-28 15:57:39 +01:00
|
|
|
// Luanti
|
|
|
|
// SPDX-License-Identifier: LGPL-2.1-or-later
|
|
|
|
// Copyright (C) 2010-2013 celeron55, Perttu Ahola <celeron55@gmail.com>
|
2015-02-10 21:14:24 +01:00
|
|
|
|
2017-08-17 22:19:39 +02:00
|
|
|
#pragma once
|
2015-02-10 21:14:24 +01:00
|
|
|
|
2015-10-13 03:57:44 -04:00
|
|
|
#include "irrlichttypes.h"
|
2022-06-05 16:47:38 +01: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 16:47:38 +01: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 16:47:38 +01: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;
|
|
|
|
};
|