class BanManager
{
public:
- BanManager(const std::string &bannfilepath);
+ BanManager(const std::string &banfilepath);
~BanManager();
void load();
void save();
}
}
-void Camera::update(LocalPlayer* player, f32 frametime, f32 busytime,
- f32 tool_reload_ratio, ClientEnvironment &c_env)
+void Camera::update(LocalPlayer* player, f32 frametime, f32 busytime, f32 tool_reload_ratio)
{
// Get player position
// Smooth the movement when walking up stairs
// Calculate new position
bool abort = false;
- for (int i = BS; i <= BS*2.75; i++)
- {
- my_cp.X = m_camera_position.X + m_camera_direction.X*-i;
- my_cp.Z = m_camera_position.Z + m_camera_direction.Z*-i;
+ for (int i = BS; i <= BS * 2.75; i++) {
+ my_cp.X = m_camera_position.X + m_camera_direction.X * -i;
+ my_cp.Z = m_camera_position.Z + m_camera_direction.Z * -i;
if (i > 12)
- my_cp.Y = m_camera_position.Y + (m_camera_direction.Y*-i);
+ my_cp.Y = m_camera_position.Y + (m_camera_direction.Y * -i);
// Prevent camera positioned inside nodes
INodeDefManager *nodemgr = m_client->ndef();
- MapNode n = c_env.getClientMap().getNodeNoEx(floatToInt(my_cp, BS));
+ MapNode n = m_client->getEnv().getClientMap()
+ .getNodeNoEx(floatToInt(my_cp, BS));
+
const ContentFeatures& features = nodemgr->get(n);
- if(features.walkable)
- {
+ if (features.walkable) {
my_cp.X += m_camera_direction.X*-1*-BS/2;
my_cp.Z += m_camera_direction.Z*-1*-BS/2;
my_cp.Y += m_camera_direction.Y*-1*-BS/2;
#include "inventory.h"
#include "mesh.h"
#include "client/tile.h"
-#include "util/numeric.h"
#include <ICameraSceneNode.h>
#include <ISceneNode.h>
#include <list>
-#include "client.h"
-
class LocalPlayer;
struct MapDrawControl;
class Client;
// Update the camera from the local player's position.
// busytime is used to adjust the viewing range.
void update(LocalPlayer* player, f32 frametime, f32 busytime,
- f32 tool_reload_ratio, ClientEnvironment &c_env);
+ f32 tool_reload_ratio);
// Update render distance
void updateViewingRange();
#include <sstream>
#include <cmath>
#include <IFileSystem.h>
+#include "client.h"
+#include "network/clientopcodes.h"
+#include "network/networkpacket.h"
#include "threading/mutex_auto_lock.h"
#include "client/renderingengine.h"
#include "util/auth.h"
#include "util/serialize.h"
#include "util/string.h"
#include "util/srp.h"
-#include "client.h"
-#include "network/clientopcodes.h"
#include "filesys.h"
#include "mapblock_mesh.h"
#include "mapblock.h"
#include "tileanimation.h"
#include "mesh_generator_thread.h"
#include <fstream>
-#include "filesys.h"
#define CLIENT_CHAT_MESSAGE_LIMIT_PER_10S 10.0f
}
return m_mousepos;
-
}
+
virtual void setMousePos(s32 x, s32 y)
{
if (RenderingEngine::get_raw_device()->getCursorControl()) {
#include <IrrlichtDevice.h>
#include <irrlicht.h>
#include "fontengine.h"
+#include "client.h"
#include "clouds.h"
#include "util/numeric.h"
#include "guiscalingfilter.h"
#include "hud.h"
+#include "localplayer.h"
#include "camera.h"
#include "minimap.h"
#include "clientmap.h"
#include "util/serialize.h"
#include "util/pointedthing.h"
+#include "client.h"
#include "clientenvironment.h"
#include "clientsimpleobject.h"
#include "clientmap.h"
#include <ISceneManager.h>
#include "environment.h"
#include "clientobject.h"
+#include "util/numeric.h"
class ClientSimpleObject;
class ClientMap;
*/
#include <sstream>
-
#include "clientiface.h"
+#include "network/connection.h"
+#include "network/serveropcodes.h"
#include "remoteplayer.h"
#include "settings.h"
#include "mapblock.h"
-#include "network/connection.h"
#include "serverenvironment.h"
#include "map.h"
#include "emerge.h"
#include "content_sao.h" // TODO this is used for cleanup of only
#include "log.h"
-#include "network/serveropcodes.h"
#include "util/srp.h"
#include "face_position_cache.h"
#include "constants.h"
#include "serialization.h" // for SER_FMT_VER_INVALID
#include "network/networkpacket.h"
+#include "network/networkprotocol.h"
#include "porting.h"
#include <list>
#include "localplayer.h"
#include "map.h"
#include "camera.h" // CameraModes
+#include "client.h"
#include "wieldmesh.h"
#include <algorithm>
#include "client/renderingengine.h"
#ifndef CONTENT_MAPBLOCK_HEADER
#define CONTENT_MAPBLOCK_HEADER
-#include "util/numeric.h"
+
#include "nodedef.h"
#include <IMeshManipulator.h>
#include <atomic>
#include <mutex>
#include "irr_v3d.h"
-#include "activeobject.h"
-#include "util/numeric.h"
#include "network/networkprotocol.h" // for AccessDeniedCode
+#include "util/basic_macros.h"
class IGameDef;
class Map;
float tool_reload_ratio = runData.time_from_last_punch / full_punch_interval;
tool_reload_ratio = MYMIN(tool_reload_ratio, 1.0);
- camera->update(player, dtime, busy_time / 1000.0f, tool_reload_ratio,
- client->getEnv());
+ camera->update(player, dtime, busy_time / 1000.0f, tool_reload_ratio);
camera->step(dtime);
v3f camera_position = camera->getPosition();
#define GETTEXT_HEADER
#include "config.h" // for USE_GETTEXT
+#include <string>
#if USE_GETTEXT
#include <libintl.h>
#include "irrlichttypes_extrabloated.h"
#include "modalMenu.h"
-#include "client.h"
#include "gettext.h"
#include "keycode.h"
#include <string>
*/
#include "guiPasswordChange.h"
-#include "debug.h"
-#include "serialization.h"
-#include <string>
+#include "client.h"
#include <IGUICheckBox.h>
#include <IGUIEditBox.h>
#include <IGUIButton.h>
#include "irrlichttypes_extrabloated.h"
#include "modalMenu.h"
-#include "client.h"
#include <string>
+class Client;
+
class GUIPasswordChange : public GUIModalMenu
{
public:
#include "irrlichttypes_extrabloated.h"
#include "modalMenu.h"
-#include "client.h"
#include <string>
class GUIVolumeChange : public GUIModalMenu
gui::IGUIElement* parent, s32 id,
IMenuManager *menumgr);
~GUIVolumeChange();
-
+
void removeChildren();
/*
Remove and re-add (or reposition) stuff
void drawMenu();
bool OnEvent(const SEvent& event);
-
+
bool pausesGame() { return true; }
};
* regardless of the compiler.
*/
#ifndef _MSC_VER
-# include <stdint.h>
+# include <cstdint>
#endif
#include <irrTypes.h>
void setCollisionbox(const aabb3f &box) { m_collisionbox = box; }
private:
+ // clang-format off
void accelerateHorizontal(const v3f &target_speed, f32 max_increase, bool slippery);
+ // clang-format on
void accelerateVertical(const v3f &target_speed, const f32 max_increase);
bool updateSneakNode(Map *map, const v3f &position, const v3f &sneak_max);
#include "mainmenumanager.h"
#include "irrlichttypes_extrabloated.h"
+#include "chat_interface.h"
#include "debug.h"
#include "unittest/test.h"
#include "server.h"
#include "quicktune.h"
#include "httpfetch.h"
#include "guiEngine.h"
-#include "map.h"
-#include "player.h"
-#include "mapsector.h"
-#include "fontengine.h"
#include "gameparams.h"
#include "database.h"
#include "config.h"
#endif
#ifndef SERVER
#include "client/clientlauncher.h"
-
#endif
#ifdef HAVE_TOUCHSCREENGUI
*/
#include "mapblock_mesh.h"
+#include "client.h"
#include "mapblock.h"
#include "map.h"
#include "profiler.h"
#include "noise.h"
#include "map.h"
#include "log.h"
+#include "util/numeric.h"
#include <algorithm>
*/
#include "minimap.h"
-#include "threading/mutex_auto_lock.h"
-#include "threading/semaphore.h"
+#include "client.h"
#include "clientmap.h"
#include "settings.h"
-#include "nodedef.h"
-#include "porting.h"
-#include "util/numeric.h"
-#include "util/string.h"
#include "mapblock.h"
-#include <math.h>
#include "client/renderingengine.h"
MinimapUpdateThread::~MinimapUpdateThread()
{
- for (std::map<v3s16, MinimapMapblock *>::iterator
- it = m_blocks_cache.begin();
- it != m_blocks_cache.end(); ++it) {
- delete it->second;
+ for (auto &it : m_blocks_cache) {
+ delete it.second;
}
- for (std::deque<QueuedMinimapUpdate>::iterator
- it = m_update_queue.begin();
- it != m_update_queue.end(); ++it) {
- QueuedMinimapUpdate &q = *it;
+ for (auto &q : m_update_queue) {
delete q.data;
}
}
#define MINIMAP_HEADER
#include "irrlichttypes_extrabloated.h"
-#include "client.h"
+#include "util/thread.h"
#include "voxel.h"
-#include "threading/semaphore.h"
#include <map>
#include <string>
#include <vector>
-#include "camera.h"
+
+class Client;
+class ITextureSource;
+class IShaderSource;
#define MINIMAP_MAX_SX 512
#define MINIMAP_MAX_SY 512
-
enum MinimapMode {
MINIMAP_MODE_OFF,
MINIMAP_MODE_SURFACEx1,
#include "client.h"
#include "networkprotocol.h"
-#include "networkpacket.h"
+
+class NetworkPacket;
enum ToClientConnectionState {
TOCLIENT_STATE_NOT_CONNECTED,
}
}
+/*
+ ConnectionCommand
+ */
+
+void ConnectionCommand::send(u16 peer_id_, u8 channelnum_, NetworkPacket *pkt,
+ bool reliable_)
+{
+ type = CONNCMD_SEND;
+ peer_id = peer_id_;
+ channelnum = channelnum_;
+ data = pkt->oldForgePacket();
+ reliable = reliable_;
+}
+
/*
Channel
*/
#include "socket.h"
#include "exceptions.h"
#include "constants.h"
-#include "network/networkpacket.h"
#include "util/pointer.h"
#include "util/container.h"
#include "util/thread.h"
type = CONNCMD_DISCONNECT_PEER;
peer_id = peer_id_;
}
- void send(u16 peer_id_, u8 channelnum_,
- NetworkPacket* pkt, bool reliable_)
- {
- type = CONNCMD_SEND;
- peer_id = peer_id_;
- channelnum = channelnum_;
- data = pkt->oldForgePacket();
- reliable = reliable_;
- }
+
+ void send(u16 peer_id_, u8 channelnum_, NetworkPacket* pkt, bool reliable_);
void ack(u16 peer_id_, u8 channelnum_, const SharedBuffer<u8> &data_)
{
*/
#include "networkpacket.h"
-#include "debug.h"
+#include <sstream>
#include "exceptions.h"
#include "util/serialize.h"
#ifndef NETWORKPACKET_HEADER
#define NETWORKPACKET_HEADER
+#include <SColor.h>
#include "util/pointer.h"
#include "util/numeric.h"
-#include "networkprotocol.h"
class NetworkPacket
{
#include "server.h"
#include "networkprotocol.h"
-#include "networkpacket.h"
+
+class NetworkPacket;
enum ToServerConnectionState {
TOSERVER_STATE_NOT_CONNECTED,
#include <iostream>
#include <map>
#include <list>
-#include "util/numeric.h"
#include "mapnode.h"
#ifndef SERVER
#include "client/tile.h"
float lacunarity = 2.0f;
u32 flags = NOISE_FLAG_DEFAULTS;
- NoiseParams() {}
+ NoiseParams() = default;
NoiseParams(float offset_, float scale_, v3f spread_, s32 seed_,
u16 octaves_, float persist_, float lacunarity_,
#include <deque>
#include <map>
-#include "threading/thread.h"
#include "threading/semaphore.h"
+#include "threading/thread.h"
#include "debug.h"
#include "lua.h"
#include "cpp_api/s_base.h"
// Data required to queue a job
struct LuaJobInfo
{
- LuaJobInfo() {};
+ LuaJobInfo() = default;
// Function to be called in async environment
std::string serializedFunction = "";
#include <iostream>
#include <string>
#include <thread>
+#include <mutex>
#include "util/basic_macros.h"
extern "C" {
}
#include "irrlichttypes.h"
-#include "threading/mutex_auto_lock.h"
#include "common/c_types.h"
#include "common/c_internal.h"
#include <thread>
#include "common/c_internal.h"
#include "cpp_api/s_base.h"
+#include "threading/mutex_auto_lock.h"
#ifdef SCRIPTAPI_LOCK_DEBUG
#include "debug.h" // assert()
}
#ifndef SERVER
-#include "client.h"
+class Client;
#endif
class ScriptApiBase;
#include "l_internal.h"
#include "content_cao.h"
#include "camera.h"
+#include "client.h"
LuaCamera::LuaCamera(Camera *m) : m_camera(m)
{
#include "l_client.h"
#include "chatmessage.h"
+#include "client.h"
#include "clientenvironment.h"
#include "common/c_content.h"
#include "common/c_converter.h"
#include "emerge.h"
#include "pathfinder.h"
#include "face_position_cache.h"
+#ifndef SERVER
+#include "client.h"
+#endif
struct EnumString ModApiEnvMod::es_ClearObjectsMode[] =
{
#include "l_localplayer.h"
#include "l_internal.h"
#include "script/common/c_converter.h"
+#include "localplayer.h"
LuaLocalPlayer::LuaLocalPlayer(LocalPlayer *m) : m_localplayer(m)
{
#include "lua_api/l_minimap.h"
#include "lua_api/l_internal.h"
#include "common/c_converter.h"
+#include "client.h"
#include "minimap.h"
#include "settings.h"
#include "util/hex.h"
#include "database.h"
#include "chatmessage.h"
+#include "chat_interface.h"
class ClientNotFoundException : public BaseException
{
#include "util/thread.h"
#include "util/basic_macros.h"
#include "serverenvironment.h"
-#include "chat_interface.h"
#include "clientiface.h"
#include "remoteplayer.h"
-#include "network/networkpacket.h"
#include "chatmessage.h"
#include <string>
#include <list>
#include <map>
#include <vector>
+class ChatEvent;
+struct ChatEventChat;
+struct ChatInterface;
class IWritableItemDefManager;
class IWritableNodeDefManager;
class IWritableCraftDefManager;
#include "environment.h"
#include "mapnode.h"
#include "mapblock.h"
+#include "activeobject.h"
#include <set>
class IGameDef;
#include "settings.h"
#include "util/numeric.h"
#include "util/string.h"
+#include "chat_interface.h"
TerminalChatConsole g_term_console;
#include "chat.h"
#include "threading/thread.h"
-#include "chat_interface.h"
+#include "util/container.h"
#include "log.h"
-
#include <sstream>
+
+struct ChatInterface;
+
class TermLogOutput : public ILogOutput {
public:
#include "itemdef.h"
#include "gamedef.h"
#include "mods.h"
+#include "util/numeric.h"
content_t t_CONTENT_STONE;
content_t t_CONTENT_GRASS;
#include "settings.h"
#include "util/serialize.h"
#include "network/connection.h"
+#include "network/networkpacket.h"
class TestConnection : public TestBase {
public: