-
Notifications
You must be signed in to change notification settings - Fork 53
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
Feature/gp shop #644
Open
pacampbell
wants to merge
4
commits into
sebastian-heinz:develop
Choose a base branch
from
pacampbell:feature/gp-shop
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Feature/gp shop #644
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
using System.Collections.Generic; | ||
using Arrowgene.Ddon.GameServer.Characters; | ||
using Arrowgene.Ddon.Server; | ||
using Arrowgene.Ddon.Shared.Entity.PacketStructure; | ||
using Arrowgene.Ddon.Shared.Entity.Structure; | ||
using Arrowgene.Ddon.Shared.Model; | ||
using Arrowgene.Logging; | ||
|
||
namespace Arrowgene.Ddon.GameServer.Handler | ||
{ | ||
public class BoxGachaBuyHandler : GameRequestPacketHandler<C2SBoxGachaBuyReq, S2CBoxGachaBuyRes> | ||
{ | ||
private static readonly ServerLogger Logger = LogProvider.Logger<ServerLogger>(typeof(BoxGachaBuyHandler)); | ||
|
||
public BoxGachaBuyHandler(DdonGameServer server) : base(server) | ||
{ | ||
} | ||
|
||
public override S2CBoxGachaBuyRes Handle(GameClient client, C2SBoxGachaBuyReq request) | ||
{ | ||
S2CBoxGachaBuyRes res = new S2CBoxGachaBuyRes(); | ||
|
||
// TODO: based on gacha ID & draw ID figure out which items were bought | ||
res.BoxGachaId = request.BoxGachaId; | ||
res.BoxGachaItemList.Add(new CDataBoxGachaItemInfo | ||
{ | ||
ItemId = 13800, | ||
ItemNum = 5, | ||
ItemStock = 13, | ||
Rank = 2, | ||
Effect = 0, | ||
Probability = 0, | ||
DrawNum = 0 | ||
}); | ||
|
||
List<CDataItemUpdateResult> itemUpdateResult = new List<CDataItemUpdateResult>(); | ||
foreach (CDataBoxGachaItemInfo gachaItemInfo in res.BoxGachaItemList) | ||
{ | ||
// TODO: support adding to item post | ||
itemUpdateResult.AddRange(Server.ItemManager.AddItem(Server, client.Character, true, gachaItemInfo.ItemId, gachaItemInfo.ItemNum)); | ||
} | ||
|
||
// TODO: based on Settlement ID figure out which currency was used | ||
Server.WalletManager.RemoveFromWalletNtc(client, client.Character, WalletType.GoldenGemstones, request.Price); | ||
|
||
return res; | ||
} | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
Arrowgene.Ddon.GameServer/Handler/BoxGachaDrawInfoHandler.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using Arrowgene.Ddon.Server; | ||
using Arrowgene.Ddon.Shared.Entity.PacketStructure; | ||
using Arrowgene.Ddon.Shared.Entity.Structure; | ||
using Arrowgene.Logging; | ||
|
||
namespace Arrowgene.Ddon.GameServer.Handler | ||
{ | ||
public class BoxGachaDrawInfoHandler : GameRequestPacketHandler<C2SBoxGachaDrawInfoReq, S2CBoxGachaDrawInfoRes> | ||
{ | ||
private static readonly ServerLogger Logger = LogProvider.Logger<ServerLogger>(typeof(BoxGachaDrawInfoHandler)); | ||
|
||
public BoxGachaDrawInfoHandler(DdonGameServer server) : base(server) | ||
{ | ||
} | ||
|
||
public override S2CBoxGachaDrawInfoRes Handle(GameClient client, C2SBoxGachaDrawInfoReq request) | ||
{ | ||
S2CBoxGachaDrawInfoRes res = new S2CBoxGachaDrawInfoRes(); | ||
|
||
// Reflects received results to user in the appropriate tab | ||
// TODO: unsure if request's DrawId should be directly sent back or box gacha ID should be figured out based on DrawId | ||
res.BoxGachaId = 93; | ||
res.BoxGachaItemList.Add(new CDataBoxGachaItemInfo | ||
{ | ||
ItemId = 13800, | ||
ItemNum = 5, | ||
ItemStock = 13, | ||
Rank = 2, | ||
Effect = 0, | ||
Probability = 0, | ||
DrawNum = 0 | ||
}); | ||
|
||
return res; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using Arrowgene.Ddon.Server; | ||
using Arrowgene.Ddon.Shared.Entity.PacketStructure; | ||
using Arrowgene.Ddon.Shared.Entity.Structure; | ||
using Arrowgene.Logging; | ||
|
||
namespace Arrowgene.Ddon.GameServer.Handler | ||
{ | ||
public class BoxGachaListHandler : GameRequestPacketHandler<C2SBoxGachaListReq, S2CBoxGachaListRes> | ||
{ | ||
private static readonly ServerLogger Logger = LogProvider.Logger<ServerLogger>(typeof(BoxGachaListHandler)); | ||
|
||
public BoxGachaListHandler(DdonGameServer server) : base(server) | ||
{ | ||
} | ||
|
||
public override S2CBoxGachaListRes Handle(GameClient client, C2SBoxGachaListReq request) | ||
{ | ||
S2CBoxGachaListRes res = new S2CBoxGachaListRes(); | ||
|
||
res.BoxGachaList.Add(new CDataBoxGachaInfo | ||
{ | ||
Id = 93, | ||
Begin = DateTimeOffset.UtcNow.ToUnixTimeSeconds() - 1000, | ||
End = DateTimeOffset.UtcNow.AddMonths(12).ToUnixTimeSeconds(), | ||
Unk1 = true, | ||
Name = "Consumables box lot", | ||
Description = "Rare supplies are available!", | ||
Detail = | ||
"The \"Consumables Box Lot\" is a lottery that can be drawn by spending Silver Tickets.\r\n\r\nYou can get consumables such as \"White Dragon Seal Elixir, Top\" and \"Talisman of the Twin Gods\". \r\n\r\nYou can reset the contents of the box to its initial state with the <COL ffff00>About Box Treasure Slot</COL> reset button, so please use it when you have obtained all the items you are looking for.", | ||
WeightDispType = 1, | ||
FreeSpaceText = "", | ||
ListAddr = "http://localhost:52099/sp_ingame/campaign/bnr/lotto/lot_icon_170316_03.jpg", | ||
ImageAddr = "http://localhost:52099/sp_ingame/campaign/bnr/lotto/lot_icon_170316_03.jpg", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. more localhost |
||
SettlementList = new List<CDataBoxGachaSettlementInfo> | ||
{ | ||
new() | ||
{ | ||
DrawId = 199, | ||
Id = 2, | ||
Price = 10, | ||
BasePrice = 10, | ||
DrawNum = 1, | ||
BonusNum = 0, | ||
PurchaseNum = 0, | ||
PurchaseMaxNum = 0, | ||
SpecialPriceNum = 0, | ||
SpecialPriceMaxNum = 0, | ||
Unk1 = 0 | ||
} | ||
}, | ||
BoxGachaSets = new List<CDataBoxGachaItemInfo> | ||
{ | ||
new() | ||
{ | ||
ItemId = 13800, | ||
ItemNum = 5, | ||
ItemStock = 13, | ||
Rank = 2, | ||
Effect = 0, | ||
Probability = 0, | ||
DrawNum = 0 | ||
} | ||
} | ||
}); | ||
|
||
return res; | ||
} | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
Arrowgene.Ddon.GameServer/Handler/EventCodeInputHandler.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using Arrowgene.Ddon.Server; | ||
using Arrowgene.Ddon.Shared.Entity.PacketStructure; | ||
using Arrowgene.Ddon.Shared.Model; | ||
using Arrowgene.Logging; | ||
|
||
namespace Arrowgene.Ddon.GameServer.Handler | ||
{ | ||
public class EventCodeInputHandler : GameRequestPacketHandler<C2SEventCodeInputReq, S2CEventCodeInputRes> | ||
{ | ||
private static readonly ServerLogger Logger = LogProvider.Logger<ServerLogger>(typeof(EventCodeInputHandler)); | ||
|
||
public EventCodeInputHandler(DdonGameServer server) : base(server) | ||
{ | ||
} | ||
|
||
public override S2CEventCodeInputRes Handle(GameClient client, C2SEventCodeInputReq request) | ||
{ | ||
S2CEventCodeInputRes res = new S2CEventCodeInputRes(); | ||
|
||
// TODO: based on event code figure out which items should be sent | ||
// https://h1g.jp/dd-on/?%E3%82%A4%E3%83%99%E3%83%B3%E3%83%88%E3%82%B3%E3%83%BC%E3%83%89 | ||
// https://dengekionline.com/elem/000/001/138/1138291/ | ||
if (request.Code == "UPCT-YUAW-3K16-8255") | ||
{ | ||
res.Name = "Silver Tickets and Trial Support Boat Course"; | ||
} | ||
else | ||
{ | ||
throw new ResponseErrorException(ErrorCode.ERROR_CODE_EVENT_CODE_INPUT_LOCK); | ||
} | ||
|
||
// TODO: send mail with items | ||
|
||
return res; | ||
} | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
same comment as in the other PR, it's better to have these in alphabetical order, as theyre already grouped by the group name prefix