Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: gamestore cpp #2834

Open
wants to merge 47 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
01a3b33
feat: gamestore cpp
murilo09 Aug 20, 2024
035377c
fix: store history
murilo09 Aug 20, 2024
7489831
fix: using shared pointer
murilo09 Aug 20, 2024
d22d933
Code format - (Clang-format)
github-actions[bot] Aug 20, 2024
1f6616c
fix: build
murilo09 Aug 20, 2024
11266a2
fix: tibia coins balance
murilo09 Aug 20, 2024
55ab1dc
fix: more descriptive log
murilo09 Aug 20, 2024
9ab641f
fix: store history
murilo09 Aug 20, 2024
3363cf0
Code format - (Clang-format)
github-actions[bot] Aug 20, 2024
9f968a5
fix: only wrapable store items can be moved to a house
murilo09 Aug 21, 2024
d840310
feat: movable store items flag
murilo09 Aug 21, 2024
8e82c88
fix: duplicated house store items
murilo09 Aug 21, 2024
6be8c23
fix: update balance after purchase
murilo09 Aug 21, 2024
9c078de
fix: saving premium offer on db
murilo09 Aug 21, 2024
730df1f
fix: account_coins enum values
murilo09 Aug 21, 2024
481c634
fix: build
murilo09 Aug 21, 2024
381f99b
fix: store transfer history
murilo09 Aug 21, 2024
b837428
fix: xp boost offer
murilo09 Aug 22, 2024
34db280
Code format - (Clang-format)
github-actions[bot] Aug 22, 2024
5b51900
fix: migration version
murilo09 Aug 22, 2024
a4f75cb
fix: some review changes and reorganize game.cpp functions order
dudantas Sep 13, 2024
9a1f2a0
fix: missing review
dudantas Sep 13, 2024
cad47d8
fix: review
dudantas Sep 13, 2024
fb734f5
fix: qodana linter and others
dudantas Sep 14, 2024
b1dbd35
test: print directories
dudantas Sep 14, 2024
88c7fab
fix: correct getAccountId method
dudantas Sep 14, 2024
aea8b5c
fix: message store error
dudantas Sep 14, 2024
5ad167a
feat: init implementation of "store history detail"
dudantas Sep 14, 2024
6c73c21
feat: add "enum handling" to Database::getNumber function
dudantas Sep 15, 2024
f5c1be1
improve: store detail
dudantas Sep 15, 2024
29165b4
Code format - (Clang-format)
github-actions[bot] Sep 15, 2024
ccd4fb9
feat: multiple offer price
murilo09 Sep 16, 2024
de74497
Code format - (Clang-format)
github-actions[bot] Sep 16, 2024
b4394fb
feat: try on
murilo09 Sep 17, 2024
30cc334
Code format - (Clang-format)
github-actions[bot] Sep 17, 2024
6635d63
feat: store history detail
dudantas Sep 17, 2024
5961e6c
fix: qodana
dudantas Sep 18, 2024
48a972d
fix: qodana reviews
dudantas Sep 18, 2024
ac2e791
fix: change name
murilo09 Sep 24, 2024
7a1d17b
fix: offers error message
murilo09 Sep 24, 2024
d24b99e
Code format - (Clang-format)
github-actions[bot] Sep 24, 2024
6675247
remove log
murilo09 Sep 24, 2024
2dcf9b6
feat: implement store detail
dudantas Sep 28, 2024
b224f1d
fix: circular inclusion
dudantas Sep 28, 2024
9871fdf
fix: enable unity build
dudantas Sep 28, 2024
bea9662
Merge branch 'main' into gamestore-cpp
dudantas Sep 28, 2024
40b3414
fix: compilation with unity build
dudantas Sep 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion data-otservbr-global/migrations/46.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
function onUpdateDatabase()
return false -- true = There are others migrations file | false = this is the last migration file
logger.info("Updating database to version 47 (feat: gamestore cpp)")

