Changeset - r25287:53db62f40fa0
[Not reviewed]
master
0 3 0
rubidium42 - 3 years ago 2021-04-27 17:32:51
rubidium@openttd.org
Cleanup: remove #ifdefs for compiling the old content server
3 files changed with 0 insertions and 10 deletions:
0 comments (0 inline, 0 general)
src/network/core/tcp_content.cpp
Show inline comments
 
@@ -7,20 +7,18 @@
 

	
 
/**
 
 * @file tcp_content.cpp Basic functions to receive and send Content packets.
 
 */
 

	
 
#include "../../stdafx.h"
 
#ifndef OPENTTD_MSU
 
#include "../../textfile_gui.h"
 
#include "../../newgrf_config.h"
 
#include "../../base_media_base.h"
 
#include "../../ai/ai.hpp"
 
#include "../../game/game.hpp"
 
#include "../../fios.h"
 
#endif /* OPENTTD_MSU */
 
#include "tcp_content.h"
 

	
 
#include "../../safeguards.h"
 

	
 
/** Clear everything in the struct */
 
ContentInfo::ContentInfo()
 
@@ -89,13 +87,12 @@ bool ContentInfo::IsSelected() const
 
 */
 
bool ContentInfo::IsValid() const
 
{
 
	return this->state < ContentInfo::INVALID && this->type >= CONTENT_TYPE_BEGIN && this->type < CONTENT_TYPE_END;
 
}
 

	
 
#ifndef OPENTTD_MSU
 
/**
 
 * Search a textfile file next to this file in the content list.
 
 * @param type The type of the textfile to search for.
 
 * @return The filename for the textfile, \c nullptr otherwise.
 
 */
 
const char *ContentInfo::GetTextfile(TextfileType type) const
 
@@ -136,13 +133,12 @@ const char *ContentInfo::GetTextfile(Tex
 
			tmp = FindScenario(this, true);
 
			break;
 
	}
 
	if (tmp == nullptr) return nullptr;
 
	return ::GetTextfile(type, GetContentInfoSubDir(this->type), tmp);
 
}
 
#endif /* OPENTTD_MSU */
 

	
 
void NetworkContentSocketHandler::Close()
 
{
 
	CloseConnection();
 
	if (this->sock == INVALID_SOCKET) return;
 

	
 
@@ -233,13 +229,12 @@ bool NetworkContentSocketHandler::Receiv
 
bool NetworkContentSocketHandler::Receive_CLIENT_INFO_EXTID(Packet *p) { return this->ReceiveInvalidPacket(PACKET_CONTENT_CLIENT_INFO_EXTID); }
 
bool NetworkContentSocketHandler::Receive_CLIENT_INFO_EXTID_MD5(Packet *p) { return this->ReceiveInvalidPacket(PACKET_CONTENT_CLIENT_INFO_EXTID_MD5); }
 
bool NetworkContentSocketHandler::Receive_SERVER_INFO(Packet *p) { return this->ReceiveInvalidPacket(PACKET_CONTENT_SERVER_INFO); }
 
bool NetworkContentSocketHandler::Receive_CLIENT_CONTENT(Packet *p) { return this->ReceiveInvalidPacket(PACKET_CONTENT_CLIENT_CONTENT); }
 
bool NetworkContentSocketHandler::Receive_SERVER_CONTENT(Packet *p) { return this->ReceiveInvalidPacket(PACKET_CONTENT_SERVER_CONTENT); }
 

	
 
#ifndef OPENTTD_MSU
 
/**
 
 * Helper to get the subdirectory a #ContentInfo is located in.
 
 * @param type The type of content.
 
 * @return The subdirectory the content is located in.
 
 */
 
Subdirectory GetContentInfoSubDir(ContentType type)
 
@@ -258,7 +253,6 @@ Subdirectory GetContentInfoSubDir(Conten
 
			return BASESET_DIR;
 

	
 
		case CONTENT_TYPE_SCENARIO:     return SCENARIO_DIR;
 
		case CONTENT_TYPE_HEIGHTMAP:    return HEIGHTMAP_DIR;
 
	}
 
}
 
#endif /* OPENTTD_MSU */
src/network/core/tcp_content.h
Show inline comments
 
@@ -126,11 +126,9 @@ public:
 
	/** On destructing of this class, the socket needs to be closed */
 
	virtual ~NetworkContentSocketHandler() { this->Close(); }
 

	
 
	bool ReceivePackets();
 
};
 

	
 
#ifndef OPENTTD_MSU
 
Subdirectory GetContentInfoSubDir(ContentType type);
 
#endif /* OPENTTD_MSU */
 

	
 
#endif /* NETWORK_CORE_TCP_CONTENT_H */
src/network/core/tcp_content_type.h
Show inline comments
 
@@ -79,12 +79,10 @@ struct ContentInfo {
 

	
 
	void TransferFrom(ContentInfo *other);
 

	
 
	size_t Size() const;
 
	bool IsSelected() const;
 
	bool IsValid() const;
 
#ifndef OPENTTD_MSU
 
	const char *GetTextfile(TextfileType type) const;
 
#endif /* OPENTTD_MSU */
 
};
 

	
 
#endif /* NETWORK_CORE_TCP_CONTENT_TYPE_H */
0 comments (0 inline, 0 general)