3 #include "../Common/server.h" 7 #define STORE_CHAT_SIZE 271 // includes 255 plus handle12, brackets2, colon1, space1 8 #define FORMAT_LINES 256 // controls how many we build for display in a vector, could be more because they are multi-line 27 for (
short t = 0; t <
players; t++)
38 for (
short t = index; t <
players - 1; t++)
59 WCHAR
title[MAX_TAB_CHARS - 5] = {0};
63 const size_t maxChars = min(columnWidth / fontWidth,
HELP_SIZE - 1);
68 const auto totalLines =
chatline.size();
69 const auto start =
static_cast<size_t>(max(0, (
int)totalLines -
FORMAT_LINES));
70 for (
auto pos = start; pos < totalLines; pos++)
79 std::basic_string<wchar_t> substr =
chatline.at(pos).substr(startIndex, maxChars);
80 if (substr.at(0) == 32)
83 substr =
chatline.at(pos).substr(startIndex, maxChars);
87 const size_t length = substr.length();
88 if (length == maxChars)
90 size_t space = substr.find_last_of(L
' ');
91 size_t hyphen = substr.find_last_of(L
'-');
92 if (space == std::string::npos) space = 0;
93 if (hyphen == std::string::npos) hyphen = 0;
else hyphen++;
94 backup = length - max(space, hyphen);
100 startIndex += maxChars - backup;
102 }
while (startIndex <
chatline.at(pos).length());
112 ZeroMemory(
seqplayer, MAX_ONLINEPLAYERS);
113 ZeroMemory(
dndplayer, MAX_ONLINEPLAYERS);
std::vector< std::wstring > formatchatline
std::vector< std::wstring > chatline
std::vector< std::string > formatchatlineplayer
std::vector< std::string > chatlineplayer
bool dndplayer[MAX_ONLINEPLAYERS]
void AddPlayer(unsigned char tempplayer)
unsigned char seqplayer[MAX_ONLINEPLAYERS]
WCHAR title[MAX_TAB_CHARS - 5]
void RefreshChat(long columnWidth, int fontWidth)
void RemovePlayer(short tempplayer)