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

fix unique ids #581

Merged
merged 1 commit into from
Dec 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"ItemSlotAddress":"0000000000000000000000000000000000000000","Object":{"BattleType":"Adventure","Costumes":[],"Equipments":["0468bfd9-7c76-4379-b1bc-10a3da90c584","0c4c772f-70d9-4a0d-b7e6-4cf25ad7f8f9","13164d27-1948-44a9-9bc7-b23a00aacc5f","2d9d4118-0e3b-445e-aa16-8203e50d2523","4da15d1b-503c-4e08-8476-6f405192258c","98c3abdb-17bc-49a0-8f9c-a61f48662dc7","a45c62d6-e612-4a0e-957a-9ecb7ae6f04f"]},"Metadata":{"SchemaVersion":2,"StoredBlockIndex":0}}
{"AvatarAddress":"0000000000000000000000000000000000000000","Object":{"BattleType":"Adventure","Costumes":[],"Equipments":["0468bfd9-7c76-4379-b1bc-10a3da90c584","0c4c772f-70d9-4a0d-b7e6-4cf25ad7f8f9","13164d27-1948-44a9-9bc7-b23a00aacc5f","2d9d4118-0e3b-445e-aa16-8203e50d2523","4da15d1b-503c-4e08-8476-6f405192258c","98c3abdb-17bc-49a0-8f9c-a61f48662dc7","a45c62d6-e612-4a0e-957a-9ecb7ae6f04f"]},"Metadata":{"SchemaVersion":2,"StoredBlockIndex":0}}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"RuneSlotAddress":"0000000000000000000000000000000000000000","Object":{"BattleType":"Adventure","Slots":[{"Index":0,"RuneSlotType":"Default","RuneType":"Stat","IsLock":false,"RuneId":10012},{"Index":1,"RuneSlotType":"Ncg","RuneType":"Stat","IsLock":true},{"Index":2,"RuneSlotType":"Stake","RuneType":"Stat","IsLock":true},{"Index":3,"RuneSlotType":"Default","RuneType":"Skill","IsLock":false},{"Index":4,"RuneSlotType":"Ncg","RuneType":"Skill","IsLock":true},{"Index":5,"RuneSlotType":"Stake","RuneType":"Skill","IsLock":true},{"Index":6,"RuneSlotType":"Crystal","RuneType":"Stat","IsLock":true},{"Index":7,"RuneSlotType":"Crystal","RuneType":"Skill","IsLock":true}]},"Metadata":{"SchemaVersion":1,"StoredBlockIndex":0}}
{"AvatarAddress":"0000000000000000000000000000000000000000","Object":{"BattleType":"Adventure","Slots":[{"Index":0,"RuneSlotType":"Default","RuneType":"Stat","IsLock":false,"RuneId":10012},{"Index":1,"RuneSlotType":"Ncg","RuneType":"Stat","IsLock":true},{"Index":2,"RuneSlotType":"Stake","RuneType":"Stat","IsLock":true},{"Index":3,"RuneSlotType":"Default","RuneType":"Skill","IsLock":false},{"Index":4,"RuneSlotType":"Ncg","RuneType":"Skill","IsLock":true},{"Index":5,"RuneSlotType":"Stake","RuneType":"Skill","IsLock":true},{"Index":6,"RuneSlotType":"Crystal","RuneType":"Stat","IsLock":true},{"Index":7,"RuneSlotType":"Crystal","RuneType":"Skill","IsLock":true}]},"Metadata":{"SchemaVersion":1,"StoredBlockIndex":0}}
6 changes: 3 additions & 3 deletions Mimir.MongoDB/Bson/ItemSlotDocument.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Mimir.MongoDB.Bson;
[BsonIgnoreExtraElements]
public record ItemSlotDocument(
[property: BsonIgnore, JsonIgnore] long StoredBlockIndex,
[property: BsonIgnore, JsonIgnore] Address AvatarAddress,
Address ItemSlotAddress,
[property: BsonIgnore, JsonIgnore] Address Address,
Address AvatarAddress,
ItemSlotState Object
) : MimirBsonDocument(AvatarAddress.ToHex(), new DocumentMetadata(2, StoredBlockIndex));
) : MimirBsonDocument(Address.ToHex(), new DocumentMetadata(2, StoredBlockIndex));
6 changes: 3 additions & 3 deletions Mimir.MongoDB/Bson/RuneSlotDocument.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Mimir.MongoDB.Bson;
[BsonIgnoreExtraElements]
public record RuneSlotDocument(
[property: BsonIgnore, JsonIgnore] long StoredBlockIndex,
[property: BsonIgnore, JsonIgnore] Address AvatarAddress,
Address RuneSlotAddress,
[property: BsonIgnore, JsonIgnore] Address Address,
Address AvatarAddress,
RuneSlotState Object
) : MimirBsonDocument(AvatarAddress.ToHex(), new DocumentMetadata(1, StoredBlockIndex));
) : MimirBsonDocument(Address.ToHex(), new DocumentMetadata(1, StoredBlockIndex));
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ public static async Task<IEnumerable<WriteModel<BsonDocument>>> UpdateAsync(
var itemSlotState = new ItemSlotState(serialized);
var itemSlotDocument = new ItemSlotDocument(
blockIndex,
avatarAddress,
itemSlotAddress,
avatarAddress,
itemSlotState
);
return [itemSlotDocument.ToUpdateOneModel()];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ public static async Task<IEnumerable<WriteModel<BsonDocument>>> UpdateAsync(
var runeSlotState = new RuneSlotState(serialized);
var runeSlotDocument = new RuneSlotDocument(
blockIndex,
avatarAddress,
runeSlotAddress,
avatarAddress,
runeSlotState
);
return [runeSlotDocument.ToUpdateOneModel()];
Expand Down
1 change: 0 additions & 1 deletion Mimir/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
builder.Services.AddSingleton<ICollectionRepository, CollectionRepository>();
builder.Services.AddSingleton<IDailyRewardRepository, DailyRewardRepository>();
builder.Services.AddSingleton<IInventoryRepository, InventoryRepository>();
builder.Services.AddSingleton<ItemSlotRepository>();
builder.Services.AddSingleton<IPetRepository, PetRepository>();
builder.Services.AddSingleton<IMetadataRepository, MetadataRepository>();
builder.Services.AddSingleton<IProductRepository, ProductRepository>();
Expand Down
Loading