Skip to content
This repository has been archived by the owner on May 16, 2022. It is now read-only.

Commit

Permalink
No need to static-link squirrel libs anymore
Browse files Browse the repository at this point in the history
Thanks to SLC!
  • Loading branch information
Kirollos committed Sep 21, 2015
1 parent 174c428 commit e93c9ee
Show file tree
Hide file tree
Showing 98 changed files with 42 additions and 17,989 deletions.
24 changes: 10 additions & 14 deletions RCON/RCON.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,15 @@
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>squirrel.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalOptions>/NODEFAULTLIB:libcmt %(AdditionalOptions)</AdditionalOptions>
</Link>
<CustomBuildStep>
<Command>
</Command>
</CustomBuildStep>
<PostBuildEvent>
<Command>rename "$(SolutionDir)\$(Configuration)\RCONWin32.dll" RCONx86.dll</Command>
<Command>move "$(SolutionDir)\$(Configuration)\RCONWin32.dll" "$(SolutionDir)\$(Configuration)\RCONx86.dll"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
Expand All @@ -142,15 +142,16 @@
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>squirrel.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalOptions>/NODEFAULTLIB:libcmt %(AdditionalOptions)</AdditionalOptions>
</Link>
<CustomBuildStep>
<Command>
</Command>
</CustomBuildStep>
<PostBuildEvent>
<Command>rename "$(SolutionDir)\$(Configuration)\RCONWin32.dll" RCONx86.dll</Command>
<Command>
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
Expand All @@ -169,14 +170,14 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>squirrel.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<CustomBuildStep>
<Command>
</Command>
</CustomBuildStep>
<PostBuildEvent>
<Command>rename "$(SolutionDir)\$(Configuration)\RCONWin32.dll" RCONx86.dll</Command>
<Command>move "$(SolutionDir)\$(Configuration)\RCONWin32.dll" "$(SolutionDir)\$(Configuration)\RCONx86.dll"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
Expand All @@ -195,27 +196,22 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>squirrel.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<CustomBuildStep>
<Command>
</Command>
</CustomBuildStep>
<PostBuildEvent>
<Command>rename "$(SolutionDir)\$(Configuration)\RCONWin32.dll" RCONx86.dll</Command>
<Command>
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="inc\SQImports.h" />
<ClInclude Include="inc\SQModule.h" />
<ClInclude Include="src\Client.h" />
<ClInclude Include="inc\sqconfig.h" />
<ClInclude Include="inc\sqstdaux.h" />
<ClInclude Include="inc\sqstdblob.h" />
<ClInclude Include="inc\sqstdio.h" />
<ClInclude Include="inc\sqstdmath.h" />
<ClInclude Include="inc\sqstdstring.h" />
<ClInclude Include="inc\sqstdsystem.h" />
<ClInclude Include="inc\squirrel.h" />
<ClInclude Include="inc\VCMP.h" />
<ClInclude Include="src\events.h" />
Expand Down
18 changes: 0 additions & 18 deletions RCON/RCON.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,6 @@
<ClInclude Include="inc\sqconfig.h">
<Filter>Header Files\Squirrel</Filter>
</ClInclude>
<ClInclude Include="inc\sqstdaux.h">
<Filter>Header Files\Squirrel</Filter>
</ClInclude>
<ClInclude Include="inc\sqstdblob.h">
<Filter>Header Files\Squirrel</Filter>
</ClInclude>
<ClInclude Include="inc\sqstdio.h">
<Filter>Header Files\Squirrel</Filter>
</ClInclude>
<ClInclude Include="inc\sqstdmath.h">
<Filter>Header Files\Squirrel</Filter>
</ClInclude>
<ClInclude Include="inc\sqstdstring.h">
<Filter>Header Files\Squirrel</Filter>
</ClInclude>
<ClInclude Include="inc\sqstdsystem.h">
<Filter>Header Files\Squirrel</Filter>
</ClInclude>
<ClInclude Include="inc\squirrel.h">
<Filter>Header Files\Squirrel</Filter>
</ClInclude>
Expand Down
16 changes: 0 additions & 16 deletions RCON/inc/sqstdaux.h

This file was deleted.

20 changes: 0 additions & 20 deletions RCON/inc/sqstdblob.h

This file was deleted.

53 changes: 0 additions & 53 deletions RCON/inc/sqstdio.h

This file was deleted.

15 changes: 0 additions & 15 deletions RCON/inc/sqstdmath.h

This file was deleted.

33 changes: 0 additions & 33 deletions RCON/inc/sqstdstring.h

This file was deleted.

15 changes: 0 additions & 15 deletions RCON/inc/sqstdsystem.h

This file was deleted.

28 changes: 14 additions & 14 deletions RCON/makefile
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
# I'm noob in writing makefiles, will improve this later on.

