-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added functions and improved module code
Added GetAll, IsBlocked, SetMaximumQueueSize and GetMaximumQueueSize Added API reference Added Lua extension module that adds a Lua hook Added Azure Pipelines config Bumped minor version
- Loading branch information
Showing
5 changed files
with
469 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
variables: | ||
MODULE_NAME: spew | ||
DEPENDENCIES: $(System.DefaultWorkingDirectory)/dependencies | ||
GARRYSMOD_COMMON: $(System.DefaultWorkingDirectory)/dependencies/garrysmod_common | ||
GARRYSMOD_COMMON_BRANCH: master | ||
GARRYSMOD_COMMON_REPOSITORY: https://github.com/danielga/garrysmod_common.git | ||
PROJECT_GENERATOR_VERSION: 2 | ||
REPOSITORY_DIR: $(System.DefaultWorkingDirectory) | ||
DISABLE_X86_64_BUILD: true | ||
trigger: | ||
tags: | ||
include: | ||
- '*' | ||
jobs: | ||
- job: windows | ||
displayName: Windows | ||
pool: | ||
name: Azure Pipelines | ||
vmImage: windows-2019 | ||
timeoutInMinutes: 10 | ||
variables: | ||
BOOTSTRAP_URL: https://raw.githubusercontent.com/danielga/garrysmod_common/master/build/bootstrap.ps1 | ||
BUILD_SCRIPT: $(System.DefaultWorkingDirectory)/dependencies/garrysmod_common/build/build.ps1 | ||
COMPILER_PLATFORM: vs2019 | ||
PROJECT_OS: windows | ||
PREMAKE5: $(System.DefaultWorkingDirectory)/dependencies/windows/premake-core/premake5.exe | ||
PREMAKE5_URL: https://github.com/premake/premake-core/releases/download/v5.0.0-alpha15/premake-5.0.0-alpha15-windows.zip | ||
steps: | ||
- powershell: 'Invoke-Expression ((New-Object System.Net.WebClient).DownloadString("$env:BOOTSTRAP_URL"))' | ||
displayName: Bootstrap | ||
- powershell: '& "$env:BUILD_SCRIPT"' | ||
displayName: Build | ||
- task: CopyFiles@2 | ||
displayName: 'Copy files to $(Build.ArtifactStagingDirectory)' | ||
inputs: | ||
SourceFolder: '$(System.DefaultWorkingDirectory)/projects/windows/vs2019' | ||
Contents: '*/Release/*.dll' | ||
TargetFolder: '$(Build.ArtifactStagingDirectory)' | ||
CleanTargetFolder: true | ||
flattenFolders: true | ||
preserveTimestamp: true | ||
- task: PublishBuildArtifacts@1 | ||
displayName: 'Publish build artifacts' | ||
inputs: | ||
ArtifactName: windows | ||
- job: linux | ||
displayName: Linux | ||
pool: | ||
name: Azure Pipelines | ||
vmImage: ubuntu-16.04 | ||
timeoutInMinutes: 10 | ||
variables: | ||
BOOTSTRAP_URL: https://raw.githubusercontent.com/danielga/garrysmod_common/master/build/bootstrap.sh | ||
BUILD_SCRIPT: $(System.DefaultWorkingDirectory)/dependencies/garrysmod_common/build/build.sh | ||
COMPILER_PLATFORM: gmake | ||
PREMAKE5: $(System.DefaultWorkingDirectory)/dependencies/linux/premake-core/premake5 | ||
PROJECT_OS: linux | ||
PREMAKE5_URL: https://github.com/premake/premake-core/releases/download/v5.0.0-alpha15/premake-5.0.0-alpha15-linux.tar.gz | ||
CC: gcc-9 | ||
CXX: g++-9 | ||
AR: gcc-ar-9 | ||
NM: gcc-nm-9 | ||
RANLIB: gcc-ranlib-9 | ||
steps: | ||
- bash: 'curl -s -L "$BOOTSTRAP_URL" | bash' | ||
displayName: Bootstrap | ||
- bash: | | ||
sudo apt-get update && sudo apt-get install -y g++-9-multilib | ||
$BUILD_SCRIPT | ||
displayName: Build | ||
- task: CopyFiles@2 | ||
displayName: 'Copy files to $(Build.ArtifactStagingDirectory)' | ||
inputs: | ||
SourceFolder: '$(System.DefaultWorkingDirectory)/projects/linux/gmake' | ||
Contents: '*/Release/*.dll' | ||
TargetFolder: '$(Build.ArtifactStagingDirectory)' | ||
CleanTargetFolder: true | ||
flattenFolders: true | ||
preserveTimestamp: true | ||
- task: PublishBuildArtifacts@1 | ||
displayName: 'Publish build artifacts' | ||
inputs: | ||
ArtifactName: linux | ||
- job: macosx | ||
displayName: macOS | ||
pool: | ||
name: Azure Pipelines | ||
vmImage: macOS-10.15 | ||
timeoutInMinutes: 10 | ||
variables: | ||
BOOTSTRAP_URL: https://raw.githubusercontent.com/danielga/garrysmod_common/master/build/bootstrap.sh | ||
BUILD_SCRIPT: $(System.DefaultWorkingDirectory)/dependencies/garrysmod_common/build/build.sh | ||
COMPILER_PLATFORM: gmake | ||
PREMAKE5: $(System.DefaultWorkingDirectory)/dependencies/macosx/premake-core/premake5 | ||
PROJECT_OS: macosx | ||
PREMAKE5_URL: https://github.com/premake/premake-core/releases/download/v5.0.0-alpha15/premake-5.0.0-alpha15-macosx.tar.gz | ||
MACOSX_SDK_URL: https://github.com/phracker/MacOSX-SDKs/releases/download/10.15/MacOSX10.7.sdk.tar.xz | ||
MACOSX_SDK_DIRECTORY: $(System.DefaultWorkingDirectory)/dependencies/macosx/MacOSX10.7.sdk | ||
SDKROOT: $(System.DefaultWorkingDirectory)/dependencies/macosx/MacOSX10.7.sdk | ||
steps: | ||
- bash: 'curl -s -L "$BOOTSTRAP_URL" | bash' | ||
displayName: Bootstrap | ||
- bash: | | ||
sudo xcode-select -s "/Applications/Xcode_11.7.app/Contents/Developer" | ||
$BUILD_SCRIPT | ||
displayName: Build | ||
- task: CopyFiles@2 | ||
displayName: 'Copy files to $(Build.ArtifactStagingDirectory)' | ||
inputs: | ||
SourceFolder: '$(System.DefaultWorkingDirectory)/projects/macosx/gmake' | ||
Contents: '*/Release/*.dll' | ||
TargetFolder: '$(Build.ArtifactStagingDirectory)' | ||
CleanTargetFolder: true | ||
flattenFolders: true | ||
preserveTimestamp: true | ||
- task: PublishBuildArtifacts@1 | ||
displayName: 'Publish build artifacts' | ||
inputs: | ||
ArtifactName: macosx | ||
- job: publish | ||
displayName: Publish to GitHub Releases | ||
pool: | ||
name: Azure Pipelines | ||
vmImage: ubuntu-18.04 | ||
timeoutInMinutes: 5 | ||
dependsOn: | ||
- windows | ||
- linux | ||
- macosx | ||
steps: | ||
- task: DownloadBuildArtifacts@0 | ||
displayName: 'Download build artifacts' | ||
inputs: | ||
downloadType: specific | ||
parallelizationLimit: 12 | ||
- task: GitHubRelease@1 | ||
displayName: 'Publish GitHub release $(build.sourceBranchName)' | ||
inputs: | ||
gitHubConnection: 'GitHub danielga' | ||
releaseNotesSource: inline | ||
assets: '$(System.ArtifactsDirectory)/**' | ||
addChangeLog: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
require("spew") | ||
|
||
local function PassMessagesToHook() | ||
local messages = spew.GetAll() | ||
if not messages then | ||
return | ||
end | ||
|
||
for i = 1, #messages do | ||
local msg = messages[i] | ||
hook.Run("Spew", msg.Timestamp, msg.Type, msg.Level, msg.Group, Color(msg.Color.r, msg.Color.g, msg.Color.b, msg.Color.a), msg.Message) | ||
end | ||
end | ||
|
||
function spew.EnableHook() | ||
hook.Add("Think", "spew.PassMessagesToHook", PassMessagesToHook) | ||
end | ||
|
||
function spew.DisableHook() | ||
hook.Remove("Think", "spew.PassMessagesToHook") | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.