aboutsummaryrefslogtreecommitdiff
path: root/src/gettext.h
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2022-05-06 20:13:45 +0200
committersfan5 <sfan5@live.de>2022-05-21 17:49:55 +0200
commit2f32044273d107e82fb1c35d4a0f616fa480cdf0 (patch)
tree65f73c5190558f7b067f482ac89f0eac92a4434b /src/gettext.h
parent371f21fb350a29ad1ade4ffaf38c07ca1742cd63 (diff)
downloadminetest-2f32044273d107e82fb1c35d4a0f616fa480cdf0.tar.gz
minetest-2f32044273d107e82fb1c35d4a0f616fa480cdf0.tar.bz2
minetest-2f32044273d107e82fb1c35d4a0f616fa480cdf0.zip
Don't ignore server disconnects in client code
If the server stops talking to us without saying bye we should actually end the in-game session with an error message.
Diffstat (limited to 'src/gettext.h')
0 files changed, 0 insertions, 0 deletions
120' href='#n120'>120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167
/*
Minetest
Copyright (C) 2010-2016 celeron55, Perttu Ahola <celeron55@gmail.com>
Copyright (C) 2014-2016 nerzhul, Loic Blot <loic.blot@unix-experience.fr>

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.
*/

#pragma once

#include "player.h"
#include "cloudparams.h"
#include "skyparams.h"

class PlayerSAO;

enum RemotePlayerChatResult
{
	RPLAYER_CHATRESULT_OK,
	RPLAYER_CHATRESULT_FLOODING,
	RPLAYER_CHATRESULT_KICK,
};

/*
	Player on the server
*/
class RemotePlayer : public Player
{
	friend class PlayerDatabaseFiles;

public:
	RemotePlayer(const char *name, IItemDefManager *idef);
	virtual ~RemotePlayer() = default;

	PlayerSAO *getPlayerSAO() { return m_sao; }
	void setPlayerSAO(PlayerSAO *sao) { m_sao = sao; }

	const RemotePlayerChatResult canSendChatMessage();

	void setHotbarItemcount(s32 hotbar_itemcount)
	{
		hud_hotbar_itemcount = hotbar_itemcount;
	}

	s32 getHotbarItemcount() const { return hud_hotbar_itemcount; }

	void overrideDayNightRatio(bool do_override, float ratio)
	{
		m_day_night_ratio_do_override = do_override;
		m_day_night_ratio = ratio;
	}

	void getDayNightRatio(bool *do_override, float *ratio)
	{