-
Notifications
You must be signed in to change notification settings - Fork 52
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
Migrate AvatarState.actionPoint
to use ActionPointModule
#2502
Conversation
๋ ์ด์ AvatarState์ ์์ ํ์๊ฐ ์์ด ์ญํ ์ ์ฎ๊ฒผ์ต๋๋ค.
AvatarState.actionPoint
to use ActionPointModule
AvatarState.actionPoint
to use ActionPointModule
์ก์ ํ๋ํฌํน ํ ์คํธ๋ฅผ ์ํด ์ฐ์ด๊ณ ์์ด์ ๋์์ ์ด์ ๊ณผ ๊ฐ์ด ๋ค์ ์์ ํ์ต๋๋ค
AvatarState.actionPoint
to use ActionPointModule
AvatarState.actionPoint
to use ActionPointModule
Validator ์ฝ๋๋ฅผ ์์ด์ง ํ์ฐธ๋๋๋ฐ usage๋ฅผ ๊ฐ๊ณ ์์ด์ ํท๊ฐ๋ฆฝ๋๋ค.
This PR has Quantification details
Why proper sizing of changes matters
Optimal pull request sizes drive a better predictable PR flow as they strike a
What can I do to optimize my changes
How to interpret the change counts in git diff output
Was this comment helpful? ๐ ย :ok_hand: ย :thumbsdown: (Email) |
Lib9c/Helper/InventoryExtensions.cs
Outdated
@@ -25,5 +30,39 @@ public static int GetEquippedFullCostumeOrArmorId(this Inventory inventory) | |||
|
|||
return GameConfig.DefaultAvatarArmorId; | |||
} | |||
|
|||
public static IWorld UseActionPoint( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ค์ ์ฌ์ฉ์ ์ธ๋ฒคํ ๋ฆฌ๋ณด๋ค๋ ์ก์ ์์์ IWorld๋ฅผ ๋์์ผ๋ก ํ๋ ๊ฒฝ์ฐ๊ฐ ๋ ๋ง์๊ฒ๊ฐ์๋ฐ, ActionPointModule๋ก ์ฎ๊ธฐ๊ณ ์ธ๋ฒคํ ๋ฆฌ๋ฅผ ๋ฐ๊ฒํ๋๊ฑด ์ด๋จ๊น์? ์๋๋ฉด state์ ๋ณ๊ฒฝ์ ๋ณ๋๋ก ์ฒ๋ฆฌํ๊ณ ์ด ๋ฉ์๋๋ ์ธ๋ฒคํ ๋ฆฌ์์ apํฌ์ ์ ์ฌ์ฉํ๋๊ฒ๊น์ง๋ง ์ฑ ์์ง๋๊ฒ ๋ ์ข์๊ฒ๊ฐ์ต๋๋ค. (์ถํ์ ์ต์ ํ๋ฅผ ๋ ์งํํ๊ฒ ๋๋ค๋ฉด ์ธ๋ฒคํ ๋ฆฌ๋ง ๋ณ๊ฒฝํํ IWorld์ Setํ๋ ๊ฒฝ์ฐ๋ ์์๊ฒ ๊ฐ์์)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ธ๋ฒคํ ๋ฆฌ์ชฝ์์ APํฌ์ ์ ์ฌ์ฉํ๋๊ฑฐ๊น์ง๋ง ์ฑ ์์ง๋๊ฒ ๋์๊ฑฐ๊ฐ์์ ๊ทธ ๋ฐฉํฅ์ผ๋ก ๋ณ๊ฒฝํด๋ณด๊ฒ ์ต๋๋ค.
Lib9c/Action/ChargeActionPoint.cs
Outdated
} | ||
|
||
if (avatarState.actionPoint == gameConfigState.ActionPointMax) | ||
var actionPoint = states.GetActionPoint(avatarAddress); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
diff์๋ ์์กํ๋๋ฐ ์ด ์ก์
์ UseActionPoint
๋ฅผ ์ฌ์ฉํ์ง ์๋์?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๋ค. ๊ธฐ์กด์ UseAp()
๋ ***Product ๊ฐ์ ์์ดํ
ํ๋งค/๊ตฌ๋งค ๊ด๋ จ ์ก์
์์๋ง ์ฐ๊ณ ์์์ต๋๋ค.
Lib9c/Action/CreateAvatar.cs
Outdated
@@ -238,7 +238,8 @@ public override IWorld Execute(IActionContext context) | |||
Log.Debug("{AddressesHex}CreateAvatar Total Executed Time: {Elapsed}", addressesHex, ended - started); | |||
return states | |||
.SetAgentState(signer, agentState) | |||
.SetAvatarState(avatarAddress, avatarState); | |||
.SetAvatarState(avatarAddress, avatarState) | |||
.SetActionPoint(avatarAddress, DailyReward.ActionPointMax); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(์๋ง DailyReward์์ ๋์์ค๋ฅ๋ ์๊ฒ ์ง๋ง) ์๋ก ์์ฑ๋๋ ์๋ฐํ๋ ๋ช
์์ ์ผ๋กSetDailyRewardReceivedBlockIndex
๋ก ์ค์ ์ ํด์ฃผ๋๊ฒ ์ข์๊ฒ๊ฐ์ต๋๋ค.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ipdae ๊ธฐ์กด์๋ AvatarState()
์์ฑ์์ชฝ์์๋ set์ ์ํด์ CreateAvatar ์ก์
์คํ ์ดํ์๋ 0L๋ก set๋๋ ํํ์๋๋ฐ, ๋ช
์์ ์ผ๋ก SetDailyRewardReceivedBlockIndex(avatarAddress, 0L)
๊ฐ์ ํธ์ถ์ ํด์ฃผ๋๊ฒ ์ข์๊น์?
์๋๋ฉด ์์ ์์ฑ ์์ ์ ์ธ๋ฑ์ค๋ฅผ setํด์ฃผ๋๊ฒ ์ข๊ฒ ๋ค๋ ๋ง์์ด์
จ์๊น์?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SetDailyRewardReceivedBlockIndex(avatarAddress, 0L)
์ ํ๋๊ฒ ์ข๊ฒ ๋ค๋ ์๊ธฐ์์ต๋๋ค.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ดํดํ์ต๋๋ค ๋ฐ์ํ๋๋ก ํ๊ฒ ์ต๋๋ค
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ํ์ฌ ์์ ๋ ์ก์ ๋ค์ ๋ชจ๋ GetActionPoint๋ฅผ ํตํด ๋ง์ด๊ทธ๋ ์ด์ ๋ ActionPoint๊ฐ ์ฒด์ธ์ ์กด์ฌํ๋๊ฒ์ ์ ์ ๋ก ์์ฑ๋์๋๋ฐ, ์ค์ ์ฒด์ธ์์๋ DailyReward์ก์ ์ ์คํํ๊ฑฐ๋ ์ ๊ท์์ฑ๋ ์๋ฐํ๊ฐ ์๋๋ฉด ๋ง์ด๊ทธ๋ ์ด์ ๋ ์ํ๊ฐ ์กด์ฌํ์ง ์๋ ์ํ์ ๋๋ค. ActionPointModule.TryGetActionPoint์ฒ๋ผ ์์ธ์ฒ๋ฆฌ๋ฅผ ํตํด ๋ง์ด๊ทธ๋ ์ด์ ์ด ์๋ ์ํ๋ฉด ๊ธฐ์กด ์๋ฐํ์ actionPoint๋ฅผ ์ฌ์ฉํ๊ณ , ๋ง์ง๋ง์ ๋ฐํํ ๋ SetActionPoint๋ฅผ ํธ์ถํด ํจ์๋ธ ๋ง์ด๊ทธ๋ ์ด์ ์ด ์งํ๋๋๋ก ๊ณ ๋ คํด์ผํฉ๋๋ค.
at CreateAvatar action
do not SetState, return calculated result.
if can not get action point, use avatarState.actionPoint. and use ActionPointModule.SetActionPoint().
This PR has Quantification details
Why proper sizing of changes matters
Optimal pull request sizes drive a better predictable PR flow as they strike a
What can I do to optimize my changes
How to interpret the change counts in git diff output
Was this comment helpful? ๐ ย :ok_hand: ย :thumbsdown: (Email) |
@ipdae |
resolve #2496
๐ผ๋ณ๊ฒฝ ์ดํ
AvatarState.actionPoint
๋ฅผ ์ฐธ์กฐํ๋ ๊ณณ๋ค์ ๋ชฉ๋ก์ ๋๋ค. Serialize, ๊ตฌ๋ฒ์ ์ก์ ์ด์ธ์ ๋ ์ด์ ์ฌ์ฉํ์ง ์๋๋ก ๋ณ๊ฒฝํ์ต๋๋ค.#2495 ์์ ๋ณ๊ฒฝ๋ ActionPoint ์ํ๋ฅผ ๋ค๋ฅธ ์ก์ ์์๋ ๋ฐ์ํ๋ PR์ ๋๋ค.
๋ณ๊ฒฝ๋๋ ํ์ผ์ด ๋ง์, ๊ฐ๋ฅํ ํ ํ์ผ๋ณ๋ก ๋ณ๊ฒฝ์ด ์๊ธธ๋๋ง๋ค ์ปค๋ฐ์ ๋๋ด์ต๋๋ค.
์ฃผ๋ก ActionPointModule์ ์ฌ์ฉํ๊ฒ ๋ณ๊ฒฝํ ์ปค๋ฐ, ๊ทธ๋ฆฌ๊ณ ์ด๋ฅผ ๋จ์ ํ ์คํธ์์ ๋ฐ์ํ ์ปค๋ฐ์ผ๋ก ๊ตฌ๋ถํ์์ต๋๋ค.
๋ณ๊ฐ๋ก AvatarState ์์ฑ์์์ GameConfigState๋ฅผ ๋ฐ์ง ์๊ฒ ์ ๊ฑฐํ๋ ๋ถ๋ถ์ ๋ณ๊ฐ์ PR๋ก ์์ ํ๋๊ฒ ์ข๋ค๊ณ ํ๋จ๋์ด ํฌํจํ์ง ์์์ต๋๋ค.
์ดํ๋ ์ก์ ๋ณ๊ฒฝ ์ปค๋ฐ๋ค์ ์ค๋ช ์ ๋๋ค.