本文整理汇总了C++中LineFromMessage函数的典型用法代码示例。如果您正苦于以下问题:C++ LineFromMessage函数的具体用法?C++ LineFromMessage怎么用?C++ LineFromMessage使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LineFromMessage函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: strdup
void ChatHandler::SendGlobalGMSysMessage(const char *str)
{
// Chat output
WorldPacket data;
// need copy to prevent corruption by strtok call in LineFromMessage original string
char* buf = strdup(str);
char* pos = buf;
while (char* line = LineFromMessage(pos))
{
FillSystemMessageData(&data, line);
sWorld->SendGlobalGMMessage(&data);
}
free(buf);
}
开发者ID:MiranaStarlight,项目名称:TrinityCore,代码行数:16,代码来源:Chat.cpp
示例2: strdup
void ChatHandler::SendSysMessage(const char *str)
{
WorldPackets::Chat::Chat packet;
// need copy to prevent corruption by strtok call in LineFromMessage original string
char* buf = strdup(str);
char* pos = buf;
while (char* line = LineFromMessage(pos))
{
packet.Initalize(CHAT_MSG_SYSTEM, LANG_UNIVERSAL, nullptr, nullptr, line);
m_session->SendPacket(packet.Write());
}
free(buf);
}
开发者ID:Abrek,项目名称:My-WoDCore-6.x.x,代码行数:16,代码来源:Chat.cpp
示例3: strdup
void ChatHandler::SendSysMessage(const char *str)
{
WorldPacket data;
// need copy to prevent corruption by strtok call in LineFromMessage original string
char* buf = strdup(str);
char* pos = buf;
while (char* line = LineFromMessage(pos))
{
BuildChatPacket(data, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, NULL, NULL, line);
m_session->SendPacket(&data);
}
free(buf);
}
开发者ID:jameyboor,项目名称:ElunaTrinityWotlk,代码行数:16,代码来源:Chat.cpp
示例4: strdup
void ChatHandler::SendGlobalGMSysMessage(const char *str)
{
// Chat output
WorldPacket data;
// need copy to prevent corruption by strtok call in LineFromMessage original string
char* buf = strdup(str);
char* pos = buf;
while (char* line = LineFromMessage(pos))
{
BuildChatPacket(data, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, nullptr, nullptr, line);
sWorld->SendGlobalGMMessage(&data);
}
free(buf);
}
开发者ID:SuetyPoet,项目名称:pgcompcore,代码行数:17,代码来源:Chat.cpp
示例5: while
void ChatHandler::SendSysMessage(const char *str, bool escapeCharacters)
{
WorldPacket data;
// need copy to prevent corruption by strtok call in LineFromMessage original string
char* buf;
char* pos;
if (escapeCharacters && strchr(str, '|'))
{
size_t startPos = 0;
std::ostringstream o;
while (const char* charPos = strchr(str + startPos, '|'))
{
o.write(str + startPos, charPos - str - startPos);
o << "||";
startPos = charPos - str + 1;
}
o.write(str + startPos, strlen(str) - startPos);
buf = strdup(o.str().c_str());
}
else
{
buf = strdup(str);
}
pos = buf;
while (char* line = LineFromMessage(pos))
{
BuildChatPacket(data, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, NULL, NULL, line);
m_session->SendPacket(&data);
}
free(buf);
}
开发者ID:cooler-SAI,项目名称:ElunaTrinityWotlk,代码行数:36,代码来源:Chat.cpp
注:本文中的LineFromMessage函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论