debug32:
release32:
mkdir -p ./obj/
mkdir -p ./bin/
mkdir -p ./bin/Debug/
g++ -m32 -pthread -std=c++11 -L./lib/ -c -g -fPIC -I./inc/ -I/usr/local/include -D_DEBUG ./src/*.cpp
mkdir -p ./bin/Release/
g++ -m32 -pthread -std=c++11 -c -fPIC -I./inc/ -I/usr/local/include ./src/*.cpp
mv *.o obj/
g++ -m32 -pthread -std=c++11 -L./lib/ -shared -o ./bin/Debug/RCON32.so ./obj/*.o -L/usr/local/lib ./lib/libsquirrel.a
g++ -m32 -pthread -std=c++11 -shared -o ./bin/Release/RCON32.so ./obj/*.o -L/usr/local/lib
@rm -Rf obj/*
@echo done.

release32:
release64:
mkdir -p ./obj/
mkdir -p ./bin/
mkdir -p ./bin/Release/
g++ -m32 -pthread -std=c++11 -L./lib/ -c -fPIC -I./inc/ -I/usr/local/include ./src/*.cpp
g++ -m64 -pthread -std=c++11 -c -fPIC -I./inc/ -I/usr/local/include ./src/*.cpp
mv *.o obj/
g++ -m32 -pthread -std=c++11 -L./lib/ -shared -o ./bin/Release/RCON32.so ./obj/*.o -L/usr/local/lib ./lib/libsquirrel.a
g++ -m64 -pthread -std=c++11 -shared -o ./bin/Release/RCON64.so ./obj/*.o -L/usr/local/lib
@rm -Rf obj/*
@echo done.

debug64:
debug32:
mkdir -p ./obj/
mkdir -p ./bin/
mkdir -p ./bin/Debug/
g++ -m64 -pthread -std=c++11 -L./lib/ -c -g -fPIC -I./inc/ -I/usr/local/include -D_DEBUG ./src/*.cpp
g++ -m32 -pthread -std=c++11 -c -g -fPIC -I./inc/ -I/usr/local/include -D_DEBUG ./src/*.cpp
mv *.o obj/
g++ -m64 -pthread -std=c++11 -L./lib/ -shared -o ./bin/Debug/RCON64.so ./obj/*.o -L/usr/local/lib ./lib/libsquirrel.a
g++ -m32 -pthread -std=c++11 -shared -o ./bin/Debug/RCON32.so ./obj/*.o -L/usr/local/lib
@rm -Rf obj/*
@echo done.

release64:
debug64:
mkdir -p ./obj/
mkdir -p ./bin/
mkdir -p ./bin/Release/
g++ -m64 -pthread -std=c++11 -L./lib/ -c -fPIC -I./inc/ -I/usr/local/include ./src/*.cpp
mkdir -p ./bin/Debug/
g++ -m64 -pthread -std=c++11 -c -g -fPIC -I./inc/ -I/usr/local/include -D_DEBUG ./src/*.cpp
mv *.o obj/
g++ -m64 -pthread -std=c++11 -L./lib/ -shared -o ./bin/Release/RCON64.so ./obj/*.o -L/usr/local/lib ./lib/libsquirrel.a
g++ -m64 -pthread -std=c++11 -shared -o ./bin/Debug/RCON64.so ./obj/*.o -L/usr/local/lib
@rm -Rf obj/*
@echo done.

Expand Down
36 changes: 18 additions & 18 deletions RCON/src/SquirrelFunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,27 +32,27 @@ namespace SquirrelFuncs
SQInteger clientid;
const SQChar* text;

sq_getinteger(v, 2, &clientid);
sq_getstring(v, 3, &text);
sqapi->getinteger(v, 2, &clientid);
sqapi->getstring(v, 3, &text);

Client* c = rcon->GetClient((int)clientid);
if (c == nullptr)
{
sq_pushbool(v, false);
sqapi->pushbool(v, false);
return 1;
}
sq_pushbool(v, c->Send(std::string((char*) text)));
sqapi->pushbool(v, c->Send(std::string((char*) text)));
return 1;
}

SQInteger RCON_Broadcast(HSQUIRRELVM v) // RCON_Broadcast(string text);
{
const SQChar* text;

sq_getstring(v, 2, &text);
sqapi->getstring(v, 2, &text);
SQInteger count = 0;
count = rcon->Broadcast(std::string((char*)text));
sq_pushinteger(v, count);
sqapi->pushinteger(v, count);
return 1;
}

Expand All @@ -68,27 +68,27 @@ namespace SquirrelFuncs
... // etc..
]
*/
sq_newarray(v, 0); // main array
sqapi->newarray(v, 0); // main array

for (Client* c : rcon->clients)
{
// client array
sq_newarray(v, 0); // client array
sq_pushstring(v, (const SQChar*)ipaddr(c).c_str(), -1); // ip
sq_arrayappend(v, -2);
sq_pushbool(v, (SQBool)c->isIdentified); // identified
sq_arrayappend(v, -2); // append to client array
sq_arrayappend(v, -2); // append client array to main array
sqapi->newarray(v, 0); // client array
sqapi->pushstring(v, (const SQChar*)ipaddr(c).c_str(), -1); // ip
sqapi->arrayappend(v, -2);
sqapi->pushbool(v, (SQBool)c->isIdentified); // identified
sqapi->arrayappend(v, -2); // append to client array
sqapi->arrayappend(v, -2); // append client array to main array
}
return 1;
}
}

void register_global_func(HSQUIRRELVM vm, const char *name, SQFUNCTION function)
{
sq_pushroottable(vm);
sq_pushstring(vm, (const SQChar*)name, -1);
sq_newclosure(vm, function, 0);
sq_createslot(vm, -3);
sq_pop(vm, 1);
sqapi->pushroottable(vm);
sqapi->pushstring(vm, (const SQChar*)name, -1);
sqapi->newclosure(vm, function, 0);
sqapi->newslot(vm, -3, SQFalse);
sqapi->pop(vm, 1);
}
Loading

0 comments on commit e93c9ee

Please sign in to comment.