Skip to content

Commit

Permalink
basic wotlk => cata conversion, server runs
Browse files Browse the repository at this point in the history
  • Loading branch information
kayla-glick committed Mar 9, 2024
1 parent 64975db commit d833dfe
Show file tree
Hide file tree
Showing 592 changed files with 1,436 additions and 16,561 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/missing-item-s-.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ assignees: ''

---

Links to [WOTLK Wowhead](https://wowhead.com/wotlk/items "https://wowhead.com/wotlk/items") for each item:
Links to [Cataclysm Wowhead](https://wowhead.com/cata/items "https://wowhead.com/cata/items") for each item:
6 changes: 3 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:

- name: Build 🔧
run: |
make dist/wotlk/.dirstamp
make dist/cata/.dirstamp
- name: Test
run: |
Expand All @@ -41,5 +41,5 @@ jobs:
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: dist/wotlk
single-commit: true
folder: dist/cata
single-commit: true
16 changes: 8 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
description: 'Version Tag'
default: 'v0.0.0'
required: true

jobs:
build-and-release:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -42,15 +42,15 @@ jobs:
uses: actions/[email protected]
with:
ref: ${{ github.event.inputs.ref }}

- name: Test
run: |
make test
- name: Build 🔧
run: |
make clean && VERSION=${{ github.event.inputs.tag }} make release
- name: Release
uses: ncipollo/release-action@v1
with:
Expand All @@ -62,8 +62,8 @@ jobs:
artifacts: |
wowsimcli-amd64-linux.zip
wowsimcli-windows.exe.zip
wowsimwotlk-amd64-darwin.zip
wowsimwotlk-arm64-darwin.zip
wowsimwotlk-amd64-linux.zip
wowsimwotlk-windows.exe.zip
wowsimcata-amd64-darwin.zip
wowsimcata-arm64-darwin.zip
wowsimcata-amd64-linux.zip
wowsimcata-windows.exe.zip
2 changes: 1 addition & 1 deletion .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:

- name: Build 🔧
run: |
make dist/wotlk/.dirstamp
make dist/cata/.dirstamp
- name: Test
run: |
Expand Down
14 changes: 7 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ ui/*/index.html
dist
binary_dist
sim/web/__debug_bin
/wowsimwotlkcli*
/wowsimwotlk*
/wowsimcatacli*
/wowsimcata*

# temporary files
*.results.tmp
.dockerignore
/wotlk/
/cata/
*.code-workspace
wowsimwotlk
wowsimcata

# old result file
TestAPL.results
Expand All @@ -32,6 +32,6 @@ TestAPL.results
tmp/

# lib
wowsimwotlk*.so
wowsimwotlk*.dll
wowsimwotlk*.h
wowsimcata*.so
wowsimcata*.dll
wowsimcata*.h
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

FROM golang:1.21

WORKDIR /wotlk
WORKDIR /cata
COPY . .
COPY gitconfig /etc/gitconfig

Expand Down
52 changes: 26 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
Welcome to the WoW WOTLK Classic simulator! If you have questions or are thinking about contributing, [join our discord](https://discord.gg/jJMPr9JWwx "https://discord.gg/jJMPr9JWwx") to chat!
Welcome to the WoW Cataclysm Classic simulator! If you have questions or are thinking about contributing, [join our discord](https://discord.gg/jJMPr9JWwx "https://discord.gg/jJMPr9JWwx") to chat!

The primary goal of this project is to provide a framework that makes it easy to build a DPS sim for any class/spec, with a polished UI and accurate results. Each community will have ownership / responsibility over their portion of the sim, to ensure accuracy and that their community is represented. By having all the individual sims on the same engine, we can also have a combined 'raid sim' for testing raid compositions.

This project is licensed with MIT license. We request that anyone using this software in their own project to make sure there is a user visible link back to the original project.

[Live sims can be found here.](https://wowsims.github.io/wotlk "https://wowsims.github.io/wotlk")
[Live sims can be found here.](https://wowsims.github.io/cata "https://wowsims.github.io/cata")

[Support our devs via Patreon.](https://www.patreon.com/wowsims)

# Downloading Sim

Links for latest Sim build:
- [Windows Sim](https://github.com/wowsims/wotlk/releases/latest/download/wowsimwotlk-windows.exe.zip)
- [MacOS Sim](https://github.com/wowsims/wotlk/releases/latest/download/wowsimwotlk-amd64-darwin.zip)
- [Linux Sim](https://github.com/wowsims/wotlk/releases/latest/download/wowsimwotlk-amd64-linux.zip)
- [Windows Sim](https://github.com/wowsims/cata/releases/latest/download/wowsimcata-windows.exe.zip)
- [MacOS Sim](https://github.com/wowsims/cata/releases/latest/download/wowsimcata-amd64-darwin.zip)
- [Linux Sim](https://github.com/wowsims/cata/releases/latest/download/wowsimcata-amd64-linux.zip)

Then unzip the downloaded file, then open the unzipped file to open the sim in your browser!

Alternatively, you can choose from a specific relase on the [Releases](https://github.com/wowsims/wotlk/releases) page and click the suitable link under "Assets"
Alternatively, you can choose from a specific relase on the [Releases](https://github.com/wowsims/cata/releases) page and click the suitable link under "Assets"
# Local Dev Installation

This project has dependencies on Go >=1.21, protobuf-compiler and the corresponding Go plugins, and node >= 14.0.
Expand All @@ -28,14 +28,14 @@ Script below will curl latest versions and install them.
```sh
# Standard Go installation script
curl -O https://dl.google.com/go/go1.21.1.linux-amd64.tar.gz
sudo rm -rf /usr/local/go
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf go1.21.1.linux-amd64.tar.gz
echo 'export PATH=$PATH:/usr/local/go/bin' >> $HOME/.bashrc
echo 'export GOPATH=$HOME/go' >> $HOME/.bashrc
echo 'export PATH=$PATH:$GOPATH/bin' >> $HOME/.bashrc
source $HOME/.bashrc

cd wotlk
cd cata

# Install protobuf compiler and Go plugins
sudo apt update && sudo apt upgrade
Expand All @@ -54,26 +54,26 @@ npm install
## Docker
Alternatively, install Docker and your workflow will look something like this:
```sh
git clone https://github.com/wowsims/wotlk.git
cd wotlk
git clone https://github.com/wowsims/cata.git
cd cata

# Build the docker image and install npm dependencies (only need to run these once).
docker build --tag wowsims-wotlk .
docker run --rm -v $(pwd):/wotlk wowsims-wotlk npm install
docker build --tag wowsims-cata .
docker run --rm -v $(pwd):/cata wowsims-cata npm install

# Now you can run the commands as shown in the Commands sections, preceding everything with, "docker run --rm -it -p 8080:8080 -v $(pwd):/wotlk wowsims-wotlk".
# Now you can run the commands as shown in the Commands sections, preceding everything with, "docker run --rm -it -p 8080:8080 -v $(pwd):/cata wowsims-cata".
# For convenience, set this as an environment variable:
WOTLK_CMD="docker run --rm -it -p 8080:8080 -v $(pwd):/wotlk wowsims-wotlk"
CATA_CMD="docker run --rm -it -p 8080:8080 -v $(pwd):/cata wowsims-cata"

# ... do some coding on the sim ...

# Run tests
$(echo $WOTLK_CMD) make test
$(echo $CATA_CMD) make test

# ... do some coding on the UI ...

# Host a local site
$(echo $WOTLK_CMD) make host
$(echo $CATA_CMD) make host
```

## Windows
Expand All @@ -100,8 +100,8 @@ make test
make update-tests

# Host a local version of the UI at http://localhost:8080. Visit it by pointing a browser to
# http://localhost:8080/wotlk/YOUR_SPEC_HERE, where YOUR_SPEC_HERE is the directory under ui/ with your custom code.
# Recompiles the entire client before launching using `make dist/wotlk`
# http://localhost:8080/cata/YOUR_SPEC_HERE, where YOUR_SPEC_HERE is the directory under ui/ with your custom code.
# Recompiles the entire client before launching using `make dist/cata`
make host

# With file-watching so the server auto-restarts and recompiles on Go or TS changes:
Expand All @@ -113,24 +113,24 @@ make clean
# Recompiles the ts only for the given spec (e.g. make host_elemental_shaman)
make host_$spec

# Recompiles the `wowsimwotlk` server binary and runs it, hosting /dist directory at http://localhost:3333/wotlk.
# Recompiles the `wowsimcata` server binary and runs it, hosting /dist directory at http://localhost:3333/cata.
# This is the fastest way to iterate on core go simulator code so you don't have to wait for client rebuilds.
# To rebuild client for a spec just do 'make $spec' and refresh browser.
make rundevserver

# With file-watching so the server auto-restarts and recompiles on Go or TS changes:
WATCH=1 make rundevserver

# Creates the 'wowsimwotlk' binary that can host the UI and run simulations natively (instead of with wasm).
# Creates the 'wowsimcata' binary that can host the UI and run simulations natively (instead of with wasm).
# Builds the UI and the compiles it into the binary so that you can host the sim as a server instead of wasm on the client.
# It does this by first doing make dist/wotlk and then copying all those files to binary_dist/wotlk and loading all the files in that directory into its binary on compile.
make wowsimwotlk
# It does this by first doing make dist/cata and then copying all those files to binary_dist/cata and loading all the files in that directory into its binary on compile.
make wowsimcata

# Using the --usefs flag will instead of hosting the client built into the binary, it will host whatever code is found in the /dist directory.
# Using the --usefs flag will instead of hosting the client built into the binary, it will host whatever code is found in the /dist directory.
# Use --wasm to host the client with the wasm simulator.
# The server also disables all caching so that refreshes should pickup any changed files in dist/. The client will still call to the server to run simulations so you can iterate more quickly on client changes.
# make dist/wotlk && ./wowsimwotlk --usefs would rebuild the whole client and host it. (you would have had to run `make devserver` to build the wowsimwotlk binary first.)
./wowsimwotlk --usefs
# make dist/cata && ./wowsimcata --usefs would rebuild the whole client and host it. (you would have had to run `make devserver` to build the wowsimcata binary first.)
./wowsimcata --usefs

# Generate code for items. Only necessary if you changed the items generator.
make items
Expand Down Expand Up @@ -164,7 +164,7 @@ The UI and sim can be done in either order, but it is generally recommended to b

No .html is needed, it will be generated based on `ui/index_template.html` and the `$SPEC` name.

When you're ready to try out the site, run `make host` and navigate to `http://localhost:8080/wotlk/$SPEC`.
When you're ready to try out the site, run `make host` and navigate to `http://localhost:8080/cata/$SPEC`.

## Implement the Sim
This step is where most of the magic happens. A few highlights to start understanding the sim code:
Expand Down
2 changes: 1 addition & 1 deletion assets/database/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package database
import (
_ "embed"

"github.com/wowsims/wotlk/sim/core/proto"
"github.com/wowsims/cata/sim/core/proto"
googleProto "google.golang.org/protobuf/proto"
)

Expand Down
Binary file added assets/img/cata.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/img/wotlk.jpg
Binary file not shown.
4 changes: 2 additions & 2 deletions cmd/wowsimcli/cli_main.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package main

import (
"github.com/wowsims/wotlk/cmd/wowsimcli/cmd"
"github.com/wowsims/wotlk/sim"
"github.com/wowsims/cata/cmd/wowsimcli/cmd"
"github.com/wowsims/cata/sim"
)

func init() {
Expand Down
4 changes: 2 additions & 2 deletions cmd/wowsimcli/cmd/basic_sim.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"os"

"github.com/spf13/cobra"
"github.com/wowsims/wotlk/sim/core"
"github.com/wowsims/wotlk/sim/core/proto"
"github.com/wowsims/cata/sim/core"
"github.com/wowsims/cata/sim/core/proto"
"google.golang.org/protobuf/encoding/protojson"
)

Expand Down
4 changes: 2 additions & 2 deletions cmd/wowsimcli/cmd/bulk_replace.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"time"

"github.com/spf13/cobra"
"github.com/wowsims/wotlk/sim/core"
"github.com/wowsims/wotlk/sim/core/proto"
"github.com/wowsims/cata/sim/core"
"github.com/wowsims/cata/sim/core/proto"
"google.golang.org/protobuf/encoding/protojson"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/wowsimcli/cmd/decode_link.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"strings"

"github.com/spf13/cobra"
"github.com/wowsims/wotlk/sim/core/proto"
"github.com/wowsims/cata/sim/core/proto"
"google.golang.org/protobuf/encoding/protojson"
goproto "google.golang.org/protobuf/proto"
)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/wowsims/wotlk
module github.com/wowsims/cata

go 1.21

Expand Down
Loading

0 comments on commit d833dfe

Please sign in to comment.