[Release] LiveMap

May I have some help doing this ?

Are you aware that people are implementing this into their “custom cads” and claiming credit for doing & making it? I did not read anything about that in the post about using it, implementing it, modifying it, or giving credits.

Thank you for this awesome release.
It took me about a hour to figure out that a unsecured connection is the easiest way to set this up.
I had a good bit of trouble since my site auto generates SSL Certs lol, And i was far too lazy to play with .htaccess.
So big :+1:

Question, So i updated my LiveMap server resource as well as all the web files.
The top of my site shows the up to date ver, However i am showing the update available message in red on the bottom left. Did i miss some thing?

Make sure you have the following at about line 319 in index.php

if(!Update::latestVersion()){
     echo Update::alertJs();
}

This checks for an update and sets some internal values that are needed before sending the alert to the user.

Looks good as far as i can tell.
here is the link to the map mabey its old cache info in my browser. Do you see the error message?
http://wslmc.com/nocturnusmap/
image

Hi Havoc,

The resource works like a dream, just curious as to what you use to create the map images as I have a map with street names on all the roads we’d like to use?

Thanks :slight_smile:

:thinking:

By the looks of it, the PHP cannot get the latest version from GitHub. At the minute, I’m very limited in what I can do. The quickest way to “fix” this problem would be to modify the file utils/update_checker.php by adding the following line directly below line 12.

if ($data === FALSE) {
    return TRUE;
}

It won’t actually fix anything, it will just make sure the error doesn’t show if it can’t get the latest file from GitHub :wink:

If you want to have the update functionality I would check that PHP can send requests to other servers (this is the only place an external server is used). The best way to do this is probably to put the call into a try-catch statement. It would look something like

try{
    $data = file_get_contents(self::$url);
    -- rest of code here
}catch(Exception $e){
    echo $e;
    return true; // return true so the alert doesn't show, we already got the message printed
}

Again I’m very limited in the help I can give at the minute so, sorry if this doesn’t help :frowning:

As the “credits.txt” file says I didn’t create, nor do I claim to have made, the images for the map. I do not know what tool, if any, was used to create the images. If I remember correctly from the gmap API, you should be good to use any image you want. The map needs to be broken down into “tiles” to be used though. Once that’s done you can create a new map type with options to match your images. You can look in js/src/map.js for an idea how this works for the current tileset.

Thank you, This is not really a issue at all your resource is incredibly stable and more then usable.
I will make the suggested changes. :+1: [No more message]
Now time to edit a few dozen images woo custom img time!

i have an issue when loading the website it shows this error looking thing when i load it


anyway to fix it?

Hey can someone help I am trying to implement two servers on livemaps but for some reason I keep messing up here is the code I am trying to use please help:
public static $servers = array(
“Abstraqe Roleplay” => array( // The name of the server (make unique)
“ip” => “162.248.91.123”, // The IP (if on something different to the one in the config)
“fivemPort” => “30120”, // The fivem port
“socketPort” => “30121”, // Set to the port that you set in the “socket_port” convar (if different to the one in the config)
“liveMapName” => “live_map” // Set to the resource’s name (if different to the one in the config)
)
);

    public static $servers = array(
    "Abstraqe ESX Server" => array( // The name of the server (make unique)
        "ip" => "162.248.91.123", // The IP (if on something different to the one in the config)
        "fivemPort" => "30200", // The fivem port
        "socketPort" => "30201", // Set to the port that you set in the "socket_port" convar (if different to the one in the config)
        "liveMapName" => "live_map" // Set to the resource's name (if different to the one in the config)
    )
);

Exception during executing Post callback: System.Net.Sockets.SocketException (0x80004005): Address already in use
at System.Net.Sockets.Socket.Bind (System.Net.EndPoint localEP) [0x00043] in <7090a6202c064427b4972db3ea61f536>:0
at vtortola.WebSockets.Transports.Sockets.SocketListener…ctor (vtortola.WebSockets.Transports.Sockets.SocketTransport transport, System.Net.EndPoint[] endPointsToListen, System.Net.Sockets.ProtocolType protocolType, vtortola.WebSockets.WebSocketListenerOptions options) [0x000ba] in <4fa23baef5524ca6ae016d7d9fe505e5>:0
at vtortola.WebSockets.Transports.Tcp.TcpListener…ctor (vtortola.WebSockets.Transports.Tcp.TcpTransport transport, System.Net.EndPoint[] endPointsToListen, vtortola.WebSockets.WebSocketListenerOptions options) [0x00000] in <4fa23baef5524ca6ae016d7d9fe505e5>:0
at vtortola.WebSockets.Transports.Tcp.TcpTransport+d__39.MoveNext () [0x00157] in <4fa23baef5524ca6ae016d7d9fe505e5>:0
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <49fde7938a9b47b480042d844e818c7e>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <49fde7938a9b47b480042d844e818c7e>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <49fde7938a9b47b480042d844e818c7e>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <49fde7938a9b47b480042d844e818c7e>:0
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in <49fde7938a9b47b480042d844e818c7e>:0
at vtortola.WebSockets.WebSocketListener+d__22.MoveNext () [0x00363] in <4fa23baef5524ca6ae016d7d9fe505e5>:0
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <49fde7938a9b47b480042d844e818c7e>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <49fde7938a9b47b480042d844e818c7e>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <49fde7938a9b47b480042d844e818c7e>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <49fde7938a9b47b480042d844e818c7e>:0
at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in <49fde7938a9b47b480042d844e818c7e>:0
at Havoc.Live_Map.WebSocketServer+d__14.MoveNext () [0x0006e] in :0
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <49fde7938a9b47b480042d844e818c7e>:0
at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.b__6_0 (System.Object state) [0x00000] in <49fde7938a9b47b480042d844e818c7e>:0
at CitizenFX.Core.CitizenSynchronizationContext+<>c__DisplayClass1_0.b__0 () [0x00000] in /src/code/client/clrcore/CitizenTaskScheduler.cs:20
at CitizenFX.Core.CitizenSynchronizationContext.Tick () [0x0003e] in /src/code/client/clrcore/CitizenTaskScheduler.cs:38

Any idea what the issue is?

You have something listening on the socket’s port already. Please change he the port in the CFG file and restart the plugin.

Anyone have any luck at adding a custom version of the map? I’ve looked around everywhere and can’t seem to figure it out. Any assistance would be great!

@Havoc Seems like the example site is no longer working. Google maps says it can’t work on the page correctly or something along those lines. :frowning: Not sure what is going on there.

no matter what i do it keeps saying error getting blips.

what webhost company are you using for the example live map?

Hello, thanks for this very great work !

Just a question, if my HTTP port isn’t 80, can it be a problem ?

All is OK but I still have this issue :

All configurations are OK :
Game port 30121
Websocket port 30131
(config ok web side and fivem side)

Json is also generated and the weblink is OK but still doesn’t work

Thanks for your help!

PS: I’m on private network which doesn’t allow anyport to enter from the WAN, but it’s open in LAN
Webserver and Gameserver are on the same physical server

There’s your problem. The websocket is ran on the client’s machines (people from the internet) so, if they don’t have access they can use the map for your server.

None. I have a VPS set up with nginx.

1 Like

Thanks for your answer, but all the dev infra is on LAN with me (client), then server should reach client websocket. Maybe a port forwarding issue on my infra, servers are on Virtual Machine on VirtualBox and on Windows 7 ^^’ I forward port on VB but not on W7, I’ll try to fix that ! It’s maybe that

Edit: It’s now ok for me, I let 127.0.0.1 instead of public IP… thx you !