Git Product home page Git Product logo

Comments (4)

rkusa avatar rkusa commented on June 15, 2024 1

@justin-lovell The reasoning behind the user-flag is to cover the possibility of the gRPC server crashing. By moving this state into the mission, the gRPC can retrieve it again after being restarted.

from rust-server.

rkusa avatar rkusa commented on June 15, 2024
  1. If no value exists then set the value to the current unixtime (since flags can only contain bool or numeric) using something like os.time(os.date("!*t")) and return the value.

Alternatively, the unixtime could also be retrieved inside of the Rust part of the implementation via OffsetDateTime::unix_timestamp. This way, there wouldn't be any additional Lua part necessary for this feature, as one could simply re-use the existing lua methods for GetUserFlag/SetUserFlag from Rust.

from rust-server.

justin-lovell avatar justin-lovell commented on June 15, 2024

The selection issue of the UserFlag number might be a problem (never know about a conflict?) (never mind, I had a relapse and confused it -- it can be a string)

You could probably just store this as a start-up variable (initialized OffsetDateTime::unix_timestamp) within Rust and just return it directly? No need to jump down into the mission environment.

If the mission ends and starts a new one, reset could be triggered with handler.onMissionLoadEnd() chain.

from rust-server.

rurounijones avatar rurounijones commented on June 15, 2024

Implemented by @vivanov

from rust-server.

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.