Skip to content

Commit

Permalink
add sourcescramble
Browse files Browse the repository at this point in the history
  • Loading branch information
Katsute committed Oct 31, 2023
1 parent f205223 commit 5a7cf7a
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 29 deletions.
31 changes: 22 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
name: SourcePawn CI
on:
push:
branches: [main]
pull_request:
branches: [main]
types: [opened, reopened, synchronize]
on: [push]

jobs:
ci:
name: SourcePawn CI
uses: KatsuteTF/Workflows/.github/workflows/ci.yml@main
with:
file: TF100.sp
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Install SourceMod
uses: KatsuteTF/Workflows/actions/setup-sourcepawn@main

- name: mkdir include
shell: bash
run: mkdir -p addons/sourcemod/include

- name: Install SourceScramble
uses: KatsuteTF/Workflows/actions/curl@main
with:
url: https://raw.githubusercontent.com/nosoop/SMExt-SourceScramble/master/scripting/include/sourcescramble.inc
file: addons/sourcemod/include/sourcescramble.inc

- name: Compile Plugin
run: |
spcomp -i addons/sourcemod/include TF100.sp
32 changes: 27 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,30 @@ on:
jobs:
release:
name: Release Plugin
uses: KatsuteTF/Workflows/.github/workflows/release.yml@main
with:
file: TF100.sp
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Install SourceMod
uses: KatsuteTF/Workflows/actions/setup-sourcepawn@main

- name: mkdir include
shell: bash
run: mkdir -p addons/sourcemod/include

- name: Install SourceScramble
uses: KatsuteTF/Workflows/actions/curl@main
with:
url: https://raw.githubusercontent.com/nosoop/SMExt-SourceScramble/master/scripting/include/sourcescramble.inc
file: addons/sourcemod/include/sourcescramble.inc

- name: Compile Plugin
run: |
spcomp -i addons/sourcemod/include TF100.sp
- name: Deploy to GitHub Releases
uses: AButler/[email protected]
with:
files: "TF100.smx;TF100.txt;whitelist.txt"
repo-token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

100 player server optimization plugin

Requires [SourceScramble](https://github.com/nosoop/SMExt-SourceScramble)

[![Creative Commons License](https://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png)](http://creativecommons.org/licenses/by-nc-sa/4.0/)

Licensed under [CC BY-NC-SA 4.0](https://github.com/KatsuteTF/TF100/blob/main/LICENSE)
22 changes: 11 additions & 11 deletions TF100.sp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include <sourcemod>
#include <sdktools>
#include <memorypatch>
#include <sourcescramble>

public Plugin myinfo = {
name = "TF100",
Expand Down Expand Up @@ -96,16 +96,16 @@ public void OnPluginStart(){
DeleteEntities("info_particle_system");
DeleteEntities("point_spotlight");

// // mp_tournament_whitelist patch https://github.com/sapphonie/tf2rue
// GameData gd = LoadGameConfigFile("TF100"); // https://github.com/sapphonie/tf2rue/blob/main/gamedata/tf2.rue.txt
// if(gd == null){
// SetFailState("Failed to load TF100 gamedata");
// }else{
// MemoryPatch tmpatch = MemoryPatch.CreateFromConf(gd, "CEconItemSystem::ReloadWhitelist::nopnop");
// if(!tmpatch.Validate())
// ThrowError("Failed to verify CEconItemSystem::ReloadWhitelist::nopnop");
// tmpatch.Enable();
// }
// Whitelist Patch https://github.com/sapphonie/tf2rue
GameData gamedata = LoadGameConfigFile("TF100"); // https://github.com/sapphonie/tf2rue/blob/main/gamedata/tf2.rue.txt
if(gamedata == null){
SetFailState("Failed to load TF100 gamedata");
}else{
MemoryPatch mpatch = MemoryPatch.CreateFromConf(gd, "CEconItemSystem::ReloadWhitelist::nopnop");
if(!mpatch.Validate())
ThrowError("Failed to verify CEconItemSystem::ReloadWhitelist::nopnop");
mpatch.Enable();
}
}

public void OnEntityCreated(int entity, const char[] classname){
Expand Down
4 changes: 0 additions & 4 deletions TF100.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,13 @@
"linux"
{
"offset" "34h"
// jnz
"verify" "\x74\x53"
// nop nop
"patch" "\x90\x90"
}
"windows"
{
"offset" "45h"
// jz
"verify" "\x74\x6C"
// nop nop
"patch" "\x90\x90"
}
}
Expand Down

0 comments on commit 5a7cf7a

Please sign in to comment.