Git Product home page Git Product logo

Comments (3)

Bia10 avatar Bia10 commented on June 4, 2024 1

image

this is the important part were registering an entire conversation interface for 2 speakers

this exposes the accessibility to lua to call the func with params

so the interface is loaded in the script globals and then the entire source is evaluated if it finds reference to the global it can call the C# function.

the heavy lifting is done by moonsharp, thats where the magic of converting a DynValue result which is placeholder for lua types gets auto converted to CLR type.

from edelstein.

Kaioru avatar Kaioru commented on June 4, 2024 1

On top of what @Bia10 said,

The whole request/response system is called Conversations in the project. Do check out FieldUser::Converse and FieldUser::Prompt to see where the logic flow starts for script dialogs.

Essentially, there is a Channel<object> in each conversation context which is basically an async queue that handles request and responses from the client. This creates the stateless 'awaiting' mechanism that powers every dialog that requires user input.

Every time a method like Self.AskMenu(..) is called, the conversation context reads from the async queue and if its empty, it waits.. forever. And on the packet handling side, whenever a response is received by the server, the server pushes into the async queue which finally unblocks the read and continues on with the conversation.

See:

  1. https://github.com/Kaioru/Edelstein/blob/dev/src/common/Edelstein.Common.Gameplay.Game/Conversations/ConversationContext.cs#L26
  2. https://learn.microsoft.com/en-us/dotnet/core/extensions/channels

from edelstein.

Kaioru avatar Kaioru commented on June 4, 2024

Closing this issue, feel free to continue the discussion under the 'Discussions' tab.

from edelstein.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.