From 01899611942d9809f3e3c128e8c26202767eed73 Mon Sep 17 00:00:00 2001 From: Charles A Edwards Date: Tue, 9 Feb 2016 11:22:28 +0000 Subject: [PATCH] Server-owned world channel (43860fb) Case-insensitive channel name comparison for "world". commit 43860fb on cabfever's repo --- src/game/Server/DBCStores.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/game/Server/DBCStores.cpp b/src/game/Server/DBCStores.cpp index c5da10c0..64c8e144 100644 --- a/src/game/Server/DBCStores.cpp +++ b/src/game/Server/DBCStores.cpp @@ -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; }