From d6f1bba96c2c96294110c82396288fcb84fc467f Mon Sep 17 00:00:00 2001 From: Xackery Date: Wed, 8 May 2024 22:54:21 -0700 Subject: [PATCH] [Feature] Add devcontainer support (#4294) * Add devcontainer support * Rename default values for eqemu_config * Move devcontainer files to devcontainer --- .devcontainer/.gitignore | 6 + .devcontainer/Dockerfile.debian.arm64.dev | 9 + .devcontainer/Dockerfile.debian.dev | 9 + .devcontainer/Makefile | 284 ++++++++++++++++++++++ .devcontainer/base/eqemu_config.json | 73 ++++++ .devcontainer/base/login.json | 37 +++ .devcontainer/devcontainer.json | 49 ++++ .gitignore | 3 - .vscode/c_cpp_properties.json | 23 ++ .vscode/launch.json | 173 +++++++++++++ .vscode/settings.json | 136 +++++++++++ 11 files changed, 799 insertions(+), 3 deletions(-) create mode 100644 .devcontainer/.gitignore create mode 100644 .devcontainer/Dockerfile.debian.arm64.dev create mode 100644 .devcontainer/Dockerfile.debian.dev create mode 100644 .devcontainer/Makefile create mode 100644 .devcontainer/base/eqemu_config.json create mode 100644 .devcontainer/base/login.json create mode 100644 .devcontainer/devcontainer.json create mode 100644 .vscode/c_cpp_properties.json create mode 100644 .vscode/launch.json create mode 100644 .vscode/settings.json diff --git a/.devcontainer/.gitignore b/.devcontainer/.gitignore new file mode 100644 index 000000000..a58f289c3 --- /dev/null +++ b/.devcontainer/.gitignore @@ -0,0 +1,6 @@ +!Makefile +base/*.sql +base/*.zip +base/db/ +base/maps/ +!base/expansion/Makefile diff --git a/.devcontainer/Dockerfile.debian.arm64.dev b/.devcontainer/Dockerfile.debian.arm64.dev new file mode 100644 index 000000000..c36f6bfd8 --- /dev/null +++ b/.devcontainer/Dockerfile.debian.arm64.dev @@ -0,0 +1,9 @@ +# This is a "dev" image for running eqemu in development, also for dev containers +ARG USERNAME=user-name-goes-here +ARG USER_UID=1000 +ARG USER_GID=$USER_UID + +FROM --platform=linux/arm64 mcr.microsoft.com/devcontainers/base:debian +RUN sudo apt update && sudo apt install -y --no-install-recommends build-essential libtool cmake curl debconf-utils git libluabind-dev libsodium-dev liblua5.2-0 liblua5.2-dev libmariadb-dev libssl-dev minizip make mariadb-client locales nano open-vm-tools unzip uuid-dev iputils-ping wget libcurl4-openssl-dev gdb libyaml-cpp-dev ccache ninja-build pv mariadb-server libperl-dev libjson-perl libio-stringy-perl liblua5.1-dev libluabind-dev libboost-dev mariadb-server valgrind telnet libgoogle-perftools-dev google-perftools + +USER $USERNAME \ No newline at end of file diff --git a/.devcontainer/Dockerfile.debian.dev b/.devcontainer/Dockerfile.debian.dev new file mode 100644 index 000000000..4c324ddcf --- /dev/null +++ b/.devcontainer/Dockerfile.debian.dev @@ -0,0 +1,9 @@ +# This is a "dev" image for running eqemu in development, also for dev containers +ARG USERNAME=user-name-goes-here +ARG USER_UID=1000 +ARG USER_GID=$USER_UID + +FROM mcr.microsoft.com/devcontainers/base:debian +RUN sudo apt update && sudo apt install -y --no-install-recommends build-essential libtool cmake curl debconf-utils git libluabind-dev libsodium-dev liblua5.2-0 liblua5.2-dev libmariadb-dev libssl-dev minizip make mariadb-client locales nano open-vm-tools unzip uuid-dev iputils-ping wget libcurl4-openssl-dev gdb libyaml-cpp-dev ccache ninja-build pv mariadb-server libperl-dev libjson-perl libio-stringy-perl liblua5.1-dev libluabind-dev libboost-dev mariadb-server valgrind telnet libgoogle-perftools-dev google-perftools + +USER $USERNAME \ No newline at end of file diff --git a/.devcontainer/Makefile b/.devcontainer/Makefile new file mode 100644 index 000000000..53f06232c --- /dev/null +++ b/.devcontainer/Makefile @@ -0,0 +1,284 @@ +NAME := eqemu-server +.ONESHELL: + +DOCKER_ARGS := --rm --name ${NAME} -v $$PWD:/src -w /src ${NAME} +DOCKER_ARM64_ARGS := --rm --platform linux/arm64 --name ${NAME}-arm64 -v $$PWD:/src -w /src ${NAME}-arm64 + +.PHONY: build +build: +ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer) + @make -C ../ -f .devcontainer/Makefile build --no-print-directory + exit +endif + cd build$$BUILD_SUFFIX && cmake --build . --config Release --target all -- + +.PHONY: cmake +cmake: +ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer) + @make -C ../ -f .devcontainer/Makefile cmake --no-print-directory + exit +endif + @echo "working directory: $$PWD" + mkdir -p build$$BUILD_SUFFIX + @cd build$$BUILD_SUFFIX && cmake -DEQEMU_BUILD_LOGIN=ON \ + -DEQEMU_BUILD_TESTS=ON \ + -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -G Ninja .. + +clean: +ifneq (,$(findstring .devcontainer,$$PWD)) + @make -C ../ -f .devcontainer/Makefile clean --no-print-directory +endif + rm -rf build + +docker-cmake: +ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer) + @make -C ../ -f .devcontainer/Makefile docker-cmake --no-print-directory + exit +endif + @echo "working directory: $$PWD" + git submodule update --init --recursive + docker run ${DOCKER_ARGS} make cmake + +docker-build: +ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer) + @make -C ../ -f .devcontainer/Makefile docker-build --no-print-directory + exit +endif + docker run ${DOCKER_ARGS} make build + +# Build image if it doesn't exist +docker-image-build: +ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer) + @make -C ../ -f .devcontainer/Makefile docker-image-build --no-print-directory + exit +endif +ifeq ($(shell docker images -q ${NAME} 2> /dev/null),) + @echo "Docker image not found. Building..." + docker build -f Dockerfile.debian.dev -t ${NAME} . +endif + +docker-arm-cmake: docker-arm-image-build +ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer) + @make -C ../ -f .devcontainer/Makefile docker-arm-cmake --no-print-directory + exit +endif + git submodule update --init --recursive + docker run ${DOCKER_ARM64_ARGS} make cmake BUILD_SUFFIX=arm64 + +docker-arm-build: docker-arm-image-build +ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer) + @make -C ../ -f .devcontainer/Makefile docker-arm-build --no-print-directory + exit +endif + docker run ${DOCKER_ARM64_ARGS} make build BUILD_SUFFIX=arm64 + +docker-arm-image-build: +ifeq ($(shell docker images -q ${NAME}-arm64 2> /dev/null),) + @echo "Docker image not found. Building..." + docker build -f Dockerfile.debian.arm.dev -t ${NAME}-arm64 . +endif + +docker-clean: clean + +.PHONY: prep +prep: +ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer) + @make -C ../ -f .devcontainer/Makefile prep --no-print-directory + exit +endif + @echo "Preparing build/bin for usage..." + mkdir -p build/bin/assets/patches + cp -R -u -p .devcontainer/base/eqemu_config.json build/bin/eqemu_config.json + cp -R -u -p .devcontainer/base/login.json build/bin/login.json + cp -R -u -p loginserver/login_util/* build/bin/assets/patches/ + mkdir -p build/bin/assets + cp -R -u -p utils/patches build/bin/assets/ + -unlink build/bin/lua_modules + cd build/bin && ln -s quests/lua_modules lua_modules + -unlink build/bin/mods + cd build/bin && ln -s quests/mods mods + -unlink build/bin/maps + cd build/bin && ln -s ../../base/maps maps + mkdir -p build/bin/logs + mkdir -p build/bin/shared + @echo "Eqemu is prepared. Edit build/bin/eqemu_config.json to configure." + +maps: + @echo "Downloading maps..." + @mkdir -p base/maps + @cd base/maps && wget -nc https://github.com/Akkadius/eqemu-maps/archive/refs/heads/master.zip + @cd base/maps && unzip -o master.zip + @cd base/maps && mv eqemu-maps-master/* . + @cd base/maps && rm -rf eqemu-maps-master + @echo "Maps downloaded." + +quests: +ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer) + @make -C ../ -f .devcontainer/Makefile quests --no-print-directory + exit +endif + @cd build/bin && git clone https://github.com/ProjectEQ/projecteqquests.git quests + +# Runs tests +.PHONY: test +test: +ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer) + @make -C ../ -f .devcontainer/Makefile test --no-print-directory + exit +endif + cd build/bin && ./tests + +# Runs login binary +.PHONY: login +login: +ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer) + @make -C ../ -f .devcontainer/Makefile login --no-print-directory + exit +endif + cd build/bin && ./loginserver + +# Runs shared_memory binary +.PHONY: shared +shared: +ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer) + @make -C ../ -f .devcontainer/Makefile shared --no-print-directory + exit +endif + cd build/bin && ./shared_memory + +# Runs zone binary +.PHONY: zone +zone: +ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer) + @make -C ../ -f .devcontainer/Makefile zone --no-print-directory + exit +endif + @-rm build/bin/logs/zone/zone*.log + cd build/bin && ./zone + +# Runs world binary +.PHONY: world +world: +ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer) + @make -C ../ -f .devcontainer/Makefile world --no-print-directory + exit +endif + @-rm build/bin/logs/world*.log + cd build/bin && ./world + +# Runs ucs binary +.PHONY: ucs +ucs: +ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer) + @make -C ../ -f .devcontainer/Makefile ucs --no-print-directory + exit +endif + @-rm build/bin/logs/ucs*.log + cd build/bin && ./ucs + +# Runs queryserv binary +.PHONY: queryserv +queryserv: +ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer) + @make -C ../ -f .devcontainer/Makefile queryserv --no-print-directory + exit +endif + @-rm build/bin/logs/query_server*.log + cd build/bin && ./queryserv + +valgrind-%: +ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer) + @make -C ../ -f .devcontainer/Makefile valgrind --no-print-directory + exit +endif + cd build/bin && valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --verbose --log-file=logs/$*.valgrind.log ./$* + +# Start mariaDB standalone +.PHONY: mariadb +mariadb: + @sudo service mariadb start + +.PHONY: inject-mariadb +inject-mariadb: + -sudo service mariadb start + -mkdir -p base/db/ + -sudo mariadb -e 'DROP DATABASE IF EXISTS peq;' + -sudo mariadb -e 'CREATE DATABASE peq;' + -sudo mariadb -e "CREATE USER 'peq'@'127.0.0.1' IDENTIFIED BY 'peqpass';" + -sudo mariadb -e "GRANT ALL PRIVILEGES ON *.* TO 'peq'@'127.0.0.1';" +ifeq (,$(wildcard base/db/db.sql.zip)) + @echo "base/db.sql.zip not found. Downloading latest from https://db.projecteq.net/" + wget -nc https://db.projecteq.net/latest -O base/db/db.sql.zip + -cd base/db && unzip db.sql.zip +endif + @echo "Sourcing db may take a while, please wait..." + @cd base/db/peq-dump && sudo mariadb --database peq -e "source create_all_tables.sql" + @echo "MariaDB is now injected." + +.PHONY: gm-% +gm-%: + sudo mariadb --database peq -e "UPDATE account SET status=255 WHERE name = '$*';" + @echo "Account $* is now a GM. /camp to have it go into effect." + +depends: +ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer) + @make -C ../ -f .devcontainer/Makefile depends --no-print-directory + exit +endif + sudo apt install graphviz pip time + pip3 install graphviz + mkdir -p build/depends + @if [ ! -f "build/depends/dependency_graph.py" ]; then \ + wget https://raw.githubusercontent.com/pvigier/dependency-graph/master/dependency_graph.py -O build/depends/dependency_graph.py; \ + fi + @echo "Generating dependency graphs (This may take a while)..." + @echo "Login..." + time python3 build/depends/dependency_graph.py -f png login build/depends/login.dot + @echo "World..." + time python3 build/depends/dependency_graph.py -f png world build/depends/world.dot + @echo "Zone..." + time python3 build/depends/dependency_graph.py -f png zone build/depends/zone.dot + @echo "Common..." + time python3 build/depends/dependency_graph.py -f png common build/depends/common.dot + +backup: +ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer) + @make -C ../ -f .devcontainer/Makefile backup --no-print-directory + exit +endif + @mkdir -p build/bin/backup + cd build/bin && ./world database:dump --compress --player-tables --state-tables --system-tables --query-serv-tables + +cpu-zone: +ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer) + @make -C ../ -f .devcontainer/Makefile cpu-zone --no-print-directory + exit +endif + @cd build/bin && mkdir -p tmp + cd build/bin && CPUPROFILE=prof.out ./zone + +pprof-zone: +ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer) + @make -C ../ -f .devcontainer/Makefile pprof-zone --no-print-directory + exit +endif + cd build/bin && google-pprof --pdf zone prof.out > prof.pdf +pprof-web-zone: +ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer) + @make -C ../ -f .devcontainer/Makefile pprof-web-zone --no-print-directory + exit +endif + cd build/bin && google-pprof --web zone prof.out +pprof-gv-zone: +ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer) + @make -C ../ -f .devcontainer/Makefile pprof-gv-zone --no-print-directory + exit +endif + cd build/bin && google-pprof --gv zone prof.out > prof.gv +heap-zone: +ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer) + @make -C ../ -f .devcontainer/Makefile heap-zone --no-print-directory + exit +endif + @cd build/bin && mkdir -p tmp + cd build/bin && HEAPPROFILE=prof.out ./zone diff --git a/.devcontainer/base/eqemu_config.json b/.devcontainer/base/eqemu_config.json new file mode 100644 index 000000000..f7079f471 --- /dev/null +++ b/.devcontainer/base/eqemu_config.json @@ -0,0 +1,73 @@ +{ + "server": { + "zones": { + "defaultstatus": "0", + "ports": { + "low": "7000", + "high": "7400" + } + }, + "qsdatabase": { + "host": "127.0.0.1", + "port": "3306", + "username": "peq", + "password": "peqpass", + "db": "peq" + }, + "chatserver": { + "port": "7778", + "host": "" + }, + "mailserver": { + "host": "", + "port": "7778" + }, + "webinterface": { + "port": "9081" + }, + "world": { + "longname": "New Devbox", + "address": "192.168.1.100", + "localaddress": "192.168.1.100", + "loginserver1": { + "account": "", + "password": "", + "legacy": 0, + "host": "login.projecteq.net", + "port": "5998" + }, + "tcp": { + "ip": "127.0.0.1", + "port": "9001" + }, + "telnet": { + "ip": "0.0.0.0", + "port": "9000", + "enabled": "true" + }, + "key": "random-generate-here", + "http": { + "port": "9080", + "enabled": "true", + "mimefile": "mime.types" + }, + "shortname": "dev" + }, + "database": { + "db": "peq", + "host": "127.0.0.1", + "port": "3306", + "username": "peq", + "password": "peqpass" + }, + "files": { + "opcodes": "assets/patches/opcodes.conf", + "mail_opcodes": "assets/patches/mail_opcodes.conf" + }, + "directories": { + "patches": "assets/patches/", + "opcodes": "assets/patches/", + "plugins": "quests/plugins/" + } + } +} \ No newline at end of file diff --git a/.devcontainer/base/login.json b/.devcontainer/base/login.json new file mode 100644 index 000000000..6a7159d58 --- /dev/null +++ b/.devcontainer/base/login.json @@ -0,0 +1,37 @@ +{ + "database": { + "host": "127.0.0.1", + "port": "3306", + "db": "peq", + "user": "peq", + "password": "peqpass" + }, + "account": { + "auto_create_accounts": true + }, + "worldservers": { + "unregistered_allowed": true, + "reject_duplicate_servers": false + }, + "web_api": { + "enabled": true, + "port": 6000 + }, + "security": { + "mode": 14, + "allow_password_login": true, + "allow_token_login": true + }, + "logging": { + "trace": false, + "world_trace": false, + "dump_packets_in": false, + "dump_packets_out": false + }, + "client_configuration": { + "titanium_port": 5998, + "titanium_opcodes": "assets/patches/login_opcodes.conf", + "sod_port": 5999, + "sod_opcodes": "assets/patches/login_opcodes_sod.conf" + } +} \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 000000000..d6ccc7265 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,49 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu +{ + "name": "eqemu", + "build": { + "dockerfile": "Dockerfile.debian.dev" + }, + "appPort": [ + "5998:5998/udp", + "7000:7000/udp", + "7001:7001/udp", + "7002:7002/udp", + "7003:7003/udp", + "7004:7004/udp", + "7005:7005/udp", + "9000:9000/udp", + "9001:9001/udp" + ], + "forwardPorts": [ + 3306 + ], + "remoteEnv": { + "LOCALWSF": "${localWorkspaceFolder}", + "CONTAINERWSF": "${containerWorkspaceFolder}" + }, + "containerUser": "vscode", + // add ptrace + "runArgs": [ + "--cap-add=SYS_PTRACE", + "--security-opt", + "seccomp=unconfined" + ], + "customizations": { + "vscode": { + "extensions": [ + "ms-vscode.cpptools-extension-pack", + "vilicvane.sensitive-replace", + "maattdd.gitless", + "bibhasdn.unique-lines", + "GitHub.copilot", + "xackery.make-magic", + "Gruntfuggly.todo-tree", + "ms-vscode.cmake-tools" + ] + } + }, + "workspaceFolder": "/src", + "workspaceMount": "source=${localWorkspaceFolder},target=/src,type=bind,consistency=cached" +} \ No newline at end of file diff --git a/.gitignore b/.gitignore index e19929979..2f37a33f1 100644 --- a/.gitignore +++ b/.gitignore @@ -61,9 +61,6 @@ bin/ compile_flags.txt .cache/ -# vscode generated settings -.vscode/ - # Build pipeline !utils/scripts/build/ !utils/scripts/build/should-release/should-release diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json new file mode 100644 index 000000000..cf4a7d5a9 --- /dev/null +++ b/.vscode/c_cpp_properties.json @@ -0,0 +1,23 @@ +{ + "configurations": [ + { + "name": "Linux", + "includePath": [ + "${default}", + "${workspaceFolder}/submodules/fmt/include", + "${workspaceFolder}/submodules/cereal/include", + "${workspaceFolder}/submodules/glm", + "${workspaceFolder}/submodules/libuv/include" + ], + "defines": [ + "LUA_EQEMU=1" + ], + "compilerPath": "/usr/bin/gcc", + "cStandard": "c17", + "cppStandard": "gnu++17", + "intelliSenseMode": "linux-gcc-x64", + "configurationProvider": "ms-vscode.cmake-tools" + } + ], + "version": 4 +} \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 000000000..7e32f0c2a --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,173 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "(gdb) attach", + "type": "cppdbg", + "request": "attach", + "program": "${workspaceFolder}/build/bin/world", + "MIMode": "gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + }, + { + "description": "Set Disassembly Flavor to Intel", + "text": "-gdb-set disassembly-flavor intel", + "ignoreFailures": true + } + ] + }, + { + "name": "(gdb) shared_memory", + "type": "cppdbg", + "request": "launch", + "program": "${workspaceFolder}/build/bin/shared_memory", + "cwd": "${workspaceFolder}/build/bin", + "MIMode": "gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + }, + { + "description": "Set Disassembly Flavor to Intel", + "text": "-gdb-set disassembly-flavor intel", + "ignoreFailures": true + } + ] + }, + { + "name": "(gdb) world", + "type": "cppdbg", + "request": "launch", + "program": "${workspaceFolder}/build/bin/world", + "cwd": "${workspaceFolder}/build/bin", + "MIMode": "gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + }, + { + "description": "Set Disassembly Flavor to Intel", + "text": "-gdb-set disassembly-flavor intel", + "ignoreFailures": true + } + ] + }, + { + "name": "(gdb) zone", + "type": "cppdbg", + "request": "launch", + "program": "${workspaceFolder}/build/bin/zone", + "cwd": "${workspaceFolder}/build/bin", + "args": [ + "", + ], + "MIMode": "gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + }, + { + "description": "Set Disassembly Flavor to Intel", + "text": "-gdb-set disassembly-flavor intel", + "ignoreFailures": true + } + ] + }, + { + "name": "(gdb) zone neriakb", + "type": "cppdbg", + "request": "launch", + "program": "${workspaceFolder}/build/bin/zone", + "cwd": "${workspaceFolder}/build/bin", + "args": [ + "neriakb", + ], + "MIMode": "gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + }, + { + "description": "Set Disassembly Flavor to Intel", + "text": "-gdb-set disassembly-flavor intel", + "ignoreFailures": true + } + ] + }, + { + "name": "(gdb) login", + "type": "cppdbg", + "request": "launch", + "program": "${workspaceFolder}/build/bin/loginserver", + "cwd": "${workspaceFolder}/build/bin", + "MIMode": "gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + }, + { + "description": "Set Disassembly Flavor to Intel", + "text": "-gdb-set disassembly-flavor intel", + "ignoreFailures": true + } + ] + }, + { + "name": "(gdb) ucs", + "type": "cppdbg", + "request": "launch", + "program": "${workspaceFolder}/build/bin/ucs", + "cwd": "${workspaceFolder}/build/bin", + "MIMode": "gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + }, + { + "description": "Set Disassembly Flavor to Intel", + "text": "-gdb-set disassembly-flavor intel", + "ignoreFailures": true + } + ] + }, + { + "name": "(gdb) queryserv", + "type": "cppdbg", + "request": "launch", + "program": "${workspaceFolder}/build/bin/queryserv", + "cwd": "${workspaceFolder}/build/bin", + "MIMode": "gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + }, + { + "description": "Set Disassembly Flavor to Intel", + "text": "-gdb-set disassembly-flavor intel", + "ignoreFailures": true + } + ] + } + ] +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 000000000..bf5c79fae --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,136 @@ +{ + "editor.detectIndentation": false, + "editor.insertSpaces": false, + "editor.tabSize": 4, + "editor.autoIndent": "full", + "editor.trimAutoWhitespace": true, + "files.trimTrailingWhitespace": true, + //"editor.formatOnSave": true, + "search.exclude": { + "dependencies": false, + }, + "C_Cpp.default.includePath": [ + "/usr/include/x86_64-linux-gnu", + "/usr/include/lua5.2", + "/usr/include/mariadb", + "${workspaceFolder}/dependencies/curl_x64/include", + "${workspaceFolder}/dependencies/fmt/include", + "${workspaceFolder}/dependencies/glm", + "${workspaceFolder}/dependencies/libuv/include", + "${workspaceFolder}/dependencies/sol2", + "${workspaceFolder}/dependencies/zlibng" + ], + "telemetry.enableTelemetry": false, + "cmake.buildDirectory": "${workspaceFolder}/build", + "cmake.configureArgs": [ + "-DEQEMU_BUILD_LOGIN=ON", + "-DEQEMU_BUILD_TESTS=ON", + "-DCMAKE_CXX_COMPILER_LAUNCHER=ccache", + "-DEQEMU_ADD_PROFILER=ON", + "Ninja" + ], + "cmake.skipConfigureIfCachePresent": true, + "cmake.configureOnOpen": false, + "files.associations": { + "*.ipp": "cpp", + "functional": "cpp", + "string": "cpp", + "iostream": "cpp", + "map": "cpp", + "fstream": "cpp", + "type_traits": "cpp", + "utility": "cpp", + "cstring": "cpp", + "*.tcc": "cpp", + "cctype": "cpp", + "clocale": "cpp", + "cmath": "cpp", + "csignal": "cpp", + "cstdarg": "cpp", + "cstddef": "cpp", + "cstdio": "cpp", + "cstdlib": "cpp", + "ctime": "cpp", + "cwchar": "cpp", + "cwctype": "cpp", + "any": "cpp", + "array": "cpp", + "atomic": "cpp", + "strstream": "cpp", + "bit": "cpp", + "bitset": "cpp", + "chrono": "cpp", + "codecvt": "cpp", + "compare": "cpp", + "complex": "cpp", + "concepts": "cpp", + "condition_variable": "cpp", + "coroutine": "cpp", + "cstdint": "cpp", + "deque": "cpp", + "forward_list": "cpp", + "list": "cpp", + "set": "cpp", + "unordered_map": "cpp", + "unordered_set": "cpp", + "vector": "cpp", + "exception": "cpp", + "algorithm": "cpp", + "iterator": "cpp", + "memory": "cpp", + "memory_resource": "cpp", + "numeric": "cpp", + "optional": "cpp", + "random": "cpp", + "ratio": "cpp", + "regex": "cpp", + "source_location": "cpp", + "string_view": "cpp", + "system_error": "cpp", + "tuple": "cpp", + "future": "cpp", + "initializer_list": "cpp", + "iomanip": "cpp", + "iosfwd": "cpp", + "istream": "cpp", + "limits": "cpp", + "mutex": "cpp", + "new": "cpp", + "numbers": "cpp", + "ostream": "cpp", + "semaphore": "cpp", + "sstream": "cpp", + "stdexcept": "cpp", + "stop_token": "cpp", + "streambuf": "cpp", + "thread": "cpp", + "cfenv": "cpp", + "cinttypes": "cpp", + "typeindex": "cpp", + "typeinfo": "cpp", + "valarray": "cpp", + "variant": "cpp", + "csetjmp": "cpp", + "charconv": "cpp", + "format": "cpp", + "ranges": "cpp", + "span": "cpp" + }, + "cmake.statusbar.advanced": { + "kit": { + "visibility": "hidden", + }, + "debug": { + "visibility": "hidden", + }, + "buildTarget": { + "visibility": "hidden", + }, + "launch": { + "visibility": "hidden", + }, + "ctest": { + "visibility": "icon", + } + } +} \ No newline at end of file