Merge pull request #73 from Chuck5ta/develop21

Server-owned world channel (43860fb)
This commit is contained in:
Charles A Edwards 2016-02-09 12:29:55 +00:00
commit f42cb963b4

View File

@ -638,6 +638,8 @@ ChatChannelsEntry const* GetChannelEntryFor(uint32 channel_id)
return NULL;
}
static ChatChannelsEntry worldCh = { 26, 4, "world" };
ChatChannelsEntry const* GetChannelEntryFor(const std::string& name)
{
// not sorted, numbering index from 0
@ -657,6 +659,21 @@ ChatChannelsEntry const* GetChannelEntryFor(const std::string& name)
return ch;
}
}
bool compare = true; // hack for world channel, TODO smth!
std::string world = "world";
for (uint8 i = 0; i < name.length(); ++i)
{
if (tolower(name[i]) != world[i])
{
compare = false;
break;
}
}
if (compare)
return &worldCh;
return NULL;
}