Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 4 additions & 1 deletion CmakeIncludes/Ogre3D/FindOGRE.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#This has been modified fron the original
# This file was taken from RakNet 4.082 without modifications.
# Please see licenses/RakNet license.txt for the underlying license and related copyright.

#This has been modified fron the original

include(${RakNet_SOURCE_DIR}/CmakeIncludes/Ogre3D/PreprocessorUtils.cmake)
include(${RakNet_SOURCE_DIR}/CmakeIncludes/Ogre3D/FindPkgMacros.cmake)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
8 changes: 4 additions & 4 deletions DependentExtensions/Autopatcher/AutopatcherServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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<size_t>(32));
if (requestType==ASUMC_GET_CHANGELIST)
requestTypeString="GetChangelist";
else
Expand All @@ -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<size_t>(32));

char *changelistString;
if (getChangelistResult==GCR_DELETE_FILES)
Expand All @@ -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<size_t>(32));

char *patchResultString;
if (patchResult==PR_NO_FILES_NEEDED_PATCHING)
Expand Down
4 changes: 2 additions & 2 deletions DependentExtensions/IrrlichtDemo/CDemo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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<size_t>(32));
SLNet::ConnectionAttemptResult car = rakPeer->Connect(hostIP,packet->systemAddress.GetPort(),0,0);
RakAssert(car== SLNet::CONNECTION_ATTEMPT_STARTED);
}
Expand Down
5 changes: 5 additions & 0 deletions DependentExtensions/IrrlichtDemo/CMainMenu.cpp
Original file line number Diff line number Diff line change
@@ -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"


Expand Down
3 changes: 2 additions & 1 deletion DependentExtensions/Lobby2/Lobby2ResultCode.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* of patent rights can be found in the RakNet Patents.txt file in the same directory.
*
*
* Modified work: Copyright (c) 2017, SLikeSoft UG (haftungsbeschränkt)
* Modified work: Copyright (c) 2017-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.
Expand All @@ -16,6 +16,7 @@
#ifndef __LOBBY_2_RESULT_CODE_H
#define __LOBBY_2_RESULT_CODE_H

#include "slikenet/defines.h" // used for SLNet -> RakNet namespace change in RAKNET_COMPATIBILITY mode
namespace SLNet
{

Expand Down
4 changes: 2 additions & 2 deletions DependentExtensions/Lobby2/PGSQL/Lobby2Message_PGSQL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
53 changes: 52 additions & 1 deletion DependentExtensions/Lobby2/Rooms/ProfanityFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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)
Expand Down
5 changes: 3 additions & 2 deletions DependentExtensions/Lobby2/Rooms/ProfanityFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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();
Expand Down
3 changes: 2 additions & 1 deletion DependentExtensions/Lobby2/Rooms/RoomsErrorCodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* of patent rights can be found in the RakNet Patents.txt file in the same directory.
*
*
* Modified work: Copyright (c) 2017, SLikeSoft UG (haftungsbeschränkt)
* Modified work: Copyright (c) 2017-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.
Expand All @@ -16,6 +16,7 @@
#ifndef __ROOMS_ERROR_CODES_H
#define __ROOMS_ERROR_CODES_H

#include "slikenet/defines.h" // used for SLNet -> RakNet namespace change in RAKNET_COMPATIBILITY mode
namespace SLNet
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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<size_t>(64));
rakPeerInterface->GetGuidFromSystemAddress(SLNet::UNASSIGNED_SYSTEM_ADDRESS).ToString(str2, 62);
remoteSystemAddress.ToString(true, str3, 64);
remoteSystemAddress.ToString(true, str3, static_cast<size_t>(64));
rakPeerInterface->GetGuidFromSystemAddress(remoteSystemAddress).ToString(str4, 64);


Expand All @@ -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<size_t>(64));
rakPeerInterface->GetGuidFromSystemAddress(SLNet::UNASSIGNED_SYSTEM_ADDRESS).ToString(str2, 62);
remoteSystemAddress.ToString(true, str3, 64);
remoteSystemAddress.ToString(true, str3, static_cast<size_t>(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", \
Expand All @@ -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<size_t>(64));
rakPeerInterface->GetGuidFromSystemAddress(SLNet::UNASSIGNED_SYSTEM_ADDRESS).ToString(str2, 62);
remoteSystemAddress.ToString(true, str3, 64);
remoteSystemAddress.ToString(true, str3, static_cast<size_t>(64));
rakPeerInterface->GetGuidFromSystemAddress(remoteSystemAddress).ToString(str4, 64);

unsigned char typeByte;
Expand All @@ -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<size_t>(64));
rakPeerInterface->GetGuidFromSystemAddress(SLNet::UNASSIGNED_SYSTEM_ADDRESS).ToString(str2, 62);
remoteSystemAddress.ToString(true, str3, 64);
remoteSystemAddress.ToString(true, str3, static_cast<size_t>(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", \
Expand All @@ -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<size_t>(64));
rakPeerInterface->GetGuidFromSystemAddress(SLNet::UNASSIGNED_SYSTEM_ADDRESS).ToString(str2, 62);
remoteSystemAddress.ToString(true, str3, 64);
remoteSystemAddress.ToString(true, str3, static_cast<size_t>(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", \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<size_t>(32));
SLNet::BitStream bitStream(packet->data, packet->length, false);
bitStream.IgnoreBytes(1);
bitStream.Read(outputNode->dbIdentifier);
Expand Down Expand Up @@ -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<size_t>(32));
dbIdentifier+=':';
dbIdentifier+=senderAddr;
}
Expand Down
6 changes: 3 additions & 3 deletions DependentExtensions/SQLite3Plugin/SQLite3Sample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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<size_t>(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);
Expand All @@ -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<size_t>(64));
char guidString[128];
rakNetGUID.ToString(guidString, 64);
SLNet::RakString query(
Expand Down
2 changes: 2 additions & 0 deletions DependentExtensions/Swig/DLL_Swig/SLikeNet.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@
<ClCompile Include="..\..\..\Source\src\VariadicSQLParser.cpp" />
<ClCompile Include="..\..\..\Source\src\VitaIncludes.cpp" />
<ClCompile Include="..\..\..\Source\src\WSAStartupSingleton.cpp" />
<ClCompile Include="..\SwigOutput\CplusDLLIncludes\RakNet_wrap.cxx" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\Source\include\slikenet\_FindFirst.h" />
Expand Down Expand Up @@ -383,6 +384,7 @@
<ClInclude Include="..\..\..\Source\include\slikenet\WindowsIncludes.h" />
<ClInclude Include="..\..\..\Source\include\slikenet\WSAStartupSingleton.h" />
<ClInclude Include="..\..\..\Source\include\slikenet\XBox360Includes.h" />
<ClInclude Include="..\SwigOutput\CplusDLLIncludes\RakNet_wrap.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
14 changes: 11 additions & 3 deletions DependentExtensions/Swig/MakeSwig.bat
Original file line number Diff line number Diff line change
@@ -1,21 +1,29 @@
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
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
Expand Down
Loading