Add containerization and make this bad boy work on Windows and MacOS

This commit is contained in:
omer
2024-02-28 19:08:07 -06:00
parent d58a0543eb
commit df7a63e047
557 changed files with 6647 additions and 5493 deletions
+17
View File
@@ -0,0 +1,17 @@
.DS_Store
tags
*.pyc
*.swp
*.o
build-hearthmod-*
hs_*
hm_stud/cert/*
node_modules
cache
*_log
*.log
+26 -14
View File
@@ -1,19 +1,31 @@
# os
FROM ubuntu:16.04
RUN apt-get -y update && apt-get install -y git vim libev-dev tar wget libevent-dev build-essential libnet-ifconfig-wrapper-perl cmake python-pip libjson-c-dev curl valgrind zlib1g-dev python-webpy
WORKDIR /app
RUN apt-get -y update && apt-get install -y git vim libev-dev tar wget libevent-dev build-essential libnet-ifconfig-wrapper-perl cmake qt5-default qt5-qmake python-pip libjson-c-dev curl valgrind zlib1g-dev python-webpy python-flup libssl-dev runit spawn-fcgi npm node-gyp nodejs libpcre3-dev
# couchbase
RUN cd ~ && wget http://packages.couchbase.com/releases/4.5.0/couchbase-server-enterprise_4.5.0-ubuntu14.04_amd64.deb
RUN cd ~ && dpkg -i couchbase-server-enterprise_4.5.0-ubuntu14.04_amd64.deb
RUN cd ~ && git clone https://github.com/couchbase/libcouchbase.git
RUN cd ~ && cd libcouchbase && cmake . && make && make install
RUN cd ~ && wget http://packages.couchbase.com/clients/c/libcouchbase-2.5.8_ubuntu1404_amd64.tar && tar xvf *.tar && cd libcouchbase-2.5.8_ubuntu1404_amd64/ && dpkg -i *.deb
RUN pip install couchbase
RUN wget http://packages.couchbase.com/releases/4.5.0/couchbase-server-enterprise_4.5.0-ubuntu14.04_amd64.deb
RUN dpkg -i couchbase-server-enterprise_4.5.0-ubuntu14.04_amd64.deb
RUN git clone https://github.com/couchbase/libcouchbase.git
RUN cd libcouchbase && git checkout 2.9.0 && cmake . && make && make install && ldconfig
# RUN wget http://packages.couchbase.com/clients/c/libcouchbase-2.5.8_ubuntu1404_amd64.tar && tar xvf *.tar && cd libcouchbase-2.5.8_ubuntu1404_amd64/ && dpkg -i *.deb
RUN pip install couchbase==2.2.4
# hearthmod
RUN cd ~ && git clone https://github.com/farb3yonddriv3n/hm_database.git
RUN cd ~ && git clone https://github.com/farb3yonddriv3n/hm_base.git
RUN cd ~ && git clone https://github.com/farb3yonddriv3n/hm_gameserver.git
RUN cd ~ && git clone https://github.com/farb3yonddriv3n/hm_lobbyserver.git
RUN cd ~ && git clone https://github.com/farb3yonddriv3n/hm_ctl.git
RUN cd ~ && git clone https://github.com/farb3yonddriv3n/hm_stud.git
#RUN git clone https://github.com/farb3yonddriv3n/hm_database.git
#RUN git clone https://github.com/farb3yonddriv3n/hm_base.git
#RUN git clone https://github.com/farb3yonddriv3n/hm_gameserver.git
#RUN git clone https://github.com/farb3yonddriv3n/hm_lobbyserver.git
#RUN git clone https://github.com/farb3yonddriv3n/hm_ctl.git
#RUN git clone https://github.com/farb3yonddriv3n/hm_stud.git
# cleanup
RUN rm -rf ~/couchbase-server-enterprise_4.5.0-ubuntu14.04_amd64.deb ~/libcouchb*
RUN rm -rf /app/couchbase-server-enterprise_4.5.0-ubuntu14.04_amd64.deb
# ENTRYPOINT ["/opt/couchbase/bin/couchbase-server -- -kernel global_enable_tracing false -noinput"]
# Add the custom entrypoint script
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
-95
View File
@@ -1,95 +0,0 @@
# Hearthmod Anvil
Hearthmod anvil is a software stack that allows you to Mod Hearthstone. If you intend to run it, it's recommended that you run a linux OS, preferably debian or ubuntu distribution.
## Components
[hm_lobbyserver](https://github.com/WatermelonModders/hm_lobbyserver) - hearthmod lobby server
[hm_gameserver](https://github.com/WatermelonModders/hm_gameserver) - hearthmod game server
[hm_base](https://github.com/WatermelonModders/hm_base) - hearthmod base library
[hm_client](https://github.com/WatermelonModders/hm_client) - hearthmod client
[hm_database](https://github.com/WatermelonModders/hm_database) - hearthmod latest database snapshot
[hm_sunwell](https://github.com/WatermelonModders/hm_sunwell) - hearthsim custom card generation
[hm_stud](https://github.com/WatermelonModders/hm_stud) - tls un/wrapper
[hm_nginx](https://github.com/WatermelonModders/hm_nginx) - nginx web server
[hm_web](https://github.com/WatermelonModders/hm_web) - hearthmod web interface
## Guide
Clone hearthmod software stack
```sh
git clone https://github.com/WatermelonModders/hearthmodanvil.git
```
Run
```sh
cd hearthmod/
bash host_ctl_ubuntu.sh uninstalled
```
which compiles and installs the entire hearthmod stack. Also, it doesn't check for you local couchbase, nginx or stud instances. If you don't want to mess them, consider using virtual environment or modify installation script. If you don't run ubuntu or debian, please consider installation script alteration that suits your distro and creating an upstream pull request. Script host_ctl_ubuntu.sh was only tested on Ububtu 16.04.
Once compiled, run:
```sh
bash host_ctl_ubuntu.sh start [ip]
```
where IP is address of your gameserver (your current IP in most cases) and you can play.
Then run clients:
```sh
hearthmod/hs_client1/hearthmod_client/linux
```
and
```sh
hearthmod/hs_client2/hearthmod_client/linux
```
By running two instances of hearthstone you can play by yourself and develop or test stuff.
To create or modify cards, accounts, decks; go to http://localhost/ .
## Hosts file:
If you don't want your hearthstone client to connect to hearthmod.com you must edit your hosts file by adding the following line:
```sh
<yourip> hearthmod.com
```
Hosts file location varies depending on OS.
Linux:
```sh
/etc/hosts
```
Windows:
```sh
c:\Windows\System32\Drivers\etc\hosts
```
## Troubleshooting:
web server error log file:
```sh
tail -f /usr/local/nginx/logs/error.log
```
gameserver and lobbyserver log files:
```sh
./hearthmod/hm_log/*
```
Pull requests are more than welcome.
## Contact:
join IRC channel #hearthmod @ irc.freenode.org
+88 -29
View File
@@ -1,61 +1,97 @@
# # Hearthmod Anvil
Hearthmod anvil is a software stack that allows you to Mod Hearthstone. If you intend to run it, it's recommended that you run a linux OS, preferably debian or ubuntu distribution.
# # hearthmod
Make HS fun again
## Components
[hm_lobbyserver](https://github.com/WatermelonModders/hm_lobbyserver) - hearthmod lobby server
[hm_gameserver](https://github.com/WatermelonModders/hm_gameserver) - hearthmod game server
[hm_lobbyserver](https://gitlab.hsmod.xyz/omdagny/hearthmod/hm_lobbyserver) - hearthmod lobby server
[hm_base](https://github.com/WatermelonModders/hm_base) - hearthmod base library
[hm_gameserver](https://gitlab.hsmod.xyz/omdagny/hearthmod/hm_gameserver) - hearthmod game server
[hm_client](https://github.com/WatermelonModders/hm_client) - hearthmod client
[hm_base](https://gitlab.hsmod.xyz/omdagny/hearthmod/hm_base) - hearthmod base library
[hm_database](https://github.com/WatermelonModders/hm_database) - hearthmod latest database snapshot
[hm_client](https://gitlab.hsmod.xyz/omdagny/hearthmod/hm_client) - hearthmod client
[hm_sunwell](https://github.com/WatermelonModders/hm_sunwell) - hearthsim custom card generation
[hm_database](https://gitlab.hsmod.xyz/omdagny/hearthmod/hm_database) - hearthmod latest database snapshot
[hm_stud](https://github.com/WatermelonModders/hm_stud) - tls un/wrapper
[hm_sunwell](https://gitlab.hsmod.xyz/omdagny/hearthmod/hm_sunwell) - hearthsim custom card generation
[hm_nginx](https://github.com/WatermelonModders/hm_nginx) - nginx web server
[hm_stud](https://gitlab.hsmod.xyz/omdagny/hearthmod/hm_stud) - tls un/wrapper
[hm_web](https://github.com/WatermelonModders/hm_web) - hearthmod web interface
[hm_nginx](https://gitlab.hsmod.xyz/omdagny/hearthmod/hm_nginx) - nginx web server
[hm_web](https://gitlab.hsmod.xyz/omdagny/hearthmod/hm_web) - hearthmod web interface
## Guide
Clone hearthmod software stack
```sh
git clone https://github.com/WatermelonModders/hearthmodanvilnew
git clone https://gitlab.hsmod.xyz/omdagny/hearthmod
```
Run
### Docker container
Run
```sh
cd hearthmodanvilnew/
cd hearthmod/
docker-compose up --build
```
builds and starts the hearthmod container with all of the required dependencies.
```sh
bash docker_ctl.sh bucket_create
```
creates a bucket in couchbase.
```sh
cd hearthmod/
bash docker_ctl.sh bucket_restore
```
restores the latest database snapshot/populates it.
```sh
cd hearthmod/
bash docker_ctl.sh compile
```
compiles and installs the entire hearthmod server stack.
```sh
cd hearthmod/
bash docker_ctl.sh start
```
starts the hearthmod server stack.
```sh
cd hearthmod/
bash docker_ctl.sh stop
```
### Ubuntu
Run
```sh
cd hearthmod/
bash host_ctl_ubuntu.sh uninstalled
```
which compiles and installs the entire hearthmod stack. Also, it doesn't check for you local couchbase, nginx or stud instances. If you don't want to mess them, consider using virtual environment or modify installation script. If you don't run ubuntu or debian, please consider installation script alteration that suits your distro and creating an upstream pull request. Script host_ctl_ubuntu.sh was only tested on Ububtu 16.04.
Once compiled, run:
```sh
bash host_ctl_ubuntu.sh start [ip]
```
```
where IP is address of your gameserver (your current IP in most cases) and you can play.
Then run clients:
```sh
hearthmod/hs_client1/hearthmod_client/linux
```
and
```sh
hearthmod/hs_client2/hearthmod_client/linux
```
By running two instances of hearthstone you can play by yourself and develop or test stuff.
To create or modify cards, accounts, decks; go to http://localhost/ .
## Hosts file:
If you don't want your hearthstone client to connect to hearthmod.com you must edit your hosts file by adding the following line:
@@ -67,26 +103,49 @@ If you don't want your hearthstone client to connect to hearthmod.com you must e
Hosts file location varies depending on OS.
Linux:
```sh
/etc/hosts
```
Windows:
```sh
c:\Windows\System32\Drivers\etc\hosts
```
## Running the clients:
```sh
cd hearthmod/hs_client1/hearthmod_client/linux
./hearthmod
```
and
```sh
cd hearthmod/hs_client2/hearthmod_client/linux
./hearthmod
```
By running two instances of hearthstone you can play by yourself and develop or test stuff.
To create or modify cards, accounts, decks; go to http://localhost/ .
## Troubleshooting:
TODO: Edit this to accommodate docker changes
web server error log file:
```sh
tail -f /usr/local/nginx/logs/error.log
```
gameserver and lobbyserver log files:
```sh
./hearthmod/hm_log/*
```
Pull requests are more than welcome.
-52
View File
@@ -1,52 +0,0 @@
# Hearthmod Anvil
Hearthmod anvil is a software stack that allows you to Mod Hearthstone. If you intend to run it, it's recommended that you run a linux OS, preferably debian or ubuntu distribution.
## Components
[hm_lobbyserver](https://github.com/WatermelonModders/hm_lobbyserver) - hearthmod lobby server
[hm_gameserver](https://github.com/WatermelonModders/hm_gameserver) - hearthmod game server
[hm_base](https://github.com/WatermelonModders/hm_base) - hearthmod base library
[hm_client](https://github.com/WatermelonModders/hm_client) - hearthmod client
[hm_database](https://github.com/WatermelonModders/hm_database) - hearthmod latest database snapshot
[hm_sunwell](https://github.com/WatermelonModders/hm_sunwell) - hearthsim custom card generation
[hm_stud](https://github.com/WatermelonModders/hm_stud) - tls un/wrapper
[hm_nginx](https://github.com/WatermelonModders/hm_nginx) - nginx web server
[hm_web](https://github.com/WatermelonModders/hm_web) - hearthmod web interface
## Guide
Clone hearthmod software stack
```sh
git clone https://github.com/WatermelonModders/hearthmodanvil.git
```
Run
```sh
cd hearthmod/
bash host_ctl_ubuntu.sh uninstalled
```
which compiles and installs the entire hearthmod stack. Also, it doesn't check for you local couchbase, nginx or stud instances. If you don't want to mess them, consider using virtual environment or modify installation script. If you don't run ubuntu or debian, please consider installation script alteration that suits your distro and creating an upstream pull request. Script host_ctl_ubuntu.sh was only tested on Ububtu 16.04.
Once compiled, run:
```sh
bash host_ctl_ubuntu.sh start [ip]
```
where IP is address of your gameserver (your current IP in most cases) and you can play.
Then run clients:
```sh
hearthmod/hs_client1/hearthmod_client/linux
```
and
```sh
hearthmod/hs_client2/hearthmod_client/linux
+24
View File
@@ -0,0 +1,24 @@
version: '3'
services:
hearthmod:
build:
context: .
dockerfile: Dockerfile
environment:
- COUCHBASE_HOST=localhost
- COUCHBASE_PORT=8091
- CB_REST_USERNAME=Administrator
- CB_REST_PASSWORD=password
- COUCHBASE_ADMINISTRATOR_PASSWORD=password
volumes:
- .:/app
working_dir: /app
container_name: hearthmod
command: tail -f /dev/null # Keeps the container running
ports:
- 8091:8091
- 8092:8092
- 1119:1119
- 3724:3724
- 80:80
- 9002:9002
+24 -8
View File
@@ -1,23 +1,39 @@
#!/bin/sh
CMD="docker exec -it hearthmod"
case $1 in
bucket_create)
/opt/couchbase/bin/couchbase-cli bucket-create -c localhost:8091 -u Administrator -p password --bucket=hbs --bucket-password=aci --bucket-type=couchbase --bucket-ramsize=200 --bucket-replica=1 --wait
$CMD /opt/couchbase/bin/couchbase-cli bucket-create -c "localhost:8091" --bucket=hbs --bucket-password=aci --bucket-type=couchbase --bucket-ramsize=200 --bucket-replica=1 --wait
;;
bucket_restore)
/opt/couchbase/bin/cbrestore ~/hm_database/ http://localhost:8091/ --bucket-source=hbs
$CMD /opt/couchbase/bin/cbrestore /app/hm_database/hbs http://localhost:8091/ --bucket-source=hbs
;;
compile)
make -C ~/hm_gameserver
make -C ~/hm_lobbyserver
$CMD /bin/bash -c 'cd /app/hm_stud && make && rm -rf cert/test* && cd cert && sh gen_cert.sh'
$CMD make -C /app/hm_gameserver
$CMD make -C /app/hm_lobbyserver
$CMD /bin/bash -c 'cd /app/hm_nginx && sed "s@\/usr\/local\/web@$(pwd)\/..\/hm_web\/@" conf/hm_nginx.conf > conf/nginx.conf && ./configure && make && make install'
$CMD /bin/bash -c 'cd /app/hm_sunwell/examples && npm install'
;;
build_client)
$CMD /bin/bash -c 'cd /app/hm_client/src && qmake hearthmod.pro && make'
;;
start)
mkdir -p ~/hm_log
valgrind --log-file=/root/hm_log/hm_gameserver_valgrind_$(date +%s) --trace-children=yes ~/hm_gameserver/hm_gameserver --log=/root/hm_log/hm_gameserver_$(date +%s)
valgrind --log-file=/root/hm_log/hm_lobbyserver_valgrind_$(date +%s) --trace-children=yes ~/hm_lobbyserver/hm_lobbyserver --log=/root/hm_log/hm_lobbyserver_$(date +%s)
$CMD mkdir -p /app/hm_log
# Start the servers
$CMD /app/hm_gameserver/hm_gameserver --log=/app/hm_log/hm_gameserver_$(date +%s)
$CMD /app/hm_lobbyserver/hm_lobbyserver --gameserver=127.0.0.1 --log=/app/hm_log/hm_lobbyserver_$(date +%s)
# Start stud
$CMD /app/hm_stud/stud /app/hm_stud/cert/test.com.pem
# Start fcgi
$CMD spawn-fcgi -d /app/hm_web/ -f /app/hm_web/app.py -a 127.0.0.1 -p 9002
# Start nginx
$CMD /app/hm_nginx/objs/nginx
;;
stop)
ps -ef | grep hm_ | grep -v grep | awk '{print $2}' | xargs kill -9
$CMD ps -ef | grep hm_ | grep -v grep | awk '{print $2}' | xargs kill -9
$CMD ps -ef | grep nginx | grep -v grep | awk '{print $2}' | xargs sudo kill -9
;;
*)
echo "Usage: ctl.sh {bucket_create|bucket_restore|compile|start|stop}" >&2
+15
View File
@@ -0,0 +1,15 @@
#!/bin/bash
# Sleep for a few seconds (if needed)
# sleep 5
# Start Couchbase Server
if [ "$(whoami)" = "couchbase" ]; then
exec /opt/couchbase/bin/couchbase-server -- -kernel global_enable_tracing false -noinput
else
exec chpst -ucouchbase /opt/couchbase/bin/couchbase-server -- -kernel global_enable_tracing false -noinput
fi
# Keep the script running to prevent the container from exiting
# tail -f /dev/null
-3
View File
@@ -1,3 +0,0 @@
tags
*.swp
*.o
+1 -7
View File
@@ -1,7 +1 @@
# hm_base
base library
# This is not a standalone project!
[hm_base](https://github.com/farb3yonddriv3n/hm_base) is part of [hearthmod software stack](https://github.com/hearthmod/hearthmod)
# hm_base
Binary file not shown.
-4
View File
@@ -7,7 +7,3 @@ You should be able to compile and run it using qtCreator 5.x on both linux and w
## License
Please see LICENSE file.
# This is not a standalone project!
[hm_client](https://github.com/farb3yonddriv3n/hm_client) is part of [hearthmod software stack](https://github.com/hearthmod/hearthmod)
+358
View File
@@ -0,0 +1,358 @@
#############################################################################
# Makefile for building: hearthmod
# Generated by qmake (3.0) (Qt 5.5.1)
# Project: hearthmod.pro
# Template: app
# Command: /usr/lib/x86_64-linux-gnu/qt5/bin/qmake -o Makefile hearthmod.pro
#############################################################################
MAKEFILE = Makefile
####### Compiler, tools and options
CC = gcc
CXX = g++
DEFINES = -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB
CFLAGS = -m64 -pipe -O2 -Wall -W -D_REENTRANT -fPIC $(DEFINES)
CXXFLAGS = -m64 -pipe -O2 -Wall -W -D_REENTRANT -fPIC $(DEFINES)
INCPATH = -I. -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtNetwork -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64
QMAKE = /usr/lib/x86_64-linux-gnu/qt5/bin/qmake
DEL_FILE = rm -f
CHK_DIR_EXISTS= test -d
MKDIR = mkdir -p
COPY = cp -f
COPY_FILE = cp -f
COPY_DIR = cp -f -R
INSTALL_FILE = install -m 644 -p
INSTALL_PROGRAM = install -m 755 -p
INSTALL_DIR = cp -f -R
DEL_FILE = rm -f
SYMLINK = ln -f -s
DEL_DIR = rmdir
MOVE = mv -f
TAR = tar -cf
COMPRESS = gzip -9f
DISTNAME = hearthmod1.0.0
DISTDIR = /app/hm_client/src/.tmp/hearthmod1.0.0
LINK = g++
LFLAGS = -m64 -Wl,-O1
LIBS = $(SUBLIBS) -L/usr/X11R6/lib64 -lQt5Widgets -lQt5Gui -lQt5Network -lQt5Core -lGL -lpthread
AR = ar cqs
RANLIB =
SED = sed
STRIP = strip
####### Output directory
OBJECTS_DIR = ./
####### Files
SOURCES = main.cpp \
proto.cpp \
mainwindow.cpp moc_mainwindow.cpp
OBJECTS = main.o \
proto.o \
mainwindow.o \
moc_mainwindow.o
DIST = wait.cur \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/spec_pre.prf \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/unix.conf \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/linux.conf \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/sanitize.conf \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/gcc-base.conf \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/gcc-base-unix.conf \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/g++-base.conf \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/g++-unix.conf \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/qconfig.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_bootstrap_private.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_concurrent.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_concurrent_private.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_core.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_core_private.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_dbus.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_dbus_private.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_eglfs_device_lib_private.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_gui.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_gui_private.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_network.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_network_private.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_opengl.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_opengl_private.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_openglextensions.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_openglextensions_private.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_platformsupport_private.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_printsupport.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_printsupport_private.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_sql.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_sql_private.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_testlib.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_testlib_private.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_widgets.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_widgets_private.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_xcb_qpa_lib_private.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_xml.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_xml_private.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt_functions.prf \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt_config.prf \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64/qmake.conf \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/spec_post.prf \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/exclusive_builds.prf \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/default_pre.prf \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/resolve_config.prf \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/default_post.prf \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/warn_on.prf \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt.prf \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/resources.prf \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/moc.prf \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/unix/opengl.prf \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/uic.prf \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/unix/thread.prf \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/testcase_targets.prf \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/exceptions.prf \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/yacc.prf \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/lex.prf \
hearthmod.pro proto.h \
mainwindow.h main.cpp \
proto.cpp \
mainwindow.cpp
QMAKE_TARGET = hearthmod
DESTDIR = #avoid trailing-slash linebreak
TARGET = hearthmod
first: all
####### Implicit rules
.SUFFIXES: .o .c .cpp .cc .cxx .C
.cpp.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
.cc.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
.cxx.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
.C.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
.c.o:
$(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<"
####### Build rules
$(TARGET): ui_mainwindow.h $(OBJECTS)
$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)
Makefile: hearthmod.pro /usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64/qmake.conf /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/spec_pre.prf \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/unix.conf \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/linux.conf \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/sanitize.conf \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/gcc-base.conf \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/gcc-base-unix.conf \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/g++-base.conf \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/g++-unix.conf \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/qconfig.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_bootstrap_private.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_concurrent.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_concurrent_private.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_core.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_core_private.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_dbus.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_dbus_private.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_eglfs_device_lib_private.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_gui.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_gui_private.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_network.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_network_private.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_opengl.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_opengl_private.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_openglextensions.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_openglextensions_private.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_platformsupport_private.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_printsupport.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_printsupport_private.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_sql.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_sql_private.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_testlib.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_testlib_private.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_widgets.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_widgets_private.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_xcb_qpa_lib_private.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_xml.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_xml_private.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt_functions.prf \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt_config.prf \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64/qmake.conf \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/spec_post.prf \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/exclusive_builds.prf \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/default_pre.prf \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/resolve_config.prf \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/default_post.prf \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/warn_on.prf \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt.prf \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/resources.prf \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/moc.prf \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/unix/opengl.prf \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/uic.prf \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/unix/thread.prf \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/testcase_targets.prf \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/exceptions.prf \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/yacc.prf \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/lex.prf \
hearthmod.pro \
/usr/lib/x86_64-linux-gnu/libQt5Widgets.prl \
/usr/lib/x86_64-linux-gnu/libQt5Gui.prl \
/usr/lib/x86_64-linux-gnu/libQt5Network.prl \
/usr/lib/x86_64-linux-gnu/libQt5Core.prl
$(QMAKE) -o Makefile hearthmod.pro
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/spec_pre.prf:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/unix.conf:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/linux.conf:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/sanitize.conf:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/gcc-base.conf:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/gcc-base-unix.conf:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/g++-base.conf:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/g++-unix.conf:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/qconfig.pri:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_bootstrap_private.pri:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_concurrent.pri:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_concurrent_private.pri:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_core.pri:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_core_private.pri:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_dbus.pri:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_dbus_private.pri:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_eglfs_device_lib_private.pri:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_gui.pri:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_gui_private.pri:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_network.pri:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_network_private.pri:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_opengl.pri:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_opengl_private.pri:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_openglextensions.pri:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_openglextensions_private.pri:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_platformsupport_private.pri:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_printsupport.pri:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_printsupport_private.pri:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_sql.pri:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_sql_private.pri:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_testlib.pri:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_testlib_private.pri:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_widgets.pri:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_widgets_private.pri:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_xcb_qpa_lib_private.pri:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_xml.pri:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_xml_private.pri:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt_functions.prf:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt_config.prf:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64/qmake.conf:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/spec_post.prf:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/exclusive_builds.prf:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/default_pre.prf:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/resolve_config.prf:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/default_post.prf:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/warn_on.prf:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt.prf:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/resources.prf:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/moc.prf:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/unix/opengl.prf:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/uic.prf:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/unix/thread.prf:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/testcase_targets.prf:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/exceptions.prf:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/yacc.prf:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/lex.prf:
hearthmod.pro:
/usr/lib/x86_64-linux-gnu/libQt5Widgets.prl:
/usr/lib/x86_64-linux-gnu/libQt5Gui.prl:
/usr/lib/x86_64-linux-gnu/libQt5Network.prl:
/usr/lib/x86_64-linux-gnu/libQt5Core.prl:
qmake: FORCE
@$(QMAKE) -o Makefile hearthmod.pro
qmake_all: FORCE
all: Makefile $(TARGET)
dist: distdir FORCE
(cd `dirname $(DISTDIR)` && $(TAR) $(DISTNAME).tar $(DISTNAME) && $(COMPRESS) $(DISTNAME).tar) && $(MOVE) `dirname $(DISTDIR)`/$(DISTNAME).tar.gz . && $(DEL_FILE) -r $(DISTDIR)
distdir: FORCE
@test -d $(DISTDIR) || mkdir -p $(DISTDIR)
$(COPY_FILE) --parents $(DIST) $(DISTDIR)/
$(COPY_FILE) --parents proto.h mainwindow.h $(DISTDIR)/
$(COPY_FILE) --parents main.cpp proto.cpp mainwindow.cpp $(DISTDIR)/
$(COPY_FILE) --parents mainwindow.ui $(DISTDIR)/
clean: compiler_clean
-$(DEL_FILE) $(OBJECTS)
-$(DEL_FILE) *~ core *.core
distclean: clean
-$(DEL_FILE) $(TARGET)
-$(DEL_FILE) Makefile
####### Sub-libraries
mocclean: compiler_moc_header_clean compiler_moc_source_clean
mocables: compiler_moc_header_make_all compiler_moc_source_make_all
check: first
compiler_rcc_make_all:
compiler_rcc_clean:
compiler_moc_header_make_all: moc_mainwindow.cpp
compiler_moc_header_clean:
-$(DEL_FILE) moc_mainwindow.cpp
moc_mainwindow.cpp: proto.h \
mainwindow.h
/usr/lib/x86_64-linux-gnu/qt5/bin/moc $(DEFINES) -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64 -I/app/hm_client/src -I/usr/include/x86_64-linux-gnu/qt5 -I/usr/include/x86_64-linux-gnu/qt5/QtWidgets -I/usr/include/x86_64-linux-gnu/qt5/QtGui -I/usr/include/x86_64-linux-gnu/qt5/QtNetwork -I/usr/include/x86_64-linux-gnu/qt5/QtCore -I/usr/include/c++/5 -I/usr/include/x86_64-linux-gnu/c++/5 -I/usr/include/c++/5/backward -I/usr/lib/gcc/x86_64-linux-gnu/5/include -I/usr/local/include -I/usr/lib/gcc/x86_64-linux-gnu/5/include-fixed -I/usr/include/x86_64-linux-gnu -I/usr/include mainwindow.h -o moc_mainwindow.cpp
compiler_moc_source_make_all:
compiler_moc_source_clean:
compiler_uic_make_all: ui_mainwindow.h
compiler_uic_clean:
-$(DEL_FILE) ui_mainwindow.h
ui_mainwindow.h: mainwindow.ui
/usr/lib/x86_64-linux-gnu/qt5/bin/uic mainwindow.ui -o ui_mainwindow.h
compiler_yacc_decl_make_all:
compiler_yacc_decl_clean:
compiler_yacc_impl_make_all:
compiler_yacc_impl_clean:
compiler_lex_make_all:
compiler_lex_clean:
compiler_clean: compiler_moc_header_clean compiler_uic_clean
####### Compile
main.o: main.cpp mainwindow.h \
proto.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o main.cpp
proto.o: proto.cpp proto.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o proto.o proto.cpp
mainwindow.o: mainwindow.cpp mainwindow.h \
proto.h \
ui_mainwindow.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o mainwindow.o mainwindow.cpp
moc_mainwindow.o: moc_mainwindow.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_mainwindow.o moc_mainwindow.cpp
####### Install
install: FORCE
uninstall: FORCE
FORCE:
BIN
View File
Binary file not shown.
+267
View File
@@ -0,0 +1,267 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 12.0.2, 2024-02-28T13:09:40. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
<value type="QByteArray">{951484c4-7d50-4e5b-ac29-16f6fa95c96e}</value>
</data>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>
<value type="qlonglong">0</value>
</data>
<data>
<variable>ProjectExplorer.Project.EditorSettings</variable>
<valuemap type="QVariantMap">
<value type="bool" key="EditorConfiguration.AutoIndent">true</value>
<value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
<value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
<value type="QString" key="language">Cpp</value>
<valuemap type="QVariantMap" key="value">
<value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
</valuemap>
</valuemap>
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
<value type="QString" key="language">QmlJS</value>
<valuemap type="QVariantMap" key="value">
<value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
</valuemap>
</valuemap>
<value type="qlonglong" key="EditorConfiguration.CodeStyle.Count">2</value>
<value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
<value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
<value type="int" key="EditorConfiguration.IndentSize">4</value>
<value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
<value type="int" key="EditorConfiguration.MarginColumn">80</value>
<value type="bool" key="EditorConfiguration.MouseHiding">true</value>
<value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
<value type="int" key="EditorConfiguration.PaddingMode">1</value>
<value type="int" key="EditorConfiguration.PreferAfterWhitespaceComments">0</value>
<value type="bool" key="EditorConfiguration.PreferSingleLineComments">false</value>
<value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
<value type="bool" key="EditorConfiguration.ShowMargin">false</value>
<value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
<value type="bool" key="EditorConfiguration.SmartSelectionChanging">true</value>
<value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
<value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
<value type="int" key="EditorConfiguration.TabSize">8</value>
<value type="bool" key="EditorConfiguration.UseGlobal">true</value>
<value type="bool" key="EditorConfiguration.UseIndenter">false</value>
<value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
<value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
<value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
<value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
<value type="QString" key="EditorConfiguration.ignoreFileTypes">*.md, *.MD, Makefile</value>
<value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
<value type="bool" key="EditorConfiguration.skipTrailingWhitespace">true</value>
<value type="bool" key="EditorConfiguration.tintMarginArea">true</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.PluginSettings</variable>
<valuemap type="QVariantMap">
<valuemap type="QVariantMap" key="AutoTest.ActiveFrameworks">
<value type="bool" key="AutoTest.Framework.Boost">true</value>
<value type="bool" key="AutoTest.Framework.CTest">false</value>
<value type="bool" key="AutoTest.Framework.Catch">true</value>
<value type="bool" key="AutoTest.Framework.GTest">true</value>
<value type="bool" key="AutoTest.Framework.QtQuickTest">true</value>
<value type="bool" key="AutoTest.Framework.QtTest">true</value>
</valuemap>
<valuemap type="QVariantMap" key="AutoTest.CheckStates"/>
<value type="int" key="AutoTest.RunAfterBuild">0</value>
<value type="bool" key="AutoTest.UseGlobal">true</value>
<valuemap type="QVariantMap" key="ClangTools">
<value type="bool" key="ClangTools.AnalyzeOpenFiles">true</value>
<value type="bool" key="ClangTools.BuildBeforeAnalysis">true</value>
<value type="QString" key="ClangTools.DiagnosticConfig">Builtin.DefaultTidyAndClazy</value>
<value type="int" key="ClangTools.ParallelJobs">4</value>
<value type="bool" key="ClangTools.PreferConfigFile">true</value>
<valuelist type="QVariantList" key="ClangTools.SelectedDirs"/>
<valuelist type="QVariantList" key="ClangTools.SelectedFiles"/>
<valuelist type="QVariantList" key="ClangTools.SuppressedDiagnostics"/>
<value type="bool" key="ClangTools.UseGlobalSettings">true</value>
</valuemap>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.Target.0</variable>
<valuemap type="QVariantMap">
<value type="QString" key="DeviceType">Desktop</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop (x86-darwin-generic-mach_o-64bit)</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop (x86-darwin-generic-mach_o-64bit)</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{7ad13873-6f43-4e6e-839d-81a3ad2fd7d4}</value>
<value type="qlonglong" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
<value type="qlonglong" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
<value type="qlonglong" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
<value type="int" key="EnableQmlDebugging">0</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/Users/omerdangoor/projects/hearthstone/hearthmodanvilnew/hm_client/build-hearthmod-Desktop_x86_darwin_generic_mach_o_64bit-Debug</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">/Users/omerdangoor/projects/hearthstone/hearthmodanvilnew/hm_client/build-hearthmod-Desktop_x86_darwin_generic_mach_o_64bit-Debug</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
<valuelist type="QVariantList" key="QtProjectManager.QMakeBuildStep.SelectedAbis"/>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/Users/omerdangoor/projects/hearthstone/hearthmodanvilnew/hm_client/build-hearthmod-Desktop_x86_darwin_generic_mach_o_64bit-Release</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">/Users/omerdangoor/projects/hearthstone/hearthmodanvilnew/hm_client/build-hearthmod-Desktop_x86_darwin_generic_mach_o_64bit-Release</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
<valuelist type="QVariantList" key="QtProjectManager.QMakeBuildStep.SelectedAbis"/>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Release</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
<value type="int" key="QtQuickCompiler">0</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
<value type="int" key="EnableQmlDebugging">0</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/Users/omerdangoor/projects/hearthstone/hearthmodanvilnew/hm_client/build-hearthmod-Desktop_x86_darwin_generic_mach_o_64bit-Profile</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">/Users/omerdangoor/projects/hearthstone/hearthmodanvilnew/hm_client/build-hearthmod-Desktop_x86_darwin_generic_mach_o_64bit-Profile</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
<valuelist type="QVariantList" key="QtProjectManager.QMakeBuildStep.SelectedAbis"/>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Profile</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
<value type="int" key="QtQuickCompiler">0</value>
<value type="int" key="SeparateDebugInfo">0</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.Target.BuildConfigurationCount">3</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Deploy</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
<valuemap type="QVariantMap" key="ProjectExplorer.DeployConfiguration.CustomData"/>
<value type="bool" key="ProjectExplorer.DeployConfiguration.CustomDataEnabled">false</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
<value type="bool" key="Analyzer.Perf.Settings.UseGlobalSettings">true</value>
<value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
<value type="int" key="Analyzer.Valgrind.Callgrind.CostFormat">0</value>
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
<valuelist type="QVariantList" key="CustomOutputParsers"/>
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="bool" key="PE.EnvironmentAspect.PrintOnRun">false</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/Users/omerdangoor/projects/hearthstone/hearthmodanvilnew/hm_client/src/hearthmod.pro</value>
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">/Users/omerdangoor/projects/hearthstone/hearthmodanvilnew/hm_client/src/hearthmod.pro</value>
<value type="bool" key="ProjectExplorer.RunConfiguration.Customized">false</value>
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
<value type="bool" key="RunConfiguration.UseLibrarySearchPath">true</value>
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
<value type="QString" key="RunConfiguration.WorkingDirectory.default">/Users/omerdangoor/projects/hearthstone/hearthmodanvilnew/hm_client/build-hearthmod-Desktop_x86_darwin_generic_mach_o_64bit-Debug/hearthmod.app/Contents/MacOS</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.TargetCount</variable>
<value type="qlonglong">1</value>
</data>
<data>
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>
<value type="int">22</value>
</data>
<data>
<variable>Version</variable>
<value type="int">22</value>
</data>
</qtcreator>
+345 -317
View File
@@ -2,376 +2,404 @@
hm_client - hearthmod client
Copyright (C) 2016 Filip Pancik
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This
* program is free software: you can redistribute it and/or modify
it under
* the terms of the GNU General Public License as published by
the Free
* Software Foundation, either version 3 of the License, or
(at your option)
* any later version.
This program is distributed in the hope that it will be useful,
This program is distributed in the hope that it will
* be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General
* Public License for more details.
You should have received a copy of the
* GNU General Public License
along with this program. If not, see
* <http://www.gnu.org/licenses/>.
*/
#include <QCryptographicHash>
#include <QDebug>
#include <QDir>
#include <QFile>
#include <QJsonDocument>
#include <QJsonObject>
#include <QNetworkReply>
#include <QNetworkRequest>
#include <QProcess>
#include <QtNetwork/QSslCipher>
#include <QtWidgets/QMessageBox>
#include <QtWidgets/QScrollBar>
#include <QtWidgets/QStyle>
#include <QtWidgets/QToolButton>
#include <QtWidgets/QMessageBox>
#include <QtNetwork/QSslCipher>
#include <QCryptographicHash>
#include <QJsonDocument>
#include <QJsonObject>
#include <QDebug>
#include <QFile>
#include <QProcess>
#include <QDir>
#include <QNetworkRequest>
#include <QNetworkReply>
#include "proto.h"
#include "mainwindow.h"
#include "proto.h"
#include "ui_mainwindow.h"
static int version = 1;
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent)
{
socket = NULL;
ui = new Ui::MainWindow;
ui->setupUi(this);
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) {
socket = NULL;
ui = new Ui::MainWindow;
ui->setupUi(this);
m_isReady = true;
m_isReady = true;
secureConnect();
secureConnect();
ncards = 0;
ncards = 0;
connect(ui->loginButton, SIGNAL(clicked()),
this, SLOT(login()));
connect(ui->loginButton, SIGNAL(clicked()), this, SLOT(login()));
connect(ui->pushPlay, SIGNAL(clicked()),
this, SLOT(play()));
downloadFileFromURL("http://hearthmod.com/static/checksum", "../../hearthstone/Data/Win", E_CHECKSUM);
connect(ui->pushPlay, SIGNAL(clicked()), this, SLOT(play()));
downloadFileFromURL("http://hearthmod.com/static/checksum",
"../../hearthstone/Data/Win", E_CHECKSUM);
}
MainWindow::~MainWindow()
{
delete ui;
MainWindow::~MainWindow() { delete ui; }
void MainWindow::socketError(QAbstractSocket::SocketError) {
addLog("[Lobby]: Connection error: " + socket->errorString());
QMessageBox::critical(this, QString(socket->errorString()),
QString("Connection error"));
if (socket->error() == 13) {
return;
}
exit(0);
}
void MainWindow::socketError(QAbstractSocket::SocketError)
{
addLog("[Lobby]: Connection error: " + socket->errorString());
QMessageBox::critical(this, QString(socket->errorString()), QString("Connection error"));
if(socket->error() == 13) {
return;
}
exit(0);
}
void MainWindow::play()
{
void MainWindow::play() {
#ifdef __linux__
int r = system("cd ../../hearthstone/ && sh linux");
int r = system("cd ../../hearthstone/ && sh linux");
#elif defined(__APPLE__)
QString run = "TZ=America/New_York wine ../../hearthstone/RunAsDate.exe "
"\"05\\04\\2016\" \"" +
QDir::currentPath().replace("/", "\\") +
"\\..\\..\\hearthstone\\Hearthstone.exe\" -launch";
QByteArray ba = run.toLatin1();
int r = system(ba.data());
#else
QString run = "RunAsDate.exe \"01\\04\\2016\" \"" + QDir::currentPath().replace("/", "\\") + "\\..\\..\\hearthstone\\Hearthstone.exe\" -launch";
QByteArray ba = run.toLatin1();
int r = system(ba.data());
if(r != 0) {
addLog("Executable not found ");
}
QString run = "RunAsDate.exe \"01\\04\\2016\" \"" +
QDir::currentPath().replace("/", "\\") +
"\\..\\..\\hearthstone\\Hearthstone.exe\" -launch";
QByteArray ba = run.toLatin1();
int r = system(ba.data());
#endif
if (r != 0) {
addLog("Executable not found ");
}
}
void MainWindow::login()
{
if(ui->editUsername->text().length() < 2 || ui->editUsername->text().length() > 32 ||
ui->editPassword->text().length() < 2 || ui->editPassword->text().length() > 32
) {
addLog("[Lobby]: Username and Password must be between 2 and 32 chars");
return;
void MainWindow::login() {
if (ui->editUsername->text().length() < 2 ||
ui->editUsername->text().length() > 32 ||
ui->editPassword->text().length() < 2 ||
ui->editPassword->text().length() > 32) {
addLog("[Lobby]: Username and Password must be between 2 and 32 chars");
return;
}
QJsonDocument doc;
QJsonObject obj;
obj["user"] = ui->editUsername->text();
obj["pass"] = ui->editPassword->text();
doc.setObject(obj);
QByteArray js = doc.toJson();
char output[128];
int plen = proto.packet(output, P_LOGIN, js.data(), js.length());
socket->write(output, plen);
}
void MainWindow::socketStateChanged(QAbstractSocket::SocketState state) {
qDebug() << "state changed " << state;
}
void MainWindow::addLog(QString msg) {
if (ui->listLogs->count() > 10) {
ui->listLogs->clear();
}
ui->listLogs->addItem(msg);
}
void MainWindow::socketReadyRead() {
QByteArray qb = socket->readAll();
QJsonDocument doc(QJsonDocument::fromJson(qb));
QJsonObject json = doc.object();
qint32 type = json["type"].toInt();
qint32 error = json["error"].toInt();
QString secret = json["secret"].toString();
if (error != 0) {
switch (error) {
case 1:
case 2:
addLog(QString("[Lobby]: Incorrect login details, to create an account "
"go to hearthmod.com"));
break;
case 3:
addLog(QString("[Lobby]: No deck found, please go to hearthmod.com and "
"create your deck"));
break;
}
return;
}
QJsonDocument doc;
QJsonObject obj;
if (type == P_LOGIN) {
addLog(QString("[Lobby]: Login successful"));
addLog(QString("[Lobby]: Deck found"));
ui->editPassword->setDisabled(true);
ui->editUsername->setDisabled(true);
ui->loginButton->setDisabled(true);
ui->player1->setDisabled(true);
ui->player2->setDisabled(true);
obj["user"] = ui->editUsername->text();
obj["pass"] = ui->editPassword->text();
ui->checkDeck->setChecked(1);
ui->pushPlay->setEnabled(1);
doc.setObject(obj);
QByteArray js = doc.toJson();
char output[128];
int plen = proto.packet(output, P_LOGIN, js.data(), js.length());
socket->write(output, plen);
}
void MainWindow::socketStateChanged(QAbstractSocket::SocketState state)
{
qDebug() << "state changed " << state;
}
void MainWindow::addLog(QString msg)
{
if(ui->listLogs->count() > 10) {
ui->listLogs->clear();
}
ui->listLogs->addItem(msg);
}
void MainWindow::socketReadyRead()
{
QByteArray qb = socket->readAll();
QJsonDocument doc(QJsonDocument::fromJson(qb));
QJsonObject json = doc.object();
qint32 type = json["type"].toInt();
qint32 error = json["error"].toInt();
QString secret = json["secret"].toString();
if(error != 0) {
switch(error) {
case 1:
case 2:
addLog(QString("[Lobby]: Incorrect login details, to create an account go to hearthmod.com"));
break;
case 3:
addLog(QString("[Lobby]: No deck found, please go to hearthmod.com and create your deck"));
break;
}
return;
}
if(type == P_LOGIN) {
addLog(QString("[Lobby]: Login successful"));
addLog(QString("[Lobby]: Deck found"));
ui->editPassword->setDisabled(true);
ui->editUsername->setDisabled(true);
ui->loginButton->setDisabled(true);
ui->player1->setDisabled(true);
ui->player2->setDisabled(true);
ui->checkDeck->setChecked(1);
ui->pushPlay->setEnabled(1);
QString cmd = "Windows Registry Editor Version 5.00\n\
QString cmd = "Windows Registry Editor Version 5.00\n\
\n\
[HKEY_CURRENT_USER\\Software\\Blizzard Entertainment\\Battle.net\\Launch Options\\WTCG]\n\
\"REGION\"=\"EU\"\n\
\"HBS_TOKENX\"=\"<>\"\n\
";
cmd.replace("<>", secret);
if(ui->player1->isChecked()) {
cmd.replace("HBS_TOKENX", "HBS_TOKEN0");
#ifdef __linux__
int r = system("cp ../../hearthstone/Hearthstone_Data/Managed/player1/Assembly-CSharp.dll ../../hearthstone/Hearthstone_Data/Managed/");
if(r != 0) {
qDebug() << "couldn't copy";
}
cmd.replace("<>", secret);
if (ui->player1->isChecked()) {
cmd.replace("HBS_TOKENX", "HBS_TOKEN0");
#if defined(__linux__) || defined(__APPLE__)
// Linux or macOS-specific code
int r = system(
"cp "
"../../hearthstone/Hearthstone_Data/Managed/player1/"
"Assembly-CSharp.dll ../../hearthstone/Hearthstone_Data/Managed/");
if (r != 0) {
qDebug() << "couldn't copy";
}
#else
int r = system("copy ..\\..\\hearthstone\\Hearthstone_Data\\Managed\\player1\\Assembly-CSharp.dll ..\\..\\hearthstone\\Hearthstone_Data\\Managed\\ ");
if(r != 0) {
qDebug() << "couldn't copy";
}
int r = system(
"copy "
"..\\..\\hearthstone\\Hearthstone_Data\\Managed\\player1\\Assembly-"
"CSharp.dll ..\\..\\hearthstone\\Hearthstone_Data\\Managed\\ ");
if (r != 0) {
qDebug() << "couldn't copy";
}
#endif
} else {
cmd.replace("HBS_TOKENX", "HBS_TOKEN1");
#ifdef __linux__
int r = system("cp ../../hearthstone/Hearthstone_Data/Managed/player2/Assembly-CSharp.dll ../../hearthstone/Hearthstone_Data/Managed/");
if(r != 0) {
qDebug() << "couldn't copy";
}
#else
int r = system("copy ..\\..\\hearthstone\\Hearthstone_Data\\Managed\\player2\\Assembly-CSharp.dll ..\\..\\hearthstone\\Hearthstone_Data\\Managed\\ ");
if(r != 0) {
qDebug() << "couldn't copy";
}
#endif
}
QString filename = "tmp.reg";
QFile file(filename);
if(file.open(QIODevice::ReadWrite)) {
QTextStream stream(&file);
stream << cmd << endl;
file.close();
//qDebug() << QDir::currentPath();
#ifdef __linux__
int r = system("regedit tmp.reg");
#else
int r = system("tmp.reg");
#endif
if(r != 0) {
addLog(QString("[Lobby]: Cannot register client"));
ui->pushPlay->setEnabled(0);
}
#ifdef __linux__
r = system("rm tmp.reg");
#else
r = system("del tmp.reg");
#endif
if(r != 0) {
addLog(QString("[Lobby]: Cannot clean client"));
}
}
}
}
void MainWindow::sslErrors(const QList<QSslError> &errors)
{
socket->ignoreSslErrors();
if (socket->state() != QAbstractSocket::ConnectedState) {
socketStateChanged(socket->state());
}
}
void MainWindow::secureConnect()
{
if (!socket) {
socket = new QSslSocket(this);
connect(socket, SIGNAL(stateChanged(QAbstractSocket::SocketState)),
this, SLOT(socketStateChanged(QAbstractSocket::SocketState)));
connect(socket, SIGNAL(encrypted()),
this, SLOT(socketEncrypted()));
connect(socket, SIGNAL(error(QAbstractSocket::SocketError)),
this, SLOT(socketError(QAbstractSocket::SocketError)));
connect(socket, SIGNAL(sslErrors(QList<QSslError>)),
this, SLOT(sslErrors(QList<QSslError>)));
connect(socket, SIGNAL(readyRead()),
this, SLOT(socketReadyRead()));
}
addLog(QString("[Lobby]: Connecting to hearthmod.com"));
socket->connectToHostEncrypted("hearthmod.com", 1119);
updateEnabledState();
}
void MainWindow::socketEncrypted()
{
qDebug() << "socket encrypted";
}
void MainWindow::updateEnabledState()
{
qDebug() << "state: "<< socket->state();
}
void MainWindow::downloadFileFromURL(const QString &url, const QString &filePath, enum download_step_e step) {
if (!m_isReady)
return;
m_isReady = false;
assets_step = step;
const QString fileName = filePath + url.right(url.size() - url.lastIndexOf("/")); // your filePath should end with a forward slash "/"
m_file = new QFile();
m_file->setFileName(fileName);
m_file->open(QIODevice::WriteOnly);
if (!m_file->isOpen()) {
m_isReady = true;
addLog(QString("Couldn't open file " + fileName));
return;
}
if(assets_step == E_CHECKSUM) {
addLog(QString("[Update]: Version checking.. "));
} else {
addLog(QString("[Update]: Updating assets.. "));
cmd.replace("HBS_TOKENX", "HBS_TOKEN1");
#if defined(__linux__) || defined(__APPLE__)
// Linux or macOS-specific code
int r = system(
"cp "
"../../hearthstone/Hearthstone_Data/Managed/player2/"
"Assembly-CSharp.dll ../../hearthstone/Hearthstone_Data/Managed/");
if (r != 0) {
qDebug() << "couldn't copy";
}
#else
int r = system(
"copy "
"..\\..\\hearthstone\\Hearthstone_Data\\Managed\\player2\\Assembly-"
"CSharp.dll ..\\..\\hearthstone\\Hearthstone_Data\\Managed\\ ");
if (r != 0) {
qDebug() << "couldn't copy";
}
#endif
}
QNetworkAccessManager *manager = new QNetworkAccessManager;
QString filename = "tmp.reg";
QFile file(filename);
if (file.open(QIODevice::ReadWrite)) {
QTextStream stream(&file);
stream << cmd << endl;
file.close();
// qDebug() << QDir::currentPath();
#if defined(__linux__) || defined(__APPLE__)
// Linux or macOS-specific code
int r = system("regedit tmp.reg");
#else
int r = system("tmp.reg");
#endif
if (r != 0) {
addLog(QString("[Lobby]: Cannot register client"));
ui->pushPlay->setEnabled(0);
}
#if defined(__linux__) || defined(__APPLE__)
// Linux or macOS-specific code
r = system("rm tmp.reg");
#else
r = system("del tmp.reg");
#endif
if (r != 0) {
addLog(QString("[Lobby]: Cannot clean client"));
}
}
}
}
QNetworkRequest request;
request.setUrl(QUrl(url));
void MainWindow::sslErrors(const QList<QSslError> &errors) {
socket->ignoreSslErrors();
connect(manager, SIGNAL(finished(QNetworkReply *)), this, SLOT(onDownloadFileComplete(QNetworkReply *)));
if (socket->state() != QAbstractSocket::ConnectedState) {
socketStateChanged(socket->state());
}
}
manager->get(request);
void MainWindow::secureConnect() {
if (!socket) {
socket = new QSslSocket(this);
connect(socket, SIGNAL(stateChanged(QAbstractSocket::SocketState)), this,
SLOT(socketStateChanged(QAbstractSocket::SocketState)));
connect(socket, SIGNAL(encrypted()), this, SLOT(socketEncrypted()));
connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), this,
SLOT(socketError(QAbstractSocket::SocketError)));
connect(socket, SIGNAL(sslErrors(QList<QSslError>)), this,
SLOT(sslErrors(QList<QSslError>)));
connect(socket, SIGNAL(readyRead()), this, SLOT(socketReadyRead()));
}
addLog(QString("[Lobby]: Connecting to hearthmod.com"));
socket->connectToHostEncrypted("hearthmod.com", 1119);
updateEnabledState();
}
void MainWindow::socketEncrypted() { qDebug() << "socket encrypted"; }
void MainWindow::updateEnabledState() {
qDebug() << "state: " << socket->state();
}
void MainWindow::downloadFileFromURL(const QString &url,
const QString &filePath,
enum download_step_e step) {
if (!m_isReady)
return;
m_isReady = false;
assets_step = step;
const QString fileName =
filePath +
url.right(url.size() -
url.lastIndexOf(
"/")); // your filePath should end with a forward slash "/"
m_file = new QFile();
m_file->setFileName(fileName);
m_file->open(QIODevice::WriteOnly);
if (!m_file->isOpen()) {
m_isReady = true;
addLog(QString("Couldn't open file " + fileName));
return;
}
if (assets_step == E_CHECKSUM) {
addLog(QString("[Update]: Version checking.. "));
} else {
addLog(QString("[Update]: Updating assets.. "));
}
QNetworkAccessManager *manager = new QNetworkAccessManager;
QNetworkRequest request;
request.setUrl(QUrl(url));
connect(manager, SIGNAL(finished(QNetworkReply *)), this,
SLOT(onDownloadFileComplete(QNetworkReply *)));
manager->get(request);
}
void MainWindow::onDownloadFileComplete(QNetworkReply *reply) {
int update = 0;
int update = 0;
if (!m_file->isWritable()) {
m_isReady = true;
addLog(QString("Update couldn't complete"));
return; // TODO: error check
if (!m_file->isWritable()) {
m_isReady = true;
addLog(QString("Update couldn't complete"));
return; // TODO: error check
}
if (assets_step == E_CHECKSUM) {
// write to checksum
QString cs = reply->readAll();
if (cs.length() < 1) {
QMessageBox::critical(
this, tr("Version check"),
"Version check failed. Server is most likely offline.");
// QMessageBox::critical(this, QString(socket->errorString()),
// QString("Connection error"));
exit(0);
}
if(assets_step == E_CHECKSUM) {
// write to checksum
QString cs = reply->readAll();
if(cs.length() < 1) {
QMessageBox::critical(this, tr("Version check"), "Version check failed. Server is most likely offline.");
//QMessageBox::critical(this, QString(socket->errorString()), QString("Connection error"));
exit(0);
}
m_file->write(cs.toStdString().c_str());
m_file->close();
m_file->write(cs.toStdString().c_str());
m_file->close();
QFile f("../../hearthstone/Data/Win/local_checksum");
f.open(QFile::ReadOnly | QFile::Text);
QTextStream in(&f);
QString checksum_local = in.readAll();
f.close();
QFile f("../../hearthstone/Data/Win/local_checksum");
f.open(QFile::ReadOnly | QFile::Text);
QTextStream in(&f);
QString checksum_local = in.readAll();
f.close();
assets_step = E_ASSETS;
assets_step = E_ASSETS;
if(cs == checksum_local) {
addLog(QString("[Update]: Assets up to date."));
} else {
addLog(QString("[Update]: Update required."));
update = 1;
}
// write to local checksum
QFile f1("../../hearthstone/Data/Win/local_checksum");
f1.open(QFile::ReadWrite);
f1.write(cs.toStdString().c_str());
f1.close();
m_isReady = true;
if(update == 1) {
ui->editPassword->setDisabled(true);
ui->editUsername->setDisabled(true);
ui->loginButton->setDisabled(true);
ui->player1->setDisabled(true);
ui->player2->setDisabled(true);
downloadFileFromURL("http://hearthmod.com/static/cardxml0.unity3d", "../../hearthstone/Data/Win", E_ASSETS);
} else {
ui->checkAssets->setChecked(1);
}
if (cs == checksum_local) {
addLog(QString("[Update]: Assets up to date."));
} else {
addLog(QString("[Update]: Assets downloaded."));
m_file->write(reply->readAll());
m_file->close(); // TODO: delete the file from the system later on
m_isReady = true;
ui->editPassword->setDisabled(false);
ui->editUsername->setDisabled(false);
ui->loginButton->setDisabled(false);
ui->player1->setDisabled(false);
ui->player2->setDisabled(false);
ui->checkAssets->setChecked(1);
addLog(QString("[Update]: Update required."));
update = 1;
}
// write to local checksum
QFile f1("../../hearthstone/Data/Win/local_checksum");
f1.open(QFile::ReadWrite);
f1.write(cs.toStdString().c_str());
f1.close();
m_isReady = true;
if (update == 1) {
ui->editPassword->setDisabled(true);
ui->editUsername->setDisabled(true);
ui->loginButton->setDisabled(true);
ui->player1->setDisabled(true);
ui->player2->setDisabled(true);
downloadFileFromURL("http://hearthmod.com/static/cardxml0.unity3d",
"../../hearthstone/Data/Win", E_ASSETS);
} else {
ui->checkAssets->setChecked(1);
}
} else {
addLog(QString("[Update]: Assets downloaded."));
m_file->write(reply->readAll());
m_file->close(); // TODO: delete the file from the system later on
m_isReady = true;
ui->editPassword->setDisabled(false);
ui->editUsername->setDisabled(false);
ui->loginButton->setDisabled(false);
ui->player1->setDisabled(false);
ui->player2->setDisabled(false);
ui->checkAssets->setChecked(1);
}
}
+4 -4
View File
@@ -13,10 +13,10 @@
<property name="windowTitle">
<string>HearthMod Beta</string>
</property>
<property name="windowIcon">
<iconset>
<normaloff>../../../.wine/drive_c/games/HS3/Hearthstone_Data/wait.cur</normaloff>../../../.wine/drive_c/games/HS3/Hearthstone_Data/wait.cur</iconset>
</property>
<!-- <property name="windowIcon"> -->
<!-- <iconset> -->
<!-- <normaloff>../../../.wine/drive_c/games/HS3/Hearthstone_Data/wait.cur</normaloff>../../../.wine/drive_c/games/HS3/Hearthstone_Data/wait.cur</iconset> -->
<!-- </property> -->
<property name="autoFillBackground">
<bool>true</bool>
</property>
+192
View File
@@ -0,0 +1,192 @@
/****************************************************************************
** Meta object code from reading C++ file 'mainwindow.h'
**
** Created by: The Qt Meta Object Compiler version 67 (Qt 5.5.1)
**
** WARNING! All changes made in this file will be lost!
*****************************************************************************/
#include "mainwindow.h"
#include <QtCore/qbytearray.h>
#include <QtCore/qmetatype.h>
#include <QtCore/QList>
#if !defined(Q_MOC_OUTPUT_REVISION)
#error "The header file 'mainwindow.h' doesn't include <QObject>."
#elif Q_MOC_OUTPUT_REVISION != 67
#error "This file was generated using the moc from 5.5.1. It"
#error "cannot be used with the include files from this version of Qt."
#error "(The moc has changed too much.)"
#endif
QT_BEGIN_MOC_NAMESPACE
struct qt_meta_stringdata_MainWindow_t {
QByteArrayData data[19];
char stringdata0[261];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_MainWindow_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_MainWindow_t qt_meta_stringdata_MainWindow = {
{
QT_MOC_LITERAL(0, 0, 10), // "MainWindow"
QT_MOC_LITERAL(1, 11, 13), // "secureConnect"
QT_MOC_LITERAL(2, 25, 0), // ""
QT_MOC_LITERAL(3, 26, 18), // "socketStateChanged"
QT_MOC_LITERAL(4, 45, 28), // "QAbstractSocket::SocketState"
QT_MOC_LITERAL(5, 74, 5), // "state"
QT_MOC_LITERAL(6, 80, 15), // "socketEncrypted"
QT_MOC_LITERAL(7, 96, 9), // "sslErrors"
QT_MOC_LITERAL(8, 106, 16), // "QList<QSslError>"
QT_MOC_LITERAL(9, 123, 6), // "errors"
QT_MOC_LITERAL(10, 130, 11), // "socketError"
QT_MOC_LITERAL(11, 142, 28), // "QAbstractSocket::SocketError"
QT_MOC_LITERAL(12, 171, 15), // "socketReadyRead"
QT_MOC_LITERAL(13, 187, 18), // "updateEnabledState"
QT_MOC_LITERAL(14, 206, 22), // "onDownloadFileComplete"
QT_MOC_LITERAL(15, 229, 14), // "QNetworkReply*"
QT_MOC_LITERAL(16, 244, 5), // "reply"
QT_MOC_LITERAL(17, 250, 5), // "login"
QT_MOC_LITERAL(18, 256, 4) // "play"
},
"MainWindow\0secureConnect\0\0socketStateChanged\0"
"QAbstractSocket::SocketState\0state\0"
"socketEncrypted\0sslErrors\0QList<QSslError>\0"
"errors\0socketError\0QAbstractSocket::SocketError\0"
"socketReadyRead\0updateEnabledState\0"
"onDownloadFileComplete\0QNetworkReply*\0"
"reply\0login\0play"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_MainWindow[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
10, 14, // methods
0, 0, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
// slots: name, argc, parameters, tag, flags
1, 0, 64, 2, 0x08 /* Private */,
3, 1, 65, 2, 0x08 /* Private */,
6, 0, 68, 2, 0x08 /* Private */,
7, 1, 69, 2, 0x08 /* Private */,
10, 1, 72, 2, 0x08 /* Private */,
12, 0, 75, 2, 0x08 /* Private */,
13, 0, 76, 2, 0x08 /* Private */,
14, 1, 77, 2, 0x08 /* Private */,
17, 0, 80, 2, 0x08 /* Private */,
18, 0, 81, 2, 0x08 /* Private */,
// slots: parameters
QMetaType::Void,
QMetaType::Void, 0x80000000 | 4, 5,
QMetaType::Void,
QMetaType::Void, 0x80000000 | 8, 9,
QMetaType::Void, 0x80000000 | 11, 2,
QMetaType::Void,
QMetaType::Void,
QMetaType::Void, 0x80000000 | 15, 16,
QMetaType::Void,
QMetaType::Void,
0 // eod
};
void MainWindow::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::InvokeMetaMethod) {
MainWindow *_t = static_cast<MainWindow *>(_o);
Q_UNUSED(_t)
switch (_id) {
case 0: _t->secureConnect(); break;
case 1: _t->socketStateChanged((*reinterpret_cast< QAbstractSocket::SocketState(*)>(_a[1]))); break;
case 2: _t->socketEncrypted(); break;
case 3: _t->sslErrors((*reinterpret_cast< const QList<QSslError>(*)>(_a[1]))); break;
case 4: _t->socketError((*reinterpret_cast< QAbstractSocket::SocketError(*)>(_a[1]))); break;
case 5: _t->socketReadyRead(); break;
case 6: _t->updateEnabledState(); break;
case 7: _t->onDownloadFileComplete((*reinterpret_cast< QNetworkReply*(*)>(_a[1]))); break;
case 8: _t->login(); break;
case 9: _t->play(); break;
default: ;
}
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
switch (_id) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 1:
switch (*reinterpret_cast<int*>(_a[1])) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 0:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QAbstractSocket::SocketState >(); break;
}
break;
case 3:
switch (*reinterpret_cast<int*>(_a[1])) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 0:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QList<QSslError> >(); break;
}
break;
case 4:
switch (*reinterpret_cast<int*>(_a[1])) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 0:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QAbstractSocket::SocketError >(); break;
}
break;
case 7:
switch (*reinterpret_cast<int*>(_a[1])) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 0:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QNetworkReply* >(); break;
}
break;
}
}
}
const QMetaObject MainWindow::staticMetaObject = {
{ &QMainWindow::staticMetaObject, qt_meta_stringdata_MainWindow.data,
qt_meta_data_MainWindow, qt_static_metacall, Q_NULLPTR, Q_NULLPTR}
};
const QMetaObject *MainWindow::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *MainWindow::qt_metacast(const char *_clname)
{
if (!_clname) return Q_NULLPTR;
if (!strcmp(_clname, qt_meta_stringdata_MainWindow.stringdata0))
return static_cast<void*>(const_cast< MainWindow*>(this));
return QMainWindow::qt_metacast(_clname);
}
int MainWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QMainWindow::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 10)
qt_static_metacall(this, _c, _id, _a);
_id -= 10;
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
if (_id < 10)
qt_static_metacall(this, _c, _id, _a);
_id -= 10;
}
return _id;
}
QT_END_MOC_NAMESPACE
+170
View File
@@ -0,0 +1,170 @@
/********************************************************************************
** Form generated from reading UI file 'mainwindow.ui'
**
** Created by: Qt User Interface Compiler version 5.5.1
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/
#ifndef UI_MAINWINDOW_H
#define UI_MAINWINDOW_H
#include <QtCore/QVariant>
#include <QtWidgets/QAction>
#include <QtWidgets/QApplication>
#include <QtWidgets/QButtonGroup>
#include <QtWidgets/QCheckBox>
#include <QtWidgets/QGroupBox>
#include <QtWidgets/QHeaderView>
#include <QtWidgets/QLabel>
#include <QtWidgets/QLineEdit>
#include <QtWidgets/QListWidget>
#include <QtWidgets/QMainWindow>
#include <QtWidgets/QMenu>
#include <QtWidgets/QMenuBar>
#include <QtWidgets/QPushButton>
#include <QtWidgets/QRadioButton>
#include <QtWidgets/QStatusBar>
#include <QtWidgets/QWidget>
QT_BEGIN_NAMESPACE
class Ui_MainWindow {
public:
QAction *actionQuit;
QWidget *centralWidget;
QGroupBox *groupBox_2;
QListWidget *listLogs;
QGroupBox *lobby;
QGroupBox *groupBox;
QLineEdit *editUsername;
QLabel *label;
QLabel *label_2;
QLineEdit *editPassword;
QPushButton *loginButton;
QLabel *label_3;
QRadioButton *player1;
QRadioButton *player2;
QGroupBox *groupBox_3;
QCheckBox *checkDeck;
QPushButton *pushPlay;
QCheckBox *checkAssets;
QMenuBar *menuBar;
QMenu *menuMenu;
QMenu *menuAbout;
QStatusBar *statusBar;
void setupUi(QMainWindow *MainWindow) {
if (MainWindow->objectName().isEmpty())
MainWindow->setObjectName(QStringLiteral("MainWindow"));
MainWindow->resize(751, 431);
MainWindow->setAutoFillBackground(true);
actionQuit = new QAction(MainWindow);
actionQuit->setObjectName(QStringLiteral("actionQuit"));
centralWidget = new QWidget(MainWindow);
centralWidget->setObjectName(QStringLiteral("centralWidget"));
groupBox_2 = new QGroupBox(centralWidget);
groupBox_2->setObjectName(QStringLiteral("groupBox_2"));
groupBox_2->setGeometry(QRect(10, 190, 731, 191));
listLogs = new QListWidget(groupBox_2);
listLogs->setObjectName(QStringLiteral("listLogs"));
listLogs->setGeometry(QRect(10, 30, 711, 151));
lobby = new QGroupBox(centralWidget);
lobby->setObjectName(QStringLiteral("lobby"));
lobby->setEnabled(true);
lobby->setGeometry(QRect(10, 10, 731, 181));
groupBox = new QGroupBox(lobby);
groupBox->setObjectName(QStringLiteral("groupBox"));
groupBox->setGeometry(QRect(10, 30, 341, 141));
editUsername = new QLineEdit(groupBox);
editUsername->setObjectName(QStringLiteral("editUsername"));
editUsername->setGeometry(QRect(90, 40, 231, 25));
label = new QLabel(groupBox);
label->setObjectName(QStringLiteral("label"));
label->setGeometry(QRect(10, 40, 71, 17));
label_2 = new QLabel(groupBox);
label_2->setObjectName(QStringLiteral("label_2"));
label_2->setGeometry(QRect(10, 70, 67, 21));
editPassword = new QLineEdit(groupBox);
editPassword->setObjectName(QStringLiteral("editPassword"));
editPassword->setGeometry(QRect(90, 70, 231, 25));
editPassword->setEchoMode(QLineEdit::Password);
loginButton = new QPushButton(groupBox);
loginButton->setObjectName(QStringLiteral("loginButton"));
loginButton->setGeometry(QRect(210, 100, 111, 25));
label_3 = new QLabel(groupBox);
label_3->setObjectName(QStringLiteral("label_3"));
label_3->setGeometry(QRect(10, 100, 71, 17));
player1 = new QRadioButton(groupBox);
player1->setObjectName(QStringLiteral("player1"));
player1->setGeometry(QRect(90, 100, 41, 23));
player1->setChecked(true);
player2 = new QRadioButton(groupBox);
player2->setObjectName(QStringLiteral("player2"));
player2->setGeometry(QRect(140, 100, 41, 23));
groupBox_3 = new QGroupBox(lobby);
groupBox_3->setObjectName(QStringLiteral("groupBox_3"));
groupBox_3->setGeometry(QRect(370, 30, 351, 141));
checkDeck = new QCheckBox(groupBox_3);
checkDeck->setObjectName(QStringLiteral("checkDeck"));
checkDeck->setEnabled(false);
checkDeck->setGeometry(QRect(10, 30, 92, 23));
pushPlay = new QPushButton(groupBox_3);
pushPlay->setObjectName(QStringLiteral("pushPlay"));
pushPlay->setEnabled(false);
pushPlay->setGeometry(QRect(20, 100, 321, 31));
checkAssets = new QCheckBox(groupBox_3);
checkAssets->setObjectName(QStringLiteral("checkAssets"));
checkAssets->setEnabled(false);
checkAssets->setGeometry(QRect(10, 60, 92, 23));
MainWindow->setCentralWidget(centralWidget);
menuBar = new QMenuBar(MainWindow);
menuBar->setObjectName(QStringLiteral("menuBar"));
menuBar->setGeometry(QRect(0, 0, 751, 22));
menuMenu = new QMenu(menuBar);
menuMenu->setObjectName(QStringLiteral("menuMenu"));
menuAbout = new QMenu(menuBar);
menuAbout->setObjectName(QStringLiteral("menuAbout"));
MainWindow->setMenuBar(menuBar);
statusBar = new QStatusBar(MainWindow);
statusBar->setObjectName(QStringLiteral("statusBar"));
MainWindow->setStatusBar(statusBar);
menuBar->addAction(menuMenu->menuAction());
menuBar->addAction(menuAbout->menuAction());
menuMenu->addAction(actionQuit);
retranslateUi(MainWindow);
QMetaObject::connectSlotsByName(MainWindow);
} // setupUi
void retranslateUi(QMainWindow *MainWindow) {
MainWindow->setWindowTitle(
QApplication::translate("MainWindow", "HearthMod Beta", 0));
actionQuit->setText(QApplication::translate("MainWindow", "Quit", 0));
groupBox_2->setTitle(QApplication::translate("MainWindow", "Logs", 0));
lobby->setTitle(QApplication::translate("MainWindow", "Lobby", 0));
groupBox->setTitle(QApplication::translate("MainWindow", "Login", 0));
label->setText(QApplication::translate("MainWindow", "Username", 0));
label_2->setText(QApplication::translate("MainWindow", "Password", 0));
loginButton->setText(QApplication::translate("MainWindow", "Login", 0));
label_3->setText(QApplication::translate("MainWindow", "Player", 0));
player1->setText(QApplication::translate("MainWindow", "1", 0));
player2->setText(QApplication::translate("MainWindow", "2", 0));
groupBox_3->setTitle(QApplication::translate("MainWindow", "Game", 0));
checkDeck->setText(QApplication::translate("MainWindow", "Deck", 0));
pushPlay->setText(QApplication::translate("MainWindow", "Play!", 0));
checkAssets->setText(QApplication::translate("MainWindow", "Assets", 0));
menuMenu->setTitle(QApplication::translate("MainWindow", "Menu", 0));
menuAbout->setTitle(QApplication::translate("MainWindow", "Help", 0));
} // retranslateUi
};
namespace Ui {
class MainWindow : public Ui_MainWindow {};
} // namespace Ui
QT_END_NAMESPACE
#endif // UI_MAINWINDOW_H
-4
View File
@@ -1,6 +1,2 @@
# hm_database
hearthmod database dump
# This is not a standalone project!
[hm_database](https://github.com/farb3yonddriv3n/hm_database) is part of [hearthmod software stack](https://github.com/hearthmod/hearthmod)
-4
View File
@@ -1,4 +0,0 @@
tags
*.pyc
*.swp
*.o
+1 -1
View File
@@ -1,4 +1,4 @@
CFLAGS=-Wall -DMOD_$(mod) -g -Isrc/include -Isrc/include/proto -I../hm_base/src/include -I/usr/include/json-c/ -Iscript/mechanics/include #-DTURNOFF_TIMER -DMANA_ZERO -DTEST_DECK -DSPELL_ZERO_MANA
CFLAGS=-Wall -g -Isrc/include -Isrc/include/proto -I../hm_base/src/include -I/usr/include/json-c/ -Iscript/mechanics/include -DTURNOFF_TIMER -DMANA_ZERO #-DTEST_DECK #-DSPELL_ZERO_MANA
LIBS=-lev -lhmbase -lm -ljson-c -lcouchbase
LIBPATH=-L../hm_base/lib
TARGET=hm_gameserver
-4
View File
@@ -16,7 +16,3 @@ hm_gameserver is compatible with HearthStone client 5.2.x.
## Compilation ##
cd hm_gameserver && make
# This is not a standalone project!
[hm_gameserver](https://github.com/farb3yonddriv3n/hm_gameserver) is part of [hearthmod software stack](https://github.com/hearthmod/hearthmod)
BIN
View File
Binary file not shown.
+138
View File
@@ -0,0 +1,138 @@
destroyed_EX1_354_FLAG, 1000
spell_EX1_354_FLAG, 1000
destroyed_CS2_012_FLAG, 1000
spell_CS2_012_FLAG, 1000
destroyed_EX1_371_FLAG, 1000
buff_EX1_371_FLAG, 1000
destroyed_EX1_312_FLAG, 1000
spell_aoe_EX1_312_FLAG, 1000
destroyed_CS2_011_FLAG, 1000
buff_CS2_011_FLAG, 1000
destroyed_OG_223_FLAG, 1000
buff_OG_223_FLAG, 1000
destroyed_EX1_251_FLAG, 1000
spell_aoe_EX1_251_FLAG, 1000
destroyed_EX1_259_FLAG, 1000
spell_aoe_EX1_259_FLAG, 1000
destroyed_OG_101_FLAG, 1000
buff_OG_101_FLAG, 1000
destroyed_CS2_108_FLAG, 1000
buff_CS2_108_FLAG, 1000
destroyed_EX1_303_FLAG, 1000
spell_aoe_EX1_303_FLAG, 1000
weapon_CS2_097_FLAG, 1000
idle_CS2_097_FLAG, 1000
weapon_destroyed_CS2_097_FLAG, 1000
weapon_attack_CS2_097_FLAG, 1000
onboard_CS2_097_FLAG, 1000
spell_CS1h_001_FLAG, 1000
destroyed_NEW1_036_FLAG, 1000
buff_NEW1_036_FLAG, 1000
spell_aoe_GVG_010_FLAG, 1000
spell_aoe_CS1_112_FLAG, 1000
spell_CS2_072_FLAG, 1000
buff_CS2_077_FLAG, 1000
buff_CS2_023_FLAG, 1000
attachment_attack_EX1_607e_FLAG, 1000
defender_TB_SPT_Boss_FLAG, 1000
buff_LOEA16_9_FLAG, 1000
buff_CS2_234_FLAG, 1000
buff_PRO_001c_FLAG, 1000
attack_effect_CS2_024_FLAG, 1000
spell_CS2_024_FLAG, 1000
spell_DS1_185_FLAG, 1000
buff_CS2_063_FLAG, 1000
buff_CS2_076_FLAG, 1000
buff_AT_074_FLAG, 1000
spell_BRMA11_3_FLAG, 1000
destroyed_BRM_003_FLAG, 1000
spell_BRM_003_FLAG, 1000
destroyed_AT_001_FLAG, 1000
spell_AT_001_FLAG, 1000
buff_EX1_607_FLAG, 1000
attack_EX1_097_FLAG, 1000
battlecry_EX1_097_FLAG, 1000
buff_OG_090_FLAG, 1000
attack_EX1_011_FLAG, 1000
battlecry_EX1_011_FLAG, 1000
endturn_EX1_105_FLAG, 1000
attack_EX1_105_FLAG, 1000
attack_CS2_088_FLAG, 1000
battlecry_CS2_088_FLAG, 1000
onboard_CS2_088_FLAG, 1000
attack_EX1_158t_FLAG, 1000
attack_NAX4_03H_FLAG, 1000
attack_AT_023_FLAG, 1000
attack_CS2_168_FLAG, 1000
attack_CS2_201_FLAG, 1000
attack_CS2_200_FLAG, 1000
attack_CS2_119_FLAG, 1000
attack_CS2_172_FLAG, 1000
attack_CS2_171_FLAG, 1000
attack_CS2_182_FLAG, 1000
attack_CS2_120_FLAG, 1000
attack_EX1_506a_FLAG, 1000
attack_CS2_042_FLAG, 1000
battlecry_CS2_042_FLAG, 1000
attack_CS2_boar_FLAG, 1000
attack_CS2_237_FLAG, 1000
attack_LOE_077_FLAG, 1000
battlecry_LOE_077_FLAG, 1000
destroyed_CS2_118_FLAG, 1000
defender_CS2_118_FLAG, 1000
attack_CS2_118_FLAG, 1000
onboard_CS2_118_FLAG, 1000
destroyed_AT_128_FLAG, 1000
attack_AT_128_FLAG, 1000
attack_EX1_614_FLAG, 1000
battlecry_EX1_614_FLAG, 1000
attack_EX1_593_FLAG, 1000
battlecry_EX1_593_FLAG, 1000
attack_GVG_105_FLAG, 1000
battlecry_GVG_105_FLAG, 1000
attack_NEW1_030_FLAG, 1000
battlecry_NEW1_030_FLAG, 1000
destroyed_EX1_383_FLAG, 1000
attack_EX1_383_FLAG, 1000
onboard_EX1_383_FLAG, 1000
destroyed_CS2_065_FLAG, 1000
attack_CS2_065_FLAG, 1000
onboard_CS2_065_FLAG, 1000
destroyed_AT_018_FLAG, 1000
attack_AT_018_FLAG, 1000
onboard_AT_018_FLAG, 1000
destroyed_EX1_165t2_FLAG, 1000
attack_EX1_165t2_FLAG, 1000
onboard_EX1_165t2_FLAG, 1000
destroyed_EX1_559_FLAG, 1000
attack_EX1_559_FLAG, 1000
onboard_EX1_559_FLAG, 1000
destroyed_NEW1_011_FLAG, 1000
defender_NEW1_011_FLAG, 1000
attack_NEW1_011_FLAG, 1000
onboard_NEW1_011_FLAG, 1000
attack_CS2_226_FLAG, 1000
battlecry_CS2_226_FLAG, 1000
attack_EX1_009_FLAG, 1000
buff_EX1_581_FLAG, 1000
attack_EX1_049_FLAG, 1000
battlecry_EX1_049_FLAG, 1000
spell_aoe_EX1_400_FLAG, 1000
attack_effect_attachment_LOEA06_03e_FLAG, 1000
weapon_LOE_118_FLAG, 1000
idle_LOE_118_FLAG, 1000
weapon_destroyed_LOE_118_FLAG, 1000
weapon_attack_LOE_118_FLAG, 1000
onboard_LOE_118_FLAG, 1000
buff_LOEA06_03_FLAG, 1000
spell_aoe_CS2_026_FLAG, 1000
attack_EX1_306_FLAG, 1000
battlecry_EX1_306_FLAG, 1000
destroyed_CS2_222_FLAG, 1000
attack_CS2_222_FLAG, 1000
idle_CS2_222_FLAG, 1000
onboard_CS2_222_FLAG, 1000
destroyed_CS2_231_FLAG, 1000
attack_CS2_231_FLAG, 1000
idle_CS2_231_FLAG, 1000
onboard_CS2_231_FLAG, 1000
@@ -0,0 +1,14 @@
#ifndef SECTION_ATTACHMENT_ATTACK_H_
#define SECTION_ATTACHMENT_ATTACK_H_
#define attachment_attack_EX1_607e\
{\
int count = hsl_count_attachments(HSL_fake_deck, NULL, HSL_fake_attacker, "EX1_607e");\
if(count == 1) {\
hsl_replenish_health(HSL_fake_attacker, 1); \
}}
#define __SECTION_ATTACHMENT_ATTACK\
attachment_attack_EX1_607e\
#endif
@@ -0,0 +1,234 @@
#ifndef SECTION_ATTACK_H_
#define SECTION_ATTACK_H_
#define attack_EX1_097\
if(HSL_attacker && flag(&(HSL_attacker->state), attack_EX1_097_FLAG, FLAG_ISSET)) {\
hsl_attack(HSL_attacker, HSL_defenders, HSL_fake_levelup); \
}
#define attack_EX1_011\
if(HSL_attacker && flag(&(HSL_attacker->state), attack_EX1_011_FLAG, FLAG_ISSET)) {\
hsl_attack(HSL_attacker, HSL_defenders, HSL_fake_levelup); \
}
#define attack_EX1_105\
if(HSL_attacker && flag(&(HSL_attacker->state), attack_EX1_105_FLAG, FLAG_ISSET)) {\
hsl_attack(HSL_attacker, HSL_defenders, HSL_fake_levelup); \
}
#define attack_CS2_088\
if(HSL_attacker && flag(&(HSL_attacker->state), attack_CS2_088_FLAG, FLAG_ISSET)) {\
hsl_attack(HSL_attacker, HSL_defenders, HSL_fake_levelup); \
}
#define attack_EX1_158t\
if(HSL_attacker && flag(&(HSL_attacker->state), attack_EX1_158t_FLAG, FLAG_ISSET)) {\
hsl_attack(HSL_attacker, HSL_defenders, HSL_fake_levelup); \
}
#define attack_NAX4_03H\
if(HSL_attacker && flag(&(HSL_attacker->state), attack_NAX4_03H_FLAG, FLAG_ISSET)) {\
hsl_attack(HSL_attacker, HSL_defenders, HSL_fake_levelup); \
}
#define attack_AT_023\
if(HSL_attacker && flag(&(HSL_attacker->state), attack_AT_023_FLAG, FLAG_ISSET)) {\
hsl_attack(HSL_attacker, HSL_defenders, HSL_fake_levelup); \
}
#define attack_CS2_168\
if(HSL_attacker && flag(&(HSL_attacker->state), attack_CS2_168_FLAG, FLAG_ISSET)) {\
hsl_attack(HSL_attacker, HSL_defenders, HSL_fake_levelup); \
}
#define attack_CS2_201\
if(HSL_attacker && flag(&(HSL_attacker->state), attack_CS2_201_FLAG, FLAG_ISSET)) {\
hsl_attack(HSL_attacker, HSL_defenders, HSL_fake_levelup); \
}
#define attack_CS2_200\
if(HSL_attacker && flag(&(HSL_attacker->state), attack_CS2_200_FLAG, FLAG_ISSET)) {\
hsl_attack(HSL_attacker, HSL_defenders, HSL_fake_levelup); \
}
#define attack_CS2_119\
if(HSL_attacker && flag(&(HSL_attacker->state), attack_CS2_119_FLAG, FLAG_ISSET)) {\
hsl_attack(HSL_attacker, HSL_defenders, HSL_fake_levelup); \
}
#define attack_CS2_172\
if(HSL_attacker && flag(&(HSL_attacker->state), attack_CS2_172_FLAG, FLAG_ISSET)) {\
hsl_attack(HSL_attacker, HSL_defenders, HSL_fake_levelup); \
}
#define attack_CS2_171\
if(HSL_attacker && flag(&(HSL_attacker->state), attack_CS2_171_FLAG, FLAG_ISSET)) {\
hsl_attack(HSL_attacker, HSL_defenders, HSL_fake_levelup); \
}
#define attack_CS2_182\
if(HSL_attacker && flag(&(HSL_attacker->state), attack_CS2_182_FLAG, FLAG_ISSET)) {\
hsl_attack(HSL_attacker, HSL_defenders, HSL_fake_levelup); \
}
#define attack_CS2_120\
if(HSL_attacker && flag(&(HSL_attacker->state), attack_CS2_120_FLAG, FLAG_ISSET)) {\
hsl_attack(HSL_attacker, HSL_defenders, HSL_fake_levelup); \
}
#define attack_EX1_506a\
if(HSL_attacker && flag(&(HSL_attacker->state), attack_EX1_506a_FLAG, FLAG_ISSET)) {\
hsl_attack(HSL_attacker, HSL_defenders, HSL_fake_levelup); \
}
#define attack_CS2_042\
if(HSL_attacker && flag(&(HSL_attacker->state), attack_CS2_042_FLAG, FLAG_ISSET)) {\
hsl_attack(HSL_attacker, HSL_defenders, HSL_fake_levelup); \
}
#define attack_CS2_boar\
if(HSL_attacker && flag(&(HSL_attacker->state), attack_CS2_boar_FLAG, FLAG_ISSET)) {\
hsl_attack(HSL_attacker, HSL_defenders, HSL_fake_levelup); \
}
#define attack_CS2_237\
if(HSL_attacker && flag(&(HSL_attacker->state), attack_CS2_237_FLAG, FLAG_ISSET)) {\
hsl_attack(HSL_attacker, HSL_defenders, HSL_fake_levelup); \
}
#define attack_LOE_077\
if(HSL_attacker && flag(&(HSL_attacker->state), attack_LOE_077_FLAG, FLAG_ISSET)) {\
hsl_attack(HSL_attacker, HSL_defenders, HSL_fake_levelup); \
}
#define attack_CS2_118\
if(HSL_attacker && flag(&(HSL_attacker->state), attack_CS2_118_FLAG, FLAG_ISSET)) {\
hsl_attack(HSL_attacker, HSL_defenders, HSL_fake_levelup); \
}
#define attack_AT_128\
if(HSL_attacker && flag(&(HSL_attacker->state), attack_AT_128_FLAG, FLAG_ISSET)) {\
hsl_attack(HSL_attacker, HSL_defenders, HSL_fake_levelup); \
}
#define attack_EX1_614\
if(HSL_attacker && flag(&(HSL_attacker->state), attack_EX1_614_FLAG, FLAG_ISSET)) {\
hsl_attack(HSL_attacker, HSL_defenders, HSL_fake_levelup); \
}
#define attack_EX1_593\
if(HSL_attacker && flag(&(HSL_attacker->state), attack_EX1_593_FLAG, FLAG_ISSET)) {\
hsl_attack(HSL_attacker, HSL_defenders, HSL_fake_levelup); \
}
#define attack_GVG_105\
if(HSL_attacker && flag(&(HSL_attacker->state), attack_GVG_105_FLAG, FLAG_ISSET)) {\
hsl_attack(HSL_attacker, HSL_defenders, HSL_fake_levelup); \
}
#define attack_NEW1_030\
if(HSL_attacker && flag(&(HSL_attacker->state), attack_NEW1_030_FLAG, FLAG_ISSET)) {\
hsl_attack(HSL_attacker, HSL_defenders, HSL_fake_levelup); \
}
#define attack_EX1_383\
if(HSL_attacker && flag(&(HSL_attacker->state), attack_EX1_383_FLAG, FLAG_ISSET)) {\
hsl_attack(HSL_attacker, HSL_defenders, HSL_fake_levelup); \
}
#define attack_CS2_065\
if(HSL_attacker && flag(&(HSL_attacker->state), attack_CS2_065_FLAG, FLAG_ISSET)) {\
hsl_attack(HSL_attacker, HSL_defenders, HSL_fake_levelup); \
}
#define attack_AT_018\
if(HSL_attacker && flag(&(HSL_attacker->state), attack_AT_018_FLAG, FLAG_ISSET)) {\
hsl_attack(HSL_attacker, HSL_defenders, HSL_fake_levelup); \
}
#define attack_EX1_165t2\
if(HSL_attacker && flag(&(HSL_attacker->state), attack_EX1_165t2_FLAG, FLAG_ISSET)) {\
hsl_attack(HSL_attacker, HSL_defenders, HSL_fake_levelup); \
}
#define attack_EX1_559\
if(HSL_attacker && flag(&(HSL_attacker->state), attack_EX1_559_FLAG, FLAG_ISSET)) {\
hsl_attack(HSL_attacker, HSL_defenders, HSL_fake_levelup); \
}
#define attack_NEW1_011\
if(HSL_attacker && flag(&(HSL_attacker->state), attack_NEW1_011_FLAG, FLAG_ISSET)) {\
hsl_attack(HSL_attacker, HSL_defenders, HSL_fake_levelup); \
}
#define attack_CS2_226\
if(HSL_attacker && flag(&(HSL_attacker->state), attack_CS2_226_FLAG, FLAG_ISSET)) {\
hsl_attack(HSL_attacker, HSL_defenders, HSL_fake_levelup); \
}
#define attack_EX1_009\
if(HSL_attacker && flag(&(HSL_attacker->state), attack_EX1_009_FLAG, FLAG_ISSET)) {\
hsl_attack(HSL_attacker, HSL_defenders, HSL_fake_levelup); \
}
#define attack_EX1_049\
if(HSL_attacker && flag(&(HSL_attacker->state), attack_EX1_049_FLAG, FLAG_ISSET)) {\
hsl_attack(HSL_attacker, HSL_defenders, HSL_fake_levelup); \
}
#define attack_EX1_306\
if(HSL_attacker && flag(&(HSL_attacker->state), attack_EX1_306_FLAG, FLAG_ISSET)) {\
hsl_attack(HSL_attacker, HSL_defenders, HSL_fake_levelup); \
}
#define attack_CS2_222\
if(HSL_attacker && flag(&(HSL_attacker->state), attack_CS2_222_FLAG, FLAG_ISSET)) {\
hsl_attack(HSL_attacker, HSL_defenders, HSL_fake_levelup); \
}
#define attack_CS2_231\
if(HSL_attacker && flag(&(HSL_attacker->state), attack_CS2_231_FLAG, FLAG_ISSET)) {\
hsl_attack(HSL_attacker, HSL_defenders, HSL_fake_levelup); \
}
#define __SECTION_ATTACK\
attack_EX1_097\
attack_EX1_011\
attack_EX1_105\
attack_CS2_088\
attack_EX1_158t\
attack_NAX4_03H\
attack_AT_023\
attack_CS2_168\
attack_CS2_201\
attack_CS2_200\
attack_CS2_119\
attack_CS2_172\
attack_CS2_171\
attack_CS2_182\
attack_CS2_120\
attack_EX1_506a\
attack_CS2_042\
attack_CS2_boar\
attack_CS2_237\
attack_LOE_077\
attack_CS2_118\
attack_AT_128\
attack_EX1_614\
attack_EX1_593\
attack_GVG_105\
attack_NEW1_030\
attack_EX1_383\
attack_CS2_065\
attack_AT_018\
attack_EX1_165t2\
attack_EX1_559\
attack_NEW1_011\
attack_CS2_226\
attack_EX1_009\
attack_EX1_049\
attack_EX1_306\
attack_CS2_222\
attack_CS2_231\
#endif
@@ -0,0 +1,12 @@
#ifndef SECTION_ATTACK_EFFECT_H_
#define SECTION_ATTACK_EFFECT_H_
#define attack_effect_CS2_024\
if(HSL_attacker && flag(&(HSL_attacker->state), attack_effect_CS2_024_FLAG, FLAG_ISSET)) {\
hsl_freeze(HSL_attacker, HSL_defender) \
}
#define __SECTION_ATTACK_EFFECT\
attack_effect_CS2_024\
#endif
@@ -0,0 +1,12 @@
#ifndef SECTION_ATTACK_EFFECT_ATTACHMENT_H_
#define SECTION_ATTACK_EFFECT_ATTACHMENT_H_
#define attack_effect_attachment_LOEA06_03e\
{\
if(!is_spell(HSL_attacker) && attack > 0) { int count = hsl_count_attachments(hsl_deck(HSL_defender), NULL, HSL_defender, CN_DESOLATOR_BONUS); if(count > 0) { attack += count; } } \
}
#define __SECTION_ATTACK_EFFECT_ATTACHMENT\
attack_effect_attachment_LOEA06_03e\
#endif
@@ -0,0 +1,78 @@
#ifndef SECTION_BATTLECRY_H_
#define SECTION_BATTLECRY_H_
#define battlecry_EX1_097\
if(HSL_attacker && flag(&(HSL_attacker->state), battlecry_EX1_097_FLAG, FLAG_ISSET)) {\
def(card_s, def) def = hsl_card(HSL_target); if(def) { hsl_increase_health(HSL_attacker, default_health(def)); hsl_change_attack(HSL_attacker, default_attack(def)); hsl_destroy(hsl_deck(def), def); } \
}
#define battlecry_EX1_011\
if(HSL_attacker && flag(&(HSL_attacker->state), battlecry_EX1_011_FLAG, FLAG_ISSET)) {\
def(card_s, def) def = hsl_card(HSL_target); if(def) { hsl_heal_bc(HSL_attacker, def, 2); } \
}
#define battlecry_CS2_088\
if(HSL_attacker && flag(&(HSL_attacker->state), battlecry_CS2_088_FLAG, FLAG_ISSET)) {\
def(card_list_s, allcards) allcards = hsl_board_friendly_cards(HSL_deck_player, HSL_attacker->id, HSL_heroes_included); def(card_list_s, cl) foreach(cl, allcards) { cl->card->receive.heal = 99; } hsl_attack_aoe(attacker, allcards, HSL_fake_levelup); hsl_link_target(attacker, allcards); \
}
#define battlecry_CS2_042\
if(HSL_attacker && flag(&(HSL_attacker->state), battlecry_CS2_042_FLAG, FLAG_ISSET)) {\
def(card_s, def) def = hsl_card(HSL_target); if(def) { hsl_attack_bc(HSL_attacker, def, 3); } \
}
#define battlecry_LOE_077\
if(HSL_attacker && flag(&(HSL_attacker->state), battlecry_LOE_077_FLAG, FLAG_ISSET)) {\
hsl_summon_card(HSL_deck_player, CN_BOAR, cardholder1); hsl_summon_card(HSL_deck_player, CN_VULTURE, cardholder2); \
}
#define battlecry_EX1_614\
if(HSL_attacker && flag(&(HSL_attacker->state), battlecry_EX1_614_FLAG, FLAG_ISSET)) {\
def(card_s, def) def = hsl_card(HSL_target); if(def) { hsl_swap_health(HSL_attacker, def); } \
}
#define battlecry_EX1_593\
if(HSL_attacker && flag(&(HSL_attacker->state), battlecry_EX1_593_FLAG, FLAG_ISSET)) {\
def(card_s, def) def = hsl_card(HSL_target); if(def) { hsl_attack_bc(HSL_attacker, def, 2); } \
}
#define battlecry_GVG_105\
if(HSL_attacker && flag(&(HSL_attacker->state), battlecry_GVG_105_FLAG, FLAG_ISSET)) {\
def(card_list_s, allcards) allcards = hsl_board_friendly_cards(HSL_deck_player, HSL_attacker->id, HSL_heroes_excluded); def(card_list_s, cl) foreach(cl, allcards) { hsl_unset_exhausted(card(cl)); } \
}
#define battlecry_NEW1_030\
if(HSL_attacker && flag(&(HSL_attacker->state), battlecry_NEW1_030_FLAG, FLAG_ISSET)) {\
def(card_list_s, allcards); allcards = hsl_board_all_cards_no_boss(HSL_attacker, HSL_heroes_excluded); def(card_list_s, itm); foreach(itm, allcards) { if(card(itm)->controller == HSL_deck_player->controller) { hsl_destroy(HSL_deck_player, card(itm)); } else { hsl_destroy(HSL_deck_opponent, card(itm)); } } def(card_list_s, hand); hand = hsl_cards_get_hand(HSL_deck_player); hsl_discard_hand(HSL_deck_player, hand); \
}
#define battlecry_CS2_226\
if(HSL_attacker && flag(&(HSL_attacker->state), battlecry_CS2_226_FLAG, FLAG_ISSET)) {\
int num_minions = hsl_board_minions_count(HSL_deck_player, HSL_attacker); if(num_minions > 0) { hsl_change_attack(HSL_attacker, num_minions); hsl_increase_health(HSL_attacker, num_minions); hsl_add_single_attachment(HSL_player, HSL_deck_player, HSL_attacker, HSL_attacker); } \
}
#define battlecry_EX1_049\
if(HSL_attacker && flag(&(HSL_attacker->state), battlecry_EX1_049_FLAG, FLAG_ISSET)) {\
def(card_s, def) def = hsl_card(HSL_target); if(def) { hsl_return_to_hand(def); } \
}
#define battlecry_EX1_306\
if(HSL_attacker && flag(&(HSL_attacker->state), battlecry_EX1_306_FLAG, FLAG_ISSET)) {\
hsl_discard_random_hand(HSL_deck_player, 1, holder) \
}
#define __SECTION_BATTLECRY\
battlecry_EX1_097\
battlecry_EX1_011\
battlecry_CS2_088\
battlecry_CS2_042\
battlecry_LOE_077\
battlecry_EX1_614\
battlecry_EX1_593\
battlecry_GVG_105\
battlecry_NEW1_030\
battlecry_CS2_226\
battlecry_EX1_049\
battlecry_EX1_306\
#endif
@@ -0,0 +1,114 @@
#ifndef SECTION_BUFF_H_
#define SECTION_BUFF_H_
#define buff_EX1_371\
if(HSL_attacker && flag(&(HSL_attacker->state), buff_EX1_371_FLAG, FLAG_ISSET)) {\
hsl_divine_shield(HSL_defender); \
}
#define buff_CS2_011\
if(HSL_attacker && flag(&(HSL_attacker->state), buff_CS2_011_FLAG, FLAG_ISSET)) {\
hsl_add_attachment(HSL_player, HSL_attacker, HSL_defender, 2); \
}
#define buff_OG_223\
if(HSL_attacker && flag(&(HSL_attacker->state), buff_OG_223_FLAG, FLAG_ISSET)) {\
int change = HSL_defender->attack; hsl_buff_attack_expire(1, HSL_defender, change); hsl_add_attachment(HSL_player, HSL_attacker, HSL_defender, 1); \
}
#define buff_OG_101\
if(HSL_attacker && flag(&(HSL_attacker->state), buff_OG_101_FLAG, FLAG_ISSET)) {\
hsl_destroy(HSL_deck_player, HSL_defender); int i; for(i = 0; i < 2; i++) { hsl_summon_card(HSL_deck_player, CN_EIDOLON, cardholder); } \
}
#define buff_CS2_108\
if(HSL_attacker && flag(&(HSL_attacker->state), buff_CS2_108_FLAG, FLAG_ISSET)) {\
if(HSL_defender->controller == HSL_deck_player->controller) { hsl_destroy(HSL_deck_player, HSL_defender); } else { hsl_destroy(HSL_deck_opponent, HSL_defender); } \
}
#define buff_NEW1_036\
if(HSL_attacker && flag(&(HSL_attacker->state), buff_NEW1_036_FLAG, FLAG_ISSET)) {\
def(card_list_s, all); all = hsl_board_friendly_cards(HSL_deck_player, HSL_attacker->id, HSL_heroes_excluded); def(card_list_s, itm); foreach(itm, all) { hsl_buff_attack_expire(1, itm->card, 1); hsl_add_attachment(HSL_player, HSL_attacker, itm->card, 1); hsl_add_defender(itm->card, holder); } \
}
#define buff_CS2_077\
if(HSL_attacker && flag(&(HSL_attacker->state), buff_CS2_077_FLAG, FLAG_ISSET)) {\
hsl_draw_cards(HSL_player, HSL_deck_player, draw_card, 4); \
}
#define buff_CS2_023\
if(HSL_attacker && flag(&(HSL_attacker->state), buff_CS2_023_FLAG, FLAG_ISSET)) {\
hsl_draw_cards(HSL_player, HSL_deck_player, draw_card, 2) \
}
#define buff_LOEA16_9\
if(HSL_attacker && flag(&(HSL_attacker->state), buff_LOEA16_9_FLAG, FLAG_ISSET)) {\
hsl_refresh_mana(HSL_deck_player, 3); \
}
#define buff_CS2_234\
if(HSL_attacker && flag(&(HSL_attacker->state), buff_CS2_234_FLAG, FLAG_ISSET)) {\
hsl_destroy(hsl_deck(HSL_defender),HSL_defender); \
}
#define buff_PRO_001c\
if(HSL_attacker && flag(&(HSL_attacker->state), buff_PRO_001c_FLAG, FLAG_ISSET)) {\
def(card_list_s, allcards); allcards = hsl_board_friendly_cards(HSL_deck_player, HSL_no_attacker, HSL_heroes_excluded); def(card_list_s, cl); foreach(cl, allcards) { hsl_set_exhausted(card(cl)); } \
}
#define buff_CS2_063\
if(HSL_attacker && flag(&(HSL_attacker->state), buff_CS2_063_FLAG, FLAG_ISSET)) {\
hsl_buff_corrupt_expire(2, HSL_defender); hsl_add_attachment(HSL_player, HSL_attacker, HSL_defender, 2); \
}
#define buff_CS2_076\
if(HSL_attacker && flag(&(HSL_attacker->state), buff_CS2_076_FLAG, FLAG_ISSET)) {\
hsl_destroy(HSL_deck_opponent, HSL_defender); \
}
#define buff_AT_074\
if(HSL_attacker && flag(&(HSL_attacker->state), buff_AT_074_FLAG, FLAG_ISSET)) {\
hsl_add_attachment(HSL_player, HSL_attacker, HSL_defender, 2); hsl_set_magic_immunity(HSL_defender); \
}
#define buff_EX1_607\
if(HSL_attacker && flag(&(HSL_attacker->state), buff_EX1_607_FLAG, FLAG_ISSET)) {\
hsl_add_single_attachment(HSL_player, HSL_deck_player, HSL_attacker, HSL_defender); \
}
#define buff_OG_090\
if(HSL_attacker && flag(&(HSL_attacker->state), buff_OG_090_FLAG, FLAG_ISSET)) {\
hsl_refresh_mana(HSL_deck_player, 3); \
}
#define buff_EX1_581\
if(HSL_attacker && flag(&(HSL_attacker->state), buff_EX1_581_FLAG, FLAG_ISSET)) {\
hsl_return_to_hand(HSL_defender); \
}
#define buff_LOEA06_03\
if(HSL_attacker && flag(&(HSL_attacker->state), buff_LOEA06_03_FLAG, FLAG_ISSET)) {\
int count = hsl_count_attachments(hsl_deck(HSL_defender), NULL, HSL_defender, CN_DESOLATOR_BONUS); if(count == 0) { hsl_add_single_attachment(HSL_player, hsl_deck(HSL_defender), HSL_attacker, HSL_defender); } \
}
#define __SECTION_BUFF\
buff_EX1_371\
buff_CS2_011\
buff_OG_223\
buff_OG_101\
buff_CS2_108\
buff_NEW1_036\
buff_CS2_077\
buff_CS2_023\
buff_LOEA16_9\
buff_CS2_234\
buff_PRO_001c\
buff_CS2_063\
buff_CS2_076\
buff_AT_074\
buff_EX1_607\
buff_OG_090\
buff_EX1_581\
buff_LOEA06_03\
#endif
@@ -0,0 +1,24 @@
#ifndef SECTION_DEFENDER_H_
#define SECTION_DEFENDER_H_
#define defender_TB_SPT_Boss\
if(HSL_fake_defender && flag(&(HSL_fake_defender->state), defender_TB_SPT_Boss_FLAG, FLAG_ISSET)) {\
\
}
#define defender_CS2_118\
if(HSL_fake_defender && flag(&(HSL_fake_defender->state), defender_CS2_118_FLAG, FLAG_ISSET)) {\
/* Necromastery */ if(!(is_destroyed(HSL_fake_defender)) && level(HSL_fake_defender) >= 2) { def(deck_s, mdeck); mdeck = HSL_fake_defender->controller == HSL_deck_player->controller ? HSL_deck_player : HSL_deck_opponent ; int stacks = hsl_count_attachments(mdeck, NULL, HSL_fake_defender, CN_NECROMASTERY); if(is_destroyed(HSL_fake_attacker) && stacks < 5) { hsl_change_attack(HSL_fake_defender, 1); hsl_apply_attachment(HSL_player, mdeck, HSL_fake_defender, CN_NECROMASTERY); } } \
}
#define defender_NEW1_011\
if(HSL_fake_defender && flag(&(HSL_fake_defender->state), defender_NEW1_011_FLAG, FLAG_ISSET)) {\
if(!(is_destroyed(HSL_fake_defender)) && level(HSL_fake_defender) >= 2) { if(HSL_fake_defender->controller == HSL_deck_player->controller) { hsl_add_new_card_hand(HSL_deck_player, CN_COUNTER_HELIX, holder); } else { hsl_add_new_card_hand(HSL_deck_opponent, CN_COUNTER_HELIX, holder); } } \
}
#define __SECTION_DEFENDER\
defender_TB_SPT_Boss\
defender_CS2_118\
defender_NEW1_011\
#endif
@@ -0,0 +1,150 @@
#ifndef SECTION_DESTROYED_H_
#define SECTION_DESTROYED_H_
#define destroyed_EX1_354\
if(HSL_fake_defender && flag(&(HSL_fake_defender->state), destroyed_EX1_354_FLAG, FLAG_ISSET)) {\
hsl_add_new_card_hand(HSL_deck_player, "EX1_354", holder); \
}
#define destroyed_CS2_012\
if(HSL_fake_defender && flag(&(HSL_fake_defender->state), destroyed_CS2_012_FLAG, FLAG_ISSET)) {\
hsl_add_new_card_hand(HSL_deck_player, CN_SWIPES, holder); \
}
#define destroyed_EX1_371\
if(HSL_fake_defender && flag(&(HSL_fake_defender->state), destroyed_EX1_371_FLAG, FLAG_ISSET)) {\
hsl_add_new_card_hand(HSL_deck_player, "EX1_371", holder); \
}
#define destroyed_EX1_312\
if(HSL_fake_defender && flag(&(HSL_fake_defender->state), destroyed_EX1_312_FLAG, FLAG_ISSET)) {\
hsl_add_new_card_hand(HSL_deck_player, CN_BLACK_HOLE, holder); \
}
#define destroyed_CS2_011\
if(HSL_fake_defender && flag(&(HSL_fake_defender->state), destroyed_CS2_011_FLAG, FLAG_ISSET)) {\
hsl_add_new_card_hand(HSL_deck_player, CN_ENRAGE, holder); \
}
#define destroyed_OG_223\
if(HSL_fake_defender && flag(&(HSL_fake_defender->state), destroyed_OG_223_FLAG, FLAG_ISSET)) {\
hsl_add_new_card_hand(HSL_deck_player, CN_GODS_STRENGTH, holder); \
}
#define destroyed_EX1_251\
if(HSL_fake_defender && flag(&(HSL_fake_defender->state), destroyed_EX1_251_FLAG, FLAG_ISSET)) {\
hsl_add_new_card_hand(HSL_deck_player, CN_FORKED_LIGHTNING, holder); \
}
#define destroyed_EX1_259\
if(HSL_fake_defender && flag(&(HSL_fake_defender->state), destroyed_EX1_259_FLAG, FLAG_ISSET)) {\
hsl_add_new_card_hand(HSL_deck_player, CN_GODS_WRATH, holder); \
}
#define destroyed_OG_101\
if(HSL_fake_defender && flag(&(HSL_fake_defender->state), destroyed_OG_101_FLAG, FLAG_ISSET)) {\
hsl_add_new_card_hand(HSL_deck_player, CN_DEMONIC_CONVERSION, holder); \
}
#define destroyed_CS2_108\
if(HSL_fake_defender && flag(&(HSL_fake_defender->state), destroyed_CS2_108_FLAG, FLAG_ISSET)) {\
hsl_add_new_card_hand(HSL_deck_player, CN_CULLING_BLADE, holder); \
}
#define destroyed_EX1_303\
if(HSL_fake_defender && flag(&(HSL_fake_defender->state), destroyed_EX1_303_FLAG, FLAG_ISSET)) {\
hsl_add_new_card_hand(HSL_deck_player, CN_REQUIEM_OF_SOULS, holder); \
}
#define destroyed_NEW1_036\
if(HSL_fake_defender && flag(&(HSL_fake_defender->state), destroyed_NEW1_036_FLAG, FLAG_ISSET)) {\
hsl_add_new_card_hand(HSL_deck_player, CN_WARCRY, holder); \
}
#define destroyed_BRM_003\
if(HSL_fake_defender && flag(&(HSL_fake_defender->state), destroyed_BRM_003_FLAG, FLAG_ISSET)) {\
hsl_add_new_card_hand(HSL_deck_player, CN_DRAGONS_BREATH, holder); \
}
#define destroyed_AT_001\
if(HSL_fake_defender && flag(&(HSL_fake_defender->state), destroyed_AT_001_FLAG, FLAG_ISSET)) {\
hsl_add_new_card_hand(HSL_deck_player, CN_LAGUNA_BLADE, holder); \
}
#define destroyed_CS2_118\
if(HSL_fake_defender && flag(&(HSL_fake_defender->state), destroyed_CS2_118_FLAG, FLAG_ISSET)) {\
hsl_destroy_inhand(CN_REQUIEM_OF_SOULS); \
}
#define destroyed_AT_128\
if(HSL_fake_defender && flag(&(HSL_fake_defender->state), destroyed_AT_128_FLAG, FLAG_ISSET)) {\
hsl_summon_card(hsl_deck(HSL_fake_defender), CN_SKELETON, cardholder); \
}
#define destroyed_EX1_383\
if(HSL_fake_defender && flag(&(HSL_fake_defender->state), destroyed_EX1_383_FLAG, FLAG_ISSET)) {\
hsl_destroy_inhand(CN_WARCRY); hsl_destroy_inhand(CN_GODS_STRENGTH); \
}
#define destroyed_CS2_065\
if(HSL_fake_defender && flag(&(HSL_fake_defender->state), destroyed_CS2_065_FLAG, FLAG_ISSET)) {\
hsl_destroy_inhand(CN_DEMONIC_CONVERSION); hsl_destroy_inhand(CN_BLACK_HOLE); \
}
#define destroyed_AT_018\
if(HSL_fake_defender && flag(&(HSL_fake_defender->state), destroyed_AT_018_FLAG, FLAG_ISSET)) {\
hsl_destroy_inhand(CN_DRAGONS_BREATH); hsl_destroy_inhand(CN_LAGUNA_BLADE); \
}
#define destroyed_EX1_165t2\
if(HSL_fake_defender && flag(&(HSL_fake_defender->state), destroyed_EX1_165t2_FLAG, FLAG_ISSET)) {\
hsl_destroy_inhand(CN_ENRAGE); hsl_destroy_inhand(CN_SWIPES); \
}
#define destroyed_EX1_559\
if(HSL_fake_defender && flag(&(HSL_fake_defender->state), destroyed_EX1_559_FLAG, FLAG_ISSET)) {\
hsl_destroy_inhand(CN_FORKED_LIGHTNING); hsl_destroy_inhand(CN_GODS_WRATH); \
}
#define destroyed_NEW1_011\
if(HSL_fake_defender && flag(&(HSL_fake_defender->state), destroyed_NEW1_011_FLAG, FLAG_ISSET)) {\
hsl_destroy_inhand(CN_CULLING_BLADE); hsl_destroy_inhand(CN_COUNTER_HELIX); \
}
#define destroyed_CS2_222\
if(HSL_fake_defender && flag(&(HSL_fake_defender->state), destroyed_CS2_222_FLAG, FLAG_ISSET)) {\
def(card_list_s, all); all = hsl_board_friendly_cards(hsl_deck(HSL_fake_defender), -1, 0); def(card_list_s, itm) foreach(itm, all) { hsl_remove_attachment(hsl_deck(HSL_fake_defender), NULL, card(itm), CN_STORMWIND_CHAMP_BONUS); hsl_change_attack(card(itm), -1); hsl_decrease_health(card(itm), 1); } \
}
#define destroyed_CS2_231\
if(HSL_fake_defender && flag(&(HSL_fake_defender->state), destroyed_CS2_231_FLAG, FLAG_ISSET)) {\
def(card_list_s, tiny); tiny = hsl_cards_by_name(hsl_deck(HSL_fake_defender), CN_TINY); def(card_list_s, itm); foreach(itm, tiny) { hsl_remove_attachment(hsl_deck(card(itm)), NULL, card(itm), CN_WISP_BONUS); hsl_change_attack(card(itm), -4); hsl_decrease_health(card(itm), 4); } \
}
#define __SECTION_DESTROYED\
destroyed_EX1_354\
destroyed_CS2_012\
destroyed_EX1_371\
destroyed_EX1_312\
destroyed_CS2_011\
destroyed_OG_223\
destroyed_EX1_251\
destroyed_EX1_259\
destroyed_OG_101\
destroyed_CS2_108\
destroyed_EX1_303\
destroyed_NEW1_036\
destroyed_BRM_003\
destroyed_AT_001\
destroyed_CS2_118\
destroyed_AT_128\
destroyed_EX1_383\
destroyed_CS2_065\
destroyed_AT_018\
destroyed_EX1_165t2\
destroyed_EX1_559\
destroyed_NEW1_011\
destroyed_CS2_222\
destroyed_CS2_231\
#endif
@@ -0,0 +1,12 @@
#ifndef SECTION_ENDTURN_H_
#define SECTION_ENDTURN_H_
#define endturn_EX1_105\
{\
def(card_list_s, tiny); tiny = hsl_cards_by_name(HSL_fake_deck, CN_TINY); def(card_list_s, tc); foreach(tc, tiny) { hsl_change_attack(card(tc), 2); hsl_increase_health(card(tc), 2); hsl_add_single_attachment(HSL_player, HSL_fake_deck, card(tc), card(tc)); } \
}
#define __SECTION_ENDTURN\
endturn_EX1_105\
#endif
@@ -0,0 +1,26 @@
#ifndef SECTION_IDLE_H_
#define SECTION_IDLE_H_
#define idle_CS2_097\
{ if(is_boss(HSL_attacker) && is_weapon(HSL_deck_player, CN_DIVINE_RAPIER)) { hsl_apply_attachment(HSL_player, HSL_deck_player, HSL_attacker, CN_DIVINE_RAPIER_BONUS); hsl_change_attack(HSL_attacker, 8); } }\
#define idle_LOE_118\
{ if(is_boss(HSL_attacker) && is_weapon(HSL_deck_player, CN_ECHO_SABRE)) { hsl_set_windfury(HSL_attacker); } }\
#define idle_CS2_222\
{ int count = hsl_board_count_by_name(hsl_deck(HSL_fake_attacker), CN_STORMWIND_CHAMP); if(cmp_cardname(HSL_fake_attacker, CN_STORMWIND_CHAMP)) { count--; } if(count > 0) { int i; for(i = 0; i < count; i++) { hsl_apply_attachment(HSL_player, hsl_deck(HSL_fake_attacker), HSL_fake_attacker, CN_STORMWIND_CHAMP_BONUS); } hsl_change_attack(HSL_fake_attacker, count); hsl_increase_health(HSL_fake_attacker, count); } }\
#define idle_CS2_231\
{ if(cmp_cardname(HSL_attacker, CN_TINY)) { int wisps = hsl_board_count_by_name(HSL_deck_player, CN_WISP); if(wisps >= 1) { hsl_apply_attachment(HSL_player, HSL_deck_player, HSL_attacker, CN_WISP_BONUS); hsl_change_attack(HSL_attacker, 4); hsl_increase_health(HSL_attacker, 4); } } }\
#define __SECTION_IDLE\
idle_CS2_097\
idle_LOE_118\
idle_CS2_222\
idle_CS2_231\
#endif
@@ -0,0 +1,78 @@
#ifndef SECTION_ONBOARD_H_
#define SECTION_ONBOARD_H_
#define onboard_CS2_097\
if(HSL_attacker && flag(&(HSL_attacker->state), onboard_CS2_097_FLAG, FLAG_ISSET)) {\
def(card_list_s, all) all = hsl_board_boss_cards(HSL_deck_player); def(card_list_s, itm) foreach(itm, all) { hsl_apply_attachment(HSL_player, HSL_deck_player, itm->card, CN_DIVINE_RAPIER_BONUS); hsl_change_attack(itm->card, 8); } \
}
#define onboard_CS2_088\
if(HSL_attacker && flag(&(HSL_attacker->state), onboard_CS2_088_FLAG, FLAG_ISSET)) {\
hsl_add_new_card_hand(HSL_deck_player, "EX1_371", holder); hsl_add_new_card_hand(HSL_deck_player, "EX1_354", holder1); \
}
#define onboard_CS2_118\
if(HSL_attacker && flag(&(HSL_attacker->state), onboard_CS2_118_FLAG, FLAG_ISSET)) {\
hsl_apply_attachment(HSL_player, HSL_deck_player, HSL_attacker, LEVEL_1); \
}
#define onboard_EX1_383\
if(HSL_attacker && flag(&(HSL_attacker->state), onboard_EX1_383_FLAG, FLAG_ISSET)) {\
hsl_apply_attachment(HSL_player, HSL_deck_player, HSL_attacker, LEVEL_1); \
}
#define onboard_CS2_065\
if(HSL_attacker && flag(&(HSL_attacker->state), onboard_CS2_065_FLAG, FLAG_ISSET)) {\
hsl_apply_attachment(HSL_player, HSL_deck_player, HSL_attacker, LEVEL_1); \
}
#define onboard_AT_018\
if(HSL_attacker && flag(&(HSL_attacker->state), onboard_AT_018_FLAG, FLAG_ISSET)) {\
hsl_apply_attachment(HSL_player, HSL_deck_player, HSL_attacker, LEVEL_1); \
}
#define onboard_EX1_165t2\
if(HSL_attacker && flag(&(HSL_attacker->state), onboard_EX1_165t2_FLAG, FLAG_ISSET)) {\
hsl_apply_attachment(HSL_player, HSL_deck_player, HSL_attacker, LEVEL_1); \
}
#define onboard_EX1_559\
if(HSL_attacker && flag(&(HSL_attacker->state), onboard_EX1_559_FLAG, FLAG_ISSET)) {\
hsl_apply_attachment(HSL_player, HSL_deck_player, HSL_attacker, LEVEL_1); \
}
#define onboard_NEW1_011\
if(HSL_attacker && flag(&(HSL_attacker->state), onboard_NEW1_011_FLAG, FLAG_ISSET)) {\
hsl_apply_attachment(HSL_player, HSL_deck_player, HSL_attacker, LEVEL_1); \
}
#define onboard_LOE_118\
if(HSL_attacker && flag(&(HSL_attacker->state), onboard_LOE_118_FLAG, FLAG_ISSET)) {\
def(card_list_s, all) all = hsl_board_boss_cards(HSL_deck_player); def(card_list_s, itm) foreach(itm, all) { hsl_set_windfury(itm->card); /* card can attack again */ if(turn_plays(itm->card) == 1) { hsl_unset_exhausted(itm->card); } } \
}
#define onboard_CS2_222\
if(HSL_attacker && flag(&(HSL_attacker->state), onboard_CS2_222_FLAG, FLAG_ISSET)) {\
def(card_list_s, all); all = hsl_board_friendly_cards(HSL_deck_player, HSL_attacker->id, 0); def(card_list_s, itm); foreach(itm, all) { hsl_apply_attachment(HSL_player, HSL_deck_player, card(itm), CN_STORMWIND_CHAMP_BONUS); hsl_change_attack(card(itm), 1); hsl_increase_health(card(itm), 1); } \
}
#define onboard_CS2_231\
if(HSL_attacker && flag(&(HSL_attacker->state), onboard_CS2_231_FLAG, FLAG_ISSET)) {\
def(card_list_s, tiny); tiny = hsl_cards_by_name(HSL_deck_player, CN_TINY); def(card_list_s, itm); foreach(itm, tiny) { hsl_apply_attachment(HSL_player, HSL_deck_player, card(itm), CN_WISP_BONUS); hsl_change_attack(card(itm), 4); hsl_increase_health(card(itm), 4); } \
}
#define __SECTION_ONBOARD\
onboard_CS2_097\
onboard_CS2_088\
onboard_CS2_118\
onboard_EX1_383\
onboard_CS2_065\
onboard_AT_018\
onboard_EX1_165t2\
onboard_EX1_559\
onboard_NEW1_011\
onboard_LOE_118\
onboard_CS2_222\
onboard_CS2_231\
#endif
@@ -0,0 +1,60 @@
#ifndef SECTION_SPELL_H_
#define SECTION_SPELL_H_
#define spell_EX1_354\
if(HSL_attacker && flag(&(HSL_attacker->state), spell_EX1_354_FLAG, FLAG_ISSET)) {\
hsl_receive_heal(HSL_defender, 2); hsl_attack(HSL_attacker, HSL_defenders, HSL_fake_levelup); \
}
#define spell_CS2_012\
if(HSL_attacker && flag(&(HSL_attacker->state), spell_CS2_012_FLAG, FLAG_ISSET)) {\
/* Wounded multiplies damage */ int count = hsl_count_attachments(HSL_deck_player, HSL_deck_opponent, HSL_defender, CN_WOUNDED); hsl_receive_damage(HSL_defender, 2 + count * 2); /* Wounded lasts 6 rounds */ hsl_add_attachment(HSL_opponent, HSL_attacker, HSL_defender, 6); hsl_attack(HSL_attacker, HSL_defenders, HSL_fake_levelup); \
}
#define spell_CS1h_001\
if(HSL_attacker && flag(&(HSL_attacker->state), spell_CS1h_001_FLAG, FLAG_ISSET)) {\
hsl_receive_heal(HSL_defender, 2); hsl_attack(HSL_attacker, HSL_defenders, HSL_fake_levelup); \
}
#define spell_CS2_072\
if(HSL_attacker && flag(&(HSL_attacker->state), spell_CS2_072_FLAG, FLAG_ISSET)) {\
hsl_receive_damage(HSL_defender, 2); hsl_attack(HSL_attacker, HSL_defenders, HSL_fake_levelup); \
}
#define spell_CS2_024\
if(HSL_attacker && flag(&(HSL_attacker->state), spell_CS2_024_FLAG, FLAG_ISSET)) {\
hsl_receive_damage(HSL_defender, 3); hsl_attack(HSL_attacker, HSL_defenders, HSL_fake_levelup); \
}
#define spell_DS1_185\
if(HSL_attacker && flag(&(HSL_attacker->state), spell_DS1_185_FLAG, FLAG_ISSET)) {\
hsl_receive_damage(HSL_defender, 2); hsl_attack(HSL_attacker, HSL_defenders, HSL_fake_levelup); \
}
#define spell_BRMA11_3\
if(HSL_attacker && flag(&(HSL_attacker->state), spell_BRMA11_3_FLAG, FLAG_ISSET)) {\
hsl_receive_damage(HSL_defender, 2); hsl_attack(HSL_attacker, HSL_defenders, HSL_fake_levelup); \
}
#define spell_BRM_003\
if(HSL_attacker && flag(&(HSL_attacker->state), spell_BRM_003_FLAG, FLAG_ISSET)) {\
hsl_receive_damage(HSL_defender, 2); hsl_attack(HSL_attacker, HSL_defenders, HSL_fake_levelup); \
}
#define spell_AT_001\
if(HSL_attacker && flag(&(HSL_attacker->state), spell_AT_001_FLAG, FLAG_ISSET)) {\
hsl_receive_damage(HSL_defender, 10); hsl_attack(HSL_attacker, HSL_defenders, HSL_fake_levelup); \
}
#define __SECTION_SPELL\
spell_EX1_354\
spell_CS2_012\
spell_CS1h_001\
spell_CS2_072\
spell_CS2_024\
spell_DS1_185\
spell_BRMA11_3\
spell_BRM_003\
spell_AT_001\
#endif
@@ -0,0 +1,54 @@
#ifndef SECTION_SPELL_AOE_H_
#define SECTION_SPELL_AOE_H_
#define spell_aoe_EX1_312\
if(HSL_attacker && flag(&(HSL_attacker->state), spell_aoe_EX1_312_FLAG, FLAG_ISSET)) {\
def(card_list_s, e) e = hsl_board_enemy_cards(HSL_attacker, HSL_heroes_excluded, HSL_magic_immunity_excluded); def(card_list_s, cl) foreach(cl, e) { hsl_receive_damage(card(cl), 1); } hsl_attack_aoe(HSL_attacker, e, HSL_fake_levelup); hsl_link_target(HSL_attacker, e); \
}
#define spell_aoe_EX1_251\
if(HSL_attacker && flag(&(HSL_attacker->state), spell_aoe_EX1_251_FLAG, FLAG_ISSET)) {\
def(card_list_s, e) e = hsl_board_enemy_cards(HSL_attacker, HSL_heroes_excluded, HSL_magic_immunity_excluded); def(card_list_s, cl) foreach(cl, e) { hsl_receive_damage(card(cl), 1); } hsl_attack_aoe(HSL_attacker, e, HSL_fake_levelup); hsl_link_target(HSL_attacker, e); \
}
#define spell_aoe_EX1_259\
if(HSL_attacker && flag(&(HSL_attacker->state), spell_aoe_EX1_259_FLAG, FLAG_ISSET)) {\
def(card_list_s, e) e = hsl_board_enemy_cards(HSL_attacker, HSL_heroes_excluded, HSL_magic_immunity_excluded); def(card_list_s, cl) foreach(cl, e) { hsl_receive_damage(card(cl), 3); } hsl_attack_aoe(HSL_attacker, e, HSL_fake_levelup); hsl_link_target(HSL_attacker, e); \
}
#define spell_aoe_EX1_303\
if(HSL_attacker && flag(&(HSL_attacker->state), spell_aoe_EX1_303_FLAG, FLAG_ISSET)) {\
def(card_s, shadow_fiend); shadow_fiend = hsl_card_board_by_name(HSL_player, HSL_deck_player, CN_SHADOW_FIEND); if(shadow_fiend) { int count = hsl_count_attachments(HSL_deck_player, NULL, shadow_fiend, CN_NECROMASTERY); def(card_list_s, e) e = hsl_board_enemy_cards(HSL_attacker, HSL_heroes_excluded, HSL_magic_immunity_excluded); def(card_list_s, cl) foreach(cl, e) { hsl_receive_damage(card(cl), count); } hsl_attack_aoe(HSL_attacker, e, HSL_fake_levelup); hsl_link_target(HSL_attacker, e); } \
}
#define spell_aoe_GVG_010\
if(HSL_attacker && flag(&(HSL_attacker->state), spell_aoe_GVG_010_FLAG, FLAG_ISSET)) {\
hsl_refresh_mana(HSL_deck_player, 2); def(card_list_s, allcards) allcards = hsl_board_friendly_cards(HSL_deck_player, HSL_attacker->id, HSL_heroes_excluded); def(card_list_s, cl) foreach(cl, allcards) { hsl_receive_heal(card(cl), 2); } hsl_attack_aoe(HSL_attacker, allcards, HSL_fake_levelup); hsl_link_target(HSL_attacker, allcards); \
}
#define spell_aoe_CS1_112\
if(HSL_attacker && flag(&(HSL_attacker->state), spell_aoe_CS1_112_FLAG, FLAG_ISSET)) {\
def(card_list_s, allcards) allcards = hsl_board_friendly_cards(HSL_deck_player, HSL_attacker->id, HSL_heroes_excluded); def(card_list_s, cl) foreach(cl, allcards) { cl->card->receive.heal = 2; } hsl_attack_aoe(HSL_attacker, allcards, HSL_fake_levelup); hsl_link_target(HSL_attacker, allcards); \
}
#define spell_aoe_EX1_400\
if(HSL_attacker && flag(&(HSL_attacker->state), spell_aoe_EX1_400_FLAG, FLAG_ISSET)) {\
def(card_list_s, e) e = hsl_board_enemy_cards(HSL_attacker, HSL_heroes_excluded, HSL_magic_immunity_included); def(card_list_s, cl) foreach(cl, e) { hsl_receive_damage(card(cl), 1); } hsl_attack_aoe(HSL_attacker, e, HSL_fake_levelup); hsl_link_target(HSL_attacker, e); \
}
#define spell_aoe_CS2_026\
if(HSL_attacker && flag(&(HSL_attacker->state), spell_aoe_CS2_026_FLAG, FLAG_ISSET)) {\
def(card_list_s, e) e = hsl_board_enemy_cards(HSL_attacker, HSL_heroes_excluded, HSL_magic_immunity_excluded); int count = hsl_count_cards(e); if(count > 0) { def(card_s, card) card = hsl_random_card(e); def(card_list_s, cl) foreach(cl, e) { hsl_receive_damage(card(cl), 1); } if(card) { hsl_freeze(HSL_attacker, card); } } hsl_attack_aoe(HSL_attacker, e, HSL_fake_levelup); hsl_link_target(HSL_attacker, e); \
}
#define __SECTION_SPELL_AOE\
spell_aoe_EX1_312\
spell_aoe_EX1_251\
spell_aoe_EX1_259\
spell_aoe_EX1_303\
spell_aoe_GVG_010\
spell_aoe_CS1_112\
spell_aoe_EX1_400\
spell_aoe_CS2_026\
#endif
@@ -0,0 +1,18 @@
#ifndef SECTION_WEAPON_H_
#define SECTION_WEAPON_H_
#define weapon_CS2_097\
if(HSL_attacker && flag(&(HSL_attacker->state), weapon_CS2_097_FLAG, FLAG_ISSET)) {\
hsl_give_weapon(HSL_deck_player); \
}
#define weapon_LOE_118\
if(HSL_attacker && flag(&(HSL_attacker->state), weapon_LOE_118_FLAG, FLAG_ISSET)) {\
hsl_give_weapon(HSL_deck_player); \
}
#define __SECTION_WEAPON\
weapon_CS2_097\
weapon_LOE_118\
#endif
@@ -0,0 +1,18 @@
#ifndef SECTION_WEAPON_ATTACK_H_
#define SECTION_WEAPON_ATTACK_H_
#define weapon_attack_CS2_097\
if(HSL_fake_weapon && flag(&(HSL_fake_weapon->state), weapon_attack_CS2_097_FLAG, FLAG_ISSET)) {\
if(HSL_fake_weapon) { hsl_set_weapon_durability(HSL_fake_weapon, -1); if(hsl_weapon_durability(HSL_fake_weapon) == 0) { hsl_destroy_weapon(HSL_fake_weapon, HSL_fake_deck); } hsl_add_defender(HSL_fake_weapon, holder); } \
}
#define weapon_attack_LOE_118\
if(HSL_fake_weapon && flag(&(HSL_fake_weapon->state), weapon_attack_LOE_118_FLAG, FLAG_ISSET)) {\
if(HSL_fake_weapon) { hsl_set_weapon_durability(HSL_fake_weapon, -1); if(hsl_weapon_durability(HSL_fake_weapon) == 0) { hsl_destroy_weapon(HSL_fake_weapon, HSL_fake_deck); } hsl_add_defender(HSL_fake_weapon, holder); } \
}
#define __SECTION_WEAPON_ATTACK\
weapon_attack_CS2_097\
weapon_attack_LOE_118\
#endif
@@ -0,0 +1,18 @@
#ifndef SECTION_WEAPON_DESTROYED_H_
#define SECTION_WEAPON_DESTROYED_H_
#define weapon_destroyed_CS2_097\
if(HSL_fake_weapon && flag(&(HSL_fake_weapon->state), weapon_destroyed_CS2_097_FLAG, FLAG_ISSET)) {\
def(card_list_s, all) all = hsl_board_boss_cards(HSL_deck_player); def(card_list_s, itm) foreach(itm, all) { hsl_remove_attachment(HSL_deck_player, NULL, itm->card, CN_DIVINE_RAPIER_BONUS); hsl_change_attack(itm->card, -8); hsl_add_defender(itm->card, holder); } \
}
#define weapon_destroyed_LOE_118\
if(HSL_fake_weapon && flag(&(HSL_fake_weapon->state), weapon_destroyed_LOE_118_FLAG, FLAG_ISSET)) {\
def(card_list_s, all) all = hsl_board_boss_cards(HSL_deck_player); def(card_list_s, itm) foreach(itm, all) { hsl_unset_windfury(itm->card); if(turn_plays(itm->card) > 0) { hsl_set_exhausted(itm->card); } hsl_add_defender(itm->card, holder); } \
}
#define __SECTION_WEAPON_DESTROYED\
weapon_destroyed_CS2_097\
weapon_destroyed_LOE_118\
#endif
+2 -2
View File
@@ -70,7 +70,7 @@ if __name__ == "__main__":
p = parser.parser()
cb = Bucket('couchbase://localhost/hbs', password='aci')
loaded = cb.get('u:mod_dota').value
loaded = cb.get('u:mod_woa').value
for c in loaded['cards']:
@@ -78,7 +78,7 @@ if __name__ == "__main__":
for k in c:
if k[0] == '__name':
name = k[1]
if k[0] == '__code': # code comes later than name
if k[0] == '__code': # code comes laters than name
p.parse_card(k[1], name)
'''
+330
View File
@@ -0,0 +1,330 @@
#include <flag_def.h>
int flag_defs[MAX_FLAGS_DEF] = {
1000, // index 0
1000, // index 1
1000, // index 2
1000, // index 3
1000, // index 4
1000, // index 5
1000, // index 6
1000, // index 7
1000, // index 8
1000, // index 9
1000, // index 10
1000, // index 11
1000, // index 12
1000, // index 13
1000, // index 14
1000, // index 15
1001, // index 16
1000, // index 17
1000, // index 18
1000, // index 19
1000, // index 20
1000, // index 21
1000, // index 22
1000, // index 23
1000, // index 24
1000, // index 25
1000, // index 26
1000, // index 27
1000, // index 28
1000, // index 29
1000, // index 30
1000, // index 31
1000, // index 32
1000, // index 33
1000, // index 34
1000, // index 35
1000, // index 36
1000, // index 37
1000, // index 38
1000, // index 39
1000, // index 40
1000, // index 41
1000, // index 42
1000, // index 43
1000, // index 44
1000, // index 45
1000, // index 46
1000, // index 47
1000, // index 48
1000, // index 49
1000, // index 50
1000, // index 51
1000, // index 52
1000, // index 53
1000, // index 54
1000, // index 55
1000, // index 56
1000, // index 57
1000, // index 58
1000, // index 59
1000, // index 60
1000, // index 61
1000, // index 62
1000, // index 63
1000, // index 64
1000, // index 65
1000, // index 66
1000, // index 67
1000, // index 68
1000, // index 69
1000, // index 70
1000, // index 71
1000, // index 72
1000, // index 73
1000, // index 74
1000, // index 75
1000, // index 76
1000, // index 77
1000, // index 78
1000, // index 79
1000, // index 80
1000, // index 81
1000, // index 82
1000, // index 83
1000, // index 84
1000, // index 85
1000, // index 86
1000, // index 87
1000, // index 88
1000, // index 89
1000, // index 90
1000, // index 91
1000, // index 92
1000, // index 93
1000, // index 94
1000, // index 95
1000, // index 96
1000, // index 97
1000, // index 98
1000, // index 99
1000, // index 100
1000, // index 101
1000, // index 102
1000, // index 103
1000, // index 104
1000, // index 105
1000, // index 106
1000, // index 107
1000, // index 108
1000, // index 109
1000, // index 110
1000, // index 111
1000, // index 112
1000, // index 113
1000, // index 114
1000, // index 115
1000, // index 116
1000, // index 117
1000, // index 118
1000, // index 119
1000, // index 120
1000, // index 121
1000, // index 122
1000, // index 123
1000, // index 124
1000, // index 125
1000, // index 126
1000, // index 127
1000, // index 128
1000, // index 129
1000, // index 130
1000, // index 131
1000, // index 132
1000, // index 133
1000, // index 134
1000, // index 135
1000, // index 136
1000, // index 137
1000, // index 138
1000, // index 139
1000, // index 140
1000, // index 141
1000, // index 142
1000, // index 143
1000, // index 144
1000, // index 145
1000, // index 146
1000, // index 147
1000, // index 148
1000, // index 149
1000, // index 150
1000, // index 151
1000, // index 152
1000, // index 153
1000, // index 154
1000, // index 155
1000, // index 156
1000, // index 157
1000, // index 158
1000, // index 159
1000, // index 160
1000, // index 161
1000, // index 162
1000, // index 163
1000, // index 164
1000, // index 165
1000, // index 166
1000, // index 167
1000, // index 168
1000, // index 169
1000, // index 170
1000, // index 171
1000, // index 172
1000, // index 173
1000, // index 174
1000, // index 175
1000, // index 176
1000, // index 177
1000, // index 178
1000, // index 179
1000, // index 180
1000, // index 181
1000, // index 182
1000, // index 183
1000, // index 184
1000, // index 185
1000, // index 186
1000, // index 187
1000, // index 188
1000, // index 189
1000, // index 190
1000, // index 191
1000, // index 192
1000, // index 193
1000, // index 194
1000, // index 195
1000, // index 196
1000, // index 197
1000, // index 198
1000, // index 199
1000, // index 200
1000, // index 201
1000, // index 202
1000, // index 203
1000, // index 204
1000, // index 205
1000, // index 206
1000, // index 207
1000, // index 208
1000, // index 209
1000, // index 210
1000, // index 211
1000, // index 212
1000, // index 213
1000, // index 214
1000, // index 215
1000, // index 216
1000, // index 217
1000, // index 218
1000, // index 219
1000, // index 220
1000, // index 221
1000, // index 222
1000, // index 223
1000, // index 224
1000, // index 225
1000, // index 226
1000, // index 227
1000, // index 228
1000, // index 229
1000, // index 230
1000, // index 231
1000, // index 232
1000, // index 233
1000, // index 234
1000, // index 235
1000, // index 236
1000, // index 237
1000, // index 238
1000, // index 239
1000, // index 240
1000, // index 241
1000, // index 242
1000, // index 243
1000, // index 244
1000, // index 245
1000, // index 246
1000, // index 247
1000, // index 248
1000, // index 249
1000, // index 250
1000, // index 251
1000, // index 252
1000, // index 253
1000, // index 254
1000, // index 255
1000, // index 256
1000, // index 257
1000, // index 258
1000, // index 259
1000, // index 260
1000, // index 261
1000, // index 262
1000, // index 263
1000, // index 264
1000, // index 265
1000, // index 266
1000, // index 267
1000, // index 268
1000, // index 269
1000, // index 270
1000, // index 271
1000, // index 272
1000, // index 273
1000, // index 274
1000, // index 275
1000, // index 276
1000, // index 277
1000, // index 278
1000, // index 279
1000, // index 280
1000, // index 281
1000, // index 282
1000, // index 283
1000, // index 284
1000, // index 285
1000, // index 286
1000, // index 287
1000, // index 288
1000, // index 289
1000, // index 290
1000, // index 291
1000, // index 292
1000, // index 293
1000, // index 294
1000, // index 295
1000, // index 296
1000, // index 297
1000, // index 298
1000, // index 299
1000, // index 300
1000, // index 301
1000, // index 302
1000, // index 303
1000, // index 304
1000, // index 305
1000, // index 306
1000, // index 307
1000, // index 308
1000, // index 309
1000, // index 310
1000, // index 311
1000, // index 312
1000, // index 313
1000, // index 314
1000, // index 315
1000, // index 316
1000, // index 317
1000, // index 318
1000, // index 319
1000, // index 320
1000, // index 321
1000, // index 322
1000, // index 323
1000, // index 324
1000, // index 325
};
+3 -4
View File
@@ -15,7 +15,6 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <mods.h>
#include <game.h>
enum board_e {
@@ -136,8 +135,8 @@ static void retrieve_deck_cb(struct cbop_s *cbop)
char key1[128], key2[128];
snprintf(key1, sizeof(key1), "u:deck_%s_%s", MOD_URL, w->p1->hbs_id);
snprintf(key2, sizeof(key2), "u:deck_%s_%s", MOD_URL, w->p2->hbs_id);
snprintf(key1, sizeof(key1), "u:deck_%s", w->p1->hbs_id);
snprintf(key2, sizeof(key2), "u:deck_%s", w->p2->hbs_id);
assert(hp);
@@ -202,7 +201,7 @@ void retrieve_deck(struct watcher_s *w, int player)
k = w->p2->hbs_id;
}
snprintf(key, sizeof(key), "u:deck_%s_%s", MOD_URL, k);
snprintf(key, sizeof(key), "u:deck_%s", k);
hm_log(LOG_DEBUG, lg, "Retrieving deck for player: %d", player);
+335
View File
@@ -0,0 +1,335 @@
#ifndef FLAG_DEF_H_
#define FLAG_DEF_H_
#define MAX_FLAGS_DEF 326
int flag_defs[MAX_FLAGS_DEF];
enum flags_e {
MECHANICS_DAMAGE = 0,
MECHANICS_HEALTH = 1,
MECHANICS_ATTACK = 2,
MECHANICS_ATTACK_DAMAGE = 3,
MECHANICS_ATTACK_HEAL = 4,
MECHANICS_HEROPOWER = 5,
MECHANICS_BATTLECRY_TRIGGER = 6,
MECHANICS_CHANGESIDES = 7,
MECHANICS_ARMOR = 8,
MECHANICS_DURABILITY = 9,
MECHANICS_DETACH = 10,
MECHANICS_SELECTED = 11,
MECHANICS_DESTROY_WEAPON = 12,
MECHANICS_TURN_TRIGGER = 13,
MECHANICS_COST = 14,
CARD_HAND = 15,
CARD_DESTROYED = 16,
CARD_BOARD = 17,
CARD_EXHAUSTED = 18,
CARD_HERO = 19,
CARD_HEROPOWER = 20,
CARD_HEROWEAPON = 21,
CARD_BOSS = 22,
CARD_TARGETING = 23,
CARD_NONTARGET = 24,
CARD_NONTARGET_BC = 25,
CARD_SPELL = 26,
CARD_SPELL_HEAL = 27,
CARD_SPELL_DAMAGE = 28,
CARD_HP_REINFORCE = 29,
CARD_HP_DAGGERMASTERY = 30,
CARD_HP_ARMORUP = 31,
CARD_HP_LIFETAP = 32,
CARD_HP_SHAPESHIFT = 33,
CARD_WINDFURY = 34,
CARD_DECK = 35,
CARD_TARGET_HERO = 36,
CARD_TARGET_MINIONS = 37,
CARD_TARGET_ENEMY_HERO = 38,
CARD_TARGET_ENEMY_MINIONS = 39,
CARD_TARGET_ALLY_HERO = 40,
CARD_TARGET_ALLY_MINIONS = 41,
CARD_TARGET_ALLY = 42,
CARD_TARGET_ENEMY = 43,
CARD_TARGET_ALL = 44,
CARD_HP_SPELL_DAMAGE = 45,
CARD_INNERFIRE = 46,
CARD_AOE_ENEMY_MINIONS = 47,
CARD_AOE_ALLENEMY = 48,
CARD_CHARGE = 49,
CARD_DIVINE_SHIELD = 50,
CARD_FREEZE = 51,
CARD_FROZEN = 52,
CARD_TARGET_FROZEN_4_DMG = 53,
CARD_BATTLECRY = 54,
CARD_BATTLECRY_DAMAGE3_ENEMY_HERO = 55,
CARD_BATTLECRY_TARGET = 56,
CARD_BATTLECRY_HEAL2_TARGET = 57,
CARD_BATTLECRY_DRAW1_CARD = 58,
CARD_DRAW2_CARD = 59,
CARD_DRAW4_CARD = 60,
CARD_DRAW_CARD = 61,
CARD_MINION = 62,
CARD_BUFF = 63,
CARD_DIVINESPIRIT = 64,
CARD_AOE = 65,
CARD_AOE_TARGET_ALL = 66,
CARD_HEAL_ALLIES = 67,
CARD_BATTLECRY_DAMAGE1_ALL = 68,
CARD_AOE_MINIONS = 69,
CARD_SUMMON = 70,
CARD_WEAPON_ROCKBITER = 71,
CARD_WEAPON = 72,
CARD_BOARD_WEAPON = 73,
CARD_SUMMON_CS2_MIRROR = 74,
CARD_BLESSING_OF_KINGS = 75,
CARD_BLOODLUST = 76,
CARD_BUFF_AOE = 77,
CARD_CORRUPTION = 78,
CARD_CORRUPTED = 79,
CARD_ATTACHMENT = 80,
CARD_RAID_LEADER = 81,
CARD_AURA = 82,
CARD_STORMWIND_CHAMPION = 83,
CARD_RACE_BEAST = 84,
CARD_RACE_MURLOC = 85,
CARD_TAUNT = 86,
CARD_SPELLPOWER = 87,
CARD_SAP = 88,
CARD_VANISH = 89,
CARD_SUMMON_ANIMAL_COMPANION = 90,
CARD_UNCOLLECTIBLE = 91,
CARD_BATTLECRY_SUMMON_DRAGONLING_MECHANIC = 92,
CARD_RACE_MECH = 93,
CARD_LEOKK = 94,
CARD_BATTLECRY_SUMMON_MURLOC_SCOUT = 95,
CARD_BATTLECRY_SUMMON_BOAR = 96,
CARD_BATTLECRY_SUMMON = 97,
CARD_RACE_TOTEM = 98,
CARD_RACE_DEMON = 99,
CARD_TURN_HEAL1_MINIONS = 100,
CARD_TOTEMIC_CALL_CHILD = 101,
CARD_HP_TOTEMIC_CALL = 102,
CARD_BATTLECRY_HEAL2_ALIES = 103,
CARD_BATTLECRY_HEAL6_ALLY_HERO = 104,
CARD_BATTLECRY_DAMAGE1_TARGET = 105,
CARD_BATTLECRY_DAMAGE2_TARGET = 106,
CARD_BATTLECRY_DAMAGE3_TARGET = 107,
CARD_BATTLECRY_FROSTWOLF_WARLORD = 108,
CARD_BATTLECRY_DISCARD1_CARD = 109,
CARD_DISCARD = 110,
CARD_MIND_CONTROL = 111,
CARD_AOE_CLEAVE = 112,
CARD_FAN_OF_KNIVES = 113,
CARD_KILL_COMMAND = 114,
CARD_MIND_VISION = 115,
CARD_DAMAGE_DRAW_CARD = 116,
CARD_SOULFIRE = 117,
CARD_MORTAL_COIL = 118,
CARD_DRAW1_CARD = 119,
CARD_ARMOR5 = 120,
CARD_TRUESILVER_CHAMPION = 121,
CARD_STARVING_BUZZARD = 122,
CARD_SAVAGE_ROAR = 123,
CARD_WARSONG_COMMANDER = 124,
CARD_TIMBER_WOLF = 125,
CARD_FLAMETONGUE_TOTEM = 126,
CARD_GURU_BERSERKER = 127,
CARD_CLAW = 128,
CARD_MARK_OF_THE_WILD = 129,
CARD_HUNTERS_MARK = 130,
CARD_AOE_MULTISHOT = 131,
CARD_ANCESTRAL_HEALING = 132,
CARD_ROCKBITER_WEAPON = 133,
CARD_DRAIN_LIFE = 134,
CARD_SINISTER_STRIKE = 135,
CARD_ASSASINATE = 136,
CARD_MIND_BLAST = 137,
CARD_HAND_OF_PROTECTION = 138,
CARD_CHARGE_BUFF = 139,
CARD_HEROIC_STRIKE = 140,
CARD_EXECUTE = 141,
CARD_SHADOW_WORD_DEATH = 142,
CARD_SHADOW_WORD_PAIN = 143,
CARD_SACRIFITIAL_PACT = 144,
CARD_BATTLECRY_DESTROY_ENEMY_WEAPON = 145,
CARD_POWER_WORD_SHIELD = 146,
CARD_SWIPE = 147,
CARD_ARCANE_MISSILES = 148,
CARD_TRACKING = 149,
CARD_TRANSFORM = 150,
CARD_POLYMORPH = 151,
CARD_HIDE = 152,
CARD_LINKED = 153,
CARD_HEX = 154,
CARD_TARGET_UNDAMAGED_MINION = 155,
CARD_TARGET_DAMAGED_MINION = 156,
CARD_TARGET_3ATTACK_LESS = 157,
CARD_TARGET_5ATTACK_MORE = 158,
CARD_TARGET_30PERCENT_LESS = 159,
CARD_TARGET_DEMON = 160,
CARD_BLESSING_OF_MIGHT = 161,
CARD_TARGET_UNDAMAGED = 162,
CARD_ARCHMAGE_ANTONIDAS = 163,
CARD_TARGET_BC_AUTO = 164,
CARD_TARGET_BC_MANUAL = 165,
CARD_TARGET_BC_ALL = 166,
CARD_TARGETING_BC = 167,
CARD_TARGET_BC_ALLY = 168,
CARD_TARGET_BC_ENEMY = 169,
CARD_TARGET_BC_ENEMY_MINIONS = 170,
CARD_TARGET_BC_HERO = 171,
CARD_TARGET_BC_ENEMY_HERO = 172,
CARD_TARGET_BC_MINIONS = 173,
CARD_TARGET_BC_ALLY_MINIONS = 174,
CARD_TARGET_BC_ALLY_HERO = 175,
CARD_STEALTH = 176,
CARD_ATTACK = 177,
CARD_TARGET_URSA = 178,
CARD_TARGET_SVEN = 179,
CARD_LEVELUP = 180,
CARD_PIERCE_MAGIC_IMMUNITY = 181,
CARD_TARGET_ALLY_BOARD = 182,
CARD_TARGET_BOARD = 183,
CARD_TARGET_ENEMY_BOARD = 184,
CARD_TARGET_ALLY_BOSSES = 185,
CARD_TARGET_ENEMY_BOSSES = 186,
CARD_TARGET_BOSSES = 187,
destroyed_EX1_354_FLAG = 188,
spell_EX1_354_FLAG = 189,
destroyed_CS2_012_FLAG = 190,
spell_CS2_012_FLAG = 191,
destroyed_EX1_371_FLAG = 192,
buff_EX1_371_FLAG = 193,
destroyed_EX1_312_FLAG = 194,
spell_aoe_EX1_312_FLAG = 195,
destroyed_CS2_011_FLAG = 196,
buff_CS2_011_FLAG = 197,
destroyed_OG_223_FLAG = 198,
buff_OG_223_FLAG = 199,
destroyed_EX1_251_FLAG = 200,
spell_aoe_EX1_251_FLAG = 201,
destroyed_EX1_259_FLAG = 202,
spell_aoe_EX1_259_FLAG = 203,
destroyed_OG_101_FLAG = 204,
buff_OG_101_FLAG = 205,
destroyed_CS2_108_FLAG = 206,
buff_CS2_108_FLAG = 207,
destroyed_EX1_303_FLAG = 208,
spell_aoe_EX1_303_FLAG = 209,
weapon_CS2_097_FLAG = 210,
idle_CS2_097_FLAG = 211,
weapon_destroyed_CS2_097_FLAG = 212,
weapon_attack_CS2_097_FLAG = 213,
onboard_CS2_097_FLAG = 214,
spell_CS1h_001_FLAG = 215,
destroyed_NEW1_036_FLAG = 216,
buff_NEW1_036_FLAG = 217,
spell_aoe_GVG_010_FLAG = 218,
spell_aoe_CS1_112_FLAG = 219,
spell_CS2_072_FLAG = 220,
buff_CS2_077_FLAG = 221,
buff_CS2_023_FLAG = 222,
attachment_attack_EX1_607e_FLAG = 223,
defender_TB_SPT_Boss_FLAG = 224,
buff_LOEA16_9_FLAG = 225,
buff_CS2_234_FLAG = 226,
buff_PRO_001c_FLAG = 227,
attack_effect_CS2_024_FLAG = 228,
spell_CS2_024_FLAG = 229,
spell_DS1_185_FLAG = 230,
buff_CS2_063_FLAG = 231,
buff_CS2_076_FLAG = 232,
buff_AT_074_FLAG = 233,
spell_BRMA11_3_FLAG = 234,
destroyed_BRM_003_FLAG = 235,
spell_BRM_003_FLAG = 236,
destroyed_AT_001_FLAG = 237,
spell_AT_001_FLAG = 238,
buff_EX1_607_FLAG = 239,
attack_EX1_097_FLAG = 240,
battlecry_EX1_097_FLAG = 241,
buff_OG_090_FLAG = 242,
attack_EX1_011_FLAG = 243,
battlecry_EX1_011_FLAG = 244,
endturn_EX1_105_FLAG = 245,
attack_EX1_105_FLAG = 246,
attack_CS2_088_FLAG = 247,
battlecry_CS2_088_FLAG = 248,
onboard_CS2_088_FLAG = 249,
attack_EX1_158t_FLAG = 250,
attack_NAX4_03H_FLAG = 251,
attack_AT_023_FLAG = 252,
attack_CS2_168_FLAG = 253,
attack_CS2_201_FLAG = 254,
attack_CS2_200_FLAG = 255,
attack_CS2_119_FLAG = 256,
attack_CS2_172_FLAG = 257,
attack_CS2_171_FLAG = 258,
attack_CS2_182_FLAG = 259,
attack_CS2_120_FLAG = 260,
attack_EX1_506a_FLAG = 261,
attack_CS2_042_FLAG = 262,
battlecry_CS2_042_FLAG = 263,
attack_CS2_boar_FLAG = 264,
attack_CS2_237_FLAG = 265,
attack_LOE_077_FLAG = 266,
battlecry_LOE_077_FLAG = 267,
destroyed_CS2_118_FLAG = 268,
defender_CS2_118_FLAG = 269,
attack_CS2_118_FLAG = 270,
onboard_CS2_118_FLAG = 271,
destroyed_AT_128_FLAG = 272,
attack_AT_128_FLAG = 273,
attack_EX1_614_FLAG = 274,
battlecry_EX1_614_FLAG = 275,
attack_EX1_593_FLAG = 276,
battlecry_EX1_593_FLAG = 277,
attack_GVG_105_FLAG = 278,
battlecry_GVG_105_FLAG = 279,
attack_NEW1_030_FLAG = 280,
battlecry_NEW1_030_FLAG = 281,
destroyed_EX1_383_FLAG = 282,
attack_EX1_383_FLAG = 283,
onboard_EX1_383_FLAG = 284,
destroyed_CS2_065_FLAG = 285,
attack_CS2_065_FLAG = 286,
onboard_CS2_065_FLAG = 287,
destroyed_AT_018_FLAG = 288,
attack_AT_018_FLAG = 289,
onboard_AT_018_FLAG = 290,
destroyed_EX1_165t2_FLAG = 291,
attack_EX1_165t2_FLAG = 292,
onboard_EX1_165t2_FLAG = 293,
destroyed_EX1_559_FLAG = 294,
attack_EX1_559_FLAG = 295,
onboard_EX1_559_FLAG = 296,
destroyed_NEW1_011_FLAG = 297,
defender_NEW1_011_FLAG = 298,
attack_NEW1_011_FLAG = 299,
onboard_NEW1_011_FLAG = 300,
attack_CS2_226_FLAG = 301,
battlecry_CS2_226_FLAG = 302,
attack_EX1_009_FLAG = 303,
buff_EX1_581_FLAG = 304,
attack_EX1_049_FLAG = 305,
battlecry_EX1_049_FLAG = 306,
spell_aoe_EX1_400_FLAG = 307,
attack_effect_attachment_LOEA06_03e_FLAG = 308,
weapon_LOE_118_FLAG = 309,
idle_LOE_118_FLAG = 310,
weapon_destroyed_LOE_118_FLAG = 311,
weapon_attack_LOE_118_FLAG = 312,
onboard_LOE_118_FLAG = 313,
buff_LOEA06_03_FLAG = 314,
spell_aoe_CS2_026_FLAG = 315,
attack_EX1_306_FLAG = 316,
battlecry_EX1_306_FLAG = 317,
destroyed_CS2_222_FLAG = 318,
attack_CS2_222_FLAG = 319,
idle_CS2_222_FLAG = 320,
onboard_CS2_222_FLAG = 321,
destroyed_CS2_231_FLAG = 322,
attack_CS2_231_FLAG = 323,
idle_CS2_231_FLAG = 324,
onboard_CS2_231_FLAG = 325,
};
#endif
+9
View File
@@ -0,0 +1,9 @@
#ifndef LEVELUP_H_
#define LEVELUP_H_
#define MAX_LEVELUP 8
struct levelup_s {
const char *dst;
const char *src;
};
extern struct levelup_s levelup[MAX_LEVELUP];
#endif
+13
View File
@@ -0,0 +1,13 @@
#ifndef ENTGEN_H_
#define ENTGEN_H_
#define MAX_ENTITIES 133
#define MAX_BEASTS 0
#define MAX_TOTEMS 0
#define MAX_TOTEMIC_CALL 0
#define MAX_HEROPOWER 3
const char *totemic_call[MAX_TOTEMIC_CALL];
const char *race_beast[MAX_BEASTS];
const char *race_totems[MAX_TOTEMS];
#endif
+13
View File
@@ -0,0 +1,13 @@
#include <hsl_cardname.h>
#include <levelup.h>
struct levelup_s levelup[MAX_LEVELUP] = {
{CN_URSA, "CS2_012"},
{CN_ENIGMA, "EX1_312"},
{CN_ZEUS, "EX1_251"},
{CN_ZEUS, "EX1_259"},
{CN_SHADOW_FIEND, "EX1_303"},
{CN_LINA, "BRM_003"},
{CN_LINA, "AT_001"},
{CN_AXE, "EX1_400"},
};
+215
View File
@@ -0,0 +1,215 @@
#include <ent_gen.h>
#include <ent.h>
struct ent_s entities[MAX_ENTITIES] = {{ "GAME_ENTITY", 11, 6, (void *)0, (void *)0, "Game Entity", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 10, 85 }, { 202, 1 }, { 20, 1 }, { 204, 2 }, { 49, 1 }, { 198, 4 }, }} // 0
, { "GAME_005", 8, 3, (void *)0, (void *)0, "Coin", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 313, 1 }, { 202, 5 }, { 49, 3 }, }} // 1
, { "PLAYER1", 7, 12, (void *)0, (void *)0, "Player1", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 27, 64 }, { 17, 1 }, { 49, 1 }, { 31, 1 }, { 30, 1 }, { 28, 10 }, { 29, 4 }, { 272, 1 }, { 202, 2 }, { 7, 75 }, { 176, 10 }, { 399, 4 }, }} // 2
, { "PLAYER2", 7, 14, (void *)0, (void *)0, "Player2", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 24, 1 }, { 27, 66 }, { 17, 1 }, { 23, 1 }, { 31, 2 }, { 30, 2 }, { 28, 10 }, { 29, 4 }, { 272, 1 }, { 202, 2 }, { 49, 1 }, { 7, 75 }, { 176, 10 }, { 399, 3 }, }} // 3
, { "PRO_001c", 8, 5, (void *)0, (void *)0, "Kill Roshan", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 183, 11 }, { 202, 5 }, { 331, 0 }, { 330, 0 }, { 48, 30 }, }} // 4
, { "TB_SPT_Boss", 11, 5, (void *)0, (void *)0, "The Sentinel", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 380, 39537 }, { 183, 18 }, { 202, 3 }, { 45, 30 }, { 47, 0 }, }} // 5
, { "LOEA04_01", 9, 6, (void *)0, (void *)0, "The Scourge ", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 202, 3 }, { 45, 30 }, { 331, 0 }, { 330, 0 }, { 380, 16231 }, { 183, 20 }, }} // 6
, { "NAX12_04e", 9, 5, (void *)0, (void *)0, "Tether", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 183, 12 }, { 202, 6 }, { 331, 0 }, { 330, 0 }, { 338, 1 }, }} // 7
, { "LOEA16_3e", 9, 4, (void *)0, (void *)0, "Grow", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 183, 20 }, { 202, 6 }, { 331, 0 }, { 330, 0 }, }} // 8
, { "LOEA16_9", 8, 5, (void *)0, (void *)0, "Arcane Boots", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 183, 20 }, { 202, 5 }, { 331, 0 }, { 330, 0 }, { 48, 0 }, }} // 9
, { "EX1_105", 7, 9, (void *)0, (void *)0, "Tiny", {{0, 0, 0, 0, 0, 0, 0, 0}}, "LOEA16_3e", {{ 201, 3 }, { 203, 5 }, { 202, 4 }, { 48, 1 }, { 47, 0 }, { 45, 1 }, { 183, 3 }, { 321, 1 }, { 251, 6 }, }} // 10
, { "EX1_049", 7, 12, (void *)0, (void *)0, "Youthful Brewmaster", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 201, 2 }, { 203, 1 }, { 202, 4 }, { 48, 2 }, { 47, 3 }, { 45, 2 }, { 331, 0 }, { 330, 0 }, { 218, 1 }, { 183, 3 }, { 321, 1 }, { 251, 6 }, }} // 11
, { "LOE_077", 7, 11, (void *)0, (void *)0, "Karroch, the Beastmaster", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 203, 5 }, { 202, 4 }, { 48, 5 }, { 114, 1 }, { 47, 2 }, { 45, 3 }, { 331, 0 }, { 330, 0 }, { 183, 20 }, { 321, 1 }, { 362, 0 }, }} // 12
, { "EX1_097", 7, 13, (void *)0, (void *)0, "Pudge, the Butcher", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 201, 3 }, { 217, 0 }, { 203, 3 }, { 202, 4 }, { 48, 5 }, { 47, 0 }, { 45, 4 }, { 331, 0 }, { 330, 0 }, { 190, 0 }, { 183, 3 }, { 321, 1 }, { 251, 6 }, }} // 13
, { "GVG_105", 7, 11, (void *)0, (void *)0, "Boush, the Tinker", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 200, 17 }, { 203, 4 }, { 202, 4 }, { 48, 3 }, { 217, 1 }, { 47, 1 }, { 45, 2 }, { 331, 0 }, { 330, 0 }, { 183, 13 }, { 321, 1 }, }} // 14
, { "NAX4_03H", 8, 5, (void *)0, (void *)0, "Skeleton", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 183, 12 }, { 202, 4 }, { 45, 5 }, { 48, 7 }, { 47, 6 }, }} // 15
, { "AT_128", 6, 11, (void *)0, (void *)0, "The Skeleton King", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 217, 1 }, { 203, 5 }, { 202, 4 }, { 48, 7 }, { 114, 1 }, { 47, 6 }, { 45, 5 }, { 331, 0 }, { 330, 0 }, { 183, 15 }, { 321, 1 }, }} // 16
, { "NEW1_030", 8, 12, (void *)0, (void *)0, "Deathwing", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 200, 24 }, { 203, 5 }, { 202, 4 }, { 48, 10 }, { 114, 1 }, { 47, 12 }, { 45, 12 }, { 331, 0 }, { 330, 0 }, { 218, 1 }, { 183, 3 }, { 321, 1 }, }} // 17
, { "EX1_158t", 8, 10, (void *)0, (void *)0, "Treant", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 201, 3 }, { 202, 4 }, { 199, 2 }, { 48, 1 }, { 47, 1 }, { 45, 2 }, { 331, 0 }, { 330, 0 }, { 183, 3 }, { 251, 1 }, }} // 18
, { "GVG_010", 7, 8, (void *)0, (void *)0, "Guardian Greaves", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 203, 1 }, { 202, 5 }, { 199, 6 }, { 48, 0 }, { 331, 0 }, { 330, 0 }, { 183, 13 }, { 321, 1 }, }} // 19
, { "OG_090", 6, 8, (void *)0, (void *)0, "Arcane Books", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 203, 4 }, { 202, 5 }, { 199, 4 }, { 48, 0 }, { 331, 0 }, { 330, 0 }, { 183, 21 }, { 321, 1 }, }} // 20
, { "AT_074", 6, 8, (void *)0, (void *)0, "Black King Bar", {{0, 0, 0, 0, 0, 0, 0, 0}}, "AT_074e2", {{ 203, 1 }, { 202, 5 }, { 199, 5 }, { 48, 2 }, { 331, 0 }, { 330, 0 }, { 183, 15 }, { 321, 1 }, }} // 21
, { "AT_074e2", 8, 5, (void *)0, (void *)0, "Magic Immunity", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 183, 15 }, { 202, 6 }, { 199, 5 }, { 330, 0 }, { 331, 0 }, }} // 22
, { "BRMA11_3", 8, 6, (void *)0, (void *)0, "Dagon", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 202, 5 }, { 48, 1 }, { 47, 1 }, { 331, 0 }, { 330, 0 }, { 183, 14 }, }} // 23
, { "FP1_020e", 8, 5, (void *)0, (void *)0, "Divine Rapier", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 183, 12 }, { 202, 6 }, { 199, 5 }, { 330, 1 }, { 331, 1 }, }} // 24
, { "LOEA06_03", 9, 5, (void *)0, (void *)0, "Desolator", {{0, 0, 0, 0, 0, 0, 0, 0}}, "LOEA06_03e", {{ 183, 20 }, { 202, 5 }, { 331, 0 }, { 330, 0 }, { 48, 2 }, }} // 25
, { "LOEA06_03e", 10, 4, (void *)0, (void *)0, "Desolate", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 183, 20 }, { 202, 6 }, { 331, 0 }, { 330, 0 }, }} // 26
, { "EX1_178ae", 9, 5, (void *)0, (void *)0, "Level 2", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 183, 3 }, { 202, 6 }, { 199, 2 }, { 330, 1 }, { 331, 1 }, }} // 27
, { "EX1_607", 7, 7, (void *)0, (void *)0, "Satanic", {{0, 0, 0, 0, 0, 0, 0, 0}}, "EX1_607e", {{ 201, 3 }, { 203, 5 }, { 202, 5 }, { 199, 10 }, { 48, 3 }, { 183, 3 }, { 321, 1 }, }} // 28
, { "EX1_009", 7, 11, (void *)0, (void *)0, "Courier", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 200, 20 }, { 203, 3 }, { 202, 4 }, { 212, 1 }, { 48, 1 }, { 47, 2 }, { 45, 1 }, { 331, 0 }, { 330, 0 }, { 183, 3 }, { 321, 1 }, }} // 29
, { "LOE_118", 7, 10, (void *)0, (void *)0, "Echo Sabre ", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 203, 3 }, { 202, 7 }, { 199, 10 }, { 48, 2 }, { 47, 0 }, { 331, 0 }, { 330, 0 }, { 183, 20 }, { 321, 1 }, { 187, 3 }, }} // 30
, { "EX1_303", 7, 12, (void *)0, (void *)0, "Requiem of Souls", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 201, 3 }, { 203, 3 }, { 202, 5 }, { 199, 9 }, { 48, 4 }, { 331, 0 }, { 330, 0 }, { 183, 3 }, { 321, 1 }, { 370, 1 }, { 268, 2 }, { 251, 1 }, }} // 31
, { "EX1_596e", 8, 8, (void *)0, (void *)0, "Necromastery", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 201, 3 }, { 203, 1 }, { 202, 6 }, { 199, 9 }, { 48, 0 }, { 331, 1 }, { 330, 1 }, { 183, 3 }, }} // 32
, { "AT_023", 6, 12, (void *)0, (void *)0, "Eidolon", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 200, 15 }, { 203, 3 }, { 202, 4 }, { 199, 9 }, { 48, 2 }, { 47, 2 }, { 45, 2 }, { 331, 0 }, { 330, 0 }, { 183, 15 }, { 321, 1 }, { 403, 0 }, }} // 33
, { "OG_101", 6, 8, (void *)0, (void *)0, "Demonic Conversion", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 203, 4 }, { 202, 5 }, { 199, 6 }, { 48, 3 }, { 331, 0 }, { 330, 0 }, { 183, 21 }, { 321, 1 }, }} // 34
, { "CS2_103e2", 9, 5, (void *)0, (void *)0, "Level 1", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 183, 2 }, { 202, 6 }, { 199, 10 }, { 330, 0 }, { 331, 0 }, }} // 35
, { "EX1_607e", 8, 5, (void *)0, (void *)0, "Satanic", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 183, 3 }, { 202, 6 }, { 199, 10 }, { 330, 1 }, { 331, 1 }, }} // 36
, { "CS1_129e", 8, 5, (void *)0, (void *)0, "Level 3", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 183, 3 }, { 202, 6 }, { 199, 6 }, { 330, 1 }, { 331, 1 }, }} // 37
, { "EX1_312", 7, 11, (void *)0, (void *)0, "The Black Hole", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 201, 3 }, { 203, 4 }, { 202, 5 }, { 199, 9 }, { 48, 8 }, { 331, 0 }, { 330, 0 }, { 183, 3 }, { 321, 1 }, { 268, 2 }, { 251, 1 }, }} // 38
, { "EX1_354", 7, 10, (void *)0, (void *)0, "Purification", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 201, 3 }, { 203, 4 }, { 202, 5 }, { 199, 5 }, { 48, 8 }, { 331, 0 }, { 330, 0 }, { 183, 3 }, { 321, 1 }, { 251, 1 }, }} // 39
, { "AT_001", 6, 9, (void *)0, (void *)0, "Laguna Blade", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 203, 1 }, { 202, 5 }, { 199, 4 }, { 48, 8 }, { 47, 10 }, { 331, 0 }, { 330, 0 }, { 183, 15 }, { 321, 1 }, }} // 40
, { "BRM_003", 7, 9, (void *)0, (void *)0, "Dragon's Breath", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 203, 1 }, { 202, 5 }, { 199, 4 }, { 48, 3 }, { 47, 2 }, { 331, 0 }, { 330, 0 }, { 183, 14 }, { 321, 1 }, }} // 41
, { "AT_018", 6, 12, "BRM_003", "AT_001", "Lina", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 200, 16 }, { 203, 5 }, { 202, 4 }, { 199, 6 }, { 48, 2 }, { 114, 1 }, { 47, 1 }, { 45, 14 }, { 331, 0 }, { 330, 0 }, { 183, 15 }, { 321, 1 }, }} // 42
, { "EX1_259", 7, 12, (void *)0, (void *)0, "God's Wrath", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 201, 3 }, { 203, 3 }, { 202, 5 }, { 199, 8 }, { 48, 6 }, { 47, 3 }, { 331, 0 }, { 330, 0 }, { 215, 1 }, { 183, 3 }, { 321, 1 }, { 251, 1 }, }} // 43
, { "EX1_251", 7, 12, (void *)0, (void *)0, "Forked Lightning", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 201, 3 }, { 203, 1 }, { 202, 5 }, { 199, 8 }, { 48, 2 }, { 47, 1 }, { 331, 0 }, { 330, 0 }, { 215, 1 }, { 183, 3 }, { 321, 1 }, { 251, 1 }, }} // 44
, { "EX1_559", 7, 14, "EX1_251", "EX1_259", "Zeus", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 201, 3 }, { 203, 5 }, { 202, 4 }, { 199, 4 }, { 48, 3 }, { 114, 1 }, { 47, 1 }, { 45, 15 }, { 331, 0 }, { 330, 0 }, { 183, 3 }, { 321, 1 }, { 32, 1 }, { 251, 3 }, }} // 45
, { "NEW1_036", 8, 8, (void *)0, (void *)0, "Warcry", {{0, 0, 0, 0, 0, 0, 0, 0}}, "NEW1_036e", {{ 203, 3 }, { 202, 5 }, { 199, 10 }, { 48, 1 }, { 331, 0 }, { 330, 0 }, { 183, 3 }, { 321, 1 }, }} // 46
, { "NEW1_036e", 9, 6, (void *)0, (void *)0, "Sven: Warcry", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 202, 6 }, { 199, 10 }, { 338, 1 }, { 331, 0 }, { 330, 0 }, { 183, 3 }, }} // 47
, { "EX1_165t2", 9, 11, "CS2_012", "CS2_011", "Ursa", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 200, 20 }, { 203, 5 }, { 202, 4 }, { 199, 2 }, { 48, 4 }, { 47, 3 }, { 45, 21 }, { 331, 0 }, { 330, 0 }, { 190, 0 }, { 183, 3 }, }} // 48
, { "AT_039e", 7, 6, (void *)0, (void *)0, "Wounded", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 202, 6 }, { 199, 2 }, { 338, 1 }, { 331, 0 }, { 330, 0 }, { 183, 15 }, }} // 49
, { "OG_223", 6, 6, (void *)0, (void *)0, "God's Strength", {{0, 0, 0, 0, 0, 0, 0, 0}}, "OG_223e", {{ 203, 1 }, { 202, 5 }, { 199, 5 }, { 48, 3 }, { 183, 21 }, { 321, 1 }, }} // 50
, { "OG_223e", 7, 2, (void *)0, (void *)0, "Sven: God's Strength", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 183, 21 }, { 202, 6 }, }} // 51
, { "EX1_383", 7, 16, "NEW1_036", "OG_223", "Sven", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 201, 3 }, { 217, 0 }, { 203, 5 }, { 202, 4 }, { 199, 5 }, { 48, 3 }, { 114, 1 }, { 47, 3 }, { 45, 16 }, { 331, 0 }, { 330, 0 }, { 190, 0 }, { 183, 3 }, { 321, 1 }, { 194, 0 }, { 251, 1 }, }} // 52
, { "CS2_063", 7, 10, (void *)0, (void *)0, "Corruption", {{0, 0, 0, 0, 0, 0, 0, 0}}, "CS2_063e", {{ 201, 3 }, { 203, 1 }, { 202, 5 }, { 199, 9 }, { 48, 1 }, { 331, 0 }, { 330, 0 }, { 183, 2 }, { 321, 1 }, { 251, 1 }, }} // 53
, { "CS2_063e", 8, 5, (void *)0, (void *)0, "Corruption", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 183, 2 }, { 202, 6 }, { 199, 9 }, { 330, 2 }, { 331, 2 }, }} // 54
, { "CS2_084e", 8, 3, (void *)0, (void *)0, "Hunter's Mark E", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 12, 1 }, { 202, 6 }, { 49, 6 }, }} // 55
, { "CS2_076", 7, 11, (void *)0, (void *)0, "Assassinate", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 201, 3 }, { 203, 2 }, { 202, 5 }, { 199, 7 }, { 48, 5 }, { 331, 0 }, { 330, 0 }, { 183, 2 }, { 321, 1 }, { 268, 2 }, { 251, 6 }, }} // 56
, { "CS2_234", 7, 8, (void *)0, (void *)0, "Shadow Word: Pain", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 203, 2 }, { 202, 5 }, { 199, 6 }, { 48, 2 }, { 331, 0 }, { 330, 0 }, { 183, 2 }, { 321, 1 }, }} // 57
, { "CS2_108", 7, 11, (void *)0, (void *)0, "Culling Blade", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 201, 3 }, { 203, 2 }, { 202, 5 }, { 199, 10 }, { 48, 3 }, { 331, 0 }, { 330, 0 }, { 183, 2 }, { 321, 1 }, { 268, 2 }, { 251, 1 }, }} // 58
, { "EX1_614", 7, 14, (void *)0, (void *)0, "Terrorblade", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 201, 3 }, { 200, 15 }, { 203, 5 }, { 202, 4 }, { 48, 6 }, { 114, 1 }, { 47, 5 }, { 45, 1 }, { 331, 0 }, { 330, 0 }, { 183, 3 }, { 321, 1 }, { 32, 1 }, { 251, 6 }, }} // 59
, { "EX1_371", 7, 10, (void *)0, (void *)0, "Guardian Angel", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 201, 3 }, { 203, 2 }, { 202, 5 }, { 199, 5 }, { 48, 2 }, { 331, 0 }, { 330, 0 }, { 183, 2 }, { 321, 1 }, { 251, 1 }, }} // 60
, { "CS2_022e", 8, 3, (void *)0, (void *)0, "Polymorph E", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 12, 1 }, { 202, 6 }, { 49, 6 }, }} // 61
, { "EX1_246e", 8, 3, (void *)0, (void *)0, "Hex E", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 12, 1 }, { 202, 6 }, { 49, 6 }, }} // 62
, { "CS2_092e", 8, 3, (void *)0, (void *)0, "Blessing of Kings E", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 12, 1 }, { 202, 6 }, { 49, 6 }, }} // 63
, { "CS2_087e", 8, 3, (void *)0, (void *)0, "Blessing of Might E", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 12, 1 }, { 202, 6 }, { 49, 6 }, }} // 64
, { "CS2_004e", 8, 3, (void *)0, (void *)0, "Power Word: Shield E", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 12, 1 }, { 202, 6 }, { 49, 6 }, }} // 65
, { "CS2_009e", 8, 3, (void *)0, (void *)0, "Mark of the Wild E", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 12, 1 }, { 202, 6 }, { 49, 6 }, }} // 66
, { "CS2_041e", 8, 3, (void *)0, (void *)0, "Ancestral Infusion", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 12, 1 }, { 202, 6 }, { 49, 6 }, }} // 67
, { "CS2_045e", 8, 3, (void *)0, (void *)0, "Rockbiter Weapon E", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 12, 1 }, { 202, 6 }, { 49, 6 }, }} // 68
, { "CS2_046e", 8, 3, (void *)0, (void *)0, "Bloodlust E", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 12, 1 }, { 202, 6 }, { 49, 6 }, }} // 69
, { "CS2_005o", 8, 3, (void *)0, (void *)0, "Claw E", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 12, 1 }, { 202, 6 }, { 49, 6 }, }} // 70
, { "CS2_105e", 8, 3, (void *)0, (void *)0, "Heroic Strike E", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 12, 1 }, { 202, 6 }, { 49, 6 }, }} // 71
, { "CS2_011", 7, 10, (void *)0, (void *)0, "Enrage", {{0, 0, 0, 0, 0, 0, 0, 0}}, "CS2_011o", {{ 201, 3 }, { 203, 1 }, { 202, 5 }, { 199, 2 }, { 48, 3 }, { 331, 0 }, { 330, 0 }, { 183, 2 }, { 321, 1 }, { 251, 1 }, }} // 72
, { "CS2_011o", 8, 6, (void *)0, (void *)0, "Enraged", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 202, 6 }, { 199, 2 }, { 338, 1 }, { 331, 1 }, { 330, 1 }, { 183, 2 }, }} // 73
, { "HERO_01", 7, 6, (void *)0, (void *)0, "Warrior", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 201, 3 }, { 203, 2 }, { 12, 1 }, { 49, 1 }, { 45, 30 }, { 202, 3 }, }} // 74
, { "HERO_02", 7, 6, (void *)0, (void *)0, "Shamman", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 201, 3 }, { 203, 2 }, { 12, 1 }, { 49, 1 }, { 45, 30 }, { 202, 3 }, }} // 75
, { "HERO_04", 7, 6, (void *)0, (void *)0, "Paladin", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 201, 3 }, { 203, 2 }, { 12, 1 }, { 49, 1 }, { 45, 30 }, { 202, 3 }, }} // 76
, { "HERO_05", 7, 6, (void *)0, (void *)0, "Hunter", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 201, 3 }, { 203, 2 }, { 12, 1 }, { 49, 1 }, { 45, 30 }, { 202, 3 }, }} // 77
, { "HERO_06", 7, 6, (void *)0, (void *)0, "Druid", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 201, 3 }, { 203, 2 }, { 12, 1 }, { 49, 1 }, { 45, 30 }, { 202, 3 }, }} // 78
, { "HERO_07", 7, 6, (void *)0, (void *)0, "Warlock", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 201, 3 }, { 203, 2 }, { 12, 1 }, { 49, 1 }, { 45, 30 }, { 202, 3 }, }} // 79
, { "HERO_08", 7, 6, (void *)0, (void *)0, "Mage", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 201, 3 }, { 203, 2 }, { 12, 1 }, { 49, 1 }, { 45, 30 }, { 202, 3 }, }} // 80
, { "HERO_01a", 8, 6, (void *)0, (void *)0, "King of Khaz Modan", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 201, 3 }, { 203, 2 }, { 12, 1 }, { 49, 1 }, { 45, 30 }, { 202, 3 }, }} // 81
, { "HERO_04a", 8, 6, (void *)0, (void *)0, "Blood Knight Matriarch", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 201, 3 }, { 203, 2 }, { 12, 1 }, { 49, 1 }, { 45, 30 }, { 202, 3 }, }} // 82
, { "HERO_05a", 8, 6, (void *)0, (void *)0, "Alleria Windranger", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 201, 3 }, { 203, 2 }, { 12, 1 }, { 49, 1 }, { 45, 30 }, { 202, 3 }, }} // 83
, { "HERO_08a", 8, 6, (void *)0, (void *)0, "Guardian Medivh", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 201, 3 }, { 203, 2 }, { 12, 1 }, { 49, 1 }, { 45, 30 }, { 202, 3 }, }} // 84
, { "HERO_08b", 8, 6, (void *)0, (void *)0, "Khadgar", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 201, 3 }, { 203, 2 }, { 12, 1 }, { 49, 1 }, { 45, 30 }, { 202, 3 }, }} // 85
, { "CS2_012", 7, 11, (void *)0, (void *)0, "Swipes", {{0, 0, 0, 0, 0, 0, 0, 0}}, "AT_039e", {{ 201, 3 }, { 203, 1 }, { 202, 5 }, { 199, 2 }, { 48, 2 }, { 47, 2 }, { 331, 0 }, { 330, 0 }, { 183, 2 }, { 321, 1 }, { 251, 1 }, }} // 86
, { "CS2_072", 7, 12, (void *)0, (void *)0, "Backstab", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 201, 3 }, { 203, 2 }, { 202, 5 }, { 199, 7 }, { 48, 0 }, { 47, 2 }, { 331, 0 }, { 330, 0 }, { 183, 2 }, { 321, 1 }, { 268, 2 }, { 251, 6 }, }} // 87
, { "DS1_185", 7, 9, (void *)0, (void *)0, "Arcane Shot", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 201, 3 }, { 203, 2 }, { 202, 5 }, { 199, 3 }, { 48, 1 }, { 47, 2 }, { 183, 2 }, { 321, 1 }, { 251, 8 }, }} // 88
, { "CS2_024", 7, 11, (void *)0, (void *)0, "Frostbolt", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 201, 3 }, { 203, 1 }, { 202, 5 }, { 199, 4 }, { 48, 2 }, { 47, 3 }, { 183, 2 }, { 321, 1 }, { 208, 1 }, { 268, 2 }, { 251, 1 }, }} // 89
, { "CS2_023", 7, 11, (void *)0, (void *)0, "Arcane Intellect", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 201, 3 }, { 203, 2 }, { 202, 5 }, { 199, 4 }, { 48, 3 }, { 331, 0 }, { 330, 0 }, { 183, 2 }, { 321, 1 }, { 268, 2 }, { 251, 1 }, }} // 90
, { "CS2_077", 7, 11, (void *)0, (void *)0, "Sprint", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 201, 3 }, { 203, 1 }, { 202, 5 }, { 199, 7 }, { 48, 7 }, { 331, 0 }, { 330, 0 }, { 183, 2 }, { 321, 1 }, { 268, 2 }, { 251, 1 }, }} // 91
, { "CS2_026", 7, 13, (void *)0, (void *)0, "Shiva's Guard", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 201, 3 }, { 203, 1 }, { 202, 5 }, { 199, 4 }, { 48, 3 }, { 47, 1 }, { 331, 0 }, { 330, 0 }, { 183, 2 }, { 321, 1 }, { 208, 1 }, { 268, 2 }, { 251, 1 }, }} // 92
, { "EX1_400", 7, 11, (void *)0, (void *)0, "Counter Helix", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 201, 3 }, { 203, 1 }, { 202, 5 }, { 199, 10 }, { 48, 0 }, { 47, 1 }, { 331, 0 }, { 330, 0 }, { 183, 2 }, { 321, 1 }, { 251, 1 }, }} // 93
, { "CS1_112", 7, 10, (void *)0, (void *)0, "Mekansm", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 201, 3 }, { 203, 1 }, { 202, 5 }, { 199, 6 }, { 48, 4 }, { 331, 0 }, { 330, 0 }, { 183, 2 }, { 321, 1 }, { 251, 5 }, }} // 94
, { "CS2_122e", 8, 3, (void *)0, (void *)0, "Enhanced", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 12, 1 }, { 202, 6 }, { 49, 6 }, }} // 95
, { "CS2_222", 7, 12, (void *)0, (void *)0, "Stormwind Champion", {{0, 0, 0, 0, 0, 0, 0, 0}}, "CS2_222o", {{ 201, 2 }, { 203, 1 }, { 202, 4 }, { 48, 7 }, { 47, 6 }, { 45, 6 }, { 331, 0 }, { 330, 0 }, { 183, 2 }, { 321, 1 }, { 251, 1 }, { 362, 1 }, }} // 96
, { "CS2_222o", 8, 4, (void *)0, (void *)0, "Might of Stormwind", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 183, 2 }, { 202, 6 }, { 331, 0 }, { 330, 1 }, }} // 97
, { "EX1_084e", 8, 3, (void *)0, (void *)0, "Charge", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 12, 1 }, { 202, 6 }, { 49, 6 }, }} // 98
, { "DS1_175o", 8, 3, (void *)0, (void *)0, "Furious Howl", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 12, 1 }, { 202, 6 }, { 49, 6 }, }} // 99
, { "EX1_399e", 8, 3, (void *)0, (void *)0, "Berserking", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 12, 1 }, { 202, 6 }, { 49, 6 }, }} // 100
, { "CS2_088", 7, 11, (void *)0, (void *)0, "Omniknight", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 201, 3 }, { 203, 1 }, { 202, 4 }, { 199, 5 }, { 48, 2 }, { 47, 1 }, { 45, 17 }, { 218, 1 }, { 183, 2 }, { 321, 1 }, { 251, 5 }, }} // 101
, { "EX1_593", 7, 9, (void *)0, (void *)0, "Phantom Assassin", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 201, 3 }, { 203, 2 }, { 202, 4 }, { 48, 4 }, { 47, 4 }, { 45, 2 }, { 218, 1 }, { 183, 2 }, { 321, 1 }, }} // 102
, { "EX1_011", 7, 10, (void *)0, (void *)0, "Witch Doctor", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 201, 1 }, { 203, 2 }, { 202, 4 }, { 48, 1 }, { 47, 2 }, { 45, 1 }, { 218, 1 }, { 183, 2 }, { 321, 1 }, { 251, 6 }, }} // 103
, { "CS2_042", 7, 11, (void *)0, (void *)0, "Fire Elemental", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 201, 3 }, { 203, 1 }, { 202, 4 }, { 199, 8 }, { 48, 6 }, { 47, 6 }, { 45, 5 }, { 218, 1 }, { 183, 2 }, { 321, 1 }, { 251, 3 }, }} // 104
, { "CS2_226", 7, 12, (void *)0, (void *)0, "Legion Commander", {{0, 0, 0, 0, 0, 0, 0, 0}}, "CS2_226e", {{ 201, 1 }, { 203, 4 }, { 202, 4 }, { 48, 5 }, { 47, 4 }, { 45, 4 }, { 331, 0 }, { 330, 0 }, { 218, 1 }, { 183, 2 }, { 321, 1 }, { 251, 1 }, }} // 105
, { "CS2_226e", 8, 4, (void *)0, (void *)0, "Frostwolf Banner", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 183, 2 }, { 202, 6 }, { 331, 1 }, { 330, 1 }, }} // 106
, { "EX1_306", 7, 13, (void *)0, (void *)0, "Queen of Pain", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 201, 3 }, { 200, 15 }, { 203, 2 }, { 202, 4 }, { 199, 9 }, { 48, 3 }, { 47, 4 }, { 45, 3 }, { 218, 1 }, { 183, 2 }, { 321, 1 }, { 268, 2 }, { 251, 1 }, }} // 107
, { "EX1_581", 7, 10, (void *)0, (void *)0, "Sap", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 201, 3 }, { 203, 2 }, { 202, 5 }, { 199, 7 }, { 48, 2 }, { 331, 0 }, { 330, 0 }, { 183, 2 }, { 321, 1 }, { 268, 2 }, }} // 108
, { "CS1_113e", 8, 3, (void *)0, (void *)0, "Mind Control E", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 12, 1 }, { 202, 6 }, { 49, 6 }, }} // 109
, { "NEW1_011", 8, 11, (void *)0, "CS2_108", "Mogul Khan, Axe", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 203, 5 }, { 202, 4 }, { 199, 10 }, { 48, 3 }, { 47, 2 }, { 197, 0 }, { 45, 20 }, { 331, 0 }, { 330, 0 }, { 183, 2 }, { 321, 1 }, }} // 110
, { "CS2_171", 7, 12, (void *)0, (void *)0, "Stonetusk Boar", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 201, 3 }, { 200, 20 }, { 203, 2 }, { 202, 4 }, { 48, 1 }, { 47, 1 }, { 197, 0 }, { 45, 1 }, { 183, 2 }, { 321, 1 }, { 268, 2 }, { 251, 6 }, }} // 111
, { "CS2_065", 7, 13, "OG_101", "EX1_312", "Enigma", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 201, 3 }, { 200, 15 }, { 203, 5 }, { 202, 4 }, { 199, 9 }, { 48, 2 }, { 47, 1 }, { 45, 15 }, { 190, 0 }, { 183, 2 }, { 321, 1 }, { 268, 2 }, { 251, 9 }, }} // 112
, { "EX1_565o", 8, 3, (void *)0, (void *)0, "Flametongue", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 12, 1 }, { 202, 6 }, { 49, 6 }, }} // 113
, { "EX1_506a", 8, 9, (void *)0, (void *)0, "Murloc Scout", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 201, 3 }, { 200, 14 }, { 203, 1 }, { 202, 4 }, { 48, 0 }, { 47, 1 }, { 45, 1 }, { 183, 2 }, { 251, 1 }, }} // 114
, { "CS2_237", 7, 12, (void *)0, (void *)0, "Vulture", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 200, 20 }, { 203, 1 }, { 202, 4 }, { 199, 3 }, { 48, 1 }, { 47, 1 }, { 45, 1 }, { 331, 0 }, { 330, 0 }, { 183, 2 }, { 321, 1 }, { 32, 1 }, }} // 115
, { "CS2_boar", 8, 11, (void *)0, (void *)0, "Boar", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 201, 3 }, { 200, 20 }, { 203, 1 }, { 202, 4 }, { 48, 1 }, { 47, 1 }, { 45, 1 }, { 331, 0 }, { 330, 0 }, { 183, 2 }, { 251, 1 }, }} // 116
, { "CS2_119", 7, 8, (void *)0, (void *)0, "Oasis Snapjaw", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 200, 20 }, { 203, 2 }, { 202, 4 }, { 48, 4 }, { 47, 2 }, { 45, 7 }, { 183, 2 }, { 321, 1 }, }} // 117
, { "CS2_172", 7, 11, (void *)0, (void *)0, "Bloodfen Raptor", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 201, 1 }, { 200, 20 }, { 203, 2 }, { 202, 4 }, { 48, 2 }, { 47, 3 }, { 45, 2 }, { 183, 2 }, { 321, 1 }, { 268, 2 }, { 251, 1 }, }} // 118
, { "CS2_118", 7, 9, (void *)0, "EX1_303", "Shadow Fiend", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 203, 5 }, { 202, 4 }, { 48, 2 }, { 47, 1 }, { 45, 14 }, { 331, 0 }, { 330, 0 }, { 183, 2 }, { 321, 1 }, }} // 119
, { "CS2_231", 7, 8, (void *)0, (void *)0, "Wisp", {{0, 0, 0, 0, 0, 0, 0, 0}}, "NAX12_04e", {{ 201, 3 }, { 203, 1 }, { 202, 4 }, { 48, 2 }, { 47, 0 }, { 45, 2 }, { 183, 3 }, { 251, 7 }, }} // 120
, { "CS2_201", 7, 8, (void *)0, (void *)0, "Core Hound", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 200, 20 }, { 203, 1 }, { 202, 4 }, { 48, 7 }, { 47, 9 }, { 45, 5 }, { 183, 2 }, { 321, 1 }, }} // 121
, { "CS2_168", 7, 10, (void *)0, (void *)0, "Murloc Raider", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 201, 2 }, { 200, 14 }, { 203, 2 }, { 202, 4 }, { 48, 1 }, { 47, 2 }, { 45, 1 }, { 183, 2 }, { 321, 1 }, { 251, 1 }, }} // 122
, { "CS2_120", 7, 8, (void *)0, (void *)0, "River Crocolisk", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 200, 20 }, { 203, 2 }, { 202, 4 }, { 48, 2 }, { 47, 2 }, { 45, 3 }, { 183, 2 }, { 321, 1 }, }} // 123
, { "CS2_200", 7, 7, (void *)0, (void *)0, "Boulderfist Ogre", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 203, 2 }, { 202, 4 }, { 48, 6 }, { 47, 6 }, { 45, 7 }, { 183, 2 }, { 321, 1 }, }} // 124
, { "CS2_182", 7, 12, (void *)0, (void *)0, "Chillwind Yeti", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 201, 3 }, { 203, 1 }, { 202, 4 }, { 48, 4 }, { 47, 4 }, { 45, 5 }, { 331, 0 }, { 330, 0 }, { 183, 2 }, { 321, 1 }, { 268, 2 }, { 251, 6 }, }} // 125
, { "CS2_034", 7, 7, (void *)0, (void *)0, "Fireblast", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 201, 3 }, { 203, 2 }, { 12, 1 }, { 48, 2 }, { 49, 1 }, { 47, 1 }, { 202, 10 }, }} // 126
, { "CS1h_001", 8, 7, (void *)0, (void *)0, "Lesser Heal", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 201, 3 }, { 203, 2 }, { 202, 10 }, { 199, 6 }, { 48, 2 }, { 183, 2 }, { 251, 1 }, }} // 127
, { "CS2_101", 7, 6, (void *)0, (void *)0, "Reinforce", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 201, 3 }, { 203, 2 }, { 202, 10 }, { 48, 2 }, { 49, 1 }, { 12, 1 }, }} // 128
, { "CS2_083b", 8, 6, (void *)0, (void *)0, "Dagger Mastery", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 201, 3 }, { 203, 2 }, { 202, 10 }, { 48, 2 }, { 49, 1 }, { 12, 1 }, }} // 129
, { "CS2_097", 7, 13, (void *)0, (void *)0, "Divine Rapier", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 201, 3 }, { 203, 1 }, { 202, 7 }, { 199, 5 }, { 48, 5 }, { 47, 8 }, { 331, 0 }, { 330, 0 }, { 183, 2 }, { 321, 1 }, { 187, 1 }, { 32, 1 }, { 251, 6 }, }} // 130
, { "MANA_CARD", 9, 3, (void *)0, (void *)0, "Empty card", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 263, 5 }, { 12, 1 }, { 49, 3 }, }} // 131
, { "NO_CARD", 7, 1, (void *)0, (void *)0, "No Card", {{0, 0, 0, 0, 0, 0, 0, 0}}, (void *)0, {{ 49, 2 }, }} // 132
, };
void entities_init() {
flag(&entities[7].flags, CARD_ATTACHMENT, FLAG_SET);
flag(&entities[8].flags, CARD_ATTACHMENT, FLAG_SET);
flag(&entities[22].flags, CARD_ATTACHMENT, FLAG_SET);
flag(&entities[24].flags, CARD_ATTACHMENT, FLAG_SET);
flag(&entities[26].flags, CARD_ATTACHMENT, FLAG_SET);
flag(&entities[27].flags, CARD_ATTACHMENT, FLAG_SET);
flag(&entities[32].flags, CARD_ATTACHMENT, FLAG_SET);
flag(&entities[35].flags, CARD_ATTACHMENT, FLAG_SET);
flag(&entities[36].flags, CARD_ATTACHMENT, FLAG_SET);
flag(&entities[37].flags, CARD_ATTACHMENT, FLAG_SET);
flag(&entities[47].flags, CARD_ATTACHMENT, FLAG_SET);
flag(&entities[49].flags, CARD_ATTACHMENT, FLAG_SET);
flag(&entities[51].flags, CARD_ATTACHMENT, FLAG_SET);
flag(&entities[54].flags, CARD_ATTACHMENT, FLAG_SET);
flag(&entities[55].flags, CARD_ATTACHMENT, FLAG_SET);
flag(&entities[61].flags, CARD_ATTACHMENT, FLAG_SET);
flag(&entities[62].flags, CARD_ATTACHMENT, FLAG_SET);
flag(&entities[63].flags, CARD_ATTACHMENT, FLAG_SET);
flag(&entities[64].flags, CARD_ATTACHMENT, FLAG_SET);
flag(&entities[65].flags, CARD_ATTACHMENT, FLAG_SET);
flag(&entities[66].flags, CARD_ATTACHMENT, FLAG_SET);
flag(&entities[67].flags, CARD_ATTACHMENT, FLAG_SET);
flag(&entities[68].flags, CARD_ATTACHMENT, FLAG_SET);
flag(&entities[69].flags, CARD_ATTACHMENT, FLAG_SET);
flag(&entities[70].flags, CARD_ATTACHMENT, FLAG_SET);
flag(&entities[71].flags, CARD_ATTACHMENT, FLAG_SET);
flag(&entities[73].flags, CARD_ATTACHMENT, FLAG_SET);
flag(&entities[74].flags, CARD_HERO, FLAG_SET);
flag(&entities[75].flags, CARD_HERO, FLAG_SET);
flag(&entities[76].flags, CARD_HERO, FLAG_SET);
flag(&entities[77].flags, CARD_HERO, FLAG_SET);
flag(&entities[78].flags, CARD_HERO, FLAG_SET);
flag(&entities[79].flags, CARD_HERO, FLAG_SET);
flag(&entities[80].flags, CARD_HERO, FLAG_SET);
flag(&entities[81].flags, CARD_HERO, FLAG_SET);
flag(&entities[82].flags, CARD_HERO, FLAG_SET);
flag(&entities[83].flags, CARD_HERO, FLAG_SET);
flag(&entities[84].flags, CARD_HERO, FLAG_SET);
flag(&entities[85].flags, CARD_HERO, FLAG_SET);
flag(&entities[95].flags, CARD_ATTACHMENT, FLAG_SET);
flag(&entities[97].flags, CARD_ATTACHMENT, FLAG_SET);
flag(&entities[98].flags, CARD_ATTACHMENT, FLAG_SET);
flag(&entities[99].flags, CARD_ATTACHMENT, FLAG_SET);
flag(&entities[100].flags, CARD_ATTACHMENT, FLAG_SET);
flag(&entities[106].flags, CARD_ATTACHMENT, FLAG_SET);
flag(&entities[109].flags, CARD_ATTACHMENT, FLAG_SET);
flag(&entities[113].flags, CARD_ATTACHMENT, FLAG_SET);
flag(&entities[114].flags, CARD_UNCOLLECTIBLE, FLAG_SET);
flag(&entities[116].flags, CARD_UNCOLLECTIBLE, FLAG_SET);
flag(&entities[126].flags, CARD_HEROPOWER, FLAG_SET);
flag(&entities[126].flags, CARD_TARGETING, FLAG_SET);
flag(&entities[126].flags, CARD_SPELL, FLAG_SET);
flag(&entities[126].flags, CARD_HP_SPELL_DAMAGE, FLAG_SET);
flag(&entities[128].flags, CARD_HEROPOWER, FLAG_SET);
flag(&entities[128].flags, CARD_SPELL, FLAG_SET);
flag(&entities[128].flags, CARD_NONTARGET, FLAG_SET);
flag(&entities[128].flags, CARD_HP_REINFORCE, FLAG_SET);
flag(&entities[128].flags, CARD_SUMMON, FLAG_SET);
flag(&entities[129].flags, CARD_HEROPOWER, FLAG_SET);
flag(&entities[129].flags, CARD_SPELL, FLAG_SET);
flag(&entities[129].flags, CARD_NONTARGET, FLAG_SET);
flag(&entities[129].flags, CARD_HP_DAGGERMASTERY, FLAG_SET);
flag(&entities[129].flags, CARD_SUMMON, FLAG_SET);
flag(&entities[131].flags, CARD_UNCOLLECTIBLE, FLAG_SET);
flag(&entities[132].flags, CARD_UNCOLLECTIBLE, FLAG_SET);
}
const char *race_beast[MAX_BEASTS] = {
};
const char *race_totems[MAX_TOTEMS] = {
};
const char *totemic_call[MAX_TOTEMIC_CALL] = {
};
const char *hp_list[MAX_HEROPOWER] = {
"CS2_034",
"CS2_101",
"CS2_083b",
};
+399
View File
@@ -0,0 +1,399 @@
#include <ent_gen.h>
#include <ent.h>
void entities_init2() {
flag(&entities[39].flags, destroyed_EX1_354_FLAG, FLAG_SET);
flag(&entities[39].flags, CARD_SPELL, FLAG_SET);
flag(&entities[39].flags, spell_EX1_354_FLAG, FLAG_SET);
flag(&entities[39].flags, CARD_TARGET_ALLY_MINIONS, FLAG_SET);
flag(&entities[39].flags, CARD_TARGETING, FLAG_SET);
flag(&entities[86].flags, destroyed_CS2_012_FLAG, FLAG_SET);
flag(&entities[86].flags, CARD_LEVELUP, FLAG_SET);
flag(&entities[86].flags, CARD_PIERCE_MAGIC_IMMUNITY, FLAG_SET);
flag(&entities[86].flags, CARD_SPELL, FLAG_SET);
flag(&entities[86].flags, spell_CS2_012_FLAG, FLAG_SET);
flag(&entities[86].flags, CARD_TARGET_ENEMY_MINIONS, FLAG_SET);
flag(&entities[86].flags, CARD_TARGETING, FLAG_SET);
flag(&entities[60].flags, destroyed_EX1_371_FLAG, FLAG_SET);
flag(&entities[60].flags, CARD_BUFF, FLAG_SET);
flag(&entities[60].flags, CARD_SPELL, FLAG_SET);
flag(&entities[60].flags, buff_EX1_371_FLAG, FLAG_SET);
flag(&entities[60].flags, CARD_TARGET_ALLY_MINIONS, FLAG_SET);
flag(&entities[60].flags, CARD_TARGETING, FLAG_SET);
flag(&entities[38].flags, destroyed_EX1_312_FLAG, FLAG_SET);
flag(&entities[38].flags, CARD_LEVELUP, FLAG_SET);
flag(&entities[38].flags, CARD_SPELL, FLAG_SET);
flag(&entities[38].flags, CARD_AOE, FLAG_SET);
flag(&entities[38].flags, spell_aoe_EX1_312_FLAG, FLAG_SET);
flag(&entities[38].flags, CARD_NONTARGET, FLAG_SET);
flag(&entities[72].flags, destroyed_CS2_011_FLAG, FLAG_SET);
flag(&entities[72].flags, CARD_BUFF, FLAG_SET);
flag(&entities[72].flags, CARD_SPELL, FLAG_SET);
flag(&entities[72].flags, buff_CS2_011_FLAG, FLAG_SET);
flag(&entities[72].flags, CARD_TARGET_URSA, FLAG_SET);
flag(&entities[72].flags, CARD_TARGETING, FLAG_SET);
flag(&entities[50].flags, destroyed_OG_223_FLAG, FLAG_SET);
flag(&entities[50].flags, CARD_BUFF, FLAG_SET);
flag(&entities[50].flags, CARD_SPELL, FLAG_SET);
flag(&entities[50].flags, buff_OG_223_FLAG, FLAG_SET);
flag(&entities[50].flags, CARD_TARGET_SVEN, FLAG_SET);
flag(&entities[50].flags, CARD_TARGETING, FLAG_SET);
flag(&entities[44].flags, destroyed_EX1_251_FLAG, FLAG_SET);
flag(&entities[44].flags, CARD_LEVELUP, FLAG_SET);
flag(&entities[44].flags, CARD_SPELL, FLAG_SET);
flag(&entities[44].flags, CARD_AOE, FLAG_SET);
flag(&entities[44].flags, spell_aoe_EX1_251_FLAG, FLAG_SET);
flag(&entities[44].flags, CARD_NONTARGET, FLAG_SET);
flag(&entities[43].flags, destroyed_EX1_259_FLAG, FLAG_SET);
flag(&entities[43].flags, CARD_LEVELUP, FLAG_SET);
flag(&entities[43].flags, CARD_SPELL, FLAG_SET);
flag(&entities[43].flags, CARD_AOE, FLAG_SET);
flag(&entities[43].flags, spell_aoe_EX1_259_FLAG, FLAG_SET);
flag(&entities[43].flags, CARD_NONTARGET, FLAG_SET);
flag(&entities[34].flags, destroyed_OG_101_FLAG, FLAG_SET);
flag(&entities[34].flags, CARD_BUFF, FLAG_SET);
flag(&entities[34].flags, CARD_SPELL, FLAG_SET);
flag(&entities[34].flags, buff_OG_101_FLAG, FLAG_SET);
flag(&entities[34].flags, CARD_TARGET_ALLY_MINIONS, FLAG_SET);
flag(&entities[34].flags, CARD_TARGETING, FLAG_SET);
flag(&entities[58].flags, destroyed_CS2_108_FLAG, FLAG_SET);
flag(&entities[58].flags, CARD_BUFF, FLAG_SET);
flag(&entities[58].flags, CARD_SPELL, FLAG_SET);
flag(&entities[58].flags, buff_CS2_108_FLAG, FLAG_SET);
flag(&entities[58].flags, CARD_TARGET_30PERCENT_LESS, FLAG_SET);
flag(&entities[58].flags, CARD_TARGETING, FLAG_SET);
flag(&entities[31].flags, destroyed_EX1_303_FLAG, FLAG_SET);
flag(&entities[31].flags, CARD_LEVELUP, FLAG_SET);
flag(&entities[31].flags, CARD_SPELL, FLAG_SET);
flag(&entities[31].flags, CARD_AOE, FLAG_SET);
flag(&entities[31].flags, spell_aoe_EX1_303_FLAG, FLAG_SET);
flag(&entities[31].flags, CARD_NONTARGET, FLAG_SET);
flag(&entities[130].flags, CARD_SPELL, FLAG_SET);
flag(&entities[130].flags, CARD_AOE, FLAG_SET);
flag(&entities[130].flags, CARD_WEAPON, FLAG_SET);
flag(&entities[130].flags, CARD_NONTARGET, FLAG_SET);
flag(&entities[130].flags, weapon_CS2_097_FLAG, FLAG_SET);
flag(&entities[130].flags, idle_CS2_097_FLAG, FLAG_SET);
flag(&entities[130].flags, weapon_destroyed_CS2_097_FLAG, FLAG_SET);
flag(&entities[130].flags, weapon_attack_CS2_097_FLAG, FLAG_SET);
flag(&entities[130].flags, onboard_CS2_097_FLAG, FLAG_SET);
flag(&entities[127].flags, CARD_HEROPOWER, FLAG_SET);
flag(&entities[127].flags, CARD_SPELL, FLAG_SET);
flag(&entities[127].flags, spell_CS1h_001_FLAG, FLAG_SET);
flag(&entities[127].flags, CARD_TARGET_ALL, FLAG_SET);
flag(&entities[127].flags, CARD_TARGETING, FLAG_SET);
flag(&entities[46].flags, destroyed_NEW1_036_FLAG, FLAG_SET);
flag(&entities[46].flags, CARD_BUFF, FLAG_SET);
flag(&entities[46].flags, CARD_SPELL, FLAG_SET);
flag(&entities[46].flags, buff_NEW1_036_FLAG, FLAG_SET);
flag(&entities[46].flags, CARD_NONTARGET, FLAG_SET);
flag(&entities[19].flags, CARD_SPELL, FLAG_SET);
flag(&entities[19].flags, CARD_AOE, FLAG_SET);
flag(&entities[19].flags, spell_aoe_GVG_010_FLAG, FLAG_SET);
flag(&entities[19].flags, CARD_NONTARGET, FLAG_SET);
flag(&entities[94].flags, CARD_SPELL, FLAG_SET);
flag(&entities[94].flags, CARD_AOE, FLAG_SET);
flag(&entities[94].flags, spell_aoe_CS1_112_FLAG, FLAG_SET);
flag(&entities[94].flags, CARD_NONTARGET, FLAG_SET);
flag(&entities[87].flags, CARD_SPELL, FLAG_SET);
flag(&entities[87].flags, spell_CS2_072_FLAG, FLAG_SET);
flag(&entities[87].flags, CARD_TARGET_UNDAMAGED_MINION, FLAG_SET);
flag(&entities[87].flags, CARD_TARGETING, FLAG_SET);
flag(&entities[91].flags, CARD_BUFF, FLAG_SET);
flag(&entities[91].flags, CARD_SPELL, FLAG_SET);
flag(&entities[91].flags, buff_CS2_077_FLAG, FLAG_SET);
flag(&entities[91].flags, CARD_NONTARGET, FLAG_SET);
flag(&entities[90].flags, CARD_BUFF, FLAG_SET);
flag(&entities[90].flags, CARD_SPELL, FLAG_SET);
flag(&entities[90].flags, buff_CS2_023_FLAG, FLAG_SET);
flag(&entities[90].flags, CARD_NONTARGET, FLAG_SET);
flag(&entities[36].flags, attachment_attack_EX1_607e_FLAG, FLAG_SET);
flag(&entities[6].flags, CARD_HERO, FLAG_SET);
flag(&entities[5].flags, defender_TB_SPT_Boss_FLAG, FLAG_SET);
flag(&entities[5].flags, CARD_HERO, FLAG_SET);
flag(&entities[9].flags, CARD_BUFF, FLAG_SET);
flag(&entities[9].flags, CARD_SPELL, FLAG_SET);
flag(&entities[9].flags, buff_LOEA16_9_FLAG, FLAG_SET);
flag(&entities[9].flags, CARD_NONTARGET, FLAG_SET);
flag(&entities[57].flags, CARD_BUFF, FLAG_SET);
flag(&entities[57].flags, CARD_SPELL, FLAG_SET);
flag(&entities[57].flags, buff_CS2_234_FLAG, FLAG_SET);
flag(&entities[57].flags, CARD_TARGET_3ATTACK_LESS, FLAG_SET);
flag(&entities[57].flags, CARD_TARGETING, FLAG_SET);
flag(&entities[4].flags, CARD_BUFF, FLAG_SET);
flag(&entities[4].flags, CARD_SPELL, FLAG_SET);
flag(&entities[4].flags, buff_PRO_001c_FLAG, FLAG_SET);
flag(&entities[4].flags, CARD_NONTARGET, FLAG_SET);
flag(&entities[89].flags, CARD_FREEZE, FLAG_SET);
flag(&entities[89].flags, CARD_MINION, FLAG_SET);
flag(&entities[89].flags, attack_effect_CS2_024_FLAG, FLAG_SET);
flag(&entities[89].flags, CARD_SPELL, FLAG_SET);
flag(&entities[89].flags, spell_CS2_024_FLAG, FLAG_SET);
flag(&entities[89].flags, CARD_TARGET_ENEMY_BOARD, FLAG_SET);
flag(&entities[89].flags, CARD_TARGETING, FLAG_SET);
flag(&entities[88].flags, CARD_SPELL, FLAG_SET);
flag(&entities[88].flags, spell_DS1_185_FLAG, FLAG_SET);
flag(&entities[88].flags, CARD_TARGET_ENEMY_BOARD, FLAG_SET);
flag(&entities[88].flags, CARD_TARGETING, FLAG_SET);
flag(&entities[53].flags, CARD_BUFF, FLAG_SET);
flag(&entities[53].flags, CARD_SPELL, FLAG_SET);
flag(&entities[53].flags, buff_CS2_063_FLAG, FLAG_SET);
flag(&entities[53].flags, CARD_TARGET_ENEMY_BOARD, FLAG_SET);
flag(&entities[53].flags, CARD_TARGETING, FLAG_SET);
flag(&entities[56].flags, CARD_BUFF, FLAG_SET);
flag(&entities[56].flags, CARD_SPELL, FLAG_SET);
flag(&entities[56].flags, buff_CS2_076_FLAG, FLAG_SET);
flag(&entities[56].flags, CARD_TARGET_ENEMY_BOARD, FLAG_SET);
flag(&entities[56].flags, CARD_TARGETING, FLAG_SET);
flag(&entities[21].flags, CARD_BUFF, FLAG_SET);
flag(&entities[21].flags, CARD_SPELL, FLAG_SET);
flag(&entities[21].flags, buff_AT_074_FLAG, FLAG_SET);
flag(&entities[21].flags, CARD_TARGET_ALLY_BOSSES, FLAG_SET);
flag(&entities[21].flags, CARD_TARGETING, FLAG_SET);
flag(&entities[23].flags, CARD_SPELL, FLAG_SET);
flag(&entities[23].flags, spell_BRMA11_3_FLAG, FLAG_SET);
flag(&entities[23].flags, CARD_TARGET_ENEMY_BOARD, FLAG_SET);
flag(&entities[23].flags, CARD_TARGETING, FLAG_SET);
flag(&entities[41].flags, destroyed_BRM_003_FLAG, FLAG_SET);
flag(&entities[41].flags, CARD_LEVELUP, FLAG_SET);
flag(&entities[41].flags, CARD_SPELL, FLAG_SET);
flag(&entities[41].flags, spell_BRM_003_FLAG, FLAG_SET);
flag(&entities[41].flags, CARD_TARGET_ENEMY_BOARD, FLAG_SET);
flag(&entities[41].flags, CARD_TARGETING, FLAG_SET);
flag(&entities[40].flags, destroyed_AT_001_FLAG, FLAG_SET);
flag(&entities[40].flags, CARD_LEVELUP, FLAG_SET);
flag(&entities[40].flags, CARD_SPELL, FLAG_SET);
flag(&entities[40].flags, spell_AT_001_FLAG, FLAG_SET);
flag(&entities[40].flags, CARD_TARGET_ENEMY_BOARD, FLAG_SET);
flag(&entities[40].flags, CARD_TARGETING, FLAG_SET);
flag(&entities[28].flags, CARD_BUFF, FLAG_SET);
flag(&entities[28].flags, CARD_SPELL, FLAG_SET);
flag(&entities[28].flags, buff_EX1_607_FLAG, FLAG_SET);
flag(&entities[28].flags, CARD_TARGET_ALLY_BOSSES, FLAG_SET);
flag(&entities[28].flags, CARD_TARGETING, FLAG_SET);
flag(&entities[13].flags, CARD_MINION, FLAG_SET);
flag(&entities[13].flags, CARD_TARGETING, FLAG_SET);
flag(&entities[13].flags, attack_EX1_097_FLAG, FLAG_SET);
flag(&entities[13].flags, CARD_BATTLECRY, FLAG_SET);
flag(&entities[13].flags, battlecry_EX1_097_FLAG, FLAG_SET);
flag(&entities[13].flags, CARD_TARGET_ENEMY_MINIONS, FLAG_SET);
flag(&entities[13].flags, CARD_TARGETING_BC, FLAG_SET);
flag(&entities[20].flags, CARD_BUFF, FLAG_SET);
flag(&entities[20].flags, CARD_SPELL, FLAG_SET);
flag(&entities[20].flags, buff_OG_090_FLAG, FLAG_SET);
flag(&entities[20].flags, CARD_NONTARGET, FLAG_SET);
flag(&entities[103].flags, CARD_MINION, FLAG_SET);
flag(&entities[103].flags, CARD_TARGETING, FLAG_SET);
flag(&entities[103].flags, attack_EX1_011_FLAG, FLAG_SET);
flag(&entities[103].flags, CARD_BATTLECRY, FLAG_SET);
flag(&entities[103].flags, battlecry_EX1_011_FLAG, FLAG_SET);
flag(&entities[103].flags, CARD_TARGET_ALLY_BOARD, FLAG_SET);
flag(&entities[103].flags, CARD_TARGETING_BC, FLAG_SET);
flag(&entities[10].flags, endturn_EX1_105_FLAG, FLAG_SET);
flag(&entities[10].flags, CARD_MINION, FLAG_SET);
flag(&entities[10].flags, CARD_TARGETING, FLAG_SET);
flag(&entities[10].flags, attack_EX1_105_FLAG, FLAG_SET);
flag(&entities[101].flags, CARD_MINION, FLAG_SET);
flag(&entities[101].flags, CARD_TARGETING, FLAG_SET);
flag(&entities[101].flags, attack_CS2_088_FLAG, FLAG_SET);
flag(&entities[101].flags, CARD_BATTLECRY, FLAG_SET);
flag(&entities[101].flags, battlecry_CS2_088_FLAG, FLAG_SET);
flag(&entities[101].flags, CARD_NONTARGET_BC, FLAG_SET);
flag(&entities[101].flags, onboard_CS2_088_FLAG, FLAG_SET);
flag(&entities[18].flags, CARD_MINION, FLAG_SET);
flag(&entities[18].flags, CARD_TARGETING, FLAG_SET);
flag(&entities[18].flags, attack_EX1_158t_FLAG, FLAG_SET);
flag(&entities[15].flags, CARD_MINION, FLAG_SET);
flag(&entities[15].flags, CARD_TARGETING, FLAG_SET);
flag(&entities[15].flags, attack_NAX4_03H_FLAG, FLAG_SET);
flag(&entities[33].flags, CARD_MINION, FLAG_SET);
flag(&entities[33].flags, CARD_TARGETING, FLAG_SET);
flag(&entities[33].flags, attack_AT_023_FLAG, FLAG_SET);
flag(&entities[122].flags, CARD_MINION, FLAG_SET);
flag(&entities[122].flags, CARD_TARGETING, FLAG_SET);
flag(&entities[122].flags, attack_CS2_168_FLAG, FLAG_SET);
flag(&entities[121].flags, CARD_MINION, FLAG_SET);
flag(&entities[121].flags, CARD_TARGETING, FLAG_SET);
flag(&entities[121].flags, attack_CS2_201_FLAG, FLAG_SET);
flag(&entities[124].flags, CARD_MINION, FLAG_SET);
flag(&entities[124].flags, CARD_TARGETING, FLAG_SET);
flag(&entities[124].flags, attack_CS2_200_FLAG, FLAG_SET);
flag(&entities[117].flags, CARD_MINION, FLAG_SET);
flag(&entities[117].flags, CARD_TARGETING, FLAG_SET);
flag(&entities[117].flags, attack_CS2_119_FLAG, FLAG_SET);
flag(&entities[118].flags, CARD_MINION, FLAG_SET);
flag(&entities[118].flags, CARD_TARGETING, FLAG_SET);
flag(&entities[118].flags, attack_CS2_172_FLAG, FLAG_SET);
flag(&entities[111].flags, CARD_MINION, FLAG_SET);
flag(&entities[111].flags, CARD_TARGETING, FLAG_SET);
flag(&entities[111].flags, attack_CS2_171_FLAG, FLAG_SET);
flag(&entities[125].flags, CARD_MINION, FLAG_SET);
flag(&entities[125].flags, CARD_TARGETING, FLAG_SET);
flag(&entities[125].flags, attack_CS2_182_FLAG, FLAG_SET);
flag(&entities[123].flags, CARD_MINION, FLAG_SET);
flag(&entities[123].flags, CARD_TARGETING, FLAG_SET);
flag(&entities[123].flags, attack_CS2_120_FLAG, FLAG_SET);
flag(&entities[114].flags, CARD_MINION, FLAG_SET);
flag(&entities[114].flags, CARD_TARGETING, FLAG_SET);
flag(&entities[114].flags, attack_EX1_506a_FLAG, FLAG_SET);
flag(&entities[104].flags, CARD_MINION, FLAG_SET);
flag(&entities[104].flags, CARD_TARGETING, FLAG_SET);
flag(&entities[104].flags, attack_CS2_042_FLAG, FLAG_SET);
flag(&entities[104].flags, CARD_BATTLECRY, FLAG_SET);
flag(&entities[104].flags, battlecry_CS2_042_FLAG, FLAG_SET);
flag(&entities[104].flags, CARD_TARGET_BOARD, FLAG_SET);
flag(&entities[104].flags, CARD_TARGETING_BC, FLAG_SET);
flag(&entities[116].flags, CARD_TAUNT, FLAG_SET);
flag(&entities[116].flags, CARD_MINION, FLAG_SET);
flag(&entities[116].flags, CARD_TARGETING, FLAG_SET);
flag(&entities[116].flags, attack_CS2_boar_FLAG, FLAG_SET);
flag(&entities[115].flags, CARD_MINION, FLAG_SET);
flag(&entities[115].flags, CARD_TARGETING, FLAG_SET);
flag(&entities[115].flags, attack_CS2_237_FLAG, FLAG_SET);
flag(&entities[12].flags, CARD_MINION, FLAG_SET);
flag(&entities[12].flags, CARD_TARGETING, FLAG_SET);
flag(&entities[12].flags, attack_LOE_077_FLAG, FLAG_SET);
flag(&entities[12].flags, CARD_BATTLECRY, FLAG_SET);
flag(&entities[12].flags, battlecry_LOE_077_FLAG, FLAG_SET);
flag(&entities[12].flags, CARD_NONTARGET_BC, FLAG_SET);
flag(&entities[119].flags, destroyed_CS2_118_FLAG, FLAG_SET);
flag(&entities[119].flags, defender_CS2_118_FLAG, FLAG_SET);
flag(&entities[119].flags, CARD_MINION, FLAG_SET);
flag(&entities[119].flags, CARD_TARGETING, FLAG_SET);
flag(&entities[119].flags, attack_CS2_118_FLAG, FLAG_SET);
flag(&entities[119].flags, onboard_CS2_118_FLAG, FLAG_SET);
flag(&entities[119].flags, CARD_BOSS, FLAG_SET);
flag(&entities[16].flags, destroyed_AT_128_FLAG, FLAG_SET);
flag(&entities[16].flags, CARD_MINION, FLAG_SET);
flag(&entities[16].flags, CARD_TARGETING, FLAG_SET);
flag(&entities[16].flags, attack_AT_128_FLAG, FLAG_SET);
flag(&entities[59].flags, CARD_MINION, FLAG_SET);
flag(&entities[59].flags, CARD_TARGETING, FLAG_SET);
flag(&entities[59].flags, attack_EX1_614_FLAG, FLAG_SET);
flag(&entities[59].flags, CARD_BATTLECRY, FLAG_SET);
flag(&entities[59].flags, battlecry_EX1_614_FLAG, FLAG_SET);
flag(&entities[59].flags, CARD_TARGET_ENEMY_BOARD, FLAG_SET);
flag(&entities[59].flags, CARD_TARGETING_BC, FLAG_SET);
flag(&entities[102].flags, CARD_MINION, FLAG_SET);
flag(&entities[102].flags, CARD_TARGETING, FLAG_SET);
flag(&entities[102].flags, attack_EX1_593_FLAG, FLAG_SET);
flag(&entities[102].flags, CARD_BATTLECRY, FLAG_SET);
flag(&entities[102].flags, battlecry_EX1_593_FLAG, FLAG_SET);
flag(&entities[102].flags, CARD_TARGET_ENEMY_BOARD, FLAG_SET);
flag(&entities[102].flags, CARD_TARGETING_BC, FLAG_SET);
flag(&entities[14].flags, CARD_MINION, FLAG_SET);
flag(&entities[14].flags, CARD_TARGETING, FLAG_SET);
flag(&entities[14].flags, attack_GVG_105_FLAG, FLAG_SET);
flag(&entities[14].flags, CARD_BATTLECRY, FLAG_SET);
flag(&entities[14].flags, battlecry_GVG_105_FLAG, FLAG_SET);
flag(&entities[14].flags, CARD_NONTARGET_BC, FLAG_SET);
flag(&entities[17].flags, CARD_MINION, FLAG_SET);
flag(&entities[17].flags, CARD_TARGETING, FLAG_SET);
flag(&entities[17].flags, attack_NEW1_030_FLAG, FLAG_SET);
flag(&entities[17].flags, CARD_BATTLECRY, FLAG_SET);
flag(&entities[17].flags, battlecry_NEW1_030_FLAG, FLAG_SET);
flag(&entities[17].flags, CARD_NONTARGET_BC, FLAG_SET);
flag(&entities[52].flags, destroyed_EX1_383_FLAG, FLAG_SET);
flag(&entities[52].flags, CARD_BOSS, FLAG_SET);
flag(&entities[52].flags, CARD_MINION, FLAG_SET);
flag(&entities[52].flags, CARD_TARGETING, FLAG_SET);
flag(&entities[52].flags, attack_EX1_383_FLAG, FLAG_SET);
flag(&entities[52].flags, onboard_EX1_383_FLAG, FLAG_SET);
flag(&entities[112].flags, destroyed_CS2_065_FLAG, FLAG_SET);
flag(&entities[112].flags, CARD_BOSS, FLAG_SET);
flag(&entities[112].flags, CARD_MINION, FLAG_SET);
flag(&entities[112].flags, CARD_TARGETING, FLAG_SET);
flag(&entities[112].flags, attack_CS2_065_FLAG, FLAG_SET);
flag(&entities[112].flags, onboard_CS2_065_FLAG, FLAG_SET);
flag(&entities[42].flags, destroyed_AT_018_FLAG, FLAG_SET);
flag(&entities[42].flags, CARD_SPELLPOWER, FLAG_SET);
flag(&entities[42].flags, CARD_BOSS, FLAG_SET);
flag(&entities[42].flags, CARD_MINION, FLAG_SET);
flag(&entities[42].flags, CARD_TARGETING, FLAG_SET);
flag(&entities[42].flags, attack_AT_018_FLAG, FLAG_SET);
flag(&entities[42].flags, onboard_AT_018_FLAG, FLAG_SET);
flag(&entities[48].flags, destroyed_EX1_165t2_FLAG, FLAG_SET);
flag(&entities[48].flags, CARD_BOSS, FLAG_SET);
flag(&entities[48].flags, CARD_MINION, FLAG_SET);
flag(&entities[48].flags, CARD_TARGETING, FLAG_SET);
flag(&entities[48].flags, attack_EX1_165t2_FLAG, FLAG_SET);
flag(&entities[48].flags, onboard_EX1_165t2_FLAG, FLAG_SET);
flag(&entities[45].flags, destroyed_EX1_559_FLAG, FLAG_SET);
flag(&entities[45].flags, CARD_SPELLPOWER, FLAG_SET);
flag(&entities[45].flags, CARD_BOSS, FLAG_SET);
flag(&entities[45].flags, CARD_MINION, FLAG_SET);
flag(&entities[45].flags, CARD_TARGETING, FLAG_SET);
flag(&entities[45].flags, attack_EX1_559_FLAG, FLAG_SET);
flag(&entities[45].flags, onboard_EX1_559_FLAG, FLAG_SET);
flag(&entities[110].flags, destroyed_NEW1_011_FLAG, FLAG_SET);
flag(&entities[110].flags, defender_NEW1_011_FLAG, FLAG_SET);
flag(&entities[110].flags, CARD_MINION, FLAG_SET);
flag(&entities[110].flags, CARD_TARGETING, FLAG_SET);
flag(&entities[110].flags, attack_NEW1_011_FLAG, FLAG_SET);
flag(&entities[110].flags, onboard_NEW1_011_FLAG, FLAG_SET);
flag(&entities[110].flags, CARD_BOSS, FLAG_SET);
flag(&entities[105].flags, CARD_MINION, FLAG_SET);
flag(&entities[105].flags, CARD_TARGETING, FLAG_SET);
flag(&entities[105].flags, attack_CS2_226_FLAG, FLAG_SET);
flag(&entities[105].flags, CARD_BATTLECRY, FLAG_SET);
flag(&entities[105].flags, battlecry_CS2_226_FLAG, FLAG_SET);
flag(&entities[105].flags, CARD_NONTARGET_BC, FLAG_SET);
flag(&entities[29].flags, CARD_MINION, FLAG_SET);
flag(&entities[29].flags, CARD_TARGETING, FLAG_SET);
flag(&entities[29].flags, attack_EX1_009_FLAG, FLAG_SET);
flag(&entities[108].flags, CARD_BUFF, FLAG_SET);
flag(&entities[108].flags, CARD_SPELL, FLAG_SET);
flag(&entities[108].flags, buff_EX1_581_FLAG, FLAG_SET);
flag(&entities[108].flags, CARD_TARGET_MINIONS, FLAG_SET);
flag(&entities[108].flags, CARD_TARGETING, FLAG_SET);
flag(&entities[11].flags, CARD_MINION, FLAG_SET);
flag(&entities[11].flags, CARD_TARGETING, FLAG_SET);
flag(&entities[11].flags, attack_EX1_049_FLAG, FLAG_SET);
flag(&entities[11].flags, CARD_BATTLECRY, FLAG_SET);
flag(&entities[11].flags, battlecry_EX1_049_FLAG, FLAG_SET);
flag(&entities[11].flags, CARD_TARGET_ALLY_MINIONS, FLAG_SET);
flag(&entities[11].flags, CARD_TARGETING_BC, FLAG_SET);
flag(&entities[93].flags, CARD_LEVELUP, FLAG_SET);
flag(&entities[93].flags, CARD_PIERCE_MAGIC_IMMUNITY, FLAG_SET);
flag(&entities[93].flags, CARD_SPELL, FLAG_SET);
flag(&entities[93].flags, CARD_AOE, FLAG_SET);
flag(&entities[93].flags, spell_aoe_EX1_400_FLAG, FLAG_SET);
flag(&entities[93].flags, CARD_NONTARGET, FLAG_SET);
flag(&entities[26].flags, attack_effect_attachment_LOEA06_03e_FLAG, FLAG_SET);
flag(&entities[30].flags, CARD_SPELL, FLAG_SET);
flag(&entities[30].flags, CARD_AOE, FLAG_SET);
flag(&entities[30].flags, CARD_WEAPON, FLAG_SET);
flag(&entities[30].flags, CARD_NONTARGET, FLAG_SET);
flag(&entities[30].flags, weapon_LOE_118_FLAG, FLAG_SET);
flag(&entities[30].flags, idle_LOE_118_FLAG, FLAG_SET);
flag(&entities[30].flags, weapon_destroyed_LOE_118_FLAG, FLAG_SET);
flag(&entities[30].flags, weapon_attack_LOE_118_FLAG, FLAG_SET);
flag(&entities[30].flags, onboard_LOE_118_FLAG, FLAG_SET);
flag(&entities[25].flags, CARD_BUFF, FLAG_SET);
flag(&entities[25].flags, CARD_SPELL, FLAG_SET);
flag(&entities[25].flags, buff_LOEA06_03_FLAG, FLAG_SET);
flag(&entities[25].flags, CARD_TARGET_ENEMY_BOARD, FLAG_SET);
flag(&entities[25].flags, CARD_TARGETING, FLAG_SET);
flag(&entities[92].flags, CARD_SPELL, FLAG_SET);
flag(&entities[92].flags, CARD_AOE, FLAG_SET);
flag(&entities[92].flags, spell_aoe_CS2_026_FLAG, FLAG_SET);
flag(&entities[92].flags, CARD_NONTARGET, FLAG_SET);
flag(&entities[107].flags, CARD_MINION, FLAG_SET);
flag(&entities[107].flags, CARD_TARGETING, FLAG_SET);
flag(&entities[107].flags, attack_EX1_306_FLAG, FLAG_SET);
flag(&entities[107].flags, CARD_BATTLECRY, FLAG_SET);
flag(&entities[107].flags, battlecry_EX1_306_FLAG, FLAG_SET);
flag(&entities[107].flags, CARD_NONTARGET_BC, FLAG_SET);
flag(&entities[96].flags, destroyed_CS2_222_FLAG, FLAG_SET);
flag(&entities[96].flags, CARD_MINION, FLAG_SET);
flag(&entities[96].flags, CARD_TARGETING, FLAG_SET);
flag(&entities[96].flags, attack_CS2_222_FLAG, FLAG_SET);
flag(&entities[96].flags, idle_CS2_222_FLAG, FLAG_SET);
flag(&entities[96].flags, onboard_CS2_222_FLAG, FLAG_SET);
flag(&entities[120].flags, destroyed_CS2_231_FLAG, FLAG_SET);
flag(&entities[120].flags, CARD_MINION, FLAG_SET);
flag(&entities[120].flags, CARD_TARGETING, FLAG_SET);
flag(&entities[120].flags, attack_CS2_231_FLAG, FLAG_SET);
flag(&entities[120].flags, idle_CS2_231_FLAG, FLAG_SET);
flag(&entities[120].flags, onboard_CS2_231_FLAG, FLAG_SET);
}
+2 -5
View File
@@ -2,14 +2,11 @@ INCS=-Isrc/include -I../hm_base/src/include -I/usr/include/json-c/
LIB_PATH=-L../hm_base/lib
LIB=-lhmbase -lm -lev -ljson-c -lcouchbase
all: base mods
$(CC) -g -DMOD_$(mod) $(INCS) $(LIB_PATH) src/*.c $(LIB) -o hm_lobbyserver
all: base
$(CC) -g $(INCS) $(LIB_PATH) src/*.c $(LIB) -o hm_lobbyserver
base:
$(MAKE) -C ../hm_base target=lobby
mods:
cd script/ && python main.py
clean:
rm hm_lobbyserver
-5
View File
@@ -1,7 +1,2 @@
# hm_lobbyserver
hearthmod lobby server
# This is not a standalone project!
[hm_lobbyserver](https://github.com/farb3yonddriv3n/hm_lobbyserver) is part of [hearthmod software stack](https://github.com/hearthmod/hearthmod)
BIN
View File
Binary file not shown.
-37
View File
@@ -1,37 +0,0 @@
try:
import couchbase
from couchbase.bucket import Bucket
from couchbase.views.iterator import View
except:
import couchbase_ffi
from couchbase_ffi.bucket import Bucket
from couchbase_ffi.views.iterator import View
cb = Bucket('couchbase://localhost/hbs', password='aci')
def prepare_mods():
l = []
for result in View(cb, "dev_mods", "mods"):
l.append({ "url": result.value["url"], "name": result.value["name"] })
out = '#ifndef MODS_H_\n'
out += '#define MODS_H_\n\n'
for i in l:
out += '#ifdef MOD_%s\n' % i['url'].upper()
out += '#define MOD_NAME "%s"\n' % i['name']
out += '#define MOD_URL "%s"\n' % i['url']
out += '#endif // MOD_%s\n\n' % i['url']
out += '#endif'
f = open("../src/include/mods.h", "w")
f.write(out)
f.close()
f = open("../../hm_gameserver/src/include/mods.h", "w")
f.write(out)
f.close()
if __name__ == '__main__':
prepare_mods()
+5 -8
View File
@@ -25,7 +25,6 @@
#define HM_LOBBYSERVER
#include <hmbase.h>
#include <mods.h>
#include <client.h>
@@ -39,8 +38,6 @@ void login_reply(struct conn_client_s *cs, int error)
json_object_object_add(obj, "type", json_object_new_int(CLIENT_LOGIN));
json_object_object_add(obj, "error", json_object_new_int(error));
json_object_object_add(obj, "secret", json_object_new_string(cs->login.secret));
json_object_object_add(obj, "mod_name", json_object_new_string(MOD_NAME));
json_object_object_add(obj, "mod_url", json_object_new_string(MOD_URL));
const char *str = json_object_get_string(obj);
hm_send(cs, str, strlen(str));
@@ -99,9 +96,9 @@ void client_login_2(struct cbop_s *cbop)
cbop->data = cs;
char k1[128];
snprintf(k1, sizeof(k1), "u:deck_%s_%s", MOD_URL, cs->login.secret);
CBGQ_V0(0, k1, strlen(k1), client_login_3, 0, 0);
return;
snprintf(k1, sizeof(k1), "u:deck_%s", cs->login.secret);
CBGQ_V0(0, k1, strlen(k1), client_login_3, 0, 0)
return;
} else {
hm_log(LOG_DEBUG, cs->log, "{Client}: passwords do not match %s %s", cs->login.pass, v);
free(cbop);
@@ -164,8 +161,8 @@ void client_login(struct conn_client_s *cs, const char *buf, int len)
cbop = malloc(sizeof(*cbop));
memset(cbop, 0, sizeof(*cbop));
cbop->data = cs;
CBGQ_V0(0, k, strlen(k), client_login_2, 0, 0);
CBGQ_V0(0, k, strlen(k), client_login_2, 0, 0)
json_object_put(obj);
json_object_put(obj);
json_tokener_free(tok);
}
+1 -1
View File
@@ -122,7 +122,7 @@ int step22_7(char *dst, int ndst);
int step22_8(char *dst, int ndst);
int step22_9_1(char *dst, int ndst, int iplen);
int step22_9_2(char *dst, int ndst, int port);
int step22_9_2(char *dst, int ndst);
int step22_9_ip(char *dst, int ndst, const char *ip, const int iplen);
#endif
+4 -13
View File
@@ -44,7 +44,6 @@ static struct ev_loop *loop;
char ip[32];
int iplen = 0;
int gameserver_port = 0;
void dump_binary(char *buf, int len)
{
@@ -550,7 +549,7 @@ void start_game(struct conn_client_s *p1, struct conn_client_s *p2, const int ga
t += step22_8(out + t, sizeof(buf2) - t);
t += step22_9_1(out + t, sizeof(buf2) - t, iplen);
t += step22_9_ip(out + t, sizeof(buf2) - t, ip, iplen);
t += step22_9_2(out + t, sizeof(buf2) - t, gameserver_port);
t += step22_9_2(out + t, sizeof(buf2) - t);
t = 0;
out = buf2;
@@ -565,7 +564,7 @@ void start_game(struct conn_client_s *p1, struct conn_client_s *p2, const int ga
t += step22_8(out + t, sizeof(buf2) - t);
t += step22_9_1(out + t, sizeof(buf2) - t, iplen);
t += step22_9_ip(out + t, sizeof(buf2) - t, ip, iplen);
t += step22_9_2(out + t, sizeof(buf2) - t, gameserver_port);
t += step22_9_2(out + t, sizeof(buf2) - t);
memcpy(buf1 + 1343 + (iplen - 14), p1->token, p1->ntoken);
memcpy(buf2 + 1343 + (iplen - 14), p2->token, p2->ntoken);
@@ -793,17 +792,9 @@ int main(int argc, char **argv)
snprintf(ip, sizeof(ip), "%s", argv[i] + 13);
iplen = strlen(ip);
}
if(strlen(argv[i]) > 18 && memcmp(argv[i], "--gameserver_port=", 18) == 0) {
char gp[32];
snprintf(gp, sizeof(gp), "%s", argv[i] + 18);
gameserver_port = atoi(gp);
}
}
assert(iplen != 0);
// gameserver port number must occupy exactly 2 protobuf bytes
assert(gameserver_port > (1 << 10) && gameserver_port < (1 << 14));
/* assert(iplen != 0); */
if(daemon == 0) {
hm_log_open(&l, NULL, LOG_DEBUG);
@@ -811,7 +802,7 @@ int main(int argc, char **argv)
daemonize();
}
hm_log(LOG_DEBUG, &l, "Associated with gameserver [%s:%d]", ip, gameserver_port);
hm_log(LOG_DEBUG, &l, "Associated with gameserver [%s]%d", ip, iplen);
loop = ev_default_loop(0);
pool = hm_create_pool(&l);
+3 -13
View File
@@ -135,19 +135,9 @@ int step22_9_1(char *dst, int ndst, int iplen) {
return 205;
}
int step22_9_2(char *dst, int ndst, int port) {
const char src[185] = { 0x18, 0x8C, 0x1D, 0x22, 0x06, 0x45, 0x6A, 0x63, 0x44, 0x65, 0x49, 0x2A, 0x13, 0x0A, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6F, 0x6E, 0x12, 0x08, 0x2A, 0x06, 0x32, 0x30, 0x38, 0x38, 0x39, 0x31, 0x2A, 0x0D, 0x0A, 0x04, 0x67, 0x61, 0x6D, 0x65, 0x12, 0x05, 0x18, 0xAA, 0x80, 0xC4, 0x06, 0x2A, 0x0C, 0x0A, 0x06, 0x70, 0x6C, 0x61, 0x79, 0x65, 0x72, 0x12, 0x02, 0x18, 0x01, 0x2A, 0x0B, 0x0A, 0x02, 0x69, 0x64, 0x12, 0x05, 0x18, 0xB2, 0xB0, 0xAA, 0x1C, 0x2A, 0x0F, 0x0A, 0x09, 0x72, 0x65, 0x73, 0x75, 0x6D, 0x61, 0x62, 0x6C, 0x65, 0x12, 0x02, 0x10, 0x01, 0x2A, 0x1E, 0x0A, 0x12, 0x73, 0x70, 0x65, 0x63, 0x74, 0x61, 0x74, 0x6F, 0x72, 0x5F, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6F, 0x72, 0x64, 0x12, 0x08, 0x2A, 0x06, 0x6F, 0x44, 0x69, 0x70, 0x49, 0x66, 0x4A, 0x0A, 0x08, 0x95, 0xA5, 0x67, 0x10, 0xE9, 0xE6, 0xAC, 0xB9, 0x05, 0x52, 0x15, 0x0A, 0x05, 0x0D, 0x93, 0x71, 0x0E, 0x1A, 0x12, 0x0C, 0x0D, 0x67, 0x39, 0xAB, 0x04, 0x15, 0x47, 0x43, 0x54, 0x57, 0x18, 0x02, };
char *ptr = (char *)&src[1];
write_uint(&ptr, ptr + 2, port);
if(ndst >= 158) {
memcpy(dst, src, 158);
} else {
abort();
}
return 158;
}
int step22_9_2(char *dst, int ndst) {const char src[185] = { 0x18, 0x8C, 0x1D, 0x22, 0x06, 0x45, 0x6A, 0x63, 0x44, 0x65, 0x49, 0x2A, 0x13, 0x0A, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6F, 0x6E, 0x12, 0x08, 0x2A, 0x06, 0x32, 0x30, 0x38, 0x38, 0x39, 0x31, 0x2A, 0x0D, 0x0A, 0x04, 0x67, 0x61, 0x6D, 0x65, 0x12, 0x05, 0x18, 0xAA, 0x80, 0xC4, 0x06, 0x2A, 0x0C, 0x0A, 0x06, 0x70, 0x6C, 0x61, 0x79, 0x65, 0x72, 0x12, 0x02, 0x18, 0x01, 0x2A, 0x0B, 0x0A, 0x02, 0x69, 0x64, 0x12, 0x05, 0x18, 0xB2, 0xB0, 0xAA, 0x1C, 0x2A, 0x0F, 0x0A, 0x09, 0x72, 0x65, 0x73, 0x75, 0x6D, 0x61, 0x62, 0x6C, 0x65, 0x12, 0x02, 0x10, 0x01, 0x2A, 0x1E, 0x0A, 0x12, 0x73, 0x70, 0x65, 0x63, 0x74, 0x61, 0x74, 0x6F, 0x72, 0x5F, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6F, 0x72, 0x64, 0x12, 0x08, 0x2A, 0x06, 0x6F, 0x44, 0x69, 0x70, 0x49, 0x66, 0x4A, 0x0A, 0x08, 0x95, 0xA5, 0x67, 0x10, 0xE9, 0xE6, 0xAC, 0xB9, 0x05, 0x52, 0x15, 0x0A, 0x05, 0x0D, 0x93, 0x71, 0x0E, 0x1A, 0x12, 0x0C, 0x0D, 0x67, 0x39, 0xAB, 0x04, 0x15, 0x47, 0x43, 0x54, 0x57, 0x18, 0x02, };
if(ndst >= 158) { memcpy(dst, src, 158); } else { abort(); }
return 158;}
int step22_9_ip(char *dst, int ndst, const char *ip, const int iplen)
{
+21
View File
@@ -0,0 +1,21 @@
default: build
clean:
rm -rf Makefile objs
build:
$(MAKE) -f objs/Makefile
$(MAKE) -f objs/Makefile manpage
install:
$(MAKE) -f objs/Makefile install
upgrade:
/usr/local/nginx/sbin/nginx -t
kill -USR2 `cat /usr/local/nginx/logs/nginx.pid`
sleep 1
test -f /usr/local/nginx/logs/nginx.pid.oldbin
kill -QUIT `cat /usr/local/nginx/logs/nginx.pid.oldbin`
Regular → Executable
View File
+27 -3
View File
@@ -40,11 +40,35 @@ http {
#access_log logs/host.access.log main;
location / {
root html;
index index.html index.htm;
location / {
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param SCRIPT_FILENAME $fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_pass 127.0.0.1:9002;
}
location /static/ {
root /app/hm_nginx/../hm_web/;
if (-f $request_filename) {
rewrite ^/static/(.*)$ /static/$1 break;
}
}
#location / {
# root html;
# index index.html index.htm;
#}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
Vendored Regular → Executable
View File
View File
File diff suppressed because it is too large Load Diff
+656
View File
@@ -0,0 +1,656 @@
----------------------------------------
checking for C compiler
----------------------------------------
checking for gcc -pipe switch
----------------------------------------
checking for gcc builtin atomic operations
----------------------------------------
checking for C99 variadic macros
----------------------------------------
checking for gcc variadic macros
----------------------------------------
checking for unistd.h
----------------------------------------
checking for inttypes.h
----------------------------------------
checking for limits.h
----------------------------------------
checking for sys/filio.h
objs/autotest.c:3:23: fatal error: sys/filio.h: No such file or directory
compilation terminated.
----------
#include <sys/filio.h>
int main() {
return 0;
}
----------
cc -o objs/autotest objs/autotest.c
----------
----------------------------------------
checking for sys/param.h
----------------------------------------
checking for sys/mount.h
----------------------------------------
checking for sys/statvfs.h
----------------------------------------
checking for crypt.h
----------------------------------------
checking for epoll
----------------------------------------
checking for EPOLLRDHUP
----------------------------------------
checking for O_PATH
----------------------------------------
checking for sendfile()
----------------------------------------
checking for sendfile64()
----------------------------------------
checking for sys/prctl.h
----------------------------------------
checking for prctl(PR_SET_DUMPABLE)
----------------------------------------
checking for sched_setaffinity()
----------------------------------------
checking for crypt_r()
----------------------------------------
checking for sys/vfs.h
----------------------------------------
checking for poll()
----------------------------------------
checking for /dev/poll
objs/autotest.c:4:25: fatal error: sys/devpoll.h: No such file or directory
compilation terminated.
----------
#include <sys/types.h>
#include <unistd.h>
#include <sys/devpoll.h>
int main() {
int n, dp; struct dvpoll dvp;
dp = 0;
dvp.dp_fds = NULL;
dvp.dp_nfds = 0;
dvp.dp_timeout = 0;
n = ioctl(dp, DP_POLL, &dvp);
if (n == -1) return 1;
return 0;
}
----------
cc -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -o objs/autotest objs/autotest.c
----------
----------------------------------------
checking for kqueue
objs/autotest.c:4:23: fatal error: sys/event.h: No such file or directory
compilation terminated.
----------
#include <sys/types.h>
#include <unistd.h>
#include <sys/event.h>
int main() {
int kq; kq = kqueue();
return 0;
}
----------
cc -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -o objs/autotest objs/autotest.c
----------
----------------------------------------
checking for crypt()
/tmp/ccBjPW1g.o: In function `main':
autotest.c:(.text+0xf): undefined reference to `crypt'
collect2: error: ld returned 1 exit status
----------
#include <sys/types.h>
#include <unistd.h>
int main() {
crypt("test", "salt");;
return 0;
}
----------
cc -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -o objs/autotest objs/autotest.c
----------
----------------------------------------
checking for crypt() in libcrypt
----------------------------------------
checking for F_READAHEAD
objs/autotest.c: In function 'main':
objs/autotest.c:7:14: error: 'F_READAHEAD' undeclared (first use in this function)
fcntl(0, F_READAHEAD, 1);;
^
objs/autotest.c:7:14: note: each undeclared identifier is reported only once for each function it appears in
----------
#include <sys/types.h>
#include <unistd.h>
#include <fcntl.h>
int main() {
fcntl(0, F_READAHEAD, 1);;
return 0;
}
----------
cc -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -o objs/autotest objs/autotest.c
----------
----------------------------------------
checking for posix_fadvise()
----------------------------------------
checking for O_DIRECT
----------------------------------------
checking for F_NOCACHE
objs/autotest.c: In function 'main':
objs/autotest.c:7:14: error: 'F_NOCACHE' undeclared (first use in this function)
fcntl(0, F_NOCACHE, 1);;
^
objs/autotest.c:7:14: note: each undeclared identifier is reported only once for each function it appears in
----------
#include <sys/types.h>
#include <unistd.h>
#include <fcntl.h>
int main() {
fcntl(0, F_NOCACHE, 1);;
return 0;
}
----------
cc -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -o objs/autotest objs/autotest.c
----------
----------------------------------------
checking for directio()
objs/autotest.c: In function 'main':
objs/autotest.c:8:5: warning: implicit declaration of function 'directio' [-Wimplicit-function-declaration]
directio(0, DIRECTIO_ON);;
^
objs/autotest.c:8:17: error: 'DIRECTIO_ON' undeclared (first use in this function)
directio(0, DIRECTIO_ON);;
^
objs/autotest.c:8:17: note: each undeclared identifier is reported only once for each function it appears in
----------
#include <sys/types.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/fcntl.h>
int main() {
directio(0, DIRECTIO_ON);;
return 0;
}
----------
cc -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -o objs/autotest objs/autotest.c
----------
----------------------------------------
checking for statfs()
----------------------------------------
checking for statvfs()
----------------------------------------
checking for dlopen()
/tmp/ccRfQzDW.o: In function `main':
autotest.c:(.text+0xf): undefined reference to `dlopen'
collect2: error: ld returned 1 exit status
----------
#include <sys/types.h>
#include <unistd.h>
#include <dlfcn.h>
int main() {
dlopen(NULL, 0);
return 0;
}
----------
cc -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -o objs/autotest objs/autotest.c
----------
----------------------------------------
checking for dlopen() in libdl
----------------------------------------
checking for sched_yield()
----------------------------------------
checking for SO_SETFIB
objs/autotest.c: In function 'main':
objs/autotest.c:7:31: error: 'SO_SETFIB' undeclared (first use in this function)
setsockopt(0, SOL_SOCKET, SO_SETFIB, NULL, 4);
^
objs/autotest.c:7:31: note: each undeclared identifier is reported only once for each function it appears in
----------
#include <sys/types.h>
#include <unistd.h>
#include <sys/socket.h>
int main() {
setsockopt(0, SOL_SOCKET, SO_SETFIB, NULL, 4);
return 0;
}
----------
cc -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -o objs/autotest objs/autotest.c
----------
----------------------------------------
checking for SO_ACCEPTFILTER
objs/autotest.c: In function 'main':
objs/autotest.c:7:31: error: 'SO_ACCEPTFILTER' undeclared (first use in this function)
setsockopt(0, SOL_SOCKET, SO_ACCEPTFILTER, NULL, 0);
^
objs/autotest.c:7:31: note: each undeclared identifier is reported only once for each function it appears in
----------
#include <sys/types.h>
#include <unistd.h>
#include <sys/socket.h>
int main() {
setsockopt(0, SOL_SOCKET, SO_ACCEPTFILTER, NULL, 0);
return 0;
}
----------
cc -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -o objs/autotest objs/autotest.c
----------
----------------------------------------
checking for TCP_DEFER_ACCEPT
----------------------------------------
checking for TCP_KEEPIDLE
----------------------------------------
checking for TCP_FASTOPEN
----------------------------------------
checking for TCP_INFO
----------------------------------------
checking for accept4()
----------------------------------------
checking for eventfd()
----------------------------------------
checking for int size
----------------------------------------
checking for long size
----------------------------------------
checking for long long size
----------------------------------------
checking for void * size
----------------------------------------
checking for uint64_t
----------------------------------------
checking for sig_atomic_t
----------------------------------------
checking for sig_atomic_t size
----------------------------------------
checking for socklen_t
----------------------------------------
checking for in_addr_t
----------------------------------------
checking for in_port_t
----------------------------------------
checking for rlim_t
checking for uintptr_t
checking for system byte ordering
----------------------------------------
checking for size_t size
----------------------------------------
checking for off_t size
----------------------------------------
checking for time_t size
----------------------------------------
checking for setproctitle()
objs/autotest.c: In function 'main':
objs/autotest.c:7:5: warning: implicit declaration of function 'setproctitle' [-Wimplicit-function-declaration]
setproctitle("test");;
^
/tmp/ccjBplGI.o: In function `main':
autotest.c:(.text+0xf): undefined reference to `setproctitle'
collect2: error: ld returned 1 exit status
----------
#include <sys/types.h>
#include <unistd.h>
#include <stdlib.h>
int main() {
setproctitle("test");;
return 0;
}
----------
cc -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -o objs/autotest objs/autotest.c
----------
----------------------------------------
checking for pread()
----------------------------------------
checking for pwrite()
----------------------------------------
checking for sys_nerr
/tmp/ccWsrzXf.o: In function `main':
autotest.c:(.text+0x6): warning: `sys_nerr' is deprecated; use `strerror' or `strerror_r' instead
135
----------------------------------------
checking for localtime_r()
----------------------------------------
checking for posix_memalign()
----------------------------------------
checking for memalign()
----------------------------------------
checking for mmap(MAP_ANON|MAP_SHARED)
----------------------------------------
checking for mmap("/dev/zero", MAP_SHARED)
----------------------------------------
checking for System V shared memory
----------------------------------------
checking for POSIX semaphores
/tmp/cc19ydxX.o: In function `main':
autotest.c:(.text+0x29): undefined reference to `sem_init'
autotest.c:(.text+0x41): undefined reference to `sem_destroy'
collect2: error: ld returned 1 exit status
----------
#include <sys/types.h>
#include <unistd.h>
#include <semaphore.h>
int main() {
sem_t sem;
if (sem_init(&sem, 1, 0) == -1) return 1;
sem_destroy(&sem);;
return 0;
}
----------
cc -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -o objs/autotest objs/autotest.c
----------
----------------------------------------
checking for POSIX semaphores in libpthread
----------------------------------------
checking for struct msghdr.msg_control
----------------------------------------
checking for ioctl(FIONBIO)
----------------------------------------
checking for struct tm.tm_gmtoff
----------------------------------------
checking for struct dirent.d_namlen
objs/autotest.c: In function 'main':
objs/autotest.c:8:28: error: 'struct dirent' has no member named 'd_namlen'
struct dirent dir; dir.d_namlen = 0;
^
objs/autotest.c:9:41: error: 'struct dirent' has no member named 'd_namlen'
printf("%d", (int) dir.d_namlen);
^
----------
#include <sys/types.h>
#include <unistd.h>
#include <dirent.h>
#include <stdio.h>
int main() {
struct dirent dir; dir.d_namlen = 0;
printf("%d", (int) dir.d_namlen);
return 0;
}
----------
cc -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -o objs/autotest objs/autotest.c
----------
----------------------------------------
checking for struct dirent.d_type
----------------------------------------
checking for sysconf(_SC_NPROCESSORS_ONLN)
----------------------------------------
checking for openat(), fstatat()
----------------------------------------
checking for getaddrinfo()
----------------------------------------
checking for PCRE library
----------------------------------------
checking for PCRE JIT support
----------------------------------------
checking for md5 in system md library
objs/autotest.c:4:17: fatal error: md5.h: No such file or directory
compilation terminated.
----------
#include <sys/types.h>
#include <unistd.h>
#include <md5.h>
int main() {
MD5_CTX md5; MD5Init(&md5);
return 0;
}
----------
cc -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -o objs/autotest objs/autotest.c -lmd
----------
----------------------------------------
checking for md5 in system md5 library
objs/autotest.c:4:17: fatal error: md5.h: No such file or directory
compilation terminated.
----------
#include <sys/types.h>
#include <unistd.h>
#include <md5.h>
int main() {
MD5_CTX md5; MD5Init(&md5);
return 0;
}
----------
cc -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -o objs/autotest objs/autotest.c -lmd5
----------
----------------------------------------
checking for md5 in system OpenSSL crypto library
----------------------------------------
checking for sha1 in system md library
objs/autotest.c:4:17: fatal error: sha.h: No such file or directory
compilation terminated.
----------
#include <sys/types.h>
#include <unistd.h>
#include <sha.h>
int main() {
SHA_CTX sha1; SHA1_Init(&sha1);
return 0;
}
----------
cc -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -o objs/autotest objs/autotest.c -lmd
----------
----------------------------------------
checking for sha1 in system OpenSSL crypto library
----------------------------------------
checking for zlib library
BIN
View File
Binary file not shown.
+202
View File
@@ -0,0 +1,202 @@
.\"
.\" Copyright (C) 2010 Sergey A. Osokin
.\" Copyright (C) Nginx, Inc.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\"
.Dd March 6, 2012
.Dt NGINX 8
.Os
.Sh NAME
.Nm nginx
.Nd "HTTP and reverse proxy server, mail proxy server"
.Sh SYNOPSIS
.Nm
.Op Fl ?hqtVv
.Op Fl c Ar file
.Op Fl g Ar directives
.Op Fl p Ar prefix
.Op Fl s Ar signal
.Sh DESCRIPTION
.Nm
(pronounced
.Dq engine x )
is an HTTP and reverse proxy server, as well as a mail proxy server.
It is known for its high performance, stability, rich feature set, simple
configuration, and low resource consumption.
.Pp
The options are as follows:
.Bl -tag -width ".Fl d Ar directives"
.It Fl ?\& , h
Print help.
.It Fl c Ar file
Use an alternative configuration
.Ar file .
.It Fl g Ar directives
Set global configuration directives.
See
.Sx EXAMPLES
for details.
.It Fl p Ar prefix
Set the prefix path.
The default value is
.Pa /usr/local/nginx .
.It Fl q
Suppress non-error messages during configuration testing.
.It Fl s Ar signal
Send a signal to the master process.
The argument
.Ar signal
can be one of:
.Cm stop , quit , reopen , reload .
The following table shows the corresponding system signals:
.Pp
.Bl -tag -width ".Cm reopen" -compact
.It Cm stop
.Dv SIGTERM
.It Cm quit
.Dv SIGQUIT
.It Cm reopen
.Dv SIGUSR1
.It Cm reload
.Dv SIGHUP
.El
.It Fl t
Do not run, just test the configuration file.
.Nm
checks the configuration file syntax and then tries to open files
referenced in the configuration file.
.It Fl V
Print the
.Nm
version, compiler version, and
.Pa configure
script parameters.
.It Fl v
Print the
.Nm
version.
.El
.Sh SIGNALS
The master process of
.Nm
can handle the following signals:
.Pp
.Bl -tag -width ".Dv SIGINT , SIGTERM" -compact
.It Dv SIGINT , SIGTERM
Shut down quickly.
.It Dv SIGHUP
Reload configuration, start the new worker process with a new
configuration, and gracefully shut down old worker processes.
.It Dv SIGQUIT
Shut down gracefully.
.It Dv SIGUSR1
Reopen log files.
.It Dv SIGUSR2
Upgrade the
.Nm
executable on the fly.
.It Dv SIGWINCH
Shut down worker processes gracefully.
.El
.Pp
While there is no need to explicitly control worker processes normally,
they support some signals too:
.Pp
.Bl -tag -width ".Dv SIGINT , SIGTERM" -compact
.It Dv SIGTERM
Shut down quickly.
.It Dv SIGQUIT
Shut down gracefully.
.It Dv SIGUSR1
Reopen log files.
.El
.Sh DEBUGGING LOG
To enable a debugging log, reconfigure
.Nm
to build with debugging:
.Pp
.Dl "./configure --with-debug ..."
.Pp
and then set the
.Cm debug
level of the
.Va error_log :
.Pp
.Dl "error_log /path/to/log debug;"
.Pp
It is also possible to enable the debugging for a particular IP address:
.Bd -literal -offset indent
events {
debug_connection 127.0.0.1;
}
.Ed
.Sh ENVIRONMENT
The
.Ev NGINX
environment variable is used internally by
.Nm
and should not be set directly by the user.
.Sh FILES
.Bl -tag -width indent
.It Pa /usr/local/nginx/logs/nginx.pid
Contains the process ID of
.Nm .
The contents of this file are not sensitive, so it can be world-readable.
.It Pa /usr/local/nginx/conf/nginx.conf
The main configuration file.
.It Pa /usr/local/nginx/logs/error.log
Error log file.
.El
.Sh EXIT STATUS
Exit status is 0 on success, or 1 if the command fails.
.Sh EXAMPLES
Test configuration file
.Pa ~/mynginx.conf
with global directives for PID and quantity of worker processes:
.Bd -literal -offset indent
nginx -t -c ~/mynginx.conf \e
-g "pid /var/run/mynginx.pid; worker_processes 2;"
.Ed
.Sh SEE ALSO
.\"Xr nginx.conf 5
.\"Pp
Documentation at
.Pa http://nginx.org/en/docs/ .
.Pp
For questions and technical support, please refer to
.Pa http://nginx.org/en/support.html .
.Sh HISTORY
Development of
.Nm
started in 2002, with the first public release on October 4, 2004.
.Sh AUTHORS
.An -nosplit
.An Igor Sysoev Aq igor@sysoev.ru .
.Pp
This manual page was originally written by
.An Sergey A. Osokin Aq osa@FreeBSD.org.ru
as a result of compiling many
.Nm
documents from all over the world.
+439
View File
@@ -0,0 +1,439 @@
#define NGX_CONFIGURE ""
#ifndef NGX_COMPILER
#define NGX_COMPILER "gcc 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.12) "
#endif
#ifndef NGX_HAVE_GCC_ATOMIC
#define NGX_HAVE_GCC_ATOMIC 1
#endif
#ifndef NGX_HAVE_C99_VARIADIC_MACROS
#define NGX_HAVE_C99_VARIADIC_MACROS 1
#endif
#ifndef NGX_HAVE_GCC_VARIADIC_MACROS
#define NGX_HAVE_GCC_VARIADIC_MACROS 1
#endif
#ifndef NGX_HAVE_EPOLL
#define NGX_HAVE_EPOLL 1
#endif
#ifndef NGX_HAVE_CLEAR_EVENT
#define NGX_HAVE_CLEAR_EVENT 1
#endif
#ifndef NGX_HAVE_EPOLLRDHUP
#define NGX_HAVE_EPOLLRDHUP 1
#endif
#ifndef NGX_HAVE_O_PATH
#define NGX_HAVE_O_PATH 1
#endif
#ifndef NGX_HAVE_SENDFILE
#define NGX_HAVE_SENDFILE 1
#endif
#ifndef NGX_HAVE_SENDFILE64
#define NGX_HAVE_SENDFILE64 1
#endif
#ifndef NGX_HAVE_PR_SET_DUMPABLE
#define NGX_HAVE_PR_SET_DUMPABLE 1
#endif
#ifndef NGX_HAVE_SCHED_SETAFFINITY
#define NGX_HAVE_SCHED_SETAFFINITY 1
#endif
#ifndef NGX_HAVE_GNU_CRYPT_R
#define NGX_HAVE_GNU_CRYPT_R 1
#endif
#ifndef NGX_HAVE_NONALIGNED
#define NGX_HAVE_NONALIGNED 1
#endif
#ifndef NGX_CPU_CACHE_LINE
#define NGX_CPU_CACHE_LINE 64
#endif
#define NGX_KQUEUE_UDATA_T (void *)
#ifndef NGX_HAVE_POSIX_FADVISE
#define NGX_HAVE_POSIX_FADVISE 1
#endif
#ifndef NGX_HAVE_O_DIRECT
#define NGX_HAVE_O_DIRECT 1
#endif
#ifndef NGX_HAVE_ALIGNED_DIRECTIO
#define NGX_HAVE_ALIGNED_DIRECTIO 1
#endif
#ifndef NGX_HAVE_STATFS
#define NGX_HAVE_STATFS 1
#endif
#ifndef NGX_HAVE_STATVFS
#define NGX_HAVE_STATVFS 1
#endif
#ifndef NGX_HAVE_SCHED_YIELD
#define NGX_HAVE_SCHED_YIELD 1
#endif
#ifndef NGX_HAVE_DEFERRED_ACCEPT
#define NGX_HAVE_DEFERRED_ACCEPT 1
#endif
#ifndef NGX_HAVE_KEEPALIVE_TUNABLE
#define NGX_HAVE_KEEPALIVE_TUNABLE 1
#endif
#ifndef NGX_HAVE_TCP_FASTOPEN
#define NGX_HAVE_TCP_FASTOPEN 1
#endif
#ifndef NGX_HAVE_TCP_INFO
#define NGX_HAVE_TCP_INFO 1
#endif
#ifndef NGX_HAVE_ACCEPT4
#define NGX_HAVE_ACCEPT4 1
#endif
#ifndef NGX_HAVE_EVENTFD
#define NGX_HAVE_EVENTFD 1
#endif
#ifndef NGX_HAVE_SYS_EVENTFD_H
#define NGX_HAVE_SYS_EVENTFD_H 1
#endif
#ifndef NGX_HAVE_UNIX_DOMAIN
#define NGX_HAVE_UNIX_DOMAIN 1
#endif
#ifndef NGX_PTR_SIZE
#define NGX_PTR_SIZE 8
#endif
#ifndef NGX_SIG_ATOMIC_T_SIZE
#define NGX_SIG_ATOMIC_T_SIZE 4
#endif
#ifndef NGX_HAVE_LITTLE_ENDIAN
#define NGX_HAVE_LITTLE_ENDIAN 1
#endif
#ifndef NGX_MAX_SIZE_T_VALUE
#define NGX_MAX_SIZE_T_VALUE 9223372036854775807LL
#endif
#ifndef NGX_SIZE_T_LEN
#define NGX_SIZE_T_LEN (sizeof("-9223372036854775808") - 1)
#endif
#ifndef NGX_MAX_OFF_T_VALUE
#define NGX_MAX_OFF_T_VALUE 9223372036854775807LL
#endif
#ifndef NGX_OFF_T_LEN
#define NGX_OFF_T_LEN (sizeof("-9223372036854775808") - 1)
#endif
#ifndef NGX_TIME_T_SIZE
#define NGX_TIME_T_SIZE 8
#endif
#ifndef NGX_TIME_T_LEN
#define NGX_TIME_T_LEN (sizeof("-9223372036854775808") - 1)
#endif
#ifndef NGX_MAX_TIME_T_VALUE
#define NGX_MAX_TIME_T_VALUE 9223372036854775807LL
#endif
#ifndef NGX_HAVE_PREAD
#define NGX_HAVE_PREAD 1
#endif
#ifndef NGX_HAVE_PWRITE
#define NGX_HAVE_PWRITE 1
#endif
#ifndef NGX_SYS_NERR
#define NGX_SYS_NERR 135
#endif
#ifndef NGX_HAVE_LOCALTIME_R
#define NGX_HAVE_LOCALTIME_R 1
#endif
#ifndef NGX_HAVE_POSIX_MEMALIGN
#define NGX_HAVE_POSIX_MEMALIGN 1
#endif
#ifndef NGX_HAVE_MEMALIGN
#define NGX_HAVE_MEMALIGN 1
#endif
#ifndef NGX_HAVE_MAP_ANON
#define NGX_HAVE_MAP_ANON 1
#endif
#ifndef NGX_HAVE_MAP_DEVZERO
#define NGX_HAVE_MAP_DEVZERO 1
#endif
#ifndef NGX_HAVE_SYSVSHM
#define NGX_HAVE_SYSVSHM 1
#endif
#ifndef NGX_HAVE_POSIX_SEM
#define NGX_HAVE_POSIX_SEM 1
#endif
#ifndef NGX_HAVE_MSGHDR_MSG_CONTROL
#define NGX_HAVE_MSGHDR_MSG_CONTROL 1
#endif
#ifndef NGX_HAVE_FIONBIO
#define NGX_HAVE_FIONBIO 1
#endif
#ifndef NGX_HAVE_GMTOFF
#define NGX_HAVE_GMTOFF 1
#endif
#ifndef NGX_HAVE_D_TYPE
#define NGX_HAVE_D_TYPE 1
#endif
#ifndef NGX_HAVE_SC_NPROCESSORS_ONLN
#define NGX_HAVE_SC_NPROCESSORS_ONLN 1
#endif
#ifndef NGX_HAVE_OPENAT
#define NGX_HAVE_OPENAT 1
#endif
#ifndef NGX_HAVE_GETADDRINFO
#define NGX_HAVE_GETADDRINFO 1
#endif
#ifndef NGX_HTTP_CACHE
#define NGX_HTTP_CACHE 1
#endif
#ifndef NGX_HTTP_GZIP
#define NGX_HTTP_GZIP 1
#endif
#ifndef NGX_HTTP_SSI
#define NGX_HTTP_SSI 1
#endif
#ifndef NGX_CRYPT
#define NGX_CRYPT 1
#endif
#ifndef NGX_HTTP_X_FORWARDED_FOR
#define NGX_HTTP_X_FORWARDED_FOR 1
#endif
#ifndef NGX_HTTP_X_FORWARDED_FOR
#define NGX_HTTP_X_FORWARDED_FOR 1
#endif
#ifndef NGX_PCRE
#define NGX_PCRE 1
#endif
#ifndef NGX_HAVE_PCRE_JIT
#define NGX_HAVE_PCRE_JIT 1
#endif
#ifndef NGX_OPENSSL_MD5
#define NGX_OPENSSL_MD5 1
#endif
#ifndef NGX_HAVE_OPENSSL_MD5_H
#define NGX_HAVE_OPENSSL_MD5_H 1
#endif
#ifndef NGX_HAVE_MD5
#define NGX_HAVE_MD5 1
#endif
#ifndef NGX_HAVE_SHA1
#define NGX_HAVE_SHA1 1
#endif
#ifndef NGX_HAVE_OPENSSL_SHA1_H
#define NGX_HAVE_OPENSSL_SHA1_H 1
#endif
#ifndef NGX_ZLIB
#define NGX_ZLIB 1
#endif
#ifndef NGX_PREFIX
#define NGX_PREFIX "/usr/local/nginx/"
#endif
#ifndef NGX_CONF_PREFIX
#define NGX_CONF_PREFIX "conf/"
#endif
#ifndef NGX_SBIN_PATH
#define NGX_SBIN_PATH ""
#endif
#ifndef NGX_CONF_PATH
#define NGX_CONF_PATH "conf/nginx.conf"
#endif
#ifndef NGX_PID_PATH
#define NGX_PID_PATH "logs/nginx.pid"
#endif
#ifndef NGX_LOCK_PATH
#define NGX_LOCK_PATH "logs/nginx.lock"
#endif
#ifndef NGX_ERROR_LOG_PATH
#define NGX_ERROR_LOG_PATH "logs/error.log"
#endif
#ifndef NGX_HTTP_LOG_PATH
#define NGX_HTTP_LOG_PATH "logs/access.log"
#endif
#ifndef NGX_HTTP_CLIENT_TEMP_PATH
#define NGX_HTTP_CLIENT_TEMP_PATH "client_body_temp"
#endif
#ifndef NGX_HTTP_PROXY_TEMP_PATH
#define NGX_HTTP_PROXY_TEMP_PATH "proxy_temp"
#endif
#ifndef NGX_HTTP_FASTCGI_TEMP_PATH
#define NGX_HTTP_FASTCGI_TEMP_PATH "fastcgi_temp"
#endif
#ifndef NGX_HTTP_UWSGI_TEMP_PATH
#define NGX_HTTP_UWSGI_TEMP_PATH "uwsgi_temp"
#endif
#ifndef NGX_HTTP_SCGI_TEMP_PATH
#define NGX_HTTP_SCGI_TEMP_PATH "scgi_temp"
#endif
#ifndef NGX_SUPPRESS_WARN
#define NGX_SUPPRESS_WARN 1
#endif
#ifndef NGX_SMP
#define NGX_SMP 1
#endif
#ifndef NGX_USER
#define NGX_USER "nobody"
#endif
#ifndef NGX_GROUP
#define NGX_GROUP "nogroup"
#endif
+51
View File
@@ -0,0 +1,51 @@
#ifndef NGX_HAVE_UNISTD_H
#define NGX_HAVE_UNISTD_H 1
#endif
#ifndef NGX_HAVE_INTTYPES_H
#define NGX_HAVE_INTTYPES_H 1
#endif
#ifndef NGX_HAVE_LIMITS_H
#define NGX_HAVE_LIMITS_H 1
#endif
#ifndef NGX_HAVE_SYS_PARAM_H
#define NGX_HAVE_SYS_PARAM_H 1
#endif
#ifndef NGX_HAVE_SYS_MOUNT_H
#define NGX_HAVE_SYS_MOUNT_H 1
#endif
#ifndef NGX_HAVE_SYS_STATVFS_H
#define NGX_HAVE_SYS_STATVFS_H 1
#endif
#ifndef NGX_HAVE_CRYPT_H
#define NGX_HAVE_CRYPT_H 1
#endif
#ifndef NGX_LINUX
#define NGX_LINUX 1
#endif
#ifndef NGX_HAVE_SYS_PRCTL_H
#define NGX_HAVE_SYS_PRCTL_H 1
#endif
#ifndef NGX_HAVE_SYS_VFS_H
#define NGX_HAVE_SYS_VFS_H 1
#endif
+105
View File
@@ -0,0 +1,105 @@
#include <ngx_config.h>
#include <ngx_core.h>
extern ngx_module_t ngx_core_module;
extern ngx_module_t ngx_errlog_module;
extern ngx_module_t ngx_conf_module;
extern ngx_module_t ngx_events_module;
extern ngx_module_t ngx_event_core_module;
extern ngx_module_t ngx_epoll_module;
extern ngx_module_t ngx_regex_module;
extern ngx_module_t ngx_http_module;
extern ngx_module_t ngx_http_core_module;
extern ngx_module_t ngx_http_log_module;
extern ngx_module_t ngx_http_upstream_module;
extern ngx_module_t ngx_http_static_module;
extern ngx_module_t ngx_http_autoindex_module;
extern ngx_module_t ngx_http_index_module;
extern ngx_module_t ngx_http_auth_basic_module;
extern ngx_module_t ngx_http_access_module;
extern ngx_module_t ngx_http_limit_conn_module;
extern ngx_module_t ngx_http_limit_req_module;
extern ngx_module_t ngx_http_geo_module;
extern ngx_module_t ngx_http_map_module;
extern ngx_module_t ngx_http_split_clients_module;
extern ngx_module_t ngx_http_referer_module;
extern ngx_module_t ngx_http_rewrite_module;
extern ngx_module_t ngx_http_proxy_module;
extern ngx_module_t ngx_http_fastcgi_module;
extern ngx_module_t ngx_http_uwsgi_module;
extern ngx_module_t ngx_http_scgi_module;
extern ngx_module_t ngx_http_memcached_module;
extern ngx_module_t ngx_http_empty_gif_module;
extern ngx_module_t ngx_http_browser_module;
extern ngx_module_t ngx_http_upstream_hash_module;
extern ngx_module_t ngx_http_upstream_ip_hash_module;
extern ngx_module_t ngx_http_upstream_least_conn_module;
extern ngx_module_t ngx_http_upstream_keepalive_module;
extern ngx_module_t ngx_http_write_filter_module;
extern ngx_module_t ngx_http_header_filter_module;
extern ngx_module_t ngx_http_chunked_filter_module;
extern ngx_module_t ngx_http_range_header_filter_module;
extern ngx_module_t ngx_http_gzip_filter_module;
extern ngx_module_t ngx_http_postpone_filter_module;
extern ngx_module_t ngx_http_ssi_filter_module;
extern ngx_module_t ngx_http_charset_filter_module;
extern ngx_module_t ngx_http_userid_filter_module;
extern ngx_module_t ngx_http_headers_filter_module;
extern ngx_module_t ngx_http_copy_filter_module;
extern ngx_module_t ngx_http_range_body_filter_module;
extern ngx_module_t ngx_http_not_modified_filter_module;
ngx_module_t *ngx_modules[] = {
&ngx_core_module,
&ngx_errlog_module,
&ngx_conf_module,
&ngx_events_module,
&ngx_event_core_module,
&ngx_epoll_module,
&ngx_regex_module,
&ngx_http_module,
&ngx_http_core_module,
&ngx_http_log_module,
&ngx_http_upstream_module,
&ngx_http_static_module,
&ngx_http_autoindex_module,
&ngx_http_index_module,
&ngx_http_auth_basic_module,
&ngx_http_access_module,
&ngx_http_limit_conn_module,
&ngx_http_limit_req_module,
&ngx_http_geo_module,
&ngx_http_map_module,
&ngx_http_split_clients_module,
&ngx_http_referer_module,
&ngx_http_rewrite_module,
&ngx_http_proxy_module,
&ngx_http_fastcgi_module,
&ngx_http_uwsgi_module,
&ngx_http_scgi_module,
&ngx_http_memcached_module,
&ngx_http_empty_gif_module,
&ngx_http_browser_module,
&ngx_http_upstream_hash_module,
&ngx_http_upstream_ip_hash_module,
&ngx_http_upstream_least_conn_module,
&ngx_http_upstream_keepalive_module,
&ngx_http_write_filter_module,
&ngx_http_header_filter_module,
&ngx_http_chunked_filter_module,
&ngx_http_range_header_filter_module,
&ngx_http_gzip_filter_module,
&ngx_http_postpone_filter_module,
&ngx_http_ssi_filter_module,
&ngx_http_charset_filter_module,
&ngx_http_userid_filter_module,
&ngx_http_headers_filter_module,
&ngx_http_copy_filter_module,
&ngx_http_range_body_filter_module,
&ngx_http_not_modified_filter_module,
NULL
};
-674
View File
@@ -1,674 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
{one line to give the program's name and a brief idea of what it does.}
Copyright (C) {year} {name of author}
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
{project} Copyright (C) {year} {fullname}
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
-45
View File
@@ -1,45 +0,0 @@
INCS= -Isrc/include -I../hm_base/src/include
LIBS_PATH= -L../hm_base/lib/
LIBS= -lhmbase
CFLAGS+= -g
compile = $(CC) -c $(CFLAGS) $(INCS) $(LIBS_PATH) src/$(1).c -o src/$(1).o $(LIBS)
static: hmproto
hmproto:
rm -rf lib/
$(call compile,alloptions)
$(call compile,bnet)
$(call compile,chooseentities)
$(call compile,chooseoption)
$(call compile,creategame)
$(call compile,packet)
$(call compile,entity)
$(call compile,entitychoices)
$(call compile,game_entity)
$(call compile,gamesetup)
$(call compile,handshake)
$(call compile,hide)
$(call compile,meta)
$(call compile,mouseinfo)
$(call compile,option)
$(call compile,platform)
$(call compile,player)
$(call compile,powerend)
$(call compile,powerhistory)
$(call compile,powerhistorydata)
$(call compile,powerstart)
$(call compile,proto)
$(call compile,suboption)
$(call compile,tag)
$(call compile,tagchange)
$(call compile,turntimer)
$(call compile,userui)
mkdir -p lib/
ar cq lib/libhmproto.a src/*.o
clean:
rm -rf src/*.o ./lib/
.PHONY: static hmproto
-2
View File
@@ -1,2 +0,0 @@
# hm_proto
hearthmod proto
-87
View File
@@ -1,87 +0,0 @@
/*
hm_gameserver - hearthmod gameserver
Copyright (C) 2016 Filip Pancik
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <proto.h>
void alloptions_free(struct alloptions_s *a)
{
struct option_s *o, *del;
for(o = a->options; o != NULL; del = o, o = o->next, option_free(del));
free(a);
}
int alloptions_serialize(void *ao, char **dst, const char *maxdst)
{
int n = 0;
struct option_s *m;
struct alloptions_s *s;
char *start;
start = *dst;
s = ao;
write_byte(dst, maxdst, 8);
write_uint64(dst, maxdst, s->id);
for(m = s->options; m != NULL; m = m->next) {
write_byte(dst, maxdst, 18);
n = option_size(m);
write_uint(dst, maxdst, n);
option_serialize(m, dst, maxdst);
}
return (*dst - start);
}
int alloptions_size(struct alloptions_s *p)
{
int num = 0, n;
struct option_s *s;
num += 1;
num += sizeofu64(p->id);
for(s = p->options; s != NULL; s = s->next) {
num += 1;
n = option_size(s);
num += sizeofu32(n) + n;
}
return num;
}
void alloptions_dump(struct alloptions_s *a)
{
struct suboption_target_s *t;
struct suboption_s *m;
struct option_s *o;
hm_log(LOG_DEBUG, lg, "Dumping alloptions:");
hm_log(LOG_DEBUG, lg, "id: %lld", a->id);
for(o = a->options; o != NULL; o = o->next) {
hm_log(LOG_DEBUG, lg, "\tOption type: %lld", o->type);
for(m = o->mainoption; m != NULL; m = m->next) {
hm_log(LOG_DEBUG, lg, "\t\tMainoption id: %lld", m->id);
for(t = m->target; t != NULL; t = t->next) {
hm_log(LOG_DEBUG, lg, "\t\t\tTarget id: %lld", t->value);
}
}
assert(o->suboptions == NULL);
}
}
-31
View File
@@ -1,31 +0,0 @@
/*
hm_gameserver - hearthmod gameserver
Copyright (C) 2016 Filip Pancik
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <proto.h>
int bnet_size(struct powerhistory_player_s *player)
{
int size = 0;
if(player) {
size += 2;
size += sizeofu64(player->bnet_hi);
size += sizeofu64(player->bnet_lo);
}
return size;
}
-87
View File
@@ -1,87 +0,0 @@
/*
hm_gameserver - hearthmod gameserver
Copyright (C) 2016 Filip Pancik
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <proto.h>
void chooseentities_free(struct chooseentities_s *c)
{
struct chooseentities_ent_s *e, *del;
for(e = c->entity; e != NULL; del = e, e = e->next, free(del));
free(c);
}
int chooseentities_serialize(void *ao, char **dst, const char *maxdst)
{
struct chooseentities_s *s;
struct chooseentities_ent_s *e;
char *start;
start = *dst;
s = ao;
write_byte(dst, maxdst, 8);
write_uint64(dst, maxdst, s->id);
write_byte(dst, maxdst, 18);
write_uint64(dst, maxdst, s->nentity);
for(e = s->entity; e != NULL; e = e->next) {
write_uint(dst, maxdst, e->entity);
}
return (*dst - start);
}
void *chooseentities_deserialize(char **dst, const char *maxdst)
{
int n, i;
struct chooseentities_s *c;
struct chooseentities_ent_s *e;
c = malloc(sizeof(*c));
memset(c, 0, sizeof(*c));
n = read_byte(dst, maxdst);
if(n != 8) {
error();
}
c->id = read_uint64(dst, maxdst);
c->entity = NULL;
n = read_byte(dst, maxdst);
if(n != 18) {
return c;
}
c->nentity = read_uint(dst, maxdst);
if(c->nentity > 5 || c->nentity < 0) {
free(c);
return NULL;
}
for(i = 0; i < c->nentity && *dst < maxdst; i++) {
e = malloc(sizeof(*e));
e->entity = read_uint(dst, maxdst);
e->next = c->entity;
c->entity = e;
}
return c;
}
-99
View File
@@ -1,99 +0,0 @@
/*
hm_gameserver - hearthmod gameserver
Copyright (C) 2016 Filip Pancik
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <proto.h>
void chooseoption_free(struct chooseoption_s *c)
{
free(c);
}
int chooseoption_serialize(void *ao, char **dst, const char *maxdst)
{
struct chooseoption_s *s;
char *start;
start = *dst;
s = ao;
write_byte(dst, maxdst, 8);
write_uint64(dst, maxdst, s->id);
write_byte(dst, maxdst, 16);
write_uint64(dst, maxdst, s->index);
write_byte(dst, maxdst, 24);
write_uint64(dst, maxdst, s->target);
if(s->suboption != 0) {
write_byte(dst, maxdst, 32);
write_uint64(dst, maxdst, s->suboption);
}
if(s->position != 0) {
write_byte(dst, maxdst, 40);
write_uint64(dst, maxdst, s->position);
}
return (*dst - start);
}
void *chooseoption_deserialize(char **dst, const char *maxdst)
{
int n;
struct chooseoption_s *o;
o = malloc(sizeof(*o));
memset(o, 0, sizeof(*o));
n = read_byte(dst, maxdst);
if(n != 8) {
error();
}
o->id = read_uint64(dst, maxdst);
n = read_byte(dst, maxdst);
if(n != 16) {
error();
}
o->index = read_uint64(dst, maxdst);
n = read_byte(dst, maxdst);
if(n != 24) {
error();
}
o->target = read_uint64(dst, maxdst);
while(*dst < maxdst) {
n = read_byte(dst, maxdst);
if(n == 32) {
o->suboption = read_uint64(dst, maxdst);
} else if(n == 40) {
o->position = read_uint64(dst, maxdst);
} else {
error();
}
}
return o;
}
void chooseoption_dump(struct chooseoption_s *o, u64 local_held_card)
{
hm_log(LOG_DEBUG, lg, "Choose options dump: option id: %lld index: %lld target: %lld suboption: %lld position: %lld local held card: %lld", o->id, o->index, o->target, o->suboption, o->position, local_held_card);
}
-109
View File
@@ -1,109 +0,0 @@
/*
hm_gameserver - hearthmod gameserver
Copyright (C) 2016 Filip Pancik
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <proto.h>
void creategame_free(struct powerhistory_creategame_s *c)
{
struct powerhistory_player_s *player, *del;
for(player = c->player; player != NULL; del = player, player = player->next, player_free(del));
free(c);
}
struct powerhistory_creategame_s *creategame_deserialize(char **dst, const char *maxdst)
{
int n, len;
struct powerhistory_creategame_s *t;
struct powerhistory_player_s *player;
t = malloc(sizeof(*t));
t->player = t->player_tail = NULL;
n = read_byte(dst, maxdst);
if(n != 10) {
error();
}
len = read_uint(dst, maxdst);
t->game_entity = game_entity_deserialize(dst, *dst + len);
while(*dst < maxdst) {
n = read_byte(dst, maxdst);
if(n != 18) {
error();
}
len = read_uint(dst, maxdst);
player = player_deserialize(dst, *dst + len);
player->next = NULL;
if(t->player == NULL && t->player_tail == NULL) {
t->player = player;
t->player_tail = player;
} else {
t->player_tail->next = player;
t->player_tail = player;
}
}
return t;
}
int creategame_size(struct powerhistory_creategame_s *cg)
{
struct powerhistory_player_s *p;
int num = 0;
int n;
if(cg) {
num += 1;
n = game_entity_size(cg->game_entity);
num += sizeofu32(n) + n;
for(p = cg->player; p != NULL; p = p->next) {
num += 1;
n = player_size(p);
num += sizeofu32(n) + n;
}
}
return num;
}
int creategame_serialize(struct powerhistory_creategame_s *cg, char **dst, const char *maxdst)
{
int n;
struct powerhistory_player_s *p;
write_byte(dst, maxdst, 10);
n = game_entity_size(cg->game_entity);
write_uint(dst, maxdst, n);
game_entity_serialize(cg->game_entity, dst, maxdst);
for(p = cg->player; p != NULL; p = p->next) {
write_byte(dst, maxdst, 18);
n = player_size(p);
write_uint(dst, maxdst, n);
player_serialize(p, dst, maxdst);
}
return 0;
}
-119
View File
@@ -1,119 +0,0 @@
/*
hm_gameserver - hearthmod gameserver
Copyright (C) 2016 Filip Pancik
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <proto.h>
void entity_free(struct powerhistory_entity_s *e)
{
struct powerhistory_tag_s *tag, *del;
for(tag = e->tag; tag != NULL; del = tag, tag = tag->next, tag_free(del));
//free(e->name);
free(e);
}
struct powerhistory_entity_s *entity_deserialize(char **dst, const char *maxdst)
{
int n, len;
struct powerhistory_entity_s *p;
struct powerhistory_tag_s *t;
p = malloc(sizeof(*p));
p->tag = p->tag_tail = NULL;
n = read_byte(dst, maxdst);
if(n != 8) {
error();
}
p->entity = read_uint64(dst, maxdst);
n = read_byte(dst, maxdst);
if(n != 18) {
error();
}
p->name = read_bytes(dst, maxdst, &p->nname);
while(*dst < maxdst) {
n = read_byte(dst, maxdst);
len = read_uint(dst, maxdst);
if(n == 26) {
t = tag_deserialize(dst, *dst + len);
t->next = NULL;
if(p->tag == NULL && p->tag_tail == NULL) {
p->tag = t;
p->tag_tail = t;
} else {
p->tag_tail->next = t;
p->tag_tail = t;
}
} else {
error();
return NULL;
}
}
return p;
}
int entity_size(struct powerhistory_entity_s *ent)
{
int num = 0;
int ts;
struct powerhistory_tag_s *tag;
num += 2;
num += sizeofu64(ent->entity);
num += sizeofu32(ent->nname) + ent->nname;
for(tag = ent->tag; tag != NULL; tag = tag->next) {
num += 1;
ts = tag_size(tag);
num += sizeofu32(ts) + ts;
}
return num;
}
int entity_serialize(struct powerhistory_entity_s *ent, char **dst, const char *maxdst)
{
int ts;
struct powerhistory_tag_s *t;
write_byte(dst, maxdst, 8);
write_uint64(dst, maxdst, ent->entity);
write_byte(dst, maxdst, 18);
write_bytes(dst, maxdst, ent->name, ent->nname);
if(ent->tag) {
for(t = ent->tag; t != NULL; t = t->next) {
write_byte(dst, maxdst, 26);
ts = tag_size(t);
write_uint(dst, maxdst, ts);
tag_serialize(t, dst, maxdst);
}
}
return 0;
}
-144
View File
@@ -1,144 +0,0 @@
/*
hm_gameserver - hearthmod gameserver
Copyright (C) 2016 Filip Pancik
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <proto.h>
void entitychoices_free(struct entitychoices_s *ec)
{
struct entitychoices_entities_s *e, *del;
for(e = ec->entities; e != NULL; del = e, e = e->next, free(del));
free(ec);
}
void *entitychoices_deserialize(char **dst, const char *maxdst)
{
int n, i;
struct entitychoices_s *o;
struct entitychoices_entities_s *e = e;
o = malloc(sizeof(*o));
memset(o, 0, sizeof(*o));
n = read_byte(dst, maxdst);
if(n != 8) {
error();
}
o->id = read_uint64(dst, maxdst);
n = read_byte(dst, maxdst);
if(n != 16) {
error();
}
o->type = read_uint64(dst, maxdst);
n = read_byte(dst, maxdst);
if(n != 32) {
error();
}
o->countmin = read_uint64(dst, maxdst);
n = read_byte(dst, maxdst);
if(n != 40) {
error();
}
o->countmax = read_uint64(dst, maxdst);
while(*dst < maxdst) {
n = read_byte(dst, maxdst);
if(n == 50) {
int n = read_uint(dst, maxdst);
for(i = 0; i < n; i++) {
e = malloc(sizeof(*e));
e->entity = read_uint64(dst, maxdst);
e->next = o->entities;
o->entities = e;
}
} else if(n == 56) {
o->source = read_uint64(dst, maxdst);
} else if(n == 64) {
o->player_id = read_uint64(dst, maxdst);
} else {
error();
}
}
return o;
}
int entitychoices_serialize(void *ep, char **dst, const char *maxdst)
{
int n = 0;
struct entitychoices_entities_s *es;
struct entitychoices_s *e = ep;
char *start;
start = *dst;
write_byte(dst, maxdst, 8);
write_uint64(dst, maxdst, e->id);
write_byte(dst, maxdst, 16);
write_uint64(dst, maxdst, e->type);
write_byte(dst, maxdst, 32);
write_uint64(dst, maxdst, e->countmin);
write_byte(dst, maxdst, 40);
write_uint64(dst, maxdst, e->countmax);
if(e->entities) {
write_byte(dst, maxdst, 50);
for(es = e->entities; es != NULL; es = es->next) {
n += sizeofu64(es->entity);
}
write_uint(dst, maxdst, n);
for(es = e->entities; es != NULL; es = es->next) {
write_uint64(dst, maxdst, es->entity);
}
}
if(e->source > 0) {
write_byte(dst, maxdst, 56);
write_uint64(dst, maxdst, e->source);
}
write_byte(dst, maxdst, 64);
write_uint64(dst, maxdst, e->player_id);
return (*dst - start);
}
void entitychoices_dump(struct entitychoices_s *es)
{
struct entitychoices_entities_s *ent;
hm_log(LOG_DEBUG, lg, "Entity Choices dump:");
hm_log(LOG_DEBUG, lg, "\t\tID: %lld", es->id);
hm_log(LOG_DEBUG, lg, "\t\tType: %lld", es->type);
hm_log(LOG_DEBUG, lg, "\t\tCountMin: %lld", es->countmin);
hm_log(LOG_DEBUG, lg, "\t\tCountMax: %lld", es->countmax);
hm_log(LOG_DEBUG, lg, "\t\tSource: %lld", es->source);
hm_log(LOG_DEBUG, lg, "\t\tPlayer: %lld", es->player_id);
for(ent = es->entities; ent != NULL; ent = ent->next) {
hm_log(LOG_DEBUG, lg, "\t\t\tChild entity: %lld", ent->entity);
}
}
-105
View File
@@ -1,105 +0,0 @@
/*
hm_gameserver - hearthmod gameserver
Copyright (C) 2016 Filip Pancik
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <proto.h>
void game_entity_free(struct powerhistory_game_entity_s *g)
{
struct powerhistory_tag_s *tag, *del;
for(tag = g->tag; tag != NULL; del = tag, tag = tag->next, tag_free(del));
free(g);
}
struct powerhistory_game_entity_s *game_entity_deserialize(char **dst, const char *maxdst)
{
int n, len;
struct powerhistory_game_entity_s *t;
struct powerhistory_tag_s *tag;
t = malloc(sizeof(*t));
memset(t, 0, sizeof(*t));
n = read_byte(dst, maxdst);
if(n != 8) {
error();
}
t->id = read_uint64(dst, maxdst);
while(*dst < maxdst) {
n = read_byte(dst, maxdst);
if(n != 18) {
error();
}
len = read_uint(dst, maxdst);
tag = tag_deserialize(dst, *dst + len);
tag->next = NULL;
if(t->tag == NULL && t->tag_tail == NULL) {
t->tag = tag;
t->tag_tail = tag;
} else {
t->tag_tail->next = tag;
t->tag_tail = tag;
}
}
return t;
}
int game_entity_serialize(struct powerhistory_game_entity_s *ent, char **dst, const char *maxdst)
{
int ts;
struct powerhistory_tag_s *t;
write_byte(dst, maxdst, 8);
write_uint64(dst, maxdst, ent->id);
if(ent->tag) {
for(t = ent->tag; t != NULL; t = t->next) {
write_byte(dst, maxdst, 18);
ts = tag_size(t);
write_uint(dst, maxdst, ts);
tag_serialize(t, dst, maxdst);
}
}
return 0;
}
int game_entity_size(struct powerhistory_game_entity_s *ent)
{
int ts;
struct powerhistory_tag_s *tag;
int num = 0;
num += 1;
num += sizeofu64(ent->id);
for(tag = ent->tag; tag != NULL; tag = tag->next) {
num += 1;
ts = tag_size(tag);
num += sizeofu32(ts) + ts;
}
return num;
}
-114
View File
@@ -1,114 +0,0 @@
/*
hm_gameserver - hearthmod gameserver
Copyright (C) 2016 Filip Pancik
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <proto.h>
void gamesetup_free(struct gamesetup_s *g)
{
free(g);
}
int gamesetup_serialize(void *data, char **dst, const char *maxdst)
{
char *start;
struct gamesetup_s *g = data;
start = *dst;
write_byte(dst, maxdst, 8);
write_uint64(dst, maxdst, g->board);
write_byte(dst, maxdst, 16);
write_uint64(dst, maxdst, g->maxsecrets);
write_byte(dst, maxdst, 24);
write_uint64(dst, maxdst, g->maxfriendlyminions);
if(g->keepalive > 0) {
write_byte(dst, maxdst, 32);
write_uint64(dst, maxdst, g->keepalive);
}
if(g->stuckdisconnect > 0) {
write_byte(dst, maxdst, 40);
write_uint64(dst, maxdst, g->stuckdisconnect);
}
return (*dst - start);
}
void *gamesetup_deserialize(char **dst, const char *maxdst)
{
int n;
struct gamesetup_s *o;
o = malloc(sizeof(*o));
memset(o, 0, sizeof(*o));
n = read_byte(dst, maxdst);
if(n != 8) {
error();
}
o->board = read_uint64(dst, maxdst);
n = read_byte(dst, maxdst);
if(n != 16) {
error();
}
o->maxsecrets = read_uint64(dst, maxdst);
n = read_byte(dst, maxdst);
if(n != 24) {
error();
}
o->maxfriendlyminions = read_uint64(dst, maxdst);
while(*dst < maxdst) {
n = read_byte(dst, maxdst);
if(n == 32) {
o->keepalive = read_uint64(dst, maxdst);
} else if(n == 40) {
o->stuckdisconnect = read_uint64(dst, maxdst);
} else {
error();
}
}
return o;
}
int gamesetup_size(struct gamesetup_s *g)
{
int num = 0;
num += 3;
num += sizeofu64(g->board);
num += sizeofu64(g->maxsecrets);
num += sizeofu64(g->maxfriendlyminions);
if(g->keepalive > 0) {
num += 1;
num += sizeofu64(g->keepalive);
}
if(g->stuckdisconnect > 0) {
num += 1;
num += sizeofu64(g->stuckdisconnect);
}
return num;
}
-115
View File
@@ -1,115 +0,0 @@
/*
hm_gameserver - hearthmod gameserver
Copyright (C) 2016 Filip Pancik
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <proto.h>
void handshake_free(struct handshake_s *h)
{
platform_free(h->platform);
free(h->version);
free(h->password);
free(h);
}
int handshake_serialize(void *ao, char **dst, const char *maxdst)
{
struct handshake_s *s;
char *start;
start = *dst;
s = ao;
write_byte(dst, maxdst, 8);
write_uint64(dst, maxdst, s->gamehandle);
write_byte(dst, maxdst, 18);
write_bytes(dst, maxdst, s->password, s->npassword);
write_byte(dst, maxdst, 24);
write_uint64(dst, maxdst, s->clienthandle);
if(s->mission != 0) {
write_byte(dst, maxdst, 32);
write_uint64(dst, maxdst, s->mission);
}
write_byte(dst, maxdst, 42);
write_bytes(dst, maxdst, s->version, s->nversion);
write_byte(dst, maxdst, 58);
write_uint(dst, maxdst, platform_size(s->platform));
platform_serialize(s->platform, dst, maxdst);
return (*dst - start);
}
void *handshake_deserialize(char **dst, const char *maxdst)
{
int n, len;
struct handshake_s *h;
h = malloc(sizeof(*h));
n = read_byte(dst, maxdst);
if(n != 8) {
error();
}
h->gamehandle = read_uint64(dst, maxdst);
n = read_byte(dst, maxdst);
if(n != 18) {
error();
}
h->password = read_bytes(dst, maxdst, &h->npassword);
n = read_byte(dst, maxdst);
if(n != 24) {
error();
}
h->clienthandle = read_uint64(dst, maxdst);
n = read_byte(dst, maxdst);
if(n == 32) {
h->mission = read_uint64(dst, maxdst);
n = read_byte(dst, maxdst);
}
if(n != 42) {
error();
}
h->version = read_bytes(dst, maxdst, &h->nversion);
n = read_byte(dst, maxdst);
if(n != 58) {
error();
}
len = read_uint(dst, maxdst);
h->platform = platform_deserialize(dst, *dst + len);
return h;
}
void handshake_dump(struct handshake_s *h)
{
hm_log(LOG_DEBUG, lg, "Gamehandle: %lld password: [%.*s] clienthandle: %lld mission: %lld verion: [%.*s] ", h->gamehandle, h->npassword, h->password, h->clienthandle, h->mission, h->nversion, h->version);
if(h->platform) {
hm_log(LOG_DEBUG, lg, "Os: %lld screen: %lld name: [%.*s] store: %lld", h->platform->os, h->platform->screen, h->platform->nname, h->platform->name, h->platform->store);
}
}
-69
View File
@@ -1,69 +0,0 @@
/*
hm_gameserver - hearthmod gameserver
Copyright (C) 2016 Filip Pancik
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <proto.h>
void hide_free(struct powerhistory_hide_s *t)
{
free(t);
}
struct powerhistory_hide_s *hide_deserialize(char **dst, const char *maxdst)
{
int n;
struct powerhistory_hide_s *t;
t = malloc(sizeof(*t));
n = read_byte(dst, maxdst);
if(n != 8) {
error();
}
t->entity = read_uint64(dst, maxdst);
n = read_byte(dst, maxdst);
if(n != 16) {
error();
}
t->zone = read_uint64(dst, maxdst);
return t;
}
int hide_serialize(struct powerhistory_hide_s *ent, char **dst, const char *maxdst)
{
write_byte(dst, maxdst, 8);
write_uint64(dst, maxdst, ent->entity);
write_byte(dst, maxdst, 16);
write_uint64(dst, maxdst, ent->zone);
return 0;
}
int hide_size(struct powerhistory_hide_s *hide)
{
int size = 0;
if(hide) {
size += 2;
size += sizeofu64(hide->entity);
size += sizeofu64(hide->zone);
}
return size;
}
-36
View File
@@ -1,36 +0,0 @@
/*
hm_gameserver - hearthmod gameserver
Copyright (C) 2016 Filip Pancik
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CHOOSEENTITIES_H_
#define CHOOSEENTITIES_H_
struct chooseentities_ent_s {
u64 entity;
struct chooseentities_ent_s *next;
};
struct chooseentities_s {
u64 id;
int nentity;
struct chooseentities_ent_s *entity;
};
void chooseentities_free(struct chooseentities_s *c);
void *chooseentities_deserialize(char **dst, const char *maxdst);
int chooseentities_serialize(void *ao, char **dst, const char *maxdst);
#endif
-43
View File
@@ -1,43 +0,0 @@
/*
hm_gameserver - hearthmod gameserver
Copyright (C) 2016 Filip Pancik
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ENTITYCHOICES_H_
#define ENTITYCHOICES_H_
struct entitychoices_entities_s {
u64 entity;
struct entitychoices_entities_s *next;
};
struct entitychoices_s {
u64 id;
u64 type;
u64 countmin;
u64 countmax;
u64 source;
u64 player_id;
struct entitychoices_entities_s *entities;
};
void entitychoices_free(struct entitychoices_s *ec);
int entitychoices_serialize(void *ep, char **dst, const char *maxdst);
void entitychoices_dump(struct entitychoices_s *es);
void *entitychoices_deserialize(char **dst, const char *maxdst);
#endif
-250
View File
@@ -1,250 +0,0 @@
/*
hm_gameserver - hearthmod gameserver
Copyright (C) 2016 Filip Pancik
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TAG_H_
#define TAG_H_
enum gametag_e {
TAG_SCRIPT_DATA_NUM_1 = 2,
TAG_SCRIPT_DATA_NUM_2 = 3,
TAG_SCRIPT_DATA_ENT_1 = 4,
TAG_SCRIPT_DATA_ENT_2 = 5,
MISSION_EVENT = 6,
TIMEOUT = 7,
TURN_START = 8,
TURN_TIMER_SLUSH = 9,
PREMIUM = 12,
GOLD_REWARD_STATE = 13,
PLAYSTATE = 17,
LAST_AFFECTED_BY = 18,
STEP = 19,
TURN = 20,
FATIGUE = 22,
CURRENT_PLAYER = 23,
FIRST_PLAYER = 24,
RESOURCES_USED = 25,
RESOURCES = 26,
HERO_ENTITY = 27,
MAXHANDSIZE = 28,
STARTHANDSIZE = 29,
PLAYER_ID = 30,
TEAM_ID = 31,
TRIGGER_VISUAL = 32,
RECENTLY_ARRIVED = 33,
PROTECTING = 34,
PROTECTED = 35,
DEFENDING = 36,
PROPOSED_DEFENDER = 37,
ATTACKING = 38,
PROPOSED_ATTACKER = 39,
ATTACHED = 40,
EXHAUSTED = 43,
DAMAGE = 44,
HEALTH = 45,
ATK = 47,
COST = 48,
ZONE = 49,
CONTROLLER = 50,
OWNER = 51,
DEFINITION = 52,
ENTITY_ID = 53,
HISTORY_PROXY = 54,
COPY_DEATHRATTLE = 55,
ELITE = 114,
MAXRESOURCES = 176,
CARD_SET = 183,
CARDTEXT_INHAND = 184,
CARDNAME = 185,
CARD_ID = 186,
DURABILITY = 187,
SILENCED = 188,
WINDFURY = 189,
TAUNT = 190,
STEALTH = 191,
SPELLPOWER = 192,
DIVINE_SHIELD = 194,
CHARGE = 197,
NEXT_STEP = 198,
CLASS = 199,
CARDRACE = 200,
FACTION = 201,
CARDTYPE = 202,
RARITY = 203,
STATE = 204,
SUMMONED = 205,
FREEZE = 208,
ENRAGED = 212,
OVERLOAD = 215,
LOYALTY = 216,
DEATHRATTLE = 217,
BATTLECRY = 218,
SECRET = 219,
COMBO = 220,
CANT_HEAL = 221,
CANT_DAMAGE = 222,
CANT_SET_ASIDE = 223,
CANT_REMOVE_FROM_GAME = 224,
CANT_READY = 225,
CANT_EXHAUST = 226,
CANT_ATTACK = 227,
CANT_TARGET = 228,
CANT_DESTROY = 229,
CANT_DISCARD = 230,
CANT_PLAY = 231,
CANT_DRAW = 232,
INCOMING_HEALING_MULTIPLIER = 233,
INCOMING_HEALING_ADJUSTMENT = 234,
INCOMING_HEALING_CAP = 235,
INCOMING_DAMAGE_MULTIPLIER = 236,
INCOMING_DAMAGE_ADJUSTMENT = 237,
INCOMING_DAMAGE_CAP = 238,
CANT_BE_HEALED = 239,
CANT_BE_DAMAGED = 240,
CANT_BE_SET_ASIDE = 241,
CANT_BE_REMOVED_FROM_GAME = 242,
CANT_BE_READIED = 243,
CANT_BE_EXHAUSTED = 244,
CANT_BE_ATTACKED = 245,
CANT_BE_TARGETED = 246,
CANT_BE_DESTROYED = 247,
CANT_BE_SUMMONING_SICK = 253,
FROZEN = 260,
JUST_PLAYED = 261,
LINKEDCARD = 262,
ZONE_POSITION = 263,
CANT_BE_FROZEN = 264,
COMBO_ACTIVE = 266,
CARD_TARGET = 267,
NUM_CARDS_PLAYED_THIS_TURN = 269,
CANT_BE_TARGETED_BY_OPPONENTS = 270,
NUM_TURNS_IN_PLAY = 271,
NUM_TURNS_LEFT = 272,
OUTGOING_DAMAGE_CAP = 273,
OUTGOING_DAMAGE_ADJUSTMENT = 274,
OUTGOING_DAMAGE_MULTIPLIER = 275,
OUTGOING_HEALING_CAP = 276,
OUTGOING_HEALING_ADJUSTMENT = 277,
OUTGOING_HEALING_MULTIPLIER = 278,
INCOMING_ABILITY_DAMAGE_ADJUSTMENT = 279,
INCOMING_COMBAT_DAMAGE_ADJUSTMENT = 280,
OUTGOING_ABILITY_DAMAGE_ADJUSTMENT = 281,
OUTGOING_COMBAT_DAMAGE_ADJUSTMENT = 282,
OUTGOING_ABILITY_DAMAGE_MULTIPLIER = 283,
OUTGOING_ABILITY_DAMAGE_CAP = 284,
INCOMING_ABILITY_DAMAGE_MULTIPLIER = 285,
INCOMING_ABILITY_DAMAGE_CAP = 286,
OUTGOING_COMBAT_DAMAGE_MULTIPLIER = 287,
OUTGOING_COMBAT_DAMAGE_CAP = 288,
INCOMING_COMBAT_DAMAGE_MULTIPLIER = 289,
INCOMING_COMBAT_DAMAGE_CAP = 290,
CURRENT_SPELLPOWER = 291,
ARMOR = 292,
MORPH = 293,
IS_MORPHED = 294,
TEMP_RESOURCES = 295,
OVERLOAD_OWED = 296,
NUM_ATTACKS_THIS_TURN = 297,
NEXT_ALLY_BUFF = 302,
MAGNET = 303,
FIRST_CARD_PLAYED_THIS_TURN = 304,
MULLIGAN_STATE = 305,
TAUNT_READY = 306,
STEALTH_READY = 307,
CHARGE_READY = 308,
CANT_BE_TARGETED_BY_ABILITIES = 311,
SHOULDEXITCOMBAT = 312,
CREATOR = 313,
CANT_BE_DISPELLED = 314,
PARENT_CARD = 316,
NUM_MINIONS_PLAYED_THIS_TURN = 317,
PREDAMAGE = 318,
TARGETING_ARROW_TEXT = 325,
ENCHANTMENT_BIRTH_VISUAL = 330,
ENCHANTMENT_IDLE_VISUAL = 331,
CANT_BE_TARGETED_BY_HERO_POWERS = 332,
HEALTH_MINIMUM = 337,
TAG_ONE_TURN_EFFECT = 338,
SILENCE = 339,
COUNTER = 340,
ARTISTNAME = 342,
HAND_REVEALED = 348,
ADJACENT_BUFF = 350,
FLAVORTEXT = 351,
FORCED_PLAY = 352,
LOW_HEALTH_THRESHOLD = 353,
SPELLPOWER_DOUBLE = 356,
HEALING_DOUBLE = 357,
NUM_OPTIONS_PLAYED_THIS_TURN = 358,
TO_BE_DESTROYED = 360,
AURA = 362,
POISONOUS = 363,
HOW_TO_EARN = 364,
HOW_TO_EARN_GOLDEN = 365,
HERO_POWER_DOUBLE = 366,
AI_MUST_PLAY = 367,
NUM_MINIONS_PLAYER_KILLED_THIS_TURN = 368,
NUM_MINIONS_KILLED_THIS_TURN = 369,
AFFECTED_BY_SPELL_POWER = 370,
EXTRA_DEATHRATTLES = 371,
START_WITH_1_HEALTH = 372,
IMMUNE_WHILE_ATTACKING = 373,
MULTIPLY_HERO_DAMAGE = 374,
MULTIPLY_BUFF_VALUE = 375,
CUSTOM_KEYWORD_EFFECT = 376,
TOPDECK = 377,
CANT_BE_TARGETED_BY_BATTLECRIES = 379,
SHOWN_HERO_POWER = 380,
DEATHRATTLE_RETURN_ZONE = 382,
STEADY_SHOT_CAN_TARGET = 383,
DISPLAYED_CREATOR = 385,
POWERED_UP = 386,
SPARE_PART = 388,
FORGETFUL = 389,
CAN_SUMMON_MAXPLUSONE_MINION = 390,
OBFUSCATED = 391,
BURNING = 392,
OVERLOAD_LOCKED = 393,
NUM_TIMES_HERO_POWER_USED_THIS_GAME = 394,
CURRENT_HEROPOWER_DAMAGE_BONUS = 395,
HEROPOWER_DAMAGE = 396,
LAST_CARD_PLAYED = 397,
NUM_FRIENDLY_MINIONS_THAT_DIED_THIS_TURN = 398,
NUM_CARDS_DRAWN_THIS_TURN = 399,
AI_ONE_SHOT_KILL = 400,
EVIL_GLOW = 401,
HIDE_COST = 402,
INSPIRE = 403,
RECEIVES_DOUBLE_SPELLDAMAGE_BONUS = 404,
HEROPOWER_ADDITIONAL_ACTIVATIONS = 405,
HEROPOWER_ACTIVATIONS_THIS_TURN = 406,
REVEALED = 410,
NUM_FRIENDLY_MINIONS_THAT_DIED_THIS_GAME = 412,
CANNOT_ATTACK_HEROES = 413,
LOCK_AND_LOAD = 414,
TREASURE = 415,
SHADOWFORM = 416,
NUM_FRIENDLY_MINIONS_THAT_ATTACKED_THIS_TURN = 417,
NUM_RESOURCES_SPENT_THIS_GAME = 418,
CHOOSE_BOTH = 419,
ELECTRIC_CHARGE_LEVEL = 420,
HEAVILY_ARMORED = 421,
DONT_SHOW_IMMUNE = 422,
HISTORY_PROXY_NO_BIG_CARD = 432,
TRANSFORMED_FROM_CARD = 435,
};
#endif
-75
View File
@@ -1,75 +0,0 @@
/*
hm_gameserver - hearthmod gameserver
Copyright (C) 2016 Filip Pancik
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef MISC_H_
#define MISC_H_
struct gamesetup_s {
u64 board;
u64 maxsecrets;
u64 maxfriendlyminions;
u64 keepalive;
u64 stuckdisconnect;
};
struct handshake_s {
u64 gamehandle;
char *password;
int npassword;
u64 clienthandle;
u64 mission;
char *version;
int nversion;
struct platform_s *platform;
};
struct platform_s {
u64 os;
u64 screen;
int nname;
char *name;
u64 store;
};
struct chooseoption_s {
u64 id;
u64 index;
u64 target;
u64 suboption;
u64 position;
};
void gamesetup_free(struct gamesetup_s *g);
int gamesetup_serialize(void *data, char **dst, const char *maxdst);
void *gamesetup_deserialize(char **dst, const char *maxdst);
void handshake_free(struct handshake_s *h);
void *handshake_deserialize(char **dst, const char *maxdst);
int handshake_serialize(void *ao, char **dst, const char *maxdst);
void platform_free(struct platform_s *p);
struct platform_s *platform_deserialize(char **dst, const char *maxdst);
int platform_serialize(void *ao, char **dst, const char *maxdst);
int platform_size(struct platform_s *p);
int chooseoption_serialize(void *ao, char **dst, const char *maxdst);
void chooseoption_free(struct chooseoption_s *c);
void *chooseoption_deserialize(char **dst, const char *maxdst);
void chooseoption_dump(struct chooseoption_s *o, u64 local_held_card);
#endif
-34
View File
@@ -1,34 +0,0 @@
/*
hm_gameserver - hearthmod gameserver
Copyright (C) 2016 Filip Pancik
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef MOUSEINFO_H_
#define MOUSEINFO_H_
struct mouseinfo_s {
u64 arroworigin;
u64 heldcard;
u64 overcard;
u64 x;
u64 y;
};
void mouseinfo_free(struct mouseinfo_s *p);
void *mouseinfo_deserialize(char **dst, const char *maxdst);
int mouseinfo_serialize(void *ao, char **dst, const char *maxdst);
int mouseinfo_size(struct mouseinfo_s *p);
#endif
-60
View File
@@ -1,60 +0,0 @@
/*
hm_gameserver - hearthmod gameserver
Copyright (C) 2016 Filip Pancik
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OPTIONS_H_
#define OPTIONS_H_
struct suboption_target_s {
u64 value;
struct suboption_target_s *next;
};
struct suboption_s {
u64 id;
struct suboption_target_s *target;
struct suboption_s *next;
};
struct option_s {
u64 type;
struct suboption_s *mainoption;
struct suboption_s *suboptions;
struct option_s *next;
};
struct alloptions_s {
u64 id;
struct option_s *options;
};
void alloptions_free(struct alloptions_s *a);
int alloptions_serialize(void *s, char **dst, const char *maxdst);
int alloptions_size(struct alloptions_s *p);
void option_free(struct option_s *p);
int option_serialize(struct option_s *s, char **dst, const char *maxdst);
int option_size(struct option_s *p);
void suboption_free(struct suboption_s *p);
int suboption_serialize(struct suboption_s *s, char **dst, const char *maxdst);
int suboption_size(struct suboption_s *p);
void alloptions_dump(struct alloptions_s *a);
#endif
-69
View File
@@ -1,69 +0,0 @@
/*
hm_gameserver - hearthmod gameserver
Copyright (C) 2016 Filip Pancik
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PACKET_H_
#define PACKET_H_
enum packet_e {
P_GETGAMESTATE = 0x01,
P_CHOOSEOPTION = 0x02,
P_CHOOSEENTITIES = 0x03,
P_TURNTIMER = 0x09,
P_ENTITIESCHOSEN = 0x0D,
P_ALLOPTIONS = 0x0E,
P_USERUI = 0x0F,
P_GAMESETUP = 0x10,
P_ENTITYCHOICES = 0x11,
P_POWERHISTORY = 0x13,
P_SPECTATORNOTIFY = 0x18,
P_PING = 0x73,
P_PONG = 0x74,
P_HANDSHAKE = 0xA8,
};
struct packet_s {
int id;
int len;
void *data;
};
struct packet_meta_s {
int id;
void *(*deserialize)(char **dst, const char *end);
int (*serialize)(void *p, char **dst, const char *end);
int (*free)(void *p);
};
#define parse_packet(m_p, m_buf, m_nbuf)\
char *ptrd##m_buf = m_buf;\
m_p = deserialize(&ptrd##m_buf, ptrd##m_buf + m_nbuf);
#define build_packet(m_p, m_src, m_type, m_buffer)\
char m_buffer[8192];\
char *ptr##m_buffer;\
int n##m_buffer = 0;\
ptr##m_buffer = m_buffer;\
add_packet(&m_p, m_src, m_type);\
n##m_buffer = serialize(m_p, &ptr##m_buffer, ptr##m_buffer + sizeof(m_buffer));
void packet_free(struct packet_s *p);
struct packet_s *deserialize(char **dst, const char *maxdst);
int serialize(struct packet_s *p, char **dst, const char *maxdst);
struct packet_s *packet_init(enum packet_e id, void *data);
void add_packet(struct packet_s **dst, void *ph, enum packet_e n);
#endif
-174
View File
@@ -1,174 +0,0 @@
/*
hm_gameserver - hearthmod gameserver
Copyright (C) 2016 Filip Pancik
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef DEF_H_
#define DEF_H_
struct powerhistory_tag_s {
u64 name;
u64 value;
struct powerhistory_tag_s *next;
};
struct powerhistory_hide_s {
u64 entity;
u64 zone;
};
struct powerhistory_tagchange_s {
u64 entity;
u64 tag;
u64 value;
};
struct powerhistory_entity_s {
u64 entity;
char *name;
int nname;
struct powerhistory_tag_s *tag, *tag_tail;
};
struct powerhistory_powerstart_s {
u64 type;
u64 index;
u64 source;
u64 target;
int ncard_id;
char *card_id;
};
struct powerhistory_powerend_s {
int i;
};
struct powerhistory_game_entity_s {
u64 id;
struct powerhistory_tag_s *tag, *tag_tail;
};
struct powerhistory_s {
struct powerhistory_data_s *data, *data_tail;
};
struct powerhistory_info_s {
u64 id;
struct powerhistory_info_s *next;
};
struct powerhistory_meta_s {
u64 type;
u64 data;
struct powerhistory_info_s *info, *info_tail;
};
struct powerhistory_player_s {
u64 id;
u64 bnet_hi;
u64 bnet_lo;
u64 cardback;
struct powerhistory_game_entity_s *entity;
struct powerhistory_player_s *next;
};
struct powerhistory_creategame_s {
struct powerhistory_game_entity_s *game_entity;
struct powerhistory_player_s *player, *player_tail;
};
struct powerhistory_data_s {
struct powerhistory_entity_s *full;
struct powerhistory_entity_s *show;
struct powerhistory_hide_s *hide;
struct powerhistory_tagchange_s *tagchange;
struct powerhistory_creategame_s *creategame;
struct powerhistory_powerstart_s *powerstart;
struct powerhistory_powerend_s *powerend;
struct powerhistory_entity_s *change_entity;
struct powerhistory_meta_s *meta;
struct powerhistory_data_s *next, *tail;
};
void powerhistory_free(struct powerhistory_s *p);
void *powerhistory_deserialize(char **dst, const char *maxdst);
int powerhistory_serialize(void *data, char **dst, const char *maxdst);
int powerhistory_size(struct powerhistory_s *ph);
struct powerhistory_data_s *powerhistory_data_deserialize(char **dst, const char *maxdst);
int powerhistorydata_serialize(struct powerhistory_data_s *ph, char **dst, const char *maxdst);
int powerhistorydata_size(struct powerhistory_data_s *ph);
void powerhistory_data_free(struct powerhistory_data_s *d);
struct powerhistory_meta_s *meta_deserialize(char **dst, const char *maxdst);
int meta_serialize(struct powerhistory_meta_s *ph, char **dst, const char *maxdst);
int meta_size(struct powerhistory_meta_s *ph);
void meta_free(struct powerhistory_meta_s *t);
struct powerhistory_powerend_s *powerend_deserialize(char **dst, const char *maxdst);
int powerend_serialize(struct powerhistory_powerend_s *ph, char **dst, const char *maxdst);
int powerend_size(struct powerhistory_powerend_s *ph);
void powerend_free(struct powerhistory_powerend_s *p);
struct powerhistory_powerstart_s *powerstart_deserialize(char **dst, const char *maxdst);
int powerstart_serialize(struct powerhistory_powerstart_s *ph, char **dst, const char *maxdst);
int powerstart_size(struct powerhistory_powerstart_s *ph);
void powerstart_free(struct powerhistory_powerstart_s *p);
struct powerhistory_creategame_s *creategame_deserialize(char **dst, const char *maxdst);
int creategame_serialize(struct powerhistory_creategame_s *ph, char **dst, const char *maxdst);
int creategame_size(struct powerhistory_creategame_s *ph);
void creategame_free(struct powerhistory_creategame_s *c);
struct powerhistory_tagchange_s *tagchange_deserialize(char **dst, const char *maxdst);
int tagchange_serialize(struct powerhistory_tagchange_s *ph, char **dst, const char *maxdst);
int tagchange_size(struct powerhistory_tagchange_s *ph);
void tagchange_free(struct powerhistory_tagchange_s *t);
struct powerhistory_hide_s *hide_deserialize(char **dst, const char *maxdst);
int hide_serialize(struct powerhistory_hide_s *ph, char **dst, const char *maxdst);
int hide_size(struct powerhistory_hide_s *ph);
void hide_free(struct powerhistory_hide_s *t);
struct powerhistory_game_entity_s *game_entity_deserialize(char **dst, const char *maxdst);
int game_entity_serialize(struct powerhistory_game_entity_s *ph, char **dst, const char *maxdst);
int game_entity_size(struct powerhistory_game_entity_s *ph);
void game_entity_free(struct powerhistory_game_entity_s *g);
struct powerhistory_entity_s *entity_deserialize(char **dst, const char *maxdst);
int entity_serialize(struct powerhistory_entity_s *ph, char **dst, const char *maxdst);
int entity_size(struct powerhistory_entity_s *ph);
void entity_free(struct powerhistory_entity_s *e);
struct powerhistory_tag_s *tag_deserialize(char **dst, const char *maxdst);
int tag_serialize(struct powerhistory_tag_s *ph, char **dst, const char *maxdst);
int tag_size(struct powerhistory_tag_s *ph);
void tag_free(struct powerhistory_tag_s *t);
void player_free(struct powerhistory_player_s *p);
struct powerhistory_player_s *player_deserialize(char **dst, const char *maxdst);
int player_serialize(struct powerhistory_player_s *ph, char **dst, const char *maxdst);
int player_size(struct powerhistory_player_s *ph);
int bnet_size(struct powerhistory_player_s *ph);
void powerhistory_dump(struct powerhistory_s *p);
#endif
-68
View File
@@ -1,68 +0,0 @@
/*
hm_gameserver - hearthmod gameserver
Copyright (C) 2016 Filip Pancik
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PROTO_H_
#define PROTO_H_
#define error()\
hm_log(LOG_EMERG, lg, "dst: %p end: %p n: %d", *dst, maxdst, n);\
abort();
#include <assert.h>
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <memory.h>
#include <malloc.h>
#include <sys/time.h>
#include <time.h>
#include <ev.h>
#include <hmbase.h>
typedef unsigned long long u64;
#include <zone.h>
#include <misc.h>
#include <powerhistory.h>
#include <packet.h>
#include <gametag.h>
#include <entitychoices.h>
#include <chooseentities.h>
#include <options.h>
#include <mouseinfo.h>
#include <userui.h>
#include <turntimer.h>
int sizeofu64(u64 v);
int sizeofu32(int v);
int write_byte(char **dst, const char *end, const char src);
int write_bytes(char **dst, const char *end, const char *src, const int nsrc);
void write_uint(char **dst, const char *end, int src);
void write_uint64(char **dst, const char *end, u64 src);
int write_mem_int(char **dst, const char *end, const int src);
char read_byte(char **dst, const char *end);
int read_uint(char **dst, const char *end);
u64 read_uint64(char **dst, const char *end);
int read_mem_int(char **dst, const char *end);
char *read_bytes(char **dst, const char *end, int *ndst);
int skip(char **dst, const char *end, const int jump);
extern struct hm_log_s *lg;
#endif
-32
View File
@@ -1,32 +0,0 @@
/*
hm_gameserver - hearthmod gameserver
Copyright (C) 2016 Filip Pancik
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TURNTIMER_H_
#define TURNTIMER_H_
struct turntimer_s {
u64 seconds;
u64 turn;
char show;
};
void turntimer_free(struct turntimer_s *t);
int turntimer_serialize(void *ao, char **dst, const char *maxdst);
void turntimer_dump(struct turntimer_s *t);
void *turntimer_deserialize(char **dst, const char *maxdst);
#endif
-33
View File
@@ -1,33 +0,0 @@
/*
hm_gameserver - hearthmod gameserver
Copyright (C) 2016 Filip Pancik
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef USERUI_H_
#define USERUI_H_
struct userui_s {
struct mouseinfo_s *mouseinfo;
u64 emote;
u64 player_id;
};
void userui_free(struct userui_s *u);
int userui_serialize(void *ao, char **dst, const char *maxdst);
void *userui_deserialize(char **dst, const char *maxdst);
int userui_size(struct userui_s *p);
void userui_dump(struct userui_s *u);
#endif
-33
View File
@@ -1,33 +0,0 @@
/*
hm_gameserver - hearthmod gameserver
Copyright (C) 2016 Filip Pancik
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ZONE_H_
#define ZONE_H_
enum zone_e {
ZONE_INVALID = 0,
ZONE_PLAY = 1,
ZONE_DECK = 2,
ZONE_HAND = 3,
ZONE_GRAVEYARD = 4,
ZONE_REMOVEDFROMGAME = 5,
ZONE_SETASIDE = 6,
ZONE_SECRET = 7,
ZONE_DISCARD = -2,
};
#endif
-126
View File
@@ -1,126 +0,0 @@
/*
hm_gameserver - hearthmod gameserver
Copyright (C) 2016 Filip Pancik
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <proto.h>
void meta_free(struct powerhistory_meta_s *t)
{
struct powerhistory_info_s *info, *del;
for(info = t->info; info != NULL; del = info, info = info->next, free(del));
free(t);
}
struct powerhistory_meta_s *meta_deserialize(char **dst, const char *maxdst)
{
int n, len;
struct powerhistory_meta_s *t;
struct powerhistory_info_s *info;
int i;
t = malloc(sizeof(*t));
memset(t, 0, sizeof(*t));
while(*dst < maxdst) {
n = read_byte(dst, maxdst);
if(n == 18) {
len = read_uint(dst, maxdst);
for(i = 0; i < len; i++) {
info = malloc(sizeof(*info));
info->id = read_uint64(dst, maxdst);
info->next = NULL;
if(t->info == NULL && t->info_tail == NULL) {
t->info = info;
t->info_tail = info;
} else {
t->info_tail->next = info;
t->info_tail = info;
}
}
} else if(n == 24) {
t->type = read_uint64(dst, maxdst);
} else if(n == 32) {
t->data = read_uint64(dst, maxdst);
} else {
error();
}
}
return t;
}
int meta_size(struct powerhistory_meta_s *p)
{
int num = 0, num2;
struct powerhistory_info_s *m;
if(p->info) {
num += 1;
num2 = num;
for(m = p->info; m != NULL; m = m->next) {
num += sizeofu64(m->id);
}
num += sizeofu32(num - num2);
}
if(p->type != 0) {
num += 1;
num += sizeofu64(p->type);
}
if(p->data != 0) {
num += 1;
num += sizeofu64(p->data);
}
return num;
}
int meta_serialize(struct powerhistory_meta_s *p, char **dst, const char *maxdst)
{
int num = 0;
struct powerhistory_info_s *m;
if(p->info) {
write_byte(dst, maxdst, 18);
for(m = p->info; m != NULL; m = m->next) {
num += sizeofu64(m->id);
}
write_uint(dst, maxdst, num);
for(m = p->info; m != NULL; m = m->next) {
write_uint64(dst, maxdst, m->id);
}
}
if(p->type != 0) {
write_byte(dst, maxdst, 24);
write_uint64(dst, maxdst, p->type);
}
if(p->data != 0) {
write_byte(dst, maxdst, 32);
write_uint64(dst, maxdst, p->data);
}
return 0;
}
-104
View File
@@ -1,104 +0,0 @@
/*
hm_gameserver - hearthmod gameserver
Copyright (C) 2016 Filip Pancik
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <proto.h>
void mouseinfo_free(struct mouseinfo_s *m)
{
free(m);
}
void *mouseinfo_deserialize(char **dst, const char *maxdst)
{
int n;
struct mouseinfo_s *c;
c = malloc(sizeof(*c));
memset(c, 0, sizeof(*c));
n = read_byte(dst, maxdst);
if(n != 8) {
error();
}
c->arroworigin = read_uint64(dst, maxdst);
n = read_byte(dst, maxdst);
if(n != 16) {
error();
}
c->heldcard = read_uint64(dst, maxdst);
n = read_byte(dst, maxdst);
if(n != 24) {
error();
}
c->overcard = read_uint64(dst, maxdst);
n = read_byte(dst, maxdst);
if(n != 32) {
error();
}
c->x = read_uint64(dst, maxdst);
n = read_byte(dst, maxdst);
if(n != 40) {
error();
}
c->y = read_uint64(dst, maxdst);
return c;
}
int mouseinfo_serialize(void *ao, char **dst, const char *maxdst)
{
struct mouseinfo_s *s;
char *start;
start = *dst;
s = ao;
write_byte(dst, maxdst, 8);
write_uint64(dst, maxdst, s->arroworigin);
write_byte(dst, maxdst, 16);
write_uint64(dst, maxdst, s->heldcard);
write_byte(dst, maxdst, 24);
write_uint64(dst, maxdst, s->overcard);
write_byte(dst, maxdst, 32);
write_uint64(dst, maxdst, s->x);
write_byte(dst, maxdst, 40);
write_uint64(dst, maxdst, s->y);
return (*dst - start);
}
int mouseinfo_size(struct mouseinfo_s *p)
{
int num = 0;
num += 5;
num += sizeofu64(p->arroworigin);
num += sizeofu64(p->heldcard);
num += sizeofu64(p->overcard);
num += sizeofu64(p->x);
num += sizeofu64(p->y);
return num;
}
-84
View File
@@ -1,84 +0,0 @@
/*
hm_gameserver - hearthmod gameserver
Copyright (C) 2016 Filip Pancik
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <proto.h>
void option_free(struct option_s *o)
{
struct suboption_s *s, *del;
for(s = o->mainoption; s != NULL; del = s, s = s->next, suboption_free(del));
for(s = o->suboptions; s != NULL; del = s, s = s->next, suboption_free(del));
free(o);
}
int option_serialize(struct option_s *s, char **dst, const char *maxdst)
{
int n = 0;
struct suboption_s *m;
char *start;
start = *dst;
write_byte(dst, maxdst, 8);
write_uint64(dst, maxdst, s->type);
if(s->mainoption) {
write_byte(dst, maxdst, 18);
n = suboption_size(s->mainoption);
write_uint(dst, maxdst, n);
suboption_serialize(s->mainoption, dst, maxdst);
}
if(s->suboptions) {
for(m = s->suboptions; m != NULL; m = m->next) {
write_byte(dst, maxdst, 26);
n = suboption_size(m);
write_uint(dst, maxdst, n);
suboption_serialize(m, dst, maxdst);
}
}
return (*dst - start);
}
int option_size(struct option_s *p)
{
int num = 0, n;
struct suboption_s *s;
num += 1;
num += sizeofu64(p->type);
if(p->mainoption) {
num += 1;
n = suboption_size(p->mainoption);
num += sizeofu32(n) + n;
}
if(p->suboptions) {
for(s = p->suboptions; s != NULL; s = s->next) {
num += 1;
n = suboption_size(s);
num += sizeofu32(n) + n;
}
}
return num;
}
-129
View File
@@ -1,129 +0,0 @@
/*
hm_gameserver - hearthmod gameserver
Copyright (C) 2016 Filip Pancik
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <proto.h>
#define MAP_PACKET_MAX 12
typedef int (*f)(void *c);
static struct packet_meta_s map_packet[MAP_PACKET_MAX] = {
{P_GETGAMESTATE, NULL, NULL, NULL},
{P_CHOOSEOPTION, chooseoption_deserialize, chooseoption_serialize, (f)chooseoption_free},
{P_TURNTIMER, turntimer_deserialize, turntimer_serialize, (f)turntimer_free},
{P_CHOOSEENTITIES, chooseentities_deserialize, chooseentities_serialize, (f)chooseentities_free},
{P_ALLOPTIONS, NULL, alloptions_serialize, (f)alloptions_free},
{P_ENTITYCHOICES, entitychoices_deserialize, entitychoices_serialize, (f)entitychoices_free},
{P_GAMESETUP, gamesetup_deserialize, gamesetup_serialize, (f)gamesetup_free},
{P_USERUI, userui_deserialize, userui_serialize, (f)userui_free},
{P_POWERHISTORY, powerhistory_deserialize, powerhistory_serialize, (f)powerhistory_free},
{P_HANDSHAKE, handshake_deserialize, handshake_serialize, (f)handshake_free},
{P_PING, NULL, NULL, NULL},
{P_PONG, NULL, NULL, NULL},
};
struct packet_s *deserialize(char **dst, const char *maxdst)
{
struct packet_s *p;
int i;
if(!(dst != NULL && *dst != NULL && *dst < maxdst)) {
return NULL;
}
p = malloc(sizeof(*p));
p->id = read_mem_int(dst, maxdst);
p->len = read_mem_int(dst, maxdst);
for(i = 0; i < MAP_PACKET_MAX; i++) {
if(map_packet[i].id == p->id) {
if(map_packet[i].deserialize) {
p->data = map_packet[i].deserialize(dst, maxdst);
assert(p->data);
}
return p;
}
}
free(p);
return NULL;
}
void packet_free(struct packet_s *p)
{
int i;
for(i = 0; i < MAP_PACKET_MAX; i++) {
if(map_packet[i].id == p->id) {
if(map_packet[i].free) {
map_packet[i].free(p->data);
}
free(p);
break;
}
}
}
int serialize(struct packet_s *p, char **dst, const char *maxdst)
{
int i, n = 0;
char *off_len;
write_mem_int(dst, maxdst, p->id);
off_len = *dst;
write_mem_int(dst, maxdst, 0); // make space for length
n += 2 * sizeof(int);
for(i = 0; i < MAP_PACKET_MAX; i++) {
if(map_packet[i].id == p->id) {
if(map_packet[i].serialize) {
n += map_packet[i].serialize(p->data, dst, maxdst);
}
write_mem_int(&off_len, maxdst, n - (2 * sizeof(int)));
return n;
}
}
return -1;
}
struct packet_s *packet_init(enum packet_e id, void *data)
{
struct packet_s *p;
p = malloc(sizeof(*p));
p->id = id;
p->data = data;
return p;
}
void add_packet(struct packet_s **dst, void *ph, enum packet_e n)
{
*dst = malloc(sizeof(**dst));
memset(*dst, 0, sizeof(**dst));
(*dst)->data = ph;
(*dst)->id = n;
}

Some files were not shown because too many files have changed in this diff Show More