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

[Improvement] - Converted store to c++, refactor all code and fix some related bugs #2

Closed
wants to merge 32 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
d0f6634
Gamestore in cpp
dudantas Aug 9, 2021
5dc0d5d
Gamestore functions and bytes
dudantas Aug 10, 2021
a8f99b9
Delete client_assertions.txt
dudantas Aug 10, 2021
c16c630
Fix indent
dudantas Aug 10, 2021
14c8276
Store loading informations done
dudantas Aug 13, 2021
300fefe
Store working 100%
dudantas Aug 14, 2021
08b053c
Fix bug in the "Account::AddCoins" and "Account::RemoveCoins" functio…
dudantas Aug 14, 2021
0d5ff63
Fix bug add/remove//get store coins and tournament store coins script
dudantas Aug 15, 2021
58204e2
Fix bug in store coins transfer
dudantas Aug 15, 2021
84b9adf
Move store coins talkactions to store folder
dudantas Aug 15, 2021
a6d9307
Fix not receiving outfit bug
dudantas Aug 15, 2021
b8077c5
Comment to explain the function
dudantas Aug 15, 2021
9c3cb42
Somes small fixes and adjustments
dudantas Aug 20, 2021
1fbbc96
More fixes
dudantas Aug 20, 2021
cb64bd0
Fix compilation error
dudantas Aug 20, 2021
798e220
Update src/creatures/creatures_definitions.hpp
dudantas Aug 21, 2021
61a0ca4
Update src/creatures/players/store/store.hpp
dudantas Aug 21, 2021
0751800
Moved the premium discount rate in the store to config.lua, and other…
dudantas Aug 22, 2021
f1c4587
Set discount store to false
dudantas Aug 22, 2021
e4576f9
Add vcpkg manifest file
dudantas Aug 22, 2021
a608d80
Fix: issue not displaying description in store offers
dudantas Aug 22, 2021
3bf81e0
Separation of coins and tournament coins
dudantas Aug 23, 2021
af1b73d
Fix identations
dudantas Aug 23, 2021
86bc6da
Refactor account class
Costallat Aug 25, 2021
0ac7e44
Update account documentation
Costallat Aug 25, 2021
38ac3f2
Fix windows build
Costallat Aug 27, 2021
b746976
Adjust code style
Costallat Aug 30, 2021
83908a8
Merge branch 'master' into gamestore-cpp
beats-dh Oct 21, 2021
73290dc
init storegame.lua > store.xml
beats-dh Jan 19, 2022
39af790
fixs store.xml
beats-dh Jan 20, 2022
aa9584b
Merge branch 'master' into gamestore-cpp
dudantas Jan 20, 2022
fea3ee0
Remove whitespace
dudantas Jan 20, 2022
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
64 changes: 64 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
Language: Cpp
BasedOnStyle: WebKit
AccessModifierOffset: -4
AlignAfterOpenBracket: false
AlignEscapedNewlinesLeft: false
AlignOperands: false
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Empty
AlwaysBreakAfterDefinitionReturnType: false
AlwaysBreakTemplateDeclarations: false
AlwaysBreakBeforeMultilineStrings: false
BreakBeforeBinaryOperators: None
BreakBeforeTernaryOperators: false
BreakConstructorInitializersBeforeComma: true
BinPackParameters: true
BinPackArguments: true
ColumnLimit: 80
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
DerivePointerAlignment: false
ExperimentalAutoDetectBinPacking: false
IndentCaseLabels: false
IndentWrappedFunctionNames: false
IndentFunctionDeclarationAfterType: false
MaxEmptyLinesToKeep: 2
KeepEmptyLinesAtTheStartOfBlocks: true
NamespaceIndentation: Inner
ObjCBlockIndentWidth: 4
ObjCSpaceAfterProperty: true
ObjCSpaceBeforeProtocolList: true
PenaltyBreakBeforeFirstCallParameter: 79
PenaltyBreakComment: 300
PenaltyBreakString: 1000
PenaltyBreakFirstLessLess: 120
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Left
SpacesBeforeTrailingComments: 1
Cpp11BracedListStyle: false
Standard: Auto
IndentWidth: 4
TabWidth: 8
UseTab: Never
BreakBeforeBraces: Linux
SpacesInParentheses: false
SpacesInSquareBrackets: false
SpacesInAngles: false
SpaceInEmptyParentheses: false
SpacesInCStyleCastParentheses: false
SpaceAfterCStyleCast: true
SpacesInContainerLiterals: true
SpaceBeforeAssignmentOperators: true
ContinuationIndentWidth: 4
CommentPragmas: '^ IWYU pragma:'
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
SpaceBeforeParens: ControlStatements
DisableFormat: false
...
4 changes: 2 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ trim_trailing_whitespace = true

