Skip to content

Commit

Permalink
update paths
Browse files Browse the repository at this point in the history
  • Loading branch information
kayla-glick committed Dec 8, 2023
1 parent 13aaba4 commit 1cd2d48
Show file tree
Hide file tree
Showing 426 changed files with 919 additions and 920 deletions.
4 changes: 2 additions & 2 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/classic/.dirstamp
make dist/sod/.dirstamp
- name: Test
run: |
Expand All @@ -41,5 +41,5 @@ jobs:
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: dist/classic/sod
folder: dist/sod
single-commit: true
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ jobs:
artifacts: |
wowsimcli-amd64-linux.zip
wowsimcli-windows.exe.zip
wowsimclassic-amd64-darwin.zip
wowsimclassic-arm64-darwin.zip
wowsimclassic-amd64-linux.zip
wowsimclassic-windows.exe.zip
wowsimsod-amd64-darwin.zip
wowsimsod-arm64-darwin.zip
wowsimsod-amd64-linux.zip
wowsimsod-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/classic/sod/.dirstamp
make dist/sod/.dirstamp
- name: Test
run: |
Expand Down
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ google-chrome*
.dockerignore
/classic/
*.code-workspace
wowsimclassic
wowsimsod

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

# lib
wowsimclassic*.so
wowsimclassic*.dll
wowsimclassic*.h
wowsimsod*.so
wowsimsod*.dll
wowsimsod*.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 /classic/sod
WORKDIR /sod
COPY . .
COPY gitconfig /etc/gitconfig

Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The primary goal of this project is to provide a framework that makes it easy to

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/classic/sod "https://wowsims.github.io/classic/sod")
[Live sims can be found here.](https://wowsims.github.io/sod "https://wowsims.github.io/sod")

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

Expand Down Expand Up @@ -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/classic/sod/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/classic/sod`
# http://localhost:8080/sod/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/sod`
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 `wowsimclassic` server binary and runs it, hosting /dist directory at http://localhost:3333/classic.
# Recompiles the `wowsimsod` server binary and runs it, hosting /dist directory at http://localhost:3333/classic.
# 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 'wowsimclassic' binary that can host the UI and run simulations natively (instead of with wasm).
# Creates the 'wowsimsod' 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/classic and then copying all those files to binary_dist/classic and loading all the files in that directory into its binary on compile.
make wowsimclassic
make wowsimsod

# 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/classic && ./wowsimclassic --usefs would rebuild the whole client and host it. (you would have had to run `make devserver` to build the wowsimclassic binary first.)
./wowsimclassic --usefs
# make dist/classic && ./wowsimsod --usefs would rebuild the whole client and host it. (you would have had to run `make devserver` to build the wowsimsod binary first.)
./wowsimsod --usefs

# Generate code for items. Only necessary if you changed the items generator.
make items
Expand Down Expand Up @@ -167,7 +167,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/classic/$SPEC`.
When you're ready to try out the site, run `make host` and navigate to `http://localhost:8080/sod/$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/classic/sod/sim/core/proto"
"github.com/wowsims/sod/sim/core/proto"
googleProto "google.golang.org/protobuf/proto"
)

Expand Down
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/classic/sod/cmd/wowsimcli/cmd"
"github.com/wowsims/classic/sod/sim"
"github.com/wowsims/sod/cmd/wowsimcli/cmd"
"github.com/wowsims/sod/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/classic/sod/sim/core"
"github.com/wowsims/classic/sod/sim/core/proto"
"github.com/wowsims/sod/sim/core"
"github.com/wowsims/sod/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/classic/sod/sim/core"
"github.com/wowsims/classic/sod/sim/core/proto"
"github.com/wowsims/sod/sim/core"
"github.com/wowsims/sod/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/classic/sod/sim/core/proto"
"github.com/wowsims/sod/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/classic/sod
module github.com/wowsims/sod

go 1.21

