Comments (3)
Thanks for your greatly detailled report. ππ»
This issue looks strange indeed... My first idea is that it fails to resolve the Skill when loading the GameConfiguration through the JsonObjectLoader, otherwise the SkillId would be null, too.
I will look into it ;)
from openmu.
I can reproduce the error, but didn't find the reason yet.
What I checked:
- The json query contains SkillId and RawSkill elements
- The json result contains the id in SkillId and the correct $ref-element in RawSkill
- The IdReferenceResolver resolves the relevant ItemDefinitions with a Skill assigned in the relevant second pass
- No breakpoint got hit in case the Skill get set from something to null
- In BuyNpcItemAction:
- The ItemDefinition of the learnable contains the skill in both GameConfiguration.Items and GameConfiguration.Monsters.MerchantStore.Items.Definition and they're the same instance π
- The instance of the MonsterDefinition in the GameConfiguration doesn't match with the one assigned to the npc instance, so e.g.
gameContext.Configuration.Monsters.First(npc => npc.Number == 255) == npcDefinition
is false.
from openmu.
The issue is most likely caused by the JsonObjectDeserializer. It loads the GameConfiguration in two passes. The first pass fills up references in the IdReferenceResolver, in case there might be any circular references:
public T Deserialize<T>(TextReader textReader, IReferenceResolver referenceResolver)
{
var serializer = new JsonSerializer();
serializer.ReferenceResolver = referenceResolver;
serializer.Converters.Add(new BinaryAsHexJsonConverter());
if (this.AreCircularReferencesExpected)
{
// This is a very naive approach to fix references to objects which occur later in the document.
// The first run just have the task to fills the references in the IdReferenceResolver.
// Unfortunately there is currently no better way, because we have circular references.
var jsonString = textReader.ReadToEnd();
using (var stringReader = new StringReader(jsonString))
using (var jsonReader = new JsonTextReader(stringReader))
{
serializer.Deserialize<T>(jsonReader);
}
textReader = new StringReader(jsonString);
}
using (textReader)
using (var jsonReader = new JsonTextReader(textReader))
{
var result = serializer.Deserialize<T>(jsonReader);
return result;
}
}
The issue here is, that the first pass adds an incomplete MonsterDefinition to the IdReferenceResolver, which is then returned at the second pass when resolving it for the MonsterSpawnAreas until the same MonsterDefinition is read again.
from openmu.
Related Issues (20)
- Local Run - No Internet HOT 3
- Can I help with any tasks? HOT 3
- Can't build the solution HOT 2
- Prevent equipping weapons and shields when not enough hands are free HOT 3
- Level-up points should be compensated when gaining Hero Status beyond level 220
- Guardian Angel damage absorption works in reverse HOT 7
- CPU 100% when the server is running HOT 11
- I love to help HOT 3
- Broken link on packets docs HOT 1
- A Fenrir cannot be repaired with a Jewel of Bless
- Can't promote guild members to battle master and assistant guild master HOT 1
- Guild Alliance, Hostility, Suspend Hostility nor working HOT 1
- The client cannot connect to the server. HOT 4
- munique net is slow HOT 2
- Monsters are not hit or in wrong coordinate HOT 2
- excelent job, add season1 ver 1.02i proto koreano HOT 1
- Points per reset can be set by Character Class HOT 2
- > i change back the language into English , and merge some Client files . Then it works , i can login with Chinese ClientοΌ [image: image.png] [image: image.png] sven-n ***@***.***> δΊ2023εΉ΄10ζ30ζ₯ε¨δΈ 17:56ειοΌ HOT 1
- How to update the game version? HOT 1
- Help: The game cannot be entered after updating the server version. HOT 23
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openmu.