Skip to content

Commit

Permalink
Update dojo 0.3.0 (#202)
Browse files Browse the repository at this point in the history
* quick upgrade test

* update systems

* make it build & migrate

* dojo/packages issues

* Revert "dojo/packages issues"

This reverts commit dc66ee9.

* update typescript & chakra ui

* use @dojoengine/create-burner

* component -> model

* prepare to use dojo packages

* packages not working

* models -> components

* better DojoProvider

* timewaste

* update cairo/dojo

* timewasting recs test

* add GameMode, settings, refactoring, wip

* finish to change all constants to settings

* liquidity scaling

* set name at game creation

* remove Name model, update set_name

* pawnshop ui

* shop/items, start to update tests

* update graphql queries

* use enums

* rc7

* shop still wip

* remove risks

* add max_items_allowed check

* use wanted

* use wanted

* display max item allowed

* fix some build issues

* fix all damn frontend build issues

* fix createBurner rendering issue

* add burner & update auth script

* remove player_two

* use dojo::contract

* fix summary

* update settings & fmt

* tuning

* feat: Escape to a random location (#199)

* feat(escape_to_random_location): Escaping to random location + Testing text in the frontend

* feat(escape_to_random_location): Correctly move to a random location

* feat(escape_to_random_location): Using description field + Update README

* feat(escape_to_random_location): Updated README

* feat(escape_to_random_location): Removed warning emoji

* feat(escape_to_random_location): Removed useless new lines

* feat(escape_to_random_location): Removed changes from scarb fmt

* feat(escape_to_random_location): Typo in README 💀

* feat(escape_to_random_location): Removed HTML tags from README, now using MD only

* feat(escape_to_random_location): Fixed mistake 😱

* feat: Add inventory on the Travel page (#200)

* feat(travel-inventory-bar): Added inventory bar in the Travel page

* feat(travel-inventory-bar): Removed not needed icons in Menu

* feat(travel-inventory-bar): Removed not needed imports

* feat(travel-inventory-bar): Removed useless import

* feat(travel-inventory-bar): Yet another useless import :)

* feat(travel-inventory-bar): Fixes from review

* feat(travel-inventory-bar): Fixes from review

* feat(travel-inventory-bar): Fixes from review

* feat(travel-inventory-bar): Updated the gradient for mobile version

* feat(travel-inventory-bar): Updated border colors & spacing

* feat(travel-inventory-bar): Padding bottom for inventory for desktop & mobile

---------

Co-authored-by: akhercha <[email protected]>

* feat: Removed cartridge avatar & Added crown to Skull icon (#201)

* feat(skull_with_crown): Removed Cartridge avatar + Added crown to skull icon

* feat(skull_with_crown): Added skull color to end-game screen

* feat(skull_with_crown): Refactor of the Skull icon from code review

* feat(skull_with_crown): Removed the <svg> tag for 💀

---------

Co-authored-by: akhercha <[email protected]>

* Set RYO metadata

* test with slot

* fix build issues

* env

* fix provider issue

* experiment graphql subscriptions for playerEntity

* fix build issues

* wss

* player subscription

* add player profile modale

* update pawnshop ui

* remove end turn summarry page

* add avatar selection

* new deployment

* temp

* ui updates & susbcription for player items&drugs

* update share link

* update decision UI

* 0.3.2

* ui updates

* encounters / fight

* make icon & text blink

* safety check with chain_id

* fix build issues

* use game_mode for testing & tune settings

* deployed

* update auth script

* deployement

* update torii ryo3...

* back to torii ryo

* fix: input style

* fix tooltips & add Ooo sound

* remove color on icons in decision

* smaller image in trade

* back to ryo1

* fix some issues & tune settings

* update manifest

* various fix & tuning

* refactoring, math, random, ..

* scarb fmt

* fix ui/responsive issues

* update events keys

* update events & prepare hustler logs

* hustler logs

* fix events ordering & add random demand

* emit market event at end turn after player update / fix build issues

* hide create test game

* add price scaling & small settings changes

* more inflation

* fixes, remove firefox ugly scrollbars, settings, etc

* enable sound

* feat: Adaptative heart (#245)

* feat(adaptative_heart): Adaptative heart depending on player's health

* feat(adaptative_heart): Updated DynamicHeart

* feat(adaptative_heart): Revert files that got pushed for no reasons...

* feat(adaptative_heart): Re-added EOF newline

* feat(adaptative_heart): Removed test health

* feat(adaptative_heart): Passing health color as a prop

* feat(adaptative_heart): Added color neon.400

* remove some toast

* 0.3.10 & fixes

* fixes & tooltip

* fix damn build issue

* fix: Encounter health during fight (#247)

* feat(adaptative_heart): Adaptative heart depending on player's health

* feat(adaptative_heart): Updated DynamicHeart

* feat(adaptative_heart): Revert files that got pushed for no reasons...

* feat(adaptative_heart): Re-added EOF newline

* feat(adaptative_heart): Removed test health

* feat(adaptative_heart): Passing health color as a prop

* feat(adaptative_heart): Added color neon.400

* fix(encounter_health): Updated encounter health

* fix(encounter_health): Removed logging for debug

* disable test/tools

* change addr

---------

Co-authored-by: akhercha <[email protected]>
Co-authored-by: akhercha <[email protected]>
Co-authored-by: Tarrence van As <[email protected]>
  • Loading branch information
4 people authored Nov 13, 2023
1 parent 82f16c0 commit d74bf57
Show file tree
Hide file tree
Showing 179 changed files with 14,997 additions and 5,949 deletions.
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ sozo migrate
torii --world {world_address}

# Setup default authorization
./scripts/default_auth.sh
./scripts/default_auth.sh [local]

# Start frontend, located at http://localhost:3000
cd web
Expand All @@ -41,6 +41,26 @@ Note: If the world address your game is deployed to is different, you'll need to
- script/default_auth.sh
- web/src/constants.ts

#### Any errors when doing `sozo build` ?

This might be because your version of sozo is not correct.

Check the `Scarb.toml` file and get the `rev` tag from the `dojo` dependency:
```toml
[dependencies]
dojo = { git = "https://github.com/dojoengine/dojo.git", rev = "ca2d2e6dd1ef0fe311310ba0728be8743b1d5cc8" }
```

In this example, this is how we would install the correct version:
```bash
git clone https://github.com/dojoengine/dojo.git
cd dojo
git checkout ca2d2e6dd1ef0fe311310ba0728be8743b1d5cc8
dojoup -p .
```

This will reinstall the binaries in your `~/.dojo/bin` folder.

### With Madara

TBD
Expand Down
21 changes: 21 additions & 0 deletions Scarb.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Code generated by scarb DO NOT EDIT.
version = 1

[[package]]
name = "dojo"
version = "0.3.10"
source = "git+https://github.com/dojoengine/dojo.git?tag=v0.3.10#be1676252c41f8188465741edcbcb381d2c12080"
dependencies = [
"dojo_plugin",
]

[[package]]
name = "dojo_plugin"
version = "0.3.10"

[[package]]
name = "rollyourown"
version = "0.1.0"
dependencies = [
"dojo",
]
42 changes: 26 additions & 16 deletions Scarb.toml
Original file line number Diff line number Diff line change
@@ -1,35 +1,45 @@
[package]
cairo-version = "2.3.0"
name = "rollyourown"
version = "0.1.0"
cairo-version = "2.2.0"

[cairo]
sierra-replace-ids = true

[dependencies]
dojo = { git = "https://github.com/dojoengine/dojo.git", tag = "v0.2.3" }
# cubit = {git = "https://github.com/influenceth/cubit.git"}
# dojo = {git = "https://github.com/dojoengine/dojo.git"}
# dojo = {git = "https://github.com/dojoengine/dojo.git", rev = "d7f46502cba3d6462b68a4dfb07336377bca2678"}
dojo = {git = "https://github.com/dojoengine/dojo.git", tag = "v0.3.10"}


[[target.dojo]]

[scripts]
katana = "katana --disable-fee --invoke-max-steps 999999999"
build = "sozo build && scarb run gendojo"
gendojo = "./scripts/gen.sh"
auth = "./scripts/default_auth.sh local"
auth_dev = "./scripts/default_auth.sh"
migrate = "sozo migrate && scarb run gendojo && scarb run auth"
migrate_dev = "sozo migrate --rpc-url https://api.cartridge.gg/x/ryo/katana --account-address 0x6e857786bbd1652857d673836c41e0544d9d5ecd3e7a1bbde744e328b8cc2f6 --private-key 0x5e9d85de083b7ddd3029c44de2997ceba8384074bbebb66696a1b507f0466fc"

[tool.dojo.env]
# Katana
account_address = "0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973"
private_key = "0x1800000000300000180000000000030000000000003006001800006600"
rpc_url = "http://localhost:5050"

# seed 420
# account_address = "0x6e857786bbd1652857d673836c41e0544d9d5ecd3e7a1bbde744e328b8cc2f6"
# private_key = "0x5e9d85de083b7ddd3029c44de2997ceba8384074bbebb66696a1b507f0466fc"
# rpc_url = "https://api.cartridge.gg/x/ryo/katana"


[tool.dojo.world]
name = "Roll Your Own"
description = "example world"
website = "https://rollyourown.preview.cartridge.gg/"
icon_uri = "file://assets/icon.png"
cover_uri = "file://assets/cover.png"
socials.x = "https://x.com/TheDopeWars"

# Katana
#rpc_url = "https://api.cartridge.gg/x/rollyourown/katana"
rpc_url = "http://localhost:5050"
account_address = "0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973"
private_key = "0x1800000000300000180000000000030000000000003006001800006600"

# Madara
#rpc_url = "https://api.cartridge.gg/x/shinai/madara"
#account_address = "0x2"
#private_key = "0xc1cf1490de1352865301bb8705143f3ef938f97fdf892f1090dcb5ac7bcd1d"

#world_address = "0x3c3dfeb374720dfd73554dc2b9e0583cb9668efb3055d07d1533afa5d219fd5"
socials.x = "https://x.com/TheDopeWars"
9 changes: 0 additions & 9 deletions player_two/Scarb.toml

This file was deleted.

75 changes: 37 additions & 38 deletions scripts/default_auth.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,62 +2,61 @@
set -euo pipefail
pushd $(dirname "$0")/..

if [ $# -ge 1 ] && [ $1 == "local" ]
then
export RPC_URL="http://localhost:5050";
if [ $# -ge 1 ] && [ $1 == "local" ]; then
export RPC_URL="http://localhost:5050"
else
export RPC_URL="https://api.cartridge.gg/x/rollyourown/katana";
export RPC_URL="https://api.cartridge.gg/x/ryo/katana"
fi

export WORLD_ADDRESS="0x3c3dfeb374720dfd73554dc2b9e0583cb9668efb3055d07d1533afa5d219fd5";
export WORLD_ADDRESS=$(cat ./target/dev/manifest.json | jq -r '.world.address')

export LOBBY_ADDRESS=$(cat ./target/dev/manifest.json | jq -r '.contracts[] | select(.name == "lobby" ).address')
export TRAVEL_ADDRESS=$(cat ./target/dev/manifest.json | jq -r '.contracts[] | select(.name == "travel" ).address')
export DECIDE_ADDRESS=$(cat ./target/dev/manifest.json | jq -r '.contracts[] | select(.name == "decide" ).address')
export TRADE_ADDRESS=$(cat ./target/dev/manifest.json | jq -r '.contracts[] | select(.name == "trade" ).address')
export SHOP_ADDRESS=$(cat ./target/dev/manifest.json | jq -r '.contracts[] | select(.name == "shop" ).address')

echo "---------------------------------------------------------------------------"
echo rpc : $RPC_URL
echo world : $WORLD_ADDRESS
echo " "
echo lobby : $LOBBY_ADDRESS
echo travel: $TRAVEL_ADDRESS
echo decide: $DECIDE_ADDRESS
echo trade : $TRADE_ADDRESS
echo shop : $SHOP_ADDRESS
echo "---------------------------------------------------------------------------"

# enable system -> component authorizations
CREATE_GAME_COMPONENTS=("Game" "Market" "Name" "Player" "Risks")
JOIN_GAME_COMPONENTS=("Game" "Player")
SET_NAME_COMPONENTS=("Name")
BUY_COMPONENTS=("Drug" "Market" "Name" "Player")
SELL_COMPONENTS=("Drug" "Market" "Name" "Player")
TRAVEL_COMPONENTS=("Player" "Market")
DECIDE_COMPONENTS=("Player" "Drug")

for component in ${CREATE_GAME_COMPONENTS[@]}; do
sozo auth writer $component create_game --world $WORLD_ADDRESS --rpc-url $RPC_URL
sleep 0.1
done
LOBBY_COMPONENTS=("Game" "Market" "Player" )
TRAVEL_COMPONENTS=("Player" "Market" "Encounter")
DECIDE_COMPONENTS=("Player" "Drug" "Market" "Encounter")
TRADE_COMPONENTS=("Drug" "Market" "Player")
SHOP_COMPONENTS=("Player" "Item" "Market")

for component in ${JOIN_GAME_COMPONENTS[@]}; do
sozo auth writer $component join_game --world $WORLD_ADDRESS --rpc-url $RPC_URL
for component in ${LOBBY_COMPONENTS[@]}; do
sozo auth writer $component $LOBBY_ADDRESS --world $WORLD_ADDRESS --rpc-url $RPC_URL
sleep 0.1
done

for component in ${SET_NAME_COMPONENTS[@]}; do
sozo auth writer $component set_name --world $WORLD_ADDRESS --rpc-url $RPC_URL
sleep 0.1
done

for component in ${BUY_COMPONENTS[@]}; do
sozo auth writer $component buy --world $WORLD_ADDRESS --rpc-url $RPC_URL
sleep 0.1
done

for component in ${SELL_COMPONENTS[@]}; do
sozo auth writer $component sell --world $WORLD_ADDRESS --rpc-url $RPC_URL
for component in ${TRAVEL_COMPONENTS[@]}; do
sozo auth writer $component $TRAVEL_ADDRESS --world $WORLD_ADDRESS --rpc-url $RPC_URL
sleep 0.1
done

for component in ${TRAVEL_COMPONENTS[@]}; do
sozo auth writer $component travel --world $WORLD_ADDRESS --rpc-url $RPC_URL
for component in ${DECIDE_COMPONENTS[@]}; do
sozo auth writer $component $DECIDE_ADDRESS --world $WORLD_ADDRESS --rpc-url $RPC_URL
sleep 0.1
done

for component in ${TRAVEL_COMPONENTS[@]}; do
sozo auth writer $component decide --world $WORLD_ADDRESS --rpc-url $RPC_URL
for component in ${TRADE_COMPONENTS[@]}; do
sozo auth writer $component $TRADE_ADDRESS --world $WORLD_ADDRESS --rpc-url $RPC_URL
sleep 0.1
done

for component in ${DECIDE_COMPONENTS[@]}; do
sozo auth writer $component decide --world $WORLD_ADDRESS --rpc-url $RPC_URL
for component in ${SHOP_COMPONENTS[@]}; do
sozo auth writer $component $SHOP_ADDRESS --world $WORLD_ADDRESS --rpc-url $RPC_URL
sleep 0.1
done

echo "Default authorizations have been successfully set."
echo "Default authorizations have been successfully set."
9 changes: 9 additions & 0 deletions scripts/gen.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
set -euo pipefail

cp ./target/dev/manifest.json ./web/manifest.json

pushd $(dirname "$0")/../web

yarn run gen:dojo
prettier --write ./src/dojo/generated
20 changes: 0 additions & 20 deletions src/components/drug.cairo

This file was deleted.

30 changes: 0 additions & 30 deletions src/components/game.cairo

This file was deleted.

23 changes: 0 additions & 23 deletions src/components/location.cairo

This file was deleted.

Loading

1 comment on commit d74bf57

@vercel
Copy link

@vercel vercel bot commented on d74bf57 Nov 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

rollyourown – ./

rollyourown.preview.cartridge.gg
rollyourown-git-main.preview.cartridge.gg

Please sign in to comment.