3 * ===============================================================
4 * SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved.
5 * ===============================================================
7 * This file is not open source and may not be copied without explicit
8 * written permission of AlliedModders LLC. This file may not be redistributed
9 * in whole or significant part.
10 * For information, see LICENSE.txt or http://www.sourcemod.net/license.php
15 #ifndef _INCLUDE_SOURCEMOD_CMSGIDPOOL_H_
16 #define _INCLUDE_SOURCEMOD_CMSGIDPOOL_H_
19 #include "sourcemm_api.h"
21 #define INVALID_MESSAGE_ID -1
28 m_Names = sm_trie_create();
32 sm_trie_destroy(m_Names);
35 int GetMessageId(const char *name)
38 if (!sm_trie_retrieve(m_Names, name, reinterpret_cast<void **>(&msgid)))
44 while (gamedll->GetUserMessageInfo(msgid, buf, sizeof(buf), dummy))
46 if (strcmp(name, buf) == 0)
48 sm_trie_insert(m_Names, name, reinterpret_cast<void *>(msgid));
54 return INVALID_MESSAGE_ID;
63 #endif //_INCLUDE_SOURCEMOD_CMSGIDPOOL_H_