Code Monkey home page Code Monkey logo

Comments (3)

TGRHavoc avatar TGRHavoc commented on August 16, 2024

Had a quick try at implementing it with the current code base. Then, tried to do it with Lua but... No success.
My attempt is over at https://github.com/TGRHavoc/live_map/tree/failed/sse and doesn't work. It's just there to show that I am actively working on trying to find a solution.

I've tried to explain to the best of my ability what I think is wrong in commit 735df7b.

In the mean time, I will look at re-writing the resource in C#. More specifically, dotnet. Hopefully I can get something working kind of like webadmin. Afaik, this resource does SSE successfully with an /events endpoint.

So, more research is required and, possibly, a rewrite is needed.

Note: The server-side events and stuff will all still be the same. This will not be a "breaking" change to others depending on the resource. It will however, need another version of the interface to work... Which, I will try and do as simply as possible. Hopefully it's just a matter of swicthing from Websockets to the EventSource API.
God, I hope it's that simple.

from live_map.

TGRHavoc avatar TGRHavoc commented on August 16, 2024

Pretty sure this is not possible with the current implementation of FiveM. For some reason the headers don't seem to be sent to the client which, causes browsers' requests to hang until the connection is closed.

I've got a C# implementation over on commit 208bd3b.

If anyone knows if any way of getting SSE to work on FiveM, do contact me on here.

As for now, going to stop working on trying to get SSE working... Good bye dreams of having a secure LiveMap out-of-the-box 😞

from live_map.

robertne13 avatar robertne13 commented on August 16, 2024

is there any simple implementation to get the websocket offline and read the coords of every player from a mysql database for example? that server updates every x minutes?

from live_map.

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.