Thanks to visit codestin.com
Credit goes to github.com

Skip to content

klantle/watchdogs

Repository files navigation

Typing SVG

Arch Support

DOCKER USAGE - for Mac/ALT Platform

NOTE Run this inside the Docker/dockerfile directory.

  • For Linux setup:
sudo usermod -aG docker $USER
newgrp docker
sudo systemctl enable docker
sudo systemctl start docker
  • Build and run:
docker build -t docker_usage .
docker run --rm -it docker_usage
  • Additional Docker Commands
docker ps -a                               # check a container
docker start <container-name>              # start a container
docker exec -it <container-name> /bin/bash # enter a container
docker stop <container-name>               # stop a container
docker rm -f <container-name>              # remove a container

TERMUX USAGE

# @@@ 1
termux-setup-storage                 # setup your storage
# @@@ 2
termux-change-repo                   # change repo
# @@@ 3
apt update                           # sync repo
# @@@ 4
apt upgrade                          # upgrade - optional
# @@@ 5
pkg install make git
# @@@ 6
git clone https://github.com/klantle/watchdogs watch
# @@@ 7
cd watch
# @@@ 8
make                                 # install library & build from source
# @@@ 9                              # moving & running
mv watchdogs.tmux .. && cd ..        # out from watch folder
mv watchdogs.tmux path/to/yourfolder # where your gamemode's
./watcdogs.tmux                      # run

MSYS2 USAGE

# @@@ 1
pacman -Sy                          # sync repo
# @@@ 2 - add more mirror (if failed in install packages)
nano /etc/pacman.d/mirrorlist.mingw64
nano /etc/pacman.d/mirrorlist.msys
nano /etc/pacman.d/mirrorlist.ucrt64
# * nano; [CTRL] + [X] & [ENTER]
Server = https://repo.msys2.org/msys/$arch
Server = https://mirror.msys2.org/msys/$arch
Server = https://mirror.selfnet.de/msys2/msys/$arch
Server = https://mirrors.rit.edu/msys2/msys/$arch
Server = https://ftp.osuosl.org/pub/msys2/msys/$arch
# * sync mirror
pacman -Sy
# @@@ 3
pacman -S make git
# @@@ 4
git clone https://github.com/klantle/watchdogs watch
# @@@ 5
cd watch
# @@@ 6
make                                 # install library & build from source
# @@@ 7                              # moving & running
mv watchdogs.win .. && cd ..         # out from watch folder
mv watchdogs.win path/to/yourfolder  # where your gamemode's
./watcdogs.win                       # run
  • note: this only in debian/ubuntu based
# @@@ 1
apt update                           # sync repo
# @@@ 2
apt install make git
# @@@ 3
git clone https://github.com/klantle/watchdogs watch
# @@@ 4
cd watch
# @@@ 5 
make                                 # install library & build from source\
# @@@ 6                              # moving & running
mv watchdogs .. && cd ..             # out from watch folder
mv watchdogs path/to/yourfolder      # where your gamemode's
./watcdogs                           # run

XTERM USAGE

xterm -hold -e ./watchdogs             # linux
xterm -hold -e ./watchdogs.win         # windows
xterm -hold -e ./watchdogs.tmux        # termux

Base Make command

make                # install library (apt/pkg/msys2)
make linux          # build from source for linux
make windows        # build from source for windows (msys2)
make termux         # build from source for termux
make clean          # clean make
make debug          # build from source with debug mode (linux)
make windows-debug  # build from source with debug mode (windows)
# `./__make.sh` for more.

image


BASIC OPERATION

Usage: help | help [<command>]

watchdogs.toml Struct

[general]
	os = "linux"                   # os type
[compiler]
	option = ["-d3", "-;+", "-(+"] # compiler options
	include_path = [
      # folders that are also automatically added
      "gamemodes",
      "gamemodes/x", 
      "gamemodes/y", 
      "gamemodes/z", 
      "pawno/include",
      "pawno/include/x",
      "pawno/include/y",
      "pawno/include/z",
  ]
  input = "gamemodes/bare.pwn"   # input compiler
  output = "gamemodes/bare.amx"  # output compiler
