29 #include "utils/timer.h"
181 +
"/packetlimiter.txt";
183 std::ifstream inPacketFile;
186 if ((stat(packetLimitsName.c_str(), &statbuf) != 0)
187 || !S_ISREG(statbuf.st_mode))
194 inPacketFile.open(packetLimitsName.c_str(), std::ios::in);
197 if (!inPacketFile.is_open() || !inPacketFile.getline(line, 100))
199 inPacketFile.close();
203 const int ver = atoi(line);
209 if (!inPacketFile.getline(line, 100))
220 inPacketFile.close();
229 std::ofstream outPacketFile;
230 outPacketFile.open(packetLimitsName.c_str(), std::ios::out);
231 if (!outPacketFile.is_open())
234 packetLimitsName.c_str())
235 outPacketFile.close();
238 outPacketFile <<
"4" << std::endl;
245 outPacketFile.close();
264 const int cnt = limit.
cnt;
#define reportAlways(...)
bool getValueBool(const std::string &key, const bool deflt) const
std::string serverConfigDir
Configuration serverConfig
#define A_DEFAULT_COPY(func)
std::string toString(T const &value)
converts any type to a string
bool checkPackets(const PacketTypeT type)
void writePacketLimits(const std::string &packetLimitsName)
bool limitPackets(const PacketTypeT type)
PacketLimit mPacketLimits[static_cast< size_t >(PacketType::PACKET_SIZE)+1]
PacketType ::T PacketTypeT