Giter Club home page Giter Club logo

Comments (3)

novabyte avatar novabyte commented on June 23, 2024

@jonbonazza When you call the socket function for creating a party can you print what the contents of the structure you get back looks like?

from nakama-godot.

jonbonazza avatar jonbonazza commented on June 23, 2024

@jonbonazza When you call the socket function for creating a party can you print what the contents of the structure you get back looks like?

Okay so finally had some more time to look at this, it looks like I get a NakamaRTAPI.Party struct and it does indeed have the leader and current party presences (which in my case, just has the one member). So I guess my questions then are:

  1. Do I not get a presence event with the leader on party create? I only get that info in the response? This is fine if it's the case, just wanted to make sure I understand it correctly.
  2. In the Party struct, presences is an array of UserPresence objects. Is there ever a situation where this array will have more than one item in it in the case of party creation? I'm assuming this is just an array because the class is reused in other places as well in during party creation, this array will always have exactly one entry, is that correct?

from nakama-godot.

novabyte avatar novabyte commented on June 23, 2024

Do I not get a presence event with the leader on party create? I only get that info in the response? This is fine if it's the case, just wanted to make sure I understand it correctly.

@jonbonazza When one of the realtime features of Nakama is used they all share the same structural pattern of an initial state is returned (in the case of Parties its NakamaRTAPI.Party) and deltas (joins and leaves) which will be received from the event listeners (i.e. received_party_presence signal). Together it provides the most compact way to keep track of presences in that gameplay feature. When a Party is created the leader receives the initial state but will not also receive a signal on received_party_presence.

Is there ever a situation where this array will have more than one item in it in the case of party creation? I'm assuming this is just an array because the class is reused in other places as well in during party creation, this array will always have exactly one entry, is that correct?

The system is designed to batch presence changes so its possible (though in the case of Party creation - it would be a very small window of time) that the party is created and another player finds it to join (if its an open party) before the party creator then receives their NakamaRTAPI.Party struct response. In this case it would be practically unlikely to occur but the design must account for it anyway to avoid potential race conditions.

Can we move the follow on questions to a forum thread? 🙏

Hope this helps.

from nakama-godot.

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.