[depends]                        # depends url - max depends: 101
	wd_toml_aio_repo = ["Y-Less/sscanf:v2.13.8", "samp-incognito/samp-streamer-plugin:v2.9.6"]
{
  "version": "2.0.0",
  "tasks": [
    {
      "label": "watchdogs", "type": "shell",
      "command": "${workspaceRoot}/watchdogs",
      "group": {
        "kind": "build", "isDefault": true
      }
    }
  ]
}

WSL

{
  "version": "2.0.0",
  "tasks": [
    {
      "label": "watchdogs", "type": "shell",
      "command": "wsl ${workspaceRoot}/watchdogs",
      "group": {
        "kind": "build", "isDefault": true
      }
    }
  ]
}

INTRO 1.1 (INSTALL)

Supported Platforms: Linux, Windows, or macOS via:


Alias (running a program with a phrase.)

alias watch='./path/to/watchdogs'

Default (on root):

alias watch='./watchdogs'

run: ~$: watch


INTRO 1.2 (COMPILATION )

Default compilation:

compile .

image

Compile specific file:

compile yourmode.pwn

Compile specific path:

compile path/to/yourmode.pwn

INTRO 1.3 (STARTING )

Run yourmode of server.cfg/config.json from parameter gamemode0 or main_scripts

running .

image

Running specific ".amx" with [<args>]

running yourmode

INTRO 1.4 (COMPILE & STARTING)

One Step - (o)basic compile & starting:

crunn

image

INTRO 1.5 (DEBUGGING )

Debug yourmode of server.cfg/config.json from parameter gamemode0 or main_scripts

debug .

image

Debug specific ".amx" with [<args>]

debug yourmode

INTRO 1.6 (DEPENDS INSTALLER)

install                 # automatic installing from watchdogs.toml
install repo/user       # installing depends from (github/gitlab/gitea/sourceforge) by input
install repo/user:v1.1  # installing depends from (github/gitlab/gitea/sourceforge) by input with specific tags version

image

INTRO 1.7 (COMPILER OPTIONS) 3.10.10 (^/v)

Option Description
-A<num> Alignment in bytes of the data segment and the stack
-a Output assembler code
-C[+/-] Compact encoding for output file (default=+)
-c<name> Codepage name or number; e.g. 1252 for Windows Latin-1
-Dpath Active directory path
-d<num> Debugging level (default=-d1):
0 no symbolic information, no run-time checks
1 run-time checks, no symbolic information
2 full debug information and dynamic checking
3 same as -d2, but implies -O0
-e<name> Set name of error file (quiet compile)
-H<hwnd> Window handle to send a notification message on finish
-i<name> Path for include files
-l Create list file (preprocess only)
-o<name> Set base name of (P-code) output file
-O<num> Optimization level (default=-O1):
0 no optimization
1 JIT-compatible optimizations only
2 full optimizations
-p<name> Set name of "prefix" file
-R[+/-] Add detailed recursion report with call chains (default=-)
-r[name] Write cross reference report to console or to specified file
-S<num> Stack/heap size in cells (default=4096)
-s<num> Skip lines from the input file
-t<num> TAB indent size (in character positions, default=8)
-v<num> Verbosity level; 0=quiet, 1=normal, 2=verbose (default=1)
-w<num> Disable a specific warning by its number
-X<num> Abstract machine size limit in bytes
-XD<num> Abstract machine data/stack size limit in bytes
-Z[+/-] Run in compatibility mode (default=-)
-E[+/-] Turn warnings into errors
-\ Use '\' for escape characters
-^ Use '^' for escape characters
-;[+/-] Require a semicolon to end each statement (default=-)
-([+/-] Require parentheses for function invocation (default=-)
sym=val Define constant sym with value val
sym= Define constant sym with value 0