Expand Down
48 changes: 24 additions & 24 deletions makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
BASE_DIR := classic/sod
BASE_DIR := sod
OUT_DIR := dist/$(BASE_DIR)
TS_CORE_SRC := $(shell find ui/core -name '*.ts' -type f)
ASSETS_INPUT := $(shell find assets/ -type f)
Expand Down Expand Up @@ -66,11 +66,11 @@ ui/core/index.ts: $(TS_CORE_SRC)
clean:
rm -rf ui/core/proto/*.ts \
sim/core/proto/*.pb.go \
wowsimclassic \
wowsimclassic-windows.exe \
wowsimclassic-amd64-darwin \
wowsimclassic-arm64-darwin \
wowsimclassic-amd64-linux \
wowsimsod \
wowsimsod-windows.exe \
wowsimsod-amd64-darwin \
wowsimsod-arm64-darwin \
wowsimsod-amd64-linux \
dist \
binary_dist \
ui/core/index.ts \
Expand Down Expand Up @@ -148,12 +148,12 @@ proto: sim/core/proto/api.pb.go ui/core/proto/api.ts

# Builds the web server with the compiled client.
.PHONY: wowsimwclassic
wowsimclassic: binary_dist devserver
wowsimsod: binary_dist devserver

.PHONY: devserver
devserver: sim/core/proto/api.pb.go sim/web/main.go binary_dist/dist.go
@echo "Starting server compile now..."
@if go build -o wowsimclassic ./sim/web/main.go; then \
@if go build -o wowsimsod ./sim/web/main.go; then \
printf "\033[1;32mBuild Completed Successfully\033[0m\n"; \
else \
printf "\033[1;31mBUILD FAILED\033[0m\n"; \
Expand All @@ -172,30 +172,30 @@ endif
rundevserver: air devserver
ifeq ($(WATCH), 1)
npx vite build -m development --watch &
ulimit -n 10240 && air -tmp_dir "/tmp" -build.include_ext "go,proto" -build.args_bin "--usefs=true --launch=false" -build.bin "./wowsimclassic" -build.cmd "make devserver" -build.exclude_dir "assets,dist,node_modules,ui,tools"
ulimit -n 10240 && air -tmp_dir "/tmp" -build.include_ext "go,proto" -build.args_bin "--usefs=true --launch=false" -build.bin "./wowsimsod" -build.cmd "make devserver" -build.exclude_dir "assets,dist,node_modules,ui,tools"
else
./wowsimclassic --usefs=true --launch=false --host=":3333"
./wowsimsod --usefs=true --launch=false --host=":3333"
endif

wowsimclassic-windows.exe: wowsimclassic
wowsimsod-windows.exe: wowsimsod
# go build only considers syso files when invoked without specifying .go files: https://github.com/golang/go/issues/16090
cp ./assets/favicon_io/icon-windows_amd64.syso ./sim/web/icon-windows_amd64.syso
cd ./sim/web/ && GOOS=windows GOARCH=amd64 GOAMD64=v2 go build -o wowsimclassic-windows.exe -ldflags="-X 'main.Version=$(VERSION)' -s -w"
cd ./sim/web/ && GOOS=windows GOARCH=amd64 GOAMD64=v2 go build -o wowsimsod-windows.exe -ldflags="-X 'main.Version=$(VERSION)' -s -w"
cd ./cmd/wowsimcli && GOOS=windows GOARCH=amd64 GOAMD64=v2 go build -o wowsimcli-windows.exe --tags=with_db -ldflags="-X 'main.Version=$(VERSION)' -s -w"
rm ./sim/web/icon-windows_amd64.syso
mv ./sim/web/wowsimclassic-windows.exe ./wowsimclassic-windows.exe
mv ./sim/web/wowsimsod-windows.exe ./wowsimsod-windows.exe
mv ./cmd/wowsimcli/wowsimcli-windows.exe ./wowsimcli-windows.exe

release: wowsimclassic wowsimclassic-windows.exe
GOOS=darwin GOARCH=amd64 GOAMD64=v2 go build -o wowsimclassic-amd64-darwin -ldflags="-X 'main.Version=$(VERSION)' -s -w" ./sim/web/main.go
GOOS=darwin GOARCH=arm64 go build -o wowsimclassic-arm64-darwin -ldflags="-X 'main.Version=$(VERSION)' -s -w" ./sim/web/main.go
GOOS=linux GOARCH=amd64 GOAMD64=v2 go build -o wowsimclassic-amd64-linux -ldflags="-X 'main.Version=$(VERSION)' -s -w" ./sim/web/main.go
release: wowsimsod wowsimsod-windows.exe
GOOS=darwin GOARCH=amd64 GOAMD64=v2 go build -o wowsimsod-amd64-darwin -ldflags="-X 'main.Version=$(VERSION)' -s -w" ./sim/web/main.go
GOOS=darwin GOARCH=arm64 go build -o wowsimsod-arm64-darwin -ldflags="-X 'main.Version=$(VERSION)' -s -w" ./sim/web/main.go
GOOS=linux GOARCH=amd64 GOAMD64=v2 go build -o wowsimsod-amd64-linux -ldflags="-X 'main.Version=$(VERSION)' -s -w" ./sim/web/main.go
GOOS=linux GOARCH=amd64 GOAMD64=v2 go build -o wowsimcli-amd64-linux --tags=with_db -ldflags="-X 'main.Version=$(VERSION)' -s -w" ./cmd/wowsimcli/cli_main.go
# Now compress into a zip because the files are getting large.
zip wowsimclassic-windows.exe.zip wowsimclassic-windows.exe
zip wowsimclassic-amd64-darwin.zip wowsimclassic-amd64-darwin
zip wowsimclassic-arm64-darwin.zip wowsimclassic-arm64-darwin
zip wowsimclassic-amd64-linux.zip wowsimclassic-amd64-linux
zip wowsimsod-windows.exe.zip wowsimsod-windows.exe
zip wowsimsod-amd64-darwin.zip wowsimsod-amd64-darwin
zip wowsimsod-arm64-darwin.zip wowsimsod-arm64-darwin
zip wowsimsod-amd64-linux.zip wowsimsod-amd64-linux
zip wowsimcli-amd64-linux.zip wowsimcli-amd64-linux
zip wowsimcli-windows.exe.zip wowsimcli-windows.exe

Expand All @@ -205,15 +205,15 @@ sim/core/proto/api.pb.go: proto/*.proto
# Only useful for building the lib on a host platform that matches the target platform
.PHONY: locallib
locallib: sim/core/proto/api.pb.go
go build -buildmode=c-shared -o wowsimclassic.so --tags=with_db ./sim/lib/library.go
go build -buildmode=c-shared -o wowsimsod.so --tags=with_db ./sim/lib/library.go

.PHONY: nixlib
nixlib: sim/core/proto/api.pb.go
GOOS=linux GOARCH=amd64 GOAMD64=v2 go build -buildmode=c-shared -o wowsimclassic-linux.so --tags=with_db ./sim/lib/library.go
GOOS=linux GOARCH=amd64 GOAMD64=v2 go build -buildmode=c-shared -o wowsimsod-linux.so --tags=with_db ./sim/lib/library.go

.PHONY: winlib
winlib: sim/core/proto/api.pb.go
GOOS=windows GOARCH=amd64 GOAMD64=v2 CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc go build -buildmode=c-shared -o wowsimclassic-windows.dll --tags=with_db ./sim/lib/library.go
GOOS=windows GOARCH=amd64 GOAMD64=v2 CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc go build -buildmode=c-shared -o wowsimsod-windows.dll --tags=with_db ./sim/lib/library.go

.PHONY: items
items: sim/core/items/all_items.go sim/core/proto/api.pb.go
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "wotlk",
"name": "sod",
"version": "0.1.0",
"private": true,
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions sim/_hunter/aimed_shot.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package hunter
import (
"time"

"github.com/wowsims/classic/sod/sim/core"
"github.com/wowsims/classic/sod/sim/core/proto"
"github.com/wowsims/sod/sim/core"
"github.com/wowsims/sod/sim/core/proto"
)

func (hunter *Hunter) registerAimedShotSpell(timer *core.Timer) {
Expand Down
4 changes: 2 additions & 2 deletions sim/_hunter/arcane_shot.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package hunter
import (
"time"

"github.com/wowsims/classic/sod/sim/core"
"github.com/wowsims/classic/sod/sim/core/proto"
"github.com/wowsims/sod/sim/core"
"github.com/wowsims/sod/sim/core/proto"
)

func (hunter *Hunter) registerArcaneShotSpell(timer *core.Timer) {
Expand Down
6 changes: 3 additions & 3 deletions sim/_hunter/aspects.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package hunter
import (
"time"

"github.com/wowsims/classic/sod/sim/core"
"github.com/wowsims/classic/sod/sim/core/proto"
"github.com/wowsims/classic/sod/sim/core/stats"
"github.com/wowsims/sod/sim/core"
"github.com/wowsims/sod/sim/core/proto"
"github.com/wowsims/sod/sim/core/stats"
)

func (hunter *Hunter) registerAspectOfTheDragonhawkSpell() {
Expand Down
4 changes: 2 additions & 2 deletions sim/_hunter/black_arrow.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package hunter
import (
"time"

"github.com/wowsims/classic/sod/sim/core"
"github.com/wowsims/classic/sod/sim/core/stats"
"github.com/wowsims/sod/sim/core"
"github.com/wowsims/sod/sim/core/stats"
)

func (hunter *Hunter) registerBlackArrowSpell(timer *core.Timer) {
Expand Down
4 changes: 2 additions & 2 deletions sim/_hunter/chimera_shot.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package hunter
import (
"time"

"github.com/wowsims/classic/sod/sim/core"
"github.com/wowsims/classic/sod/sim/core/proto"
"github.com/wowsims/sod/sim/core"
"github.com/wowsims/sod/sim/core/proto"
)

func (hunter *Hunter) registerChimeraShotSpell() {
Expand Down
4 changes: 2 additions & 2 deletions sim/_hunter/explosive_shot.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"fmt"
"time"

"github.com/wowsims/classic/sod/sim/core"
"github.com/wowsims/classic/sod/sim/core/proto"
"github.com/wowsims/sod/sim/core"
"github.com/wowsims/sod/sim/core/proto"
)

func (hunter *Hunter) registerExplosiveShotSpell(timer *core.Timer) {
Expand Down
4 changes: 2 additions & 2 deletions sim/_hunter/explosive_trap.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package hunter
import (
"time"

"github.com/wowsims/classic/sod/sim/core"
"github.com/wowsims/classic/sod/sim/core/proto"
"github.com/wowsims/sod/sim/core"
"github.com/wowsims/sod/sim/core/proto"
)

func (hunter *Hunter) registerExplosiveTrapSpell(timer *core.Timer) {
Expand Down
8 changes: 4 additions & 4 deletions sim/_hunter/hunter.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package hunter
import (
"time"

"github.com/wowsims/classic/sod/sim/common"
"github.com/wowsims/classic/sod/sim/core"
"github.com/wowsims/classic/sod/sim/core/proto"
"github.com/wowsims/classic/sod/sim/core/stats"
"github.com/wowsims/sod/sim/common"
"github.com/wowsims/sod/sim/core"
"github.com/wowsims/sod/sim/core/proto"
"github.com/wowsims/sod/sim/core/stats"
)

var TalentTreeSizes = [3]int{26, 27, 28}
Expand Down
6 changes: 3 additions & 3 deletions sim/_hunter/hunter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package hunter
import (
"testing"

_ "github.com/wowsims/classic/sod/sim/common" // imported to get item effects included.
"github.com/wowsims/classic/sod/sim/core"
"github.com/wowsims/classic/sod/sim/core/proto"
_ "github.com/wowsims/sod/sim/common" // imported to get item effects included.
"github.com/wowsims/sod/sim/core"
"github.com/wowsims/sod/sim/core/proto"
)

func init() {
Expand Down
Loading

0 comments on commit 1cd2d48

Please sign in to comment.