Allow up to 100 dice to be rolled at a time (#5047)

* Allow up to 100 dice to be rolled at a time
- Fix #4276
This commit is contained in:
Zach H 2024-06-12 08:37:04 -04:00 committed by GitHub
parent c95cc1dd9d
commit ce8092318e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
36 changed files with 184 additions and 58 deletions

View file

@ -1,28 +0,0 @@
// max sizes of strings used in the protocol
#ifndef STRINGSIZES_H
#define STRINGSIZES_H
#include <QString>
// max size for short strings, like names and things that are generally a single phrase
constexpr int MAX_NAME_LENGTH = 0xff;
// max size for chat messages and text contents
constexpr int MAX_TEXT_LENGTH = 0xfff;
// max size for deck files and pictures
constexpr int MAX_FILE_LENGTH = 0xfffff; // about a megabyte
// optimized functions to get qstrings that are at most that long
static inline QString nameFromStdString(const std::string &_string)
{
return QString::fromUtf8(_string.data(), std::min(int(_string.size()), MAX_NAME_LENGTH));
}
static inline QString textFromStdString(const std::string &_string)
{
return QString::fromUtf8(_string.data(), std::min(int(_string.size()), MAX_TEXT_LENGTH));
}
static inline QString fileFromStdString(const std::string &_string)
{
return QString::fromUtf8(_string.data(), std::min(int(_string.size()), MAX_FILE_LENGTH));
}
#endif // STRINGSIZES_H