db.query([[
ALTER TABLE `store_history`
ADD `type` smallint(2) UNSIGNED NOT NULL DEFAULT '0'
]])

return true
end
3 changes: 3 additions & 0 deletions data-otservbr-global/migrations/47.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
function onUpdateDatabase()
return false -- true = There are others migrations file | false = this is the last migration file
end
109 changes: 109 additions & 0 deletions data/XML/store/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
## Store

---

### FAQ

##### 1. Store XML Structure

```xml
<store>
<category>
<offer />
<offer />
</category>

<category>
<subcategory>
<offer />
<offer />
</subcategory>
</category>
</store>
```

### Category Options

| Field Name | Type | Usage | Default |
| ---------- | --------------- | --------------------------- | --------- |
| name | string | category name | Mandatory |
| icon | string | category icon name | Mandatory |
| rookgaard | string (yes/no) | category is allowed in rook | yes |

#### Example :

```xml
<category name="Premium Time" icon="Category_PremiumTime.png" rookgaard="yes" />
```

### Subcategory Options

| Field Name | Type | Usage | Default |
| ---------- | --------------- | ------------------------------ | --------- |
| name | string | subcategory name | Mandatory |
| icon | string | subcategory icon name | Mandatory |
| rookgaard | string (yes/no) | subcategory is allowed in rook | yes |
| state | string | subcategory highlight state | none |

### State types

| State Options |
| ------------- |
| none |
| new |
| sale |
| timed |

#### Example :

```xml
<subcategory name="Casks" icon="Category_Casks.png" rookgaard="yes" state="none">
</subcategory>
```

### Offer Options

#### Mandatory Fields

| Method | Type | Usage |
| ------- | ------------ | ------------------------------------ |
| name | string | offer name |
| icon | string | offer icon name |
| offerId | unsigned int | offer identifier |
| price | unsigned int | offer price |
| type | string | offer type (possible options below) |
| state | string | offer state (possible options below) |

### Offer types

| | | Type Options | | |
| --------- | ---------- | ------------ | ------------- | -------------- |
| none | mount | preyslot | pounch | namechange |
| item | namechange | preybonus | allblessings | sexchange |
| stackable | sexchange | temple | instantreward | hirelingskill |
| charges | house | bleesings | charms | hirelingoutfit |
| outfit | expboost | premium | hireling | huntingslot |

#### Optional Fields

| Method | Type | Usage | Default |
| ----------- | ------------ | ----------------- | ------- |
| count | unsigned int | offer count | 1 |
| validUntil | unsigned int | offer validUntil | 0 |
| coinType | string | offer coin type | coin |
| description | string | offer description | "" |
| movable | string | offer movable | false |

### Coin types

| Coin Options |
| ------------ |
| coin |
| transferable |
| tournament |

#### Example :

```XML
<offer name="Strong Health Cask" icon="Strong_Health_Cask.png" offerId="25880" price="11" type="house" movable="true" state="none" count="1000" description="" />
```
826 changes: 826 additions & 0 deletions data/XML/store/store.xml

Large diffs are not rendered by default.

10 changes: 0 additions & 10 deletions data/modules/modules.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<modules>
<!-- GameStore -->
<module type="recvbyte" byte="232" script="gamestore/gamestore.lua"/>
<module type="recvbyte" byte="233" script="gamestore/gamestore.lua"/>
<module type="recvbyte" byte="239" script="gamestore/gamestore.lua"/>
<module type="recvbyte" byte="250" delay="600" script="gamestore/gamestore.lua"/>
<module type="recvbyte" byte="251" script="gamestore/gamestore.lua"/>
<module type="recvbyte" byte="252" script="gamestore/gamestore.lua"/>
<module type="recvbyte" byte="253" script="gamestore/gamestore.lua"/>
<module type="recvbyte" byte="254" script="gamestore/gamestore.lua"/>

<!-- Blessings -->
<module type="recvbyte" byte="207" script="blessings/blessings.lua" />

Expand Down
Loading
Loading