From 48d30d6ab4657e00c0c861d67285256daeff1142 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Wed, 1 Feb 2012 22:38:03 +0000 Subject: Rewritten cAuthenticator to make use of the new cIsThread architecture - now authentication runs in a single separate thread for all clients; Global player-kicking function (cServer, cRoot); More char * -> AString conversion git-svn-id: http://mc-server.googlecode.com/svn/trunk@221 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/StringUtils.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'source/StringUtils.cpp') diff --git a/source/StringUtils.cpp b/source/StringUtils.cpp index 94b4d3c0f..c9dbb1113 100644 --- a/source/StringUtils.cpp +++ b/source/StringUtils.cpp @@ -146,3 +146,16 @@ int NoCaseCompare(const AString & s1, const AString & s2) +void ReplaceString(AString & iHayStack, const AString & iNeedle, const AString & iReplaceWith) +{ + size_t pos1 = iHayStack.find(iNeedle); + while (pos1 != AString::npos) + { + iHayStack.replace( pos1, iNeedle.size(), iReplaceWith); + pos1 = iHayStack.find(iNeedle, pos1); + } +} + + + + -- cgit v1.2.3