# C/C++
[*.{cpp,hpp,h}]
indent_style = tab
indent_size = 2
indent_style = space
indent_size = 4

# CMake
[CMakeLists.txt]
Expand Down
7 changes: 4 additions & 3 deletions config.lua.dist
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ freeDepotLimit = 2000
premiumDepotLimit = 10000
depotBoxes = 18

-- GameStore
gamestoreByModules = true

-- NOTE: Access only for Premium Account
onlyPremiumAccount = false

Expand Down Expand Up @@ -138,6 +135,10 @@ premiumToCreateMarketOffer = true
checkExpiredMarketOffersEachMinutes = 60
maxMarketOffersAtATimePerPlayer = 100

-- Store
storePremiumDiscount = false
rateStorePremiumDiscount = 1.0

-- MySQL
mysqlHost = "127.0.0.1"
mysqlUser = "root"
Expand Down
562 changes: 562 additions & 0 deletions data/XML/store.xml

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion data/lib/core/functions/player.lua
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ function Player.hasRookgaardShield(self)
or self:getItemCount(2530) > 0
end


function Player.isSorcerer(self)
return table.contains({VOCATION.ID.SORCERER, VOCATION.ID.MASTER_SORCERER}, self:getVocation():getId())
end
Expand Down
4 changes: 2 additions & 2 deletions data/lib/core/functions/tables.lua
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ function pairsByKeys(t, f)
local a = {}
for n in pairs(t) do table.insert(a, n) end
table.sort(a, f)
local i = 0 -- iterator variable
local iter = function () -- iterator function
local i = 0 -- iterator variable
local iter = function () -- iterator function
i = i + 1
if a[i] == nil then return nil
else return a[i], t[a[i]]
Expand Down
7 changes: 4 additions & 3 deletions data/migrations/0.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
-- return true = There are others migrations file
-- return false = This is the last migration file
function onUpdateDatabase()
return false
Spdlog.info("Updating database to version 1 (store c++)")
db.query("ALTER TABLE `accounts` ADD `tournament_coins` int(11) NOT NULL DEFAULT 0")
db.query("ALTER TABLE `coins_transactions` ADD `coin_type` tinyint(1) NOT NULL DEFAULT 0")
return true
end
5 changes: 5 additions & 0 deletions data/migrations/1.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-- return true = There are others migrations file
-- return false = This is the last migration file
function onUpdateDatabase()
return false
end
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"/>

<!-- Prey System -->
<module type="recvbyte" byte="235" script="prey_system/prey.lua" />
<module type="recvbyte" byte="237" script="prey_system/prey.lua" />
Expand Down
2 changes: 1 addition & 1 deletion data/modules/scripts/blessings/blessings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Blessings.Credits = {
todo = {
"Insert & Select query in blessings_history",
"Add unfair fight reductio (convert the get killer is pvp fight with getDamageMap of dead player)",
"Gamestore buy blessing",
"Store buy blessing",
"Test ank print text",
"Test all functions",
"Test henricus prices/blessings",
Expand Down
Loading