diff --git a/DependentExtensions/Autopatcher/AutopatcherPostgreRepository/AutopatcherPostgreRepository.cpp b/DependentExtensions/Autopatcher/AutopatcherPostgreRepository/AutopatcherPostgreRepository.cpp index 39a1c0816..20b2ee26f 100644 --- a/DependentExtensions/Autopatcher/AutopatcherPostgreRepository/AutopatcherPostgreRepository.cpp +++ b/DependentExtensions/Autopatcher/AutopatcherPostgreRepository/AutopatcherPostgreRepository.cpp @@ -1318,7 +1318,6 @@ bool AutopatcherPostgreRepository::UpdateApplicationFiles(const char *applicatio if (fopen_s(&fp, path, "rb") != 0) { newFiles.Clear(); - PQclear(fileRows); RakAssert(0); return false; } diff --git a/DependentExtensions/Autopatcher/AutopatcherServer.cpp b/DependentExtensions/Autopatcher/AutopatcherServer.cpp index d69f08551..aa71625c7 100644 --- a/DependentExtensions/Autopatcher/AutopatcherServer.cpp +++ b/DependentExtensions/Autopatcher/AutopatcherServer.cpp @@ -7,7 +7,7 @@ * of patent rights can be found in the RakNet Patents.txt file in the same directory. * * - * Modified work: Copyright (c) 2016-2017, SLikeSoft UG (haftungsbeschränkt) + * Modified work: Copyright (c) 2016-2018, SLikeSoft UG (haftungsbeschränkt) * * This source code was modified by SLikeSoft. Modifications are licensed under the MIT-style * license found in the license.txt file in the root directory of this source tree. @@ -41,7 +41,7 @@ void AutopatcherServerLoadNotifier_Printf::OnQueueUpdate(SystemAddress remoteSys char *operationString; char *requestTypeString; char systemAddressString[32]; - remoteSystem.ToString(true, systemAddressString, 32); + remoteSystem.ToString(true, systemAddressString, static_cast(32)); if (requestType==ASUMC_GET_CHANGELIST) requestTypeString="GetChangelist"; else @@ -61,7 +61,7 @@ void AutopatcherServerLoadNotifier_Printf::OnGetChangelistCompleted( AutopatcherServerLoadNotifier::AutopatcherState *autopatcherState) { char systemAddressString[32]; - remoteSystem.ToString(true, systemAddressString, 32); + remoteSystem.ToString(true, systemAddressString, static_cast(32)); char *changelistString; if (getChangelistResult==GCR_DELETE_FILES) @@ -80,7 +80,7 @@ void AutopatcherServerLoadNotifier_Printf::OnGetChangelistCompleted( void AutopatcherServerLoadNotifier_Printf::OnGetPatchCompleted(SystemAddress remoteSystem, AutopatcherServerLoadNotifier::PatchResult patchResult, AutopatcherServerLoadNotifier::AutopatcherState *autopatcherState) { char systemAddressString[32]; - remoteSystem.ToString(true, systemAddressString, 32); + remoteSystem.ToString(true, systemAddressString, static_cast(32)); char *patchResultString; if (patchResult==PR_NO_FILES_NEEDED_PATCHING) diff --git a/DependentExtensions/IrrlichtDemo/CDemo.cpp b/DependentExtensions/IrrlichtDemo/CDemo.cpp index 8d67a5556..5e6ef0fad 100644 --- a/DependentExtensions/IrrlichtDemo/CDemo.cpp +++ b/DependentExtensions/IrrlichtDemo/CDemo.cpp @@ -5,7 +5,7 @@ * This file was taken from RakNet 4.082. * Please see licenses/RakNet license.txt for the underlying license and related copyright. * - * Modified work: Copyright (c) 2016-2017, SLikeSoft UG (haftungsbeschränkt) + * Modified work: Copyright (c) 2016-2018, SLikeSoft UG (haftungsbeschränkt) * * This source code was modified by SLikeSoft. Modifications are licensed under the MIT-style * license found in the license.txt file in the root directory of this source tree. @@ -1177,7 +1177,7 @@ void CDemo::UpdateRakNet(void) if (packet->guid!=rakPeer->GetGuidFromSystemAddress(SLNet::UNASSIGNED_SYSTEM_ADDRESS)) { char hostIP[32]; - packet->systemAddress.ToString(false,hostIP,32); + packet->systemAddress.ToString(false,hostIP,static_cast(32)); SLNet::ConnectionAttemptResult car = rakPeer->Connect(hostIP,packet->systemAddress.GetPort(),0,0); RakAssert(car== SLNet::CONNECTION_ATTEMPT_STARTED); } diff --git a/DependentExtensions/IrrlichtDemo/CMainMenu.cpp b/DependentExtensions/IrrlichtDemo/CMainMenu.cpp index 49444c1dc..be8bde64d 100644 --- a/DependentExtensions/IrrlichtDemo/CMainMenu.cpp +++ b/DependentExtensions/IrrlichtDemo/CMainMenu.cpp @@ -1,6 +1,11 @@ // This is a Demo of the Irrlicht Engine (c) 2005-2008 by N.Gebhardt. // This file is not documented. +/* + * This file was taken from RakNet 4.082 without any modifications. + * Please see licenses/RakNet license.txt for the underlying license and related copyright. + */ + #include "CMainMenu.h" diff --git a/DependentExtensions/Lobby2/PGSQL/Lobby2Message_PGSQL.cpp b/DependentExtensions/Lobby2/PGSQL/Lobby2Message_PGSQL.cpp index b3348a5b9..0f233399a 100644 --- a/DependentExtensions/Lobby2/PGSQL/Lobby2Message_PGSQL.cpp +++ b/DependentExtensions/Lobby2/PGSQL/Lobby2Message_PGSQL.cpp @@ -3352,8 +3352,8 @@ bool SLNet::Clans_GetMemberProperties_PGSQL::ServerDBImpl( Lobby2ServerCommand * resultCode=L2RC_Clans_GetMemberProperties_UNKNOWN_TARGET_HANDLE; return true; } - SLNet::ClanMemberState clanMemberState = GetClanMemberState(clanId, targetUserId, &isSubleader, pgsql); - if (clanMemberState==CMD_UNDEFINED) + SLNet::ClanMemberState curClanMemberState = GetClanMemberState(clanId, targetUserId, &isSubleader, pgsql); + if (curClanMemberState==CMD_UNDEFINED) { resultCode=L2RC_Clans_GetMemberProperties_TARGET_NOT_IN_CLAN; return true; diff --git a/DependentExtensions/Lobby2/Rooms/ProfanityFilter.cpp b/DependentExtensions/Lobby2/Rooms/ProfanityFilter.cpp index 85b490ef0..b6e168b7a 100644 --- a/DependentExtensions/Lobby2/Rooms/ProfanityFilter.cpp +++ b/DependentExtensions/Lobby2/Rooms/ProfanityFilter.cpp @@ -7,7 +7,7 @@ * of patent rights can be found in the RakNet Patents.txt file in the same directory. * * - * Modified work: Copyright (c) 2016-2017, SLikeSoft UG (haftungsbeschränkt) + * Modified work: Copyright (c) 2016-2018, SLikeSoft UG (haftungsbeschränkt) * * This source code was modified by SLikeSoft. Modifications are licensed under the MIT-style * license found in the license.txt file in the root directory of this source tree. @@ -52,6 +52,57 @@ bool ProfanityFilter::HasProfanity(const char *str) return FilterProfanity(str, 0, 0,false) > 0; } +int ProfanityFilter::FilterProfanity(const char *input, char *output, bool filter) +{ + if (input == 0 || input[0] == 0) + return 0; + + int count = 0; + char* b = (char *)alloca(strlen(input) + 1); + strcpy_s(b, strlen(input) + 1, input); + _strlwr(b); + char *start = b; + if (output) + strcpy(output, input); + + start = strpbrk(start, WORDCHARS); + while (start != 0) + { + size_t len = strspn(start, WORDCHARS); + if (len > 0) + { + // we a have a word - let's check if it's a BAAAD one + char saveChar = start[len]; + start[len] = '\0'; + + // loop through profanity list + for (unsigned int i = 0, size = words.Size(); i < size; i++) + { + if (_stricmp(start, words[i].C_String()) == 0) + { + count++; + + // size_t len = words[i].size(); + if (filter && output) + { + for (unsigned int j = 0; j < len; j++) + { + output[start + j - b] = RandomBanChar(); + } + } + break; + } + } + start[len] = saveChar; + } + + start += len; + start = strpbrk(start, WORDCHARS); + } + + return count; +} + int ProfanityFilter::FilterProfanity(const char *input, char *output, size_t outputLength, bool filter) { if (input==0 || input[0]==0) diff --git a/DependentExtensions/Lobby2/Rooms/ProfanityFilter.h b/DependentExtensions/Lobby2/Rooms/ProfanityFilter.h index 69cc8fe0b..c31275359 100644 --- a/DependentExtensions/Lobby2/Rooms/ProfanityFilter.h +++ b/DependentExtensions/Lobby2/Rooms/ProfanityFilter.h @@ -7,7 +7,7 @@ * of patent rights can be found in the RakNet Patents.txt file in the same directory. * * - * Modified work: Copyright (c) 2016-2017, SLikeSoft UG (haftungsbeschränkt) + * Modified work: Copyright (c) 2016-2018, SLikeSoft UG (haftungsbeschränkt) * * This source code was modified by SLikeSoft. Modifications are licensed under the MIT-style * license found in the license.txt file in the root directory of this source tree. @@ -31,7 +31,8 @@ class ProfanityFilter bool HasProfanity(const char *str); // Removes profanity. Returns number of occurrences of profanity matches (including 0) - int FilterProfanity(const char *str, char *output, size_t outputLength, bool filter = true); + int FilterProfanity(const char *input, char *output, bool filter = true); + int FilterProfanity(const char *input, char *output, size_t outputLength, bool filter = true); // Number of profanity words loaded int Count(); diff --git a/DependentExtensions/SQLite3Plugin/Logger/ClientOnly/Optional/SQLiteClientLogger_PacketLogger.cpp b/DependentExtensions/SQLite3Plugin/Logger/ClientOnly/Optional/SQLiteClientLogger_PacketLogger.cpp index ca4e8deac..1467fe743 100644 --- a/DependentExtensions/SQLite3Plugin/Logger/ClientOnly/Optional/SQLiteClientLogger_PacketLogger.cpp +++ b/DependentExtensions/SQLite3Plugin/Logger/ClientOnly/Optional/SQLiteClientLogger_PacketLogger.cpp @@ -2,7 +2,7 @@ * This file was taken from RakNet 4.082. * Please see licenses/RakNet license.txt for the underlying license and related copyright. * - * Modified work: Copyright (c) 2016-2017, SLikeSoft UG (haftungsbeschränkt) + * Modified work: Copyright (c) 2016-2018, SLikeSoft UG (haftungsbeschränkt) * * This source code was modified by SLikeSoft. Modifications are licensed under the MIT-style * license found in the license.txt file in the root directory of this source tree. @@ -28,9 +28,9 @@ void SQLiteClientLogger_PacketLogger::OnDirectSocketSend(const char *data, const { char str1[64], str2[62], str3[64], str4[64]; SystemAddress localSystemAddress = rakPeerInterface->GetExternalID(remoteSystemAddress); - localSystemAddress.ToString(true, str1, 64); + localSystemAddress.ToString(true, str1, static_cast(64)); rakPeerInterface->GetGuidFromSystemAddress(SLNet::UNASSIGNED_SYSTEM_ADDRESS).ToString(str2, 62); - remoteSystemAddress.ToString(true, str3, 64); + remoteSystemAddress.ToString(true, str3, static_cast(64)); rakPeerInterface->GetGuidFromSystemAddress(remoteSystemAddress).ToString(str4, 64); @@ -41,9 +41,9 @@ void SQLiteClientLogger_PacketLogger::OnDirectSocketReceive(const char *data, co { char str1[64], str2[62], str3[64], str4[64]; SystemAddress localSystemAddress = rakPeerInterface->GetExternalID(remoteSystemAddress); - localSystemAddress.ToString(true, str1, 64); + localSystemAddress.ToString(true, str1, static_cast(64)); rakPeerInterface->GetGuidFromSystemAddress(SLNet::UNASSIGNED_SYSTEM_ADDRESS).ToString(str2, 62); - remoteSystemAddress.ToString(true, str3, 64); + remoteSystemAddress.ToString(true, str3, static_cast(64)); rakPeerInterface->GetGuidFromSystemAddress(remoteSystemAddress).ToString(str4, 64); rakSqlLog(DEFAULT_PACKET_LOGGER_TABLE, "SndRcv,Type,PacketNumber,FrameNumber,PacketID,BitLength,LocalIP,LocalGuid,RemoteIP,RemoteGuid,splitPacketId,SplitPacketIndex,splitPacketCount,orderingIndex,misc", \ @@ -53,9 +53,9 @@ void SQLiteClientLogger_PacketLogger::OnInternalPacket(InternalPacket *internalP { char str1[64], str2[62], str3[64], str4[64]; SystemAddress localSystemAddress = rakPeerInterface->GetExternalID(remoteSystemAddress); - localSystemAddress.ToString(true, str1, 64); + localSystemAddress.ToString(true, str1, static_cast(64)); rakPeerInterface->GetGuidFromSystemAddress(SLNet::UNASSIGNED_SYSTEM_ADDRESS).ToString(str2, 62); - remoteSystemAddress.ToString(true, str3, 64); + remoteSystemAddress.ToString(true, str3, static_cast(64)); rakPeerInterface->GetGuidFromSystemAddress(remoteSystemAddress).ToString(str4, 64); unsigned char typeByte; @@ -80,9 +80,9 @@ void SQLiteClientLogger_PacketLogger::OnAck(unsigned int messageNumber, SystemAd { char str1[64], str2[62], str3[64], str4[64]; SystemAddress localSystemAddress = rakPeerInterface->GetExternalID(remoteSystemAddress); - localSystemAddress.ToString(true, str1, 64); + localSystemAddress.ToString(true, str1, static_cast(64)); rakPeerInterface->GetGuidFromSystemAddress(SLNet::UNASSIGNED_SYSTEM_ADDRESS).ToString(str2, 62); - remoteSystemAddress.ToString(true, str3, 64); + remoteSystemAddress.ToString(true, str3, static_cast(64)); rakPeerInterface->GetGuidFromSystemAddress(remoteSystemAddress).ToString(str4, 64); rakSqlLog(DEFAULT_PACKET_LOGGER_TABLE, "SndRcv,Type,PacketNumber,FrameNumber,PacketID,BitLength,LocalIP,LocalGuid,RemoteIP,RemoteGuid,splitPacketId,SplitPacketIndex,splitPacketCount,orderingIndex,misc", \ @@ -92,9 +92,9 @@ void SQLiteClientLogger_PacketLogger::OnPushBackPacket(const char *data, const B { char str1[64], str2[62], str3[64], str4[64]; SystemAddress localSystemAddress = rakPeerInterface->GetExternalID(remoteSystemAddress); - localSystemAddress.ToString(true, str1, 64); + localSystemAddress.ToString(true, str1, static_cast(64)); rakPeerInterface->GetGuidFromSystemAddress(SLNet::UNASSIGNED_SYSTEM_ADDRESS).ToString(str2, 62); - remoteSystemAddress.ToString(true, str3, 64); + remoteSystemAddress.ToString(true, str3, static_cast(64)); rakPeerInterface->GetGuidFromSystemAddress(remoteSystemAddress).ToString(str4, 64); rakSqlLog(DEFAULT_PACKET_LOGGER_TABLE, "SndRcv,Type,PacketNumber,FrameNumber,PacketID,BitLength,LocalIP,LocalGuid,RemoteIP,RemoteGuid,splitPacketId,SplitPacketIndex,splitPacketCount,orderingIndex,misc", \ diff --git a/DependentExtensions/SQLite3Plugin/Logger/ServerOnly/SQLiteServerLoggerPlugin.cpp b/DependentExtensions/SQLite3Plugin/Logger/ServerOnly/SQLiteServerLoggerPlugin.cpp index 2241bcaef..106eee804 100644 --- a/DependentExtensions/SQLite3Plugin/Logger/ServerOnly/SQLiteServerLoggerPlugin.cpp +++ b/DependentExtensions/SQLite3Plugin/Logger/ServerOnly/SQLiteServerLoggerPlugin.cpp @@ -172,7 +172,7 @@ SQLiteServerLoggerPlugin::CPUThreadOutput* ExecCPULoggingThread(SQLiteServerLogg // outputNode->whenMessageArrived = cpuThreadInput->cpuInputArray[i].whenMessageArrived; outputNode->packet=packet; - packet->systemAddress.ToString(true,outputNode->ipAddressString,32); + packet->systemAddress.ToString(true,outputNode->ipAddressString,static_cast(32)); SLNet::BitStream bitStream(packet->data, packet->length, false); bitStream.IgnoreBytes(1); bitStream.Read(outputNode->dbIdentifier); @@ -940,7 +940,7 @@ PluginReceiveResult SQLiteServerLoggerPlugin::OnReceive(Packet *packet) if (sessionManagementMode==CREATE_EACH_NAMED_DB_HANDLE) { unsigned char senderAddr[32]; - packet->systemAddress.ToString(true,(char*) senderAddr, 32); + packet->systemAddress.ToString(true,(char*) senderAddr, static_cast(32)); dbIdentifier+=':'; dbIdentifier+=senderAddr; } diff --git a/DependentExtensions/SQLite3Plugin/SQLite3Sample.cpp b/DependentExtensions/SQLite3Plugin/SQLite3Sample.cpp index 02a2bb1df..10eac6004 100644 --- a/DependentExtensions/SQLite3Plugin/SQLite3Sample.cpp +++ b/DependentExtensions/SQLite3Plugin/SQLite3Sample.cpp @@ -7,7 +7,7 @@ * of patent rights can be found in the RakNet Patents.txt file in the same directory. * * - * Modified work: Copyright (c) 2016-2017, SLikeSoft UG (haftungsbeschränkt) + * Modified work: Copyright (c) 2016-2018, SLikeSoft UG (haftungsbeschränkt) * * This source code was modified by SLikeSoft. Modifications are licensed under the MIT-style * license found in the license.txt file in the root directory of this source tree. @@ -74,7 +74,7 @@ class ConnectionStatePlugin : public SQLite3ServerPlugin // Remove dropped system by primary key system address char systemAddressString[64]; - systemAddress.ToString(true,systemAddressString,64); + systemAddress.ToString(true,systemAddressString,static_cast(64)); SLNet::RakString query("DELETE FROM connectionState WHERE systemAddress='%s';", SLNet::RakString(systemAddressString).SQLEscape().C_String()); sqlite3_exec(dbHandles[idx].dbHandle,query.C_String(),0,0,0); @@ -93,7 +93,7 @@ class ConnectionStatePlugin : public SQLite3ServerPlugin // Store new system's system address and guid. rowCreationTime column is created automatically char systemAddressString[64]; - systemAddress.ToString(true,systemAddressString,64); + systemAddress.ToString(true,systemAddressString,static_cast(64)); char guidString[128]; rakNetGUID.ToString(guidString, 64); SLNet::RakString query( diff --git a/DependentExtensions/Swig/InternalSwigItems/InternalSwigDLLBuildAndCopy.bat b/DependentExtensions/Swig/InternalSwigItems/InternalSwigDLLBuildAndCopy.bat index d89af049a..a45285f3b 100644 --- a/DependentExtensions/Swig/InternalSwigItems/InternalSwigDLLBuildAndCopy.bat +++ b/DependentExtensions/Swig/InternalSwigItems/InternalSwigDLLBuildAndCopy.bat @@ -1,7 +1,8 @@ +@echo off + REM This file was taken from RakNet 4.082 without any modifications. REM Please see licenses/RakNet license.txt for the underlying license and related copyright. -@echo off if "%1"=="" goto :SKIPSETPATH set swigPath=%1 if "%swigPath:~-1%" NEQ "\" goto :SKIPREMOVESLASH diff --git a/DependentExtensions/Swig/MakeSwig.bat b/DependentExtensions/Swig/MakeSwig.bat index 136b8029b..282a09743 100644 --- a/DependentExtensions/Swig/MakeSwig.bat +++ b/DependentExtensions/Swig/MakeSwig.bat @@ -1,7 +1,13 @@ -REM This file was taken from RakNet 4.082 without any modifications. +@echo off + +REM This file was taken from RakNet 4.082. REM Please see licenses/RakNet license.txt for the underlying license and related copyright. +REM +REM Modified work: Copyright (c) 2018, SLikeSoft UG (haftungsbeschränkt) +REM +REM This source code was modified by SLikeSoft. Modifications are licensed under the MIT-style +REM license found in the license.txt file in the root directory of this source tree. -@echo off if "%1"=="" goto :NOVARS echo Performing Swig build set swigPath=%2 @@ -9,13 +15,15 @@ if "%swigPath%"=="" goto :SKIPADDSLASH if "%swigPath:~-1%"=="\" goto :SKIPADDSLASH SET swigPath=%swigPath%\ :SKIPADDSLASH -del /F /Q SwigOutput\SwigCSharpOutput\* +if exist SwigOutput\SwigCSharpOutput del /F /Q SwigOutput\SwigCSharpOutput\* if "%3"=="" goto :NOSQL %swigPath%swig -c++ -csharp -namespace RakNet -I"%1" -I"SwigInterfaceFiles" -I"%3" -DSWIG_ADDITIONAL_SQL_LITE -outdir SwigOutput\SwigCSharpOutput -o SwigOutput\CplusDLLIncludes\RakNet_wrap.cxx SwigInterfaceFiles\RakNet.i +if errorlevel 1 GOTO :SWIGERROR copy /Y SwigOutput\SwigCSharpOutput\* SwigWindowsCSharpSample\SwigTestApp\SwigFiles\* GOTO ENDSWIG :NOSQL %swigPath%swig -c++ -csharp -namespace RakNet -I"%1" -I"SwigInterfaceFiles" -outdir SwigOutput\SwigCSharpOutput -o SwigOutput\CplusDLLIncludes\RakNet_wrap.cxx SwigInterfaceFiles\RakNet.i +if errorlevel 1 GOTO :SWIGERROR copy /Y SwigOutput\SwigCSharpOutput\* SwigWindowsCSharpSample\SwigTestApp\SwigFiles\* :ENDSWIG if errorlevel 1 GOTO :SWIGERROR diff --git a/DependentExtensions/Swig/MakeSwigWithExtras.bat b/DependentExtensions/Swig/MakeSwigWithExtras.bat index 59e06890d..23d5341b3 100644 --- a/DependentExtensions/Swig/MakeSwigWithExtras.bat +++ b/DependentExtensions/Swig/MakeSwigWithExtras.bat @@ -1,7 +1,13 @@ -REM This file was taken from RakNet 4.082 without any modifications. +@echo off + +REM This file was taken from RakNet 4.082. REM Please see licenses/RakNet license.txt for the underlying license and related copyright. +REM +REM Modified work: Copyright (c) 2018, SLikeSoft UG (haftungsbeschränkt) +REM +REM This source code was modified by SLikeSoft. Modifications are licensed under the MIT-style +REM license found in the license.txt file in the root directory of this source tree. -@echo off SetLocal EnableDelayedExpansion set sourceDir=%1 CALL :dequote sourceDir @@ -13,7 +19,7 @@ if "%swigPath%"=="" goto :SKIPADDSLASH if "%swigPath:~-1%"=="\" goto :SKIPADDSLASH SET swigPath=%swigPath%\ :SKIPADDSLASH -del /F /Q SwigOutput\SwigCSharpOutput\* +if exist SwigOutput\SwigCSharpOutput del /F /Q SwigOutput\SwigCSharpOutput\* set option=%4 CALL :dequote option set dependentDir=%3 diff --git a/DependentExtensions/cat/threads/Atomic.hpp b/DependentExtensions/cat/threads/Atomic.hpp index eb3ee2afa..2f1bd909a 100644 --- a/DependentExtensions/cat/threads/Atomic.hpp +++ b/DependentExtensions/cat/threads/Atomic.hpp @@ -26,6 +26,14 @@ POSSIBILITY OF SUCH DAMAGE. */ +/* + * Modified work: Copyright (c) 2017, SLikeSoft UG (haftungsbeschränkt) + * + * This source code was modified by SLikeSoft. Modifications are licensed under the MIT-style + * license found in the license.txt file in the root directory of this source tree. + * Alternatively you are permitted to license the modifications under the Modified BSD License. + */ + #ifndef CAT_ATOMIC_HPP #define CAT_ATOMIC_HPP @@ -203,7 +211,7 @@ u32 Atomic::Add(volatile u32 *x, s32 y) #if defined(CAT_COMPILER_MSVC) && defined(CAT_WORD_64) - u32 result = _InterlockedAdd((volatile LONG*)x, y) - y; + u32 result = InterlockedAdd((volatile LONG*)x, y) - y; CAT_FENCE_COMPILER return result; diff --git a/Help/Doxygen/SLikeNetManual.chm b/Help/Doxygen/SLikeNetManual.chm index afa929e8b..c730e65a7 100644 Binary files a/Help/Doxygen/SLikeNetManual.chm and b/Help/Doxygen/SLikeNetManual.chm differ diff --git a/Help/Doxygen/html/annotated.xhtml b/Help/Doxygen/html/annotated.xhtml index 30eb78448..23bb19119 100644 --- a/Help/Doxygen/html/annotated.xhtml +++ b/Help/Doxygen/html/annotated.xhtml @@ -28,7 +28,7 @@
SLikeNet -  0.1.0 +  0.1.1
@@ -392,7 +392,7 @@ $(document).ready(function(){initNavTree('annotated.xhtml','');}); @@ -200,9 +200,9 @@ Variables

Definition at line 32 of file DS_Table.cpp.

-

References _FILE_AND_LINE_, DataStructures::Table::Row::cells, SLNet::OP_DELETE(), and DataStructures::List< list_type >::Size().

+

References _FILE_AND_LINE_, DataStructures::Table::Row::cells, SLNet::OP_DELETE(), and DataStructures::List< list_type >::Size().

-

Referenced by DataStructures::Table::Clear().

+

Referenced by DataStructures::Table::Clear().

@@ -230,9 +230,9 @@ Variables @@ -255,9 +255,9 @@ Variables
-

Definition at line 829 of file DS_Table.cpp.

+

Definition at line 847 of file DS_Table.cpp.

-

Referenced by DataStructures::Table::SortTable().

+

Referenced by DataStructures::Table::SortTable().

@@ -279,9 +279,9 @@ Variables
-

Definition at line 830 of file DS_Table.cpp.

+

Definition at line 848 of file DS_Table.cpp.

-

Referenced by RowSort(), and DataStructures::Table::SortTable().

+

Referenced by RowSort(), and DataStructures::Table::SortTable().

@@ -303,9 +303,9 @@ Variables
-

Definition at line 828 of file DS_Table.cpp.

+

Definition at line 846 of file DS_Table.cpp.

-

Referenced by RowSort(), and DataStructures::Table::SortTable().

+

Referenced by RowSort(), and DataStructures::Table::SortTable().

@@ -327,9 +327,9 @@ Variables
-

Definition at line 827 of file DS_Table.cpp.

+

Definition at line 845 of file DS_Table.cpp.

-

Referenced by RowSort(), and DataStructures::Table::SortTable().

+

Referenced by RowSort(), and DataStructures::Table::SortTable().

@@ -339,7 +339,7 @@ Variables
-

Definition at line 489 of file types.h.

+

Definition at line 494 of file types.h.

-

References val.

+

References val.

@@ -481,7 +481,7 @@ Public Attributes
-

Definition at line 503 of file types.h.

+

Definition at line 508 of file types.h.

@@ -507,9 +507,9 @@ Public Attributes
-

Definition at line 486 of file types.h.

+

Definition at line 491 of file types.h.

-

References val.

+

References val.

@@ -535,7 +535,7 @@ Public Attributes
-

Definition at line 500 of file types.h.

+

Definition at line 505 of file types.h.

@@ -560,7 +560,7 @@ Public Attributes
-

Definition at line 474 of file types.h.

+

Definition at line 479 of file types.h.

@@ -586,7 +586,7 @@ Public Attributes
-

Definition at line 476 of file types.h.

+

Definition at line 481 of file types.h.

@@ -612,9 +612,9 @@ Public Attributes
-

Definition at line 480 of file types.h.

+

Definition at line 485 of file types.h.

-

References val.

+

References val.

@@ -640,7 +640,7 @@ Public Attributes
-

Definition at line 494 of file types.h.

+

Definition at line 499 of file types.h.

@@ -666,9 +666,9 @@ Public Attributes
-

Definition at line 487 of file types.h.

+

Definition at line 492 of file types.h.

-

References val.

+

References val.

@@ -694,7 +694,7 @@ Public Attributes
-

Definition at line 501 of file types.h.

+

Definition at line 506 of file types.h.

@@ -719,7 +719,7 @@ Public Attributes
-

Definition at line 475 of file types.h.

+

Definition at line 480 of file types.h.

@@ -745,7 +745,7 @@ Public Attributes
-

Definition at line 477 of file types.h.

+

Definition at line 482 of file types.h.

@@ -771,9 +771,9 @@ Public Attributes
-

Definition at line 481 of file types.h.

+

Definition at line 486 of file types.h.

-

References val.

+

References val.

@@ -799,7 +799,7 @@ Public Attributes
-

Definition at line 495 of file types.h.

+

Definition at line 500 of file types.h.

@@ -825,9 +825,9 @@ Public Attributes
-

Definition at line 488 of file types.h.

+

Definition at line 493 of file types.h.

-

References val.

+

References val.

@@ -853,7 +853,7 @@ Public Attributes
-

Definition at line 502 of file types.h.

+

Definition at line 507 of file types.h.

@@ -879,9 +879,9 @@ Public Attributes
-

Definition at line 485 of file types.h.

+

Definition at line 490 of file types.h.

-

References val.

+

References val.

@@ -907,7 +907,7 @@ Public Attributes
-

Definition at line 499 of file types.h.

+

Definition at line 504 of file types.h.

@@ -933,9 +933,9 @@ Public Attributes
-

Definition at line 479 of file types.h.

+

Definition at line 484 of file types.h.

-

References val.

+

References val.

@@ -961,7 +961,7 @@ Public Attributes
-

Definition at line 493 of file types.h.

+

Definition at line 498 of file types.h.

@@ -987,9 +987,9 @@ Public Attributes
-

Definition at line 482 of file types.h.

+

Definition at line 487 of file types.h.

-

References val.

+

References val.

@@ -1015,7 +1015,7 @@ Public Attributes
-

Definition at line 496 of file types.h.

+

Definition at line 501 of file types.h.

@@ -1041,9 +1041,9 @@ Public Attributes
-

Definition at line 484 of file types.h.

+

Definition at line 489 of file types.h.

-

References val.

+

References val.

@@ -1069,7 +1069,7 @@ Public Attributes
-

Definition at line 498 of file types.h.

+

Definition at line 503 of file types.h.

@@ -1084,9 +1084,9 @@ Public Attributes @@ -1099,7 +1099,7 @@ Public Attributes
-

Definition at line 120 of file DS_Table.h.

+

Definition at line 121 of file DS_Table.h.

@@ -237,7 +237,7 @@ Public Attributes @@ -446,9 +447,9 @@ Variables
Note
not threadSafe, use an instance of RakNetRandom if necessary per thread
Returns
0 to 1.0f, inclusive
-

Definition at line 93 of file Rand.cpp.

+

Definition at line 95 of file Rand.cpp.

-

References _left, _next, _state, and frandomMT().

+

References _left, _next, _state, and frandomMT().

@@ -482,11 +483,11 @@ Variables
-

Definition at line 190 of file Rand.cpp.

+

Definition at line 192 of file Rand.cpp.

-

References reloadMT().

+

References reloadMT().

-

Referenced by fillBufferMT(), frandomMT(), randomMT(), and SLNet::RakNetRandom::RandomMT().

+

Referenced by fillBufferMT(), frandomMT(), randomMT(), and SLNet::RakNetRandom::RandomMT().

@@ -507,9 +508,9 @@ Variables
Note
not threadSafe, use an instance of RakNetRandom if necessary per thread
Returns
an integer random value.
-

Definition at line 89 of file Rand.cpp.

+

Definition at line 91 of file Rand.cpp.

-

References _left, _next, _state, and randomMT().

+

References _left, _next, _state, and randomMT().

@@ -543,11 +544,11 @@ Variables
-

Definition at line 162 of file Rand.cpp.

+

Definition at line 164 of file Rand.cpp.

-

References K, loBit, M, mixBits, N, and seedMT().

+

References K, loBit, M, mixBits, N, and seedMT().

-

Referenced by randomMT(), reloadMT(), and SLNet::RakNetRandom::ReloadMT().

+

Referenced by randomMT(), reloadMT(), and SLNet::RakNetRandom::ReloadMT().

@@ -565,9 +566,9 @@ Variables
-

Definition at line 85 of file Rand.cpp.

+

Definition at line 87 of file Rand.cpp.

-

References _left, _next, _state, and reloadMT().

+

References _left, _next, _state, and reloadMT().

@@ -607,11 +608,11 @@ Variables
-

Definition at line 102 of file Rand.cpp.

+

Definition at line 104 of file Rand.cpp.

-

References N.

+

References N.

-

Referenced by reloadMT(), seedMT(), and SLNet::RakNetRandom::SeedMT().

+

Referenced by reloadMT(), seedMT(), and SLNet::RakNetRandom::SeedMT().

@@ -637,9 +638,9 @@ Variables -

Definition at line 81 of file Rand.cpp.

+

Definition at line 83 of file Rand.cpp.

-

References _left, _next, _state, and seedMT().

+

References _left, _next, _state, and seedMT().

@@ -662,9 +663,9 @@ Variables
-

Definition at line 70 of file Rand.cpp.

+

Definition at line 72 of file Rand.cpp.

-

Referenced by fillBufferMT(), frandomMT(), randomMT(), reloadMT(), and seedMT().

+

Referenced by fillBufferMT(), frandomMT(), randomMT(), reloadMT(), and seedMT().

@@ -686,9 +687,9 @@ Variables
-

Definition at line 69 of file Rand.cpp.

+

Definition at line 71 of file Rand.cpp.

-

Referenced by fillBufferMT(), frandomMT(), randomMT(), reloadMT(), and seedMT().

+

Referenced by fillBufferMT(), frandomMT(), randomMT(), reloadMT(), and seedMT().

@@ -710,9 +711,9 @@ Variables
-

Definition at line 68 of file Rand.cpp.

+

Definition at line 70 of file Rand.cpp.

-

Referenced by fillBufferMT(), frandomMT(), randomMT(), reloadMT(), and seedMT().

+

Referenced by fillBufferMT(), frandomMT(), randomMT(), reloadMT(), and seedMT().

@@ -722,7 +723,7 @@ Variables
Go to the documentation of this file.
1 
-
40 /*
-
41  * Modified work: Copyright (c) 2016-2017, SLikeSoft UG (haftungsbeschränkt)
-
42  *
-
43  * This source code was modified by SLikeSoft. Modifications are licensed under the MIT-style
-
44  * license found in the license.txt file in the root directory of this source tree.
-
45  */
-
46 
-
47 #include <stdio.h>
-
48 #include <stdlib.h>
-
49 #include <string.h>
-
50 #include "slikenet/Rand.h"
-
51 
-
52 //
-
53 // uint32 must be an unsigned integer type capable of holding at least 32
-
54 // bits; exactly 32 should be fastest, but 64 is better on an Alpha with
-
55 // GCC at -O3 optimization so try your options and see what's best for you
-
56 //
-
57 
-
58 //typedef unsigned int uint32;
+
42 /*
+
43  * Modified work: Copyright (c) 2016-2017, SLikeSoft UG (haftungsbeschränkt)
+
44  *
+
45  * This source code was modified by SLikeSoft. Modifications are licensed under the MIT-style
+
46  * license found in the license.txt file in the root directory of this source tree.
+
47  */
+
48 
+
49 #include <stdio.h>
+
50 #include <stdlib.h>
+
51 #include <string.h>
+
52 #include "slikenet/Rand.h"
+
53 
+
54 //
+
55 // uint32 must be an unsigned integer type capable of holding at least 32
+
56 // bits; exactly 32 should be fastest, but 64 is better on an Alpha with
+
57 // GCC at -O3 optimization so try your options and see what's best for you
+
58 //
59 
-
60 #define N (624) // length of state vector
-
61 #define M (397) // a period parameter
-
62 #define K (0x9908B0DFU) // a magic constant
-
63 #define hiBit(u) ((u) & 0x80000000U) // mask all but highest bit of u
-
64 #define loBit(u) ((u) & 0x00000001U) // mask all but lowest bit of u
-
65 #define loBits(u) ((u) & 0x7FFFFFFFU) // mask the highest bit of u
-
66 #define mixBits(u, v) (hiBit(u)|loBits(v)) // move hi bit of u to hi bit of v
-
67 
-
68 static unsigned int _state[ N + 1 ]; // state vector + 1 extra to not violate ANSI C
-
69 static unsigned int *_next; // next random value is computed from here
-
70 static int _left = -1; // can *next++ this many times before reloading
-
71 
-
72 using namespace SLNet;
+
60 //typedef unsigned int uint32;
+
61 
+
62 #define N (624) // length of state vector
+
63 #define M (397) // a period parameter
+
64 #define K (0x9908B0DFU) // a magic constant
+
65 #define hiBit(u) ((u) & 0x80000000U) // mask all but highest bit of u
+
66 #define loBit(u) ((u) & 0x00000001U) // mask all but lowest bit of u
+
67 #define loBits(u) ((u) & 0x7FFFFFFFU) // mask the highest bit of u
+
68 #define mixBits(u, v) (hiBit(u)|loBits(v)) // move hi bit of u to hi bit of v
+
69 
+
70 static unsigned int _state[ N + 1 ]; // state vector + 1 extra to not violate ANSI C
+
71 static unsigned int *_next; // next random value is computed from here
+
72 static int _left = -1; // can *next++ this many times before reloading
73 
-
74 void seedMT( unsigned int seed, unsigned int *state, unsigned int *&next, int &left );
-
75 unsigned int reloadMT( unsigned int *state, unsigned int *&next, int &left );
-
76 unsigned int randomMT( unsigned int *state, unsigned int *&next, int &left );
-
77 void fillBufferMT( void *buffer, unsigned int bytes, unsigned int *state, unsigned int *&next, int &left );
-
78 float frandomMT( unsigned int *state, unsigned int *&next, int &left );
-
79 
-
80 // Uses global vars
-
81 void seedMT( unsigned int seed )
-
82 {
-
83  seedMT(seed, _state, _next, _left);
-
84 }
-
85 unsigned int reloadMT( void )
-
86 {
-
87  return reloadMT(_state, _next, _left);
-
88 }
-
89 unsigned int randomMT( void )
-
90 {
-
91  return randomMT(_state, _next, _left);
-
92 }
-
93 float frandomMT( void )
-
94 {
-
95  return frandomMT(_state, _next, _left);
-
96 }
-
97 void fillBufferMT( void *buffer, unsigned int bytes )
-
98 {
-
99  fillBufferMT(buffer, bytes, _state, _next, _left);
-
100 }
-
101 
-
102 void seedMT( unsigned int seed, unsigned int *state, unsigned int *&next, int &left ) // Defined in cokus_c.c
-
103 {
-
104  (void) next;
-
105 
-
106  //
-
107  // We initialize state[0..(N-1)] via the generator
+
74 using namespace SLNet;
+
75 
+
76 void seedMT( unsigned int seed, unsigned int *state, unsigned int *&next, int &left );
+
77 unsigned int reloadMT( unsigned int *state, unsigned int *&next, int &left );
+
78 unsigned int randomMT( unsigned int *state, unsigned int *&next, int &left );
+
79 void fillBufferMT( void *buffer, unsigned int bytes, unsigned int *state, unsigned int *&next, int &left );
+
80 float frandomMT( unsigned int *state, unsigned int *&next, int &left );
+
81 
+
82 // Uses global vars
+
83 void seedMT( unsigned int seed )
+
84 {
+
85  seedMT(seed, _state, _next, _left);
+
86 }
+
87 unsigned int reloadMT( void )
+
88 {
+
89  return reloadMT(_state, _next, _left);
+
90 }
+
91 unsigned int randomMT( void )
+
92 {
+
93  return randomMT(_state, _next, _left);
+
94 }
+
95 float frandomMT( void )
+
96 {
+
97  return frandomMT(_state, _next, _left);
+
98 }
+
99 void fillBufferMT( void *buffer, unsigned int bytes )
+
100 {
+
101  fillBufferMT(buffer, bytes, _state, _next, _left);
+
102 }
+
103 
+
104 void seedMT( unsigned int seed, unsigned int *state, unsigned int *&next, int &left ) // Defined in cokus_c.c
+
105 {
+
106  (void) next;
+
107 
108  //
-
109  // x_new = (69069 * x_old) mod 2^32
+
109  // We initialize state[0..(N-1)] via the generator
110  //
-
111  // from Line 15 of Table 1, p. 106, Sec. 3.3.4 of Knuth's
-
112  // _The Art of Computer Programming_, Volume 2, 3rd ed.
-
113  //
-
114  // Notes (SJC): I do not know what the initial state requirements
-
115  // of the Mersenne Twister are, but it seems this seeding generator
-
116  // could be better. It achieves the maximum period for its modulus
-
117  // (2^30) iff x_initial is odd (p. 20-21, Sec. 3.2.1.2, Knuth); if
-
118  // x_initial can be even, you have sequences like 0, 0, 0, ...;
-
119  // 2^31, 2^31, 2^31, ...; 2^30, 2^30, 2^30, ...; 2^29, 2^29 + 2^31,
-
120  // 2^29, 2^29 + 2^31, ..., etc. so I force seed to be odd below.
-
121  //
-
122  // Even if x_initial is odd, if x_initial is 1 mod 4 then
+
111  // x_new = (69069 * x_old) mod 2^32
+
112  //
+
113  // from Line 15 of Table 1, p. 106, Sec. 3.3.4 of Knuth's
+
114  // _The Art of Computer Programming_, Volume 2, 3rd ed.
+
115  //
+
116  // Notes (SJC): I do not know what the initial state requirements
+
117  // of the Mersenne Twister are, but it seems this seeding generator
+
118  // could be better. It achieves the maximum period for its modulus
+
119  // (2^30) iff x_initial is odd (p. 20-21, Sec. 3.2.1.2, Knuth); if
+
120  // x_initial can be even, you have sequences like 0, 0, 0, ...;
+
121  // 2^31, 2^31, 2^31, ...; 2^30, 2^30, 2^30, ...; 2^29, 2^29 + 2^31,
+
122  // 2^29, 2^29 + 2^31, ..., etc. so I force seed to be odd below.
123  //
-
124  // the lowest bit of x is always 1,
-
125  // the next-to-lowest bit of x is always 0,
-
126  // the 2nd-from-lowest bit of x alternates ... 0 1 0 1 0 1 0 1 ... ,
-
127  // the 3rd-from-lowest bit of x 4-cycles ... 0 1 1 0 0 1 1 0 ... ,
-
128  // the 4th-from-lowest bit of x has the 8-cycle ... 0 0 0 1 1 1 1 0 ... ,
-
129  // ...
-
130  //
-
131  // and if x_initial is 3 mod 4 then
+
124  // Even if x_initial is odd, if x_initial is 1 mod 4 then
+
125  //
+
126  // the lowest bit of x is always 1,
+
127  // the next-to-lowest bit of x is always 0,
+
128  // the 2nd-from-lowest bit of x alternates ... 0 1 0 1 0 1 0 1 ... ,
+
129  // the 3rd-from-lowest bit of x 4-cycles ... 0 1 1 0 0 1 1 0 ... ,
+
130  // the 4th-from-lowest bit of x has the 8-cycle ... 0 0 0 1 1 1 1 0 ... ,
+
131  // ...
132  //
-
133  // the lowest bit of x is always 1,
-
134  // the next-to-lowest bit of x is always 1,
-
135  // the 2nd-from-lowest bit of x alternates ... 0 1 0 1 0 1 0 1 ... ,
-
136  // the 3rd-from-lowest bit of x 4-cycles ... 0 0 1 1 0 0 1 1 ... ,
-
137  // the 4th-from-lowest bit of x has the 8-cycle ... 0 0 1 1 1 1 0 0 ... ,
-
138  // ...
-
139  //
-
140  // The generator's potency (min. s>=0 with (69069-1)^s = 0 mod 2^32) is
-
141  // 16, which seems to be alright by p. 25, Sec. 3.2.1.3 of Knuth. It
-
142  // also does well in the dimension 2..5 spectral tests, but it could be
-
143  // better in dimension 6 (Line 15, Table 1, p. 106, Sec. 3.3.4, Knuth).
-
144  //
-
145  // Note that the random number user does not see the values generated
-
146  // here directly since reloadMT() will always munge them first, so maybe
-
147  // none of all of this matters. In fact, the seed values made here could
-
148  // even be extra-special desirable if the Mersenne Twister theory says
-
149  // so-- that's why the only change I made is to restrict to odd seeds.
-
150  //
-
151 
-
152  unsigned int x = ( seed | 1U ) & 0xFFFFFFFFU, *s = state;
-
153  int j;
-
154 
-
155  for ( left = 0, *s++ = x, j = N; --j;
-
156  *s++ = ( x *= 69069U ) & 0xFFFFFFFFU )
-
157 
-
158  ;
-
159 }
-
160 
-
161 
-
162 unsigned int reloadMT( unsigned int *state, unsigned int *&next, int &left )
-
163 {
-
164  unsigned int * p0 = state, *p2 = state + 2, *pM = state + M, s0, s1;
-
165  int j;
-
166 
-
167  if ( left < -1 )
-
168  seedMT( 4357U );
-
169 
-
170  left = N - 1, next = state + 1;
+
133  // and if x_initial is 3 mod 4 then
+
134  //
+
135  // the lowest bit of x is always 1,
+
136  // the next-to-lowest bit of x is always 1,
+
137  // the 2nd-from-lowest bit of x alternates ... 0 1 0 1 0 1 0 1 ... ,
+
138  // the 3rd-from-lowest bit of x 4-cycles ... 0 0 1 1 0 0 1 1 ... ,
+
139  // the 4th-from-lowest bit of x has the 8-cycle ... 0 0 1 1 1 1 0 0 ... ,
+
140  // ...
+
141  //
+
142  // The generator's potency (min. s>=0 with (69069-1)^s = 0 mod 2^32) is
+
143  // 16, which seems to be alright by p. 25, Sec. 3.2.1.3 of Knuth. It
+
144  // also does well in the dimension 2..5 spectral tests, but it could be
+
145  // better in dimension 6 (Line 15, Table 1, p. 106, Sec. 3.3.4, Knuth).
+
146  //
+
147  // Note that the random number user does not see the values generated
+
148  // here directly since reloadMT() will always munge them first, so maybe
+
149  // none of all of this matters. In fact, the seed values made here could
+
150  // even be extra-special desirable if the Mersenne Twister theory says
+
151  // so-- that's why the only change I made is to restrict to odd seeds.
+
152  //
+
153 
+
154  unsigned int x = ( seed | 1U ) & 0xFFFFFFFFU, *s = state;
+
155  int j;
+
156 
+
157  for ( left = 0, *s++ = x, j = N; --j;
+
158  *s++ = ( x *= 69069U ) & 0xFFFFFFFFU )
+
159 
+
160  ;
+
161 }
+
162 
+
163 
+
164 unsigned int reloadMT( unsigned int *state, unsigned int *&next, int &left )
+
165 {
+
166  unsigned int * p0 = state, *p2 = state + 2, *pM = state + M, s0, s1;
+
167  int j;
+
168 
+
169  if ( left < -1 )
+
170  seedMT( 4357U );
171 
-
172  for ( s0 = state[ 0 ], s1 = state[ 1 ], j = N - M + 1; --j; s0 = s1, s1 = *p2++ )
-
173  * p0++ = *pM++ ^ ( mixBits( s0, s1 ) >> 1 ) ^ ( loBit( s1 ) ? K : 0U );
-
174 
-
175  for ( pM = state, j = M; --j; s0 = s1, s1 = *p2++ )
-
176  * p0++ = *pM++ ^ ( mixBits( s0, s1 ) >> 1 ) ^ ( loBit( s1 ) ? K : 0U );
-
177 
-
178  s1 = state[ 0 ], *p0 = *pM ^ ( mixBits( s0, s1 ) >> 1 ) ^ ( loBit( s1 ) ? K : 0U );
+
172  left = N - 1, next = state + 1;
+
173 
+
174  for ( s0 = state[ 0 ], s1 = state[ 1 ], j = N - M + 1; --j; s0 = s1, s1 = *p2++ )
+
175  * p0++ = *pM++ ^ ( mixBits( s0, s1 ) >> 1 ) ^ ( loBit( s1 ) ? K : 0U );
+
176 
+
177  for ( pM = state, j = M; --j; s0 = s1, s1 = *p2++ )
+
178  * p0++ = *pM++ ^ ( mixBits( s0, s1 ) >> 1 ) ^ ( loBit( s1 ) ? K : 0U );
179 
-
180  s1 ^= ( s1 >> 11 );
+
180  s1 = state[ 0 ], *p0 = *pM ^ ( mixBits( s0, s1 ) >> 1 ) ^ ( loBit( s1 ) ? K : 0U );
181 
-
182  s1 ^= ( s1 << 7 ) & 0x9D2C5680U;
+
182  s1 ^= ( s1 >> 11 );
183 
-
184  s1 ^= ( s1 << 15 ) & 0xEFC60000U;
+
184  s1 ^= ( s1 << 7 ) & 0x9D2C5680U;
185 
-
186  return ( s1 ^ ( s1 >> 18 ) );
-
187 }
-
188 
-
189 
-
190 unsigned int randomMT( unsigned int *state, unsigned int *&next, int &left )
-
191 {
-
192  unsigned int y;
-
193 
-
194  if ( --left < 0 )
-
195  return ( reloadMT(state, next, left) );
-
196 
-
197  y = *next++;
+
186  s1 ^= ( s1 << 15 ) & 0xEFC60000U;
+
187 
+
188  return ( s1 ^ ( s1 >> 18 ) );
+
189 }
+
190 
+
191 
+
192 unsigned int randomMT( unsigned int *state, unsigned int *&next, int &left )
+
193 {
+
194  unsigned int y;
+
195 
+
196  if ( --left < 0 )
+
197  return ( reloadMT(state, next, left) );
198 
-
199  y ^= ( y >> 11 );
+
199  y = *next++;
200 
-
201  y ^= ( y << 7 ) & 0x9D2C5680U;
+
201  y ^= ( y >> 11 );
202 
-
203  y ^= ( y << 15 ) & 0xEFC60000U;
+
203  y ^= ( y << 7 ) & 0x9D2C5680U;
204 
-
205  return ( y ^ ( y >> 18 ) );
+
205  y ^= ( y << 15 ) & 0xEFC60000U;
206 
-
207  // This change made so the value returned is in the same range as what rand() returns
-
208  // return(y ^ (y >> 18)) % 32767;
-
209 }
-
210 
-
211 void fillBufferMT( void *buffer, unsigned int bytes, unsigned int *state, unsigned int *&next, int &left )
-
212 {
-
213  unsigned int offset=0;
-
214  unsigned int r;
-
215  while (bytes-offset>=sizeof(r))
-
216  {
-
217  r = randomMT(state, next, left);
-
218  memcpy((char*)buffer+offset, &r, sizeof(r));
-
219  offset+=sizeof(r);
-
220  }
-
221 
-
222  r = randomMT(state, next, left);
-
223  memcpy((char*)buffer+offset, &r, bytes-offset);
-
224 }
-
225 
-
226 float frandomMT( unsigned int *state, unsigned int *&next, int &left )
-
227 {
-
228  return ( float ) ( ( double ) randomMT(state, next, left) / 4294967296.0 );
-
229 }
- -
231 {
-
232  left=-1;
-
233 }
- -
235 {
-
236 }
-
237 void RakNetRandom::SeedMT( unsigned int seed )
-
238 {
-
239  printf("%i\n",seed);
-
240  seedMT(seed, state, next, left);
-
241 }
-
242 
-
243 unsigned int RakNetRandom::ReloadMT( void )
-
244 {
-
245  return reloadMT(state, next, left);
-
246 }
-
247 
-
248 unsigned int RakNetRandom::RandomMT( void )
-
249 {
-
250  return randomMT(state, next, left);
-
251 }
-
252 
- -
254 {
-
255  return frandomMT(state, next, left);
-
256 }
-
257 
-
258 void RakNetRandom::FillBufferMT( void *buffer, unsigned int bytes )
-
259 {
-
260  fillBufferMT(buffer, bytes, state, next, left);
-
261 }
-
262 
-
263 /*
-
264 int main(void)
-
265 {
-
266 int j;
-
267 
-
268 // you can seed with any uint32, but the best are odds in 0..(2^32 - 1)
+
207  return ( y ^ ( y >> 18 ) );
+
208 
+
209  // This change made so the value returned is in the same range as what rand() returns
+
210  // return(y ^ (y >> 18)) % 32767;
+
211 }
+
212 
+
213 void fillBufferMT( void *buffer, unsigned int bytes, unsigned int *state, unsigned int *&next, int &left )
+
214 {
+
215  unsigned int offset=0;
+
216  unsigned int r;
+
217  while (bytes-offset>=sizeof(r))
+
218  {
+
219  r = randomMT(state, next, left);
+
220  memcpy((char*)buffer+offset, &r, sizeof(r));
+
221  offset+=sizeof(r);
+
222  }
+
223 
+
224  r = randomMT(state, next, left);
+
225  memcpy((char*)buffer+offset, &r, bytes-offset);
+
226 }
+
227 
+
228 float frandomMT( unsigned int *state, unsigned int *&next, int &left )
+
229 {
+
230  return ( float ) ( ( double ) randomMT(state, next, left) / 4294967296.0 );
+
231 }
+ +
233 {
+
234  left=-1;
+
235 }
+ +
237 {
+
238 }
+
239 void RakNetRandom::SeedMT( unsigned int seed )
+
240 {
+
241  printf("%i\n",seed);
+
242  seedMT(seed, state, next, left);
+
243 }
+
244 
+
245 unsigned int RakNetRandom::ReloadMT( void )
+
246 {
+
247  return reloadMT(state, next, left);
+
248 }
+
249 
+
250 unsigned int RakNetRandom::RandomMT( void )
+
251 {
+
252  return randomMT(state, next, left);
+
253 }
+
254 
+ +
256 {
+
257  return frandomMT(state, next, left);
+
258 }
+
259 
+
260 void RakNetRandom::FillBufferMT( void *buffer, unsigned int bytes )
+
261 {
+
262  fillBufferMT(buffer, bytes, state, next, left);
+
263 }
+
264 
+
265 /*
+
266 int main(void)
+
267 {
+
268 int j;
269 
-
270 seedMT(4357U);
+
270 // you can seed with any uint32, but the best are odds in 0..(2^32 - 1)
271 
-
272 // print the first 2,002 random numbers seven to a line as an example
+
272 seedMT(4357U);
273 
-
274 for(j=0; j<2002; j++)
-
275 RAKNET_DEBUG_PRINTF(" %10lu%s", (unsigned int) randomMT(), (j%7)==6 ? "\n" : "");
-
276 
-
277 return(EXIT_SUCCESS);
-
278 }
-
279 
-
280 */
-
281 
+
274 // print the first 2,002 random numbers seven to a line as an example
+
275 
+
276 for(j=0; j<2002; j++)
+
277 RAKNET_DEBUG_PRINTF(" %10lu%s", (unsigned int) randomMT(), (j%7)==6 ? "\n" : "");
+
278 
+
279 return(EXIT_SUCCESS);
+
280 }
+
281 
+
282 */
+
283 
@@ -2676,9 +2752,9 @@ template<class templateType > -

Definition at line 1708 of file BitStream.h.

+

Definition at line 1720 of file BitStream.h.

-

References IsBigEndian(), RakAssert, Read(), ReadBits(), and ReverseBytesInPlace().

+

References IsBigEndian(), RakAssert, Read(), ReadBits(), and ReverseBytesInPlace().

@@ -2705,9 +2781,9 @@ template<class serializationType , class sourceType > -

Definition at line 1693 of file BitStream.h.

+

Definition at line 1705 of file BitStream.h.

-

References Read().

+

References Read().

Referenced by SLNet::RakWString::Deserialize().

@@ -2754,11 +2830,50 @@ template<class templateType > -

Definition at line 1442 of file BitStream.h.

+

Definition at line 1450 of file BitStream.h.

-

References DoEndianSwap(), and ReverseBytes().

+

References DoEndianSwap(), and ReverseBytes().

-

Referenced by SLNet::StringCompressor::DecodeString(), SLNet::DataCompressor::DecompressAndAllocate(), SLNet::RakString::DeserializeCompressed(), SLNet::TableSerializer::DeserializeFilterQuery(), SLNet::TableSerializer::DeserializeFilterQueryList(), ReadAlignedBytesSafe(), ReadAlignedBytesSafeAlloc(), ReadCompressedDelta(), ReadVector(), and SerializeCompressed().

+

Referenced by SLNet::StringCompressor::DecodeString(), SLNet::DataCompressor::DecompressAndAllocate(), SLNet::RakString::DeserializeCompressed(), SLNet::TableSerializer::DeserializeFilterQuery(), SLNet::TableSerializer::DeserializeFilterQueryList(), ReadAlignedBytesSafe(), ReadAlignedBytesSafeAlloc(), ReadCompressedDelta(), ReadVector(), and SerializeCompressed().

+ + + + +
+
+ + + + + +
+ + + + + + + + +
bool SLNet::BitStream::ReadCompressed (wchar_t *& varString)
+
+inline
+
+ +

Read a wchar from a bitstream.

+

Define __BITSTREAM_NATIVE_END if you need endian swapping. This is lossless, but only has benefit if you use less than half the bits of the type If you are not using __BITSTREAM_NATIVE_END the opposite is true

+
Parameters
+ + + +
[in]varStringThe value to read
[in]varStringLengthThe length of the given varString array (in wchar_t)
+
+
+
Returns
true on success, false on failure.
+ +

Definition at line 1542 of file BitStream.h.

+ +

References SLNet::RakWString::Deserialize().

@@ -2794,18 +2909,7 @@ template<class templateType >
-

Read a wchar from a bitstream.

-

Define __BITSTREAM_NATIVE_END if you need endian swapping. This is lossless, but only has benefit if you use less than half the bits of the type If you are not using __BITSTREAM_NATIVE_END the opposite is true

-
Parameters
- - - -
[in]varStringThe value to read
[in]varStringLengthThe length of the given varString array (in wchar_t)
-
-
-
Returns
true on success, false on failure.
- -

Definition at line 1534 of file BitStream.h.

+

Definition at line 1546 of file BitStream.h.

References SLNet::RakWString::Deserialize().

@@ -2835,9 +2939,9 @@ template<>
-

Definition at line 1469 of file BitStream.h.

+

Definition at line 1477 of file BitStream.h.

-

References Read().

+

References Read().

@@ -2865,9 +2969,9 @@ template<>
-

Definition at line 1475 of file BitStream.h.

+

Definition at line 1483 of file BitStream.h.

-

References Read().

+

References Read().

@@ -2895,9 +2999,9 @@ template<>
-

Definition at line 1481 of file BitStream.h.

+

Definition at line 1489 of file BitStream.h.

-

References Read().

+

References Read().

@@ -2925,9 +3029,9 @@ template<>
-

Definition at line 1487 of file BitStream.h.

+

Definition at line 1495 of file BitStream.h.

-

References Read().

+

References Read().

@@ -2957,9 +3061,9 @@ template<>

For values between -1 and 1.

-

Definition at line 1494 of file BitStream.h.

+

Definition at line 1502 of file BitStream.h.

-

References Read().

+

References Read().

@@ -2989,9 +3093,9 @@ template<>

For values between -1 and 1.

-

Definition at line 1507 of file BitStream.h.

+

Definition at line 1515 of file BitStream.h.

-

References Read().

+

References Read().

@@ -3021,7 +3125,7 @@ template<>

For strings.

-

Definition at line 1520 of file BitStream.h.

+

Definition at line 1528 of file BitStream.h.

References SLNet::RakString::DeserializeCompressed().

@@ -3051,7 +3155,7 @@ template<>
-

Definition at line 1525 of file BitStream.h.

+

Definition at line 1533 of file BitStream.h.

References SLNet::RakWString::Deserialize().

@@ -3081,7 +3185,7 @@ template<>
-

Definition at line 1530 of file BitStream.h.

+

Definition at line 1538 of file BitStream.h.

References SLNet::RakString::DeserializeCompressed().

@@ -3111,7 +3215,7 @@ template<>
-

Definition at line 1539 of file BitStream.h.

+

Definition at line 1551 of file BitStream.h.

References SLNet::RakString::DeserializeCompressed().

@@ -3158,11 +3262,11 @@ template<class templateType >
-

Definition at line 1554 of file BitStream.h.

+

Definition at line 1566 of file BitStream.h.

-

References Read(), and ReadCompressed().

+

References Read(), and ReadCompressed().

-

Referenced by SerializeCompressedDelta().

+

Referenced by SerializeCompressedDelta().

@@ -3198,9 +3302,9 @@ template<> -

Definition at line 1567 of file BitStream.h.

+

Definition at line 1579 of file BitStream.h.

-

References Read().

+

References Read().

@@ -3245,11 +3349,11 @@ template<class templateType > -

Definition at line 1417 of file BitStream.h.

+

Definition at line 1425 of file BitStream.h.

-

References Read().

+

References Read().

-

Referenced by SerializeDelta().

+

Referenced by SerializeDelta().

@@ -3285,9 +3389,9 @@ template<> -

Definition at line 1430 of file BitStream.h.

+

Definition at line 1438 of file BitStream.h.

-

References Read().

+

References Read().

@@ -3331,11 +3435,11 @@ template<> -

Definition at line 1133 of file BitStream.cpp.

+

Definition at line 1188 of file BitStream.cpp.

-

References RakAssert, and Read().

+

References RakAssert, and Read().

-

Referenced by ReadNormVector(), and SerializeFloat16().

+

Referenced by ReadNormVector(), and SerializeFloat16().

@@ -3389,11 +3493,11 @@ template<class templateType >
Returns
true on success, false on failure.
-

Definition at line 1784 of file BitStream.h.

+

Definition at line 1796 of file BitStream.h.

-

References Read().

+

References Read().

-

Referenced by ReadOrthMatrix(), and SerializeNormQuat().

+

Referenced by ReadOrthMatrix(), and SerializeNormQuat().

@@ -3441,11 +3545,11 @@ template<class templateType >
Returns
true on success, false on failure.
-

Definition at line 1734 of file BitStream.h.

+

Definition at line 1746 of file BitStream.h.

-

References ReadFloat16().

+

References ReadFloat16().

-

Referenced by SerializeNormVector().

+

Referenced by SerializeNormVector().

@@ -3521,11 +3625,11 @@ template<class templateType >

Use 6 bytes instead of 36 Lossy, although the result is renormalized

Returns
true on success, false on failure.
-

Definition at line 1815 of file BitStream.h.

+

Definition at line 1827 of file BitStream.h.

-

References ReadNormQuat().

+

References ReadNormQuat().

-

Referenced by SerializeOrthMatrix().

+

Referenced by SerializeOrthMatrix().

@@ -3573,11 +3677,11 @@ template<class templateType >
Returns
true on success, false on failure.
-

Definition at line 1747 of file BitStream.h.

+

Definition at line 1759 of file BitStream.h.

-

References Read(), and ReadCompressed().

+

References Read(), and ReadCompressed().

-

Referenced by SerializeVector().

+

Referenced by SerializeVector().

@@ -3685,9 +3789,9 @@ template<class templateType > @@ -3723,9 +3827,9 @@ template<class templateType > @@ -3774,9 +3878,9 @@ template<class templateType >
Returns
true if writeToBitstream is true. true if writeToBitstream is false and the read was successful. false if writeToBitstream is false and the read was not successful.
-

Definition at line 774 of file BitStream.h.

+

Definition at line 778 of file BitStream.h.

-

References Read(), and Write().

+

References Read(), and Write().

@@ -3829,9 +3933,9 @@ template<class templateType >
Returns
true if writeToBitstream is true. true if writeToBitstream is false and the read was successful. false if writeToBitstream is false and the read was not successful.
-

Definition at line 833 of file BitStream.h.

+

Definition at line 837 of file BitStream.h.

-

References Read(), and Write().

+

References Read(), and Write().

@@ -3892,7 +3996,7 @@ template<class templateType >
Returns
true if writeToBitstream is true. true if writeToBitstream is false and the read was successful. false if writeToBitstream is false and the read was not successful.
-

Definition at line 908 of file BitStream.h.

+

Definition at line 912 of file BitStream.h.

References ReadBits(), and WriteBits().

@@ -3954,7 +4058,7 @@ template<class templateType > -

Definition at line 851 of file BitStream.h.

+

Definition at line 855 of file BitStream.h.

References BYTES_TO_BITS, and NumberOfLeadingZeroes().

@@ -4016,9 +4120,9 @@ template<class templateType > -

Definition at line 857 of file BitStream.h.

+

Definition at line 861 of file BitStream.h.

-

References ReadBitsFromIntegerRange(), and WriteBitsFromIntegerRange().

+

References ReadBitsFromIntegerRange(), and WriteBitsFromIntegerRange().

@@ -4056,7 +4160,7 @@ template<class serializationType , class sourceType > -

Definition at line 843 of file BitStream.h.

+

Definition at line 847 of file BitStream.h.

@@ -4105,9 +4209,9 @@ template<class templateType >
Returns
true if writeToBitstream is true. true if writeToBitstream is false and the read was successful. false if writeToBitstream is false and the read was not successful.
-

Definition at line 804 of file BitStream.h.

+

Definition at line 808 of file BitStream.h.

-

References ReadCompressed(), and WriteCompressed().

+

References ReadCompressed(), and WriteCompressed().

@@ -4163,9 +4267,9 @@ template<class templateType >
Returns
true if writeToBitstream is true. true if writeToBitstream is false and the read was successful. false if writeToBitstream is false and the read was not successful.
-

Definition at line 814 of file BitStream.h.

+

Definition at line 818 of file BitStream.h.

-

References ReadCompressedDelta(), and WriteCompressedDelta().

+

References ReadCompressedDelta(), and WriteCompressedDelta().

@@ -4206,9 +4310,9 @@ template<class templateType >

Save as SerializeCompressedDelta(templateType &currentValue, const templateType &lastValue) when we have an unknown second parameter.

Returns
true on data read. False on insufficient data in bitstream
-

Definition at line 824 of file BitStream.h.

+

Definition at line 828 of file BitStream.h.

-

References ReadCompressedDelta(), and WriteCompressedDelta().

+

References ReadCompressedDelta(), and WriteCompressedDelta().

@@ -4264,9 +4368,9 @@ template<class templateType >
Returns
true if writeToBitstream is true. true if writeToBitstream is false and the read was successful. false if writeToBitstream is false and the read was not successful.
-

Definition at line 784 of file BitStream.h.

+

Definition at line 788 of file BitStream.h.

-

References ReadDelta(), and WriteDelta().

+

References ReadDelta(), and WriteDelta().

@@ -4314,9 +4418,9 @@ template<class templateType >
Returns
true if writeToBitstream is true. true if writeToBitstream is false and the read was successful. false if writeToBitstream is false and the read was not successful.
-

Definition at line 794 of file BitStream.h.

+

Definition at line 798 of file BitStream.h.

-

References ReadDelta(), and WriteDelta().

+

References ReadDelta(), and WriteDelta().

@@ -4367,9 +4471,9 @@ template<class templateType > -

Definition at line 1148 of file BitStream.cpp.

+

Definition at line 1203 of file BitStream.cpp.

-

References ReadFloat16(), and WriteFloat16().

+

References ReadFloat16(), and WriteFloat16().

@@ -4438,9 +4542,9 @@ template<class templateType >
Returns
true if writeToBitstream is true. true if writeToBitstream is false and the read was successful. false if writeToBitstream is false and the read was not successful.
-

Definition at line 885 of file BitStream.h.

+

Definition at line 889 of file BitStream.h.

-

References ReadNormQuat(), and WriteNormQuat().

+

References ReadNormQuat(), and WriteNormQuat().

@@ -4503,9 +4607,9 @@ template<class templateType >
Returns
true if writeToBitstream is true. true if writeToBitstream is false and the read was successful. false if writeToBitstream is false and the read was not successful.
-

Definition at line 865 of file BitStream.h.

+

Definition at line 869 of file BitStream.h.

-

References ReadNormVector(), and WriteNormVector().

+

References ReadNormVector(), and WriteNormVector().

@@ -4595,9 +4699,9 @@ template<class templateType >

Use 6 bytes instead of 36 Lossy, although the result is renormalized

Returns
true on success, false on failure.
-

Definition at line 895 of file BitStream.h.

+

Definition at line 899 of file BitStream.h.

-

References ReadOrthMatrix(), and WriteOrthMatrix().

+

References ReadOrthMatrix(), and WriteOrthMatrix().

@@ -4660,9 +4764,9 @@ template<class templateType >
Returns
true if writeToBitstream is true. true if writeToBitstream is false and the read was successful. false if writeToBitstream is false and the read was not successful.
-

Definition at line 875 of file BitStream.h.

+

Definition at line 879 of file BitStream.h.

-

References ReadVector(), and WriteVector().

+

References ReadVector(), and WriteVector().

@@ -4730,7 +4834,7 @@ template<class templateType >

Sets the read bit index.

-

Definition at line 527 of file BitStream.h.

+

Definition at line 531 of file BitStream.h.

Referenced by Write().

@@ -4760,7 +4864,7 @@ template<class templateType >
Attention

Dangerous if you don't know what you are doing! For efficiency reasons you can only write mid-stream if your data is byte aligned.

-

Definition at line 921 of file BitStream.cpp.

+

Definition at line 976 of file BitStream.cpp.

Referenced by SLNet::RakPeer::ShiftIncomingTimestamp().

@@ -4799,11 +4903,11 @@ template<class templateType > -

Definition at line 918 of file BitStream.h.

+

Definition at line 922 of file BitStream.h.

-

References DoEndianSwap(), ReverseBytes(), and WriteBits().

+

References DoEndianSwap(), ReverseBytes(), and WriteBits().

-

Referenced by SLNet::RakPeer::AdvertiseSystem(), SLNet::StringTable::EncodeString(), SLNet::VariableDeltaSerializer::EndSerialize(), SLNet::RakPeer::NotifyAndFlagForShutdown(), SLNet::RakPeer::OnConnectionRequest(), operator<<(), SLNet::operator<<(), SLNet::RakPeer::ParseConnectionRequestPacket(), SLNet::RakPeer::PingInternal(), SLNet::ProcessOfflineNetworkPacket(), Read(), SLNet::RakPeer::RunUpdateCycle(), SLNet::RakPeer::SendOutOfBand(), SLNet::RakNetRandomSync::Serialize(), DataStructures::RangeList< range_type >::Serialize(), Serialize(), SLNet::RakWString::Serialize(), SLNet::RakString::Serialize(), SLNet::TableSerializer::SerializeCell(), SLNet::TableSerializer::SerializeColumns(), SLNet::RakNetRandomSync::SerializeConstruction(), SLNet::TableSerializer::SerializeFilterQuery(), SLNet::TableSerializer::SerializeFilterQueryList(), SLNet::TableSerializer::SerializeRow(), SLNet::TableSerializer::SerializeTable(), SLNet::VariableDeltaSerializer::SerializeVariable(), SLNet::RakPeer::SetOfflinePingResponse(), SLNet::RakPeer::ShiftIncomingTimestamp(), Write(), WriteAlignedBytes(), WriteBitsFromIntegerRange(), WriteCasted(), WriteCompressed(), WriteCompressedDelta(), WriteDelta(), WriteFloat16(), WriteNormQuat(), SLNet::RakPeer::WriteOutOfBandHeader(), SLNet::VariableListDeltaTracker::WriteVar(), SLNet::VariableListDeltaTracker::WriteVarToBitstream(), and WriteVector().

+

Referenced by SLNet::RakPeer::AdvertiseSystem(), SLNet::StringTable::EncodeString(), SLNet::VariableDeltaSerializer::EndSerialize(), SLNet::RakPeer::NotifyAndFlagForShutdown(), SLNet::RakPeer::OnConnectionRequest(), operator<<(), SLNet::operator<<(), SLNet::RakPeer::ParseConnectionRequestPacket(), SLNet::RakPeer::PingInternal(), SLNet::ProcessOfflineNetworkPacket(), Read(), SLNet::RakPeer::RunUpdateCycle(), SLNet::RakPeer::SendOutOfBand(), SLNet::RakNetRandomSync::Serialize(), DataStructures::RangeList< range_type >::Serialize(), Serialize(), SLNet::RakWString::Serialize(), SLNet::RakString::Serialize(), SLNet::TableSerializer::SerializeCell(), SLNet::TableSerializer::SerializeColumns(), SLNet::RakNetRandomSync::SerializeConstruction(), SLNet::TableSerializer::SerializeFilterQuery(), SLNet::TableSerializer::SerializeFilterQueryList(), SLNet::TableSerializer::SerializeRow(), SLNet::TableSerializer::SerializeTable(), SLNet::VariableDeltaSerializer::SerializeVariable(), SLNet::RakPeer::SetOfflinePingResponse(), SLNet::RakPeer::ShiftIncomingTimestamp(), Write(), WriteAlignedBytes(), WriteBitsFromIntegerRange(), WriteCasted(), WriteCompressed(), WriteCompressedDelta(), WriteDelta(), WriteFloat16(), WriteNormQuat(), SLNet::RakPeer::WriteOutOfBandHeader(), SLNet::VariableListDeltaTracker::WriteVar(), SLNet::VariableListDeltaTracker::WriteVarToBitstream(), and WriteVector().

@@ -4881,7 +4985,7 @@ template<class templateType >

Definition at line 190 of file BitStream.cpp.

-

References AddBitsAndReallocate(), BYTES_TO_BITS, GetData(), GetReadOffset(), and SetReadOffset().

+

References AddBitsAndReallocate(), BYTES_TO_BITS, GetData(), GetReadOffset(), and SetReadOffset().

@@ -4901,7 +5005,7 @@ template<class templateType >

Definition at line 186 of file BitStream.cpp.

-

References GetNumberOfBitsUsed(), GetReadOffset(), and Write().

+

References GetNumberOfBitsUsed(), GetReadOffset(), and Write().

@@ -4931,7 +5035,7 @@ template<class templateType >

Definition at line 235 of file BitStream.cpp.

-

References Write().

+

References Write().

@@ -4951,7 +5055,7 @@ template<class templateType >

Definition at line 239 of file BitStream.cpp.

-

References Write().

+

References Write().

@@ -4977,7 +5081,7 @@ template<class templateType >
-

Definition at line 678 of file BitStream.h.

+

Definition at line 682 of file BitStream.h.

References SLNet::RakString::Serialize().

@@ -5005,7 +5109,7 @@ template<class templateType >
-

Definition at line 682 of file BitStream.h.

+

Definition at line 686 of file BitStream.h.

References SLNet::RakWString::Serialize().

@@ -5033,7 +5137,7 @@ template<class templateType >
-

Definition at line 686 of file BitStream.h.

+

Definition at line 690 of file BitStream.h.

@@ -5059,7 +5163,7 @@ template<class templateType >
-

Definition at line 690 of file BitStream.h.

+

Definition at line 694 of file BitStream.h.

@@ -5085,7 +5189,7 @@ template<class templateType >
-

Definition at line 694 of file BitStream.h.

+

Definition at line 698 of file BitStream.h.

@@ -5121,7 +5225,7 @@ template<> -

Definition at line 966 of file BitStream.h.

+

Definition at line 970 of file BitStream.h.

References Write0(), and Write1().

@@ -5159,9 +5263,9 @@ template<> -

Definition at line 978 of file BitStream.h.

+

Definition at line 982 of file BitStream.h.

-

References SLNet::SystemAddress::address, SLNet::SystemAddress::GetIPVersion(), SLNet::SystemAddress::GetPortNetworkOrder(), Write(), and WriteBits().

+

References SLNet::SystemAddress::address, SLNet::SystemAddress::GetIPVersion(), SLNet::SystemAddress::GetPortNetworkOrder(), Write(), and WriteBits().

@@ -5189,9 +5293,9 @@ template<> @@ -5219,9 +5323,9 @@ template<>
-

Definition at line 1023 of file BitStream.h.

+

Definition at line 1027 of file BitStream.h.

-

References SLNet::RakNetGUID::g, and Write().

+

References SLNet::RakNetGUID::g, and Write().

@@ -5257,7 +5361,7 @@ template<> -

Definition at line 1031 of file BitStream.h.

+

Definition at line 1035 of file BitStream.h.

References SLNet::RakString::Serialize().

@@ -5287,7 +5391,7 @@ template<>
-

Definition at line 1036 of file BitStream.h.

+

Definition at line 1040 of file BitStream.h.

References SLNet::RakWString::Serialize().

@@ -5317,7 +5421,7 @@ template<>
-

Definition at line 1041 of file BitStream.h.

+

Definition at line 1045 of file BitStream.h.

References SLNet::RakString::Serialize().

@@ -5347,7 +5451,7 @@ template<>
-

Definition at line 1046 of file BitStream.h.

+

Definition at line 1050 of file BitStream.h.

References SLNet::RakWString::Serialize().

@@ -5377,9 +5481,9 @@ template<>
-

Definition at line 1051 of file BitStream.h.

+

Definition at line 1055 of file BitStream.h.

-

References Write().

+

References Write().

@@ -5407,9 +5511,9 @@ template<>
-

Definition at line 1056 of file BitStream.h.

+

Definition at line 1060 of file BitStream.h.

-

References Write().

+

References Write().

@@ -5437,9 +5541,9 @@ template<>
-

Definition at line 1061 of file BitStream.h.

+

Definition at line 1065 of file BitStream.h.

-

References Write().

+

References Write().

@@ -5463,7 +5567,7 @@ template<>

References AddBitsAndReallocate().

-

Referenced by SLNet::HuffmanEncodingTree::GenerateFromFrequencyTable(), and Write().

+

Referenced by SLNet::HuffmanEncodingTree::GenerateFromFrequencyTable(), and Write().

@@ -5487,7 +5591,7 @@ template<>

References AddBitsAndReallocate().

-

Referenced by SLNet::HuffmanEncodingTree::GenerateFromFrequencyTable(), and Write().

+

Referenced by SLNet::HuffmanEncodingTree::GenerateFromFrequencyTable(), and Write().

@@ -5527,7 +5631,7 @@ template<>

Definition at line 339 of file BitStream.cpp.

-

References AlignWriteToByteBoundary(), and Write().

+

References AlignWriteToByteBoundary(), and Write().

Referenced by SLNet::RakPeer::AdvertiseSystem(), SLNet::ProcessOfflineNetworkPacket(), SLNet::RakPeer::RunUpdateCycle(), SLNet::RakWString::Serialize(), SLNet::RakString::Serialize(), SLNet::TableSerializer::SerializeCell(), WriteAlignedBytesSafe(), and SLNet::RakPeer::WriteOutOfBandHeader().

@@ -5575,7 +5679,7 @@ template<>

Definition at line 352 of file BitStream.cpp.

-

References WriteAlignedBytes(), and WriteCompressed().

+

References WriteAlignedBytes(), and WriteCompressed().

Referenced by SLNet::TableSerializer::SerializeFilterQuery().

@@ -5595,9 +5699,9 @@ template<>
-

Definition at line 1045 of file BitStream.cpp.

+

Definition at line 1100 of file BitStream.cpp.

-

References AddBitsAndReallocate(), DoEndianSwap(), and RakAssert.

+

References AddBitsAndReallocate(), DoEndianSwap(), and RakAssert.

@@ -5615,9 +5719,9 @@ template<>
-

Definition at line 1085 of file BitStream.cpp.

+

Definition at line 1140 of file BitStream.cpp.

-

References AddBitsAndReallocate(), DoEndianSwap(), and RakAssert.

+

References AddBitsAndReallocate(), DoEndianSwap(), and RakAssert.

@@ -5635,7 +5739,7 @@ template<>
-

Definition at line 1028 of file BitStream.cpp.

+

Definition at line 1083 of file BitStream.cpp.

References AddBitsAndReallocate(), and RakAssert.

@@ -5686,7 +5790,7 @@ template<>

References AddBitsAndReallocate().

-

Referenced by SLNet::HuffmanEncodingTree::DecodeArray(), SLNet::HuffmanEncodingTree::EncodeArray(), SLNet::StringCompressor::EncodeString(), SerializeBits(), Write(), WriteBitsFromIntegerRange(), and WritePtr().

+

Referenced by SLNet::HuffmanEncodingTree::DecodeArray(), SLNet::HuffmanEncodingTree::EncodeArray(), SLNet::StringCompressor::EncodeString(), SerializeBits(), Write(), WriteBitsFromIntegerRange(), and WritePtr().

@@ -5739,11 +5843,11 @@ template<class templateType > -

Definition at line 1580 of file BitStream.h.

+

Definition at line 1592 of file BitStream.h.

References BYTES_TO_BITS, and NumberOfLeadingZeroes().

-

Referenced by SerializeBitsFromIntegerRange().

+

Referenced by SerializeBitsFromIntegerRange().

@@ -5797,9 +5901,9 @@ template<class templateType > -

Definition at line 1586 of file BitStream.h.

+

Definition at line 1598 of file BitStream.h.

-

References IsBigEndian(), RakAssert, ReverseBytes(), Write(), and WriteBits().

+

References IsBigEndian(), RakAssert, ReverseBytes(), Write(), and WriteBits().

@@ -5826,9 +5930,9 @@ template<class destinationType , class sourceType > -

Definition at line 1573 of file BitStream.h.

+

Definition at line 1585 of file BitStream.h.

-

References Write().

+

References Write().

Referenced by SLNet::ProcessOfflineNetworkPacket(), and SLNet::RakWString::Serialize().

@@ -5874,11 +5978,11 @@ template<class templateType > -

Definition at line 1112 of file BitStream.h.

+

Definition at line 1116 of file BitStream.h.

-

References DoEndianSwap(), and ReverseBytes().

+

References DoEndianSwap(), and ReverseBytes().

-

Referenced by SLNet::StringCompressor::EncodeString(), SerializeCompressed(), SLNet::RakString::SerializeCompressed(), SLNet::TableSerializer::SerializeFilterQuery(), SLNet::TableSerializer::SerializeFilterQueryList(), WriteAlignedBytesSafe(), WriteCompressed(), WriteCompressedDelta(), and WriteVector().

+

Referenced by SLNet::StringCompressor::EncodeString(), SerializeCompressed(), SLNet::RakString::SerializeCompressed(), SLNet::TableSerializer::SerializeFilterQuery(), SLNet::TableSerializer::SerializeFilterQueryList(), WriteAlignedBytesSafe(), WriteCompressed(), WriteCompressedDelta(), and WriteVector().

@@ -5904,7 +6008,7 @@ template<class templateType >
-

Definition at line 698 of file BitStream.h.

+

Definition at line 702 of file BitStream.h.

References SLNet::RakString::SerializeCompressed().

@@ -5932,7 +6036,7 @@ template<class templateType >
-

Definition at line 702 of file BitStream.h.

+

Definition at line 706 of file BitStream.h.

References SLNet::RakWString::Serialize().

@@ -5960,7 +6064,7 @@ template<class templateType >
-

Definition at line 706 of file BitStream.h.

+

Definition at line 710 of file BitStream.h.

@@ -5986,7 +6090,7 @@ template<class templateType >
-

Definition at line 710 of file BitStream.h.

+

Definition at line 714 of file BitStream.h.

@@ -6012,7 +6116,7 @@ template<class templateType >
-

Definition at line 714 of file BitStream.h.

+

Definition at line 718 of file BitStream.h.

@@ -6040,9 +6144,9 @@ template<>
-

Definition at line 1135 of file BitStream.h.

+

Definition at line 1139 of file BitStream.h.

-

References Write().

+

References Write().

@@ -6070,9 +6174,9 @@ template<>
-

Definition at line 1141 of file BitStream.h.

+

Definition at line 1145 of file BitStream.h.

-

References Write().

+

References Write().

@@ -6100,9 +6204,9 @@ template<>
-

Definition at line 1147 of file BitStream.h.

+

Definition at line 1151 of file BitStream.h.

-

References Write().

+

References Write().

@@ -6130,9 +6234,9 @@ template<>
-

Definition at line 1153 of file BitStream.h.

+

Definition at line 1157 of file BitStream.h.

-

References Write().

+

References Write().

@@ -6162,9 +6266,9 @@ template<>

For values between -1 and 1.

-

Definition at line 1160 of file BitStream.h.

+

Definition at line 1164 of file BitStream.h.

-

References RakAssert, and Write().

+

References RakAssert, and Write().

@@ -6194,9 +6298,9 @@ template<>

For values between -1 and 1.

-

Definition at line 1173 of file BitStream.h.

+

Definition at line 1177 of file BitStream.h.

-

References RakAssert, and Write().

+

References RakAssert, and Write().

@@ -6226,7 +6330,7 @@ template<>

Compress the string.

-

Definition at line 1186 of file BitStream.h.

+

Definition at line 1190 of file BitStream.h.

References SLNet::RakString::SerializeCompressed().

@@ -6256,7 +6360,7 @@ template<>
-

Definition at line 1191 of file BitStream.h.

+

Definition at line 1195 of file BitStream.h.

References SLNet::RakWString::Serialize().

@@ -6286,7 +6390,7 @@ template<>
-

Definition at line 1196 of file BitStream.h.

+

Definition at line 1200 of file BitStream.h.

References SLNet::RakString::SerializeCompressed().

@@ -6316,7 +6420,7 @@ template<>
-

Definition at line 1201 of file BitStream.h.

+

Definition at line 1205 of file BitStream.h.

References SLNet::RakWString::Serialize().

@@ -6346,9 +6450,9 @@ template<>
-

Definition at line 1206 of file BitStream.h.

+

Definition at line 1210 of file BitStream.h.

-

References WriteCompressed().

+

References WriteCompressed().

@@ -6376,9 +6480,9 @@ template<>
-

Definition at line 1211 of file BitStream.h.

+

Definition at line 1215 of file BitStream.h.

-

References WriteCompressed().

+

References WriteCompressed().

@@ -6406,9 +6510,9 @@ template<>
-

Definition at line 1216 of file BitStream.h.

+

Definition at line 1220 of file BitStream.h.

-

References WriteCompressed().

+

References WriteCompressed().

@@ -6456,11 +6560,11 @@ template<class templateType > -

Definition at line 1231 of file BitStream.h.

+

Definition at line 1235 of file BitStream.h.

-

References Write(), and WriteCompressed().

+

References Write(), and WriteCompressed().

-

Referenced by SerializeCompressedDelta().

+

Referenced by SerializeCompressedDelta().

@@ -6490,9 +6594,9 @@ template<class templateType >

Save as WriteCompressedDelta(const templateType &currentValue, const templateType &lastValue) when we have an unknown second parameter.

-

Definition at line 1258 of file BitStream.h.

+

Definition at line 1262 of file BitStream.h.

-

References Write(), and WriteCompressed().

+

References Write(), and WriteCompressed().

@@ -6539,9 +6643,9 @@ template<> -

Definition at line 1248 of file BitStream.h.

+

Definition at line 1252 of file BitStream.h.

-

References Write().

+

References Write().

@@ -6571,9 +6675,9 @@ template<>

Save as WriteCompressedDelta(bool currentValue, const templateType &lastValue) when we have an unknown second bool.

-

Definition at line 1267 of file BitStream.h.

+

Definition at line 1271 of file BitStream.h.

-

References Write().

+

References Write().

@@ -6621,11 +6725,11 @@ template<class templateType > -

Definition at line 1072 of file BitStream.h.

+

Definition at line 1076 of file BitStream.h.

-

References Write().

+

References Write().

-

Referenced by SerializeDelta().

+

Referenced by SerializeDelta().

@@ -6661,9 +6765,9 @@ template<class templateType > -

Definition at line 1099 of file BitStream.h.

+

Definition at line 1103 of file BitStream.h.

-

References Write().

+

References Write().

@@ -6710,9 +6814,9 @@ template<> -

Definition at line 1089 of file BitStream.h.

+

Definition at line 1093 of file BitStream.h.

-

References Write().

+

References Write().

@@ -6756,11 +6860,11 @@ template<> -

Definition at line 1156 of file BitStream.cpp.

+

Definition at line 1211 of file BitStream.cpp.

-

References RakAssert, and Write().

+

References RakAssert, and Write().

-

Referenced by SerializeFloat16(), and WriteNormVector().

+

Referenced by SerializeFloat16(), and WriteNormVector().

@@ -6813,11 +6917,11 @@ template<class templateType > -

Definition at line 1642 of file BitStream.h.

+

Definition at line 1654 of file BitStream.h.

-

References Write().

+

References Write().

-

Referenced by SerializeNormQuat(), and WriteOrthMatrix().

+

Referenced by SerializeNormQuat(), and WriteOrthMatrix().

@@ -6864,11 +6968,11 @@ template<class templateType > -

Definition at line 1614 of file BitStream.h.

+

Definition at line 1626 of file BitStream.h.

-

References RakAssert, and WriteFloat16().

+

References RakAssert, and WriteFloat16().

-

Referenced by SerializeNormVector().

+

Referenced by SerializeNormVector().

@@ -6943,11 +7047,11 @@ template<class templateType >

Write an orthogonal matrix by creating a quaternion, and writing 3 components of the quaternion in 2 bytes each.

Use 6 bytes instead of 36 Lossy, although the result is renormalized

-

Definition at line 1655 of file BitStream.h.

+

Definition at line 1667 of file BitStream.h.

-

References _copysign, and WriteNormQuat().

+

References _copysign, and WriteNormQuat().

-

Referenced by SerializeOrthMatrix().

+

Referenced by SerializeOrthMatrix().

@@ -6984,9 +7088,9 @@ template<class templateType > -

Definition at line 941 of file BitStream.h.

+

Definition at line 945 of file BitStream.h.

-

References DoEndianSwap(), ReverseBytes(), and WriteBits().

+

References DoEndianSwap(), ReverseBytes(), and WriteBits().

@@ -7033,11 +7137,11 @@ template<class templateType > -

Definition at line 1626 of file BitStream.h.

+

Definition at line 1638 of file BitStream.h.

-

References Write(), and WriteCompressed().

+

References Write(), and WriteCompressed().

-

Referenced by SerializeVector().

+

Referenced by SerializeVector().

@@ -7051,7 +7155,7 @@ template<class templateType > @@ -855,7 +855,7 @@ Static Public Member Functions

Definition at line 24 of file TableSerializer.cpp.

-

References DataStructures::Page< KeyType, DataType, order >::data, DataStructures::Table::GetColumns(), DataStructures::BPlusTree< KeyType, DataType, order >::GetListHead(), DataStructures::Table::GetRows(), DataStructures::Page< KeyType, DataType, order >::keys, DataStructures::Page< KeyType, DataType, order >::next, SerializeColumns(), SerializeRow(), DataStructures::Page< KeyType, DataType, order >::size, DataStructures::BPlusTree< KeyType, DataType, order >::Size(), and SLNet::BitStream::Write().

+

References DataStructures::Page< KeyType, DataType, order >::data, DataStructures::Table::GetColumns(), DataStructures::BPlusTree< KeyType, DataType, order >::GetListHead(), DataStructures::Table::GetRows(), DataStructures::Page< KeyType, DataType, order >::keys, DataStructures::Page< KeyType, DataType, order >::next, SerializeColumns(), SerializeRow(), DataStructures::Page< KeyType, DataType, order >::size, DataStructures::BPlusTree< KeyType, DataType, order >::Size(), and SLNet::BitStream::Write().

@@ -869,7 +869,7 @@ Static Public Member Functions @@ -241,7 +241,7 @@ Functions @@ -341,7 +341,7 @@ Protected Attributes

Definition at line 66 of file Rand.h.

-

Referenced by FillBufferMT(), FrandomMT(), RandomMT(), ReloadMT(), and SeedMT().

+

Referenced by FillBufferMT(), FrandomMT(), RandomMT(), ReloadMT(), and SeedMT().

@@ -365,7 +365,7 @@ Protected Attributes

Definition at line 65 of file Rand.h.

-

Referenced by FillBufferMT(), FrandomMT(), RandomMT(), ReloadMT(), and SeedMT().

+

Referenced by FillBufferMT(), FrandomMT(), RandomMT(), ReloadMT(), and SeedMT().

@@ -379,7 +379,7 @@ Protected Attributes