MCPcopy Create free account
hub / github.com/ddnet/ddnet / Unban

Method Unban

src/engine/shared/netban.cpp:257–272  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

255
256template<class T>
257int CNetBan::Unban(T *pBanPool, const typename T::CDataType *pData)
258{
259 CNetHash NetHash(pData);
260 CBan<typename T::CDataType> *pBan = pBanPool->Find(pData, &NetHash);
261 if(pBan)
262 {
263 char aBuf[256];
264 MakeBanInfo(pBan, aBuf, sizeof(aBuf), MSGTYPE_BANREM);
265 pBanPool->Remove(pBan);
266 Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "net_ban", aBuf);
267 return 0;
268 }
269 else
270 Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "net_ban", "unban failed (invalid entry)");
271 return -1;
272}
273
274void CNetBan::Init(IConsole *pConsole, IStorage *pStorage)
275{

Callers 1

TESTFunction · 0.45

Calls 3

FindMethod · 0.45
RemoveMethod · 0.45
PrintMethod · 0.45

Tested by 1

TESTFunction · 0.36