Skip to content

Commit

Permalink
- updated to SLikeNet 0.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Luke1410 committed Mar 17, 2018
1 parent 757c5b5 commit 6e3ede4
Show file tree
Hide file tree
Showing 1,105 changed files with 12,961 additions and 11,101 deletions.
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
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
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
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
12 changes: 9 additions & 3 deletions DependentExtensions/Swig/MakeSwigWithExtras.bat
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
10 changes: 9 additions & 1 deletion DependentExtensions/cat/threads/Atomic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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;
Expand Down
Binary file modified Help/Doxygen/SLikeNetManual.chm
Binary file not shown.
4 changes: 2 additions & 2 deletions Help/Doxygen/html/annotated.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">SLikeNet
&#160;<span id="projectnumber">0.1.0</span>
&#160;<span id="projectnumber">0.1.1</span>
</div>
</td>
</tr>
Expand Down Expand Up @@ -392,7 +392,7 @@ $(document).ready(function(){initNavTree('annotated.xhtml','');});
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="footer">Generated on Thu Jul 20 2017 23:56:11 for SLikeNet by
<li class="footer">Generated on Wed Mar 14 2018 00:57:07 for SLikeNet by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.2 </li>
</ul>
Expand Down
Loading

0 comments on commit 6e3ede4

Please sign in to comment.