Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I've had to change the websocket library to one that is PCL compatiable. Main changes are that this version now works with FX server (only tested on 374) New socket server 1. Now uses the "deniszykov.WebSocketListener" library for that shiz (touches #4) closes #1
- Loading branch information
Showing
15 changed files
with
326 additions
and
285 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
resource_manifest_version "44febabe-d386-4d18-afbe-5e627f4af937" | ||
|
||
client_script("client.lua") | ||
client_scripts{ | ||
"client/client.lua" | ||
} | ||
|
||
server_scripts { | ||
"blips.lua", | ||
"blip_helper.lua", | ||
"live.lua" | ||
server_scripts{ | ||
"server/live_map.net.dll", | ||
"server/wrapper.lua" | ||
} |
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
--[[ | ||
Simple file that wraps all the internal events so that they can just be called | ||
by the client without any extra steps needed by the end-developer :) | ||
]] | ||
|
||
RegisterServerEvent("livemap:AddPlayerData") | ||
RegisterServerEvent("livemap:UpdatePlayerData") | ||
|
||
RegisterServerEvent("livemap:playerSpawned") | ||
|
||
AddEventHandler("livemap:AddPlayerData", function(k, d) | ||
local id = GetPlayerIdentifier(source, 0) -- Get the first id, it'll do | ||
print("Adding data for " .. id) | ||
|
||
TriggerEvent("livemap:internal_AddPlayerData", id, k, d) | ||
end) | ||
|
||
AddEventHandler("livemap:UpdatePlayerData", function(k, d) | ||
local id = GetPlayerIdentifier(source, 0) -- Get the first id, it'll do | ||
print("Updating data for " .. id) | ||
|
||
TriggerEvent("livemap:internal_UpdatePlayerData", id, k, d) | ||
end) | ||
|
||
|
||
function setStaticDataFor(index, id) | ||
TriggerEvent("livemap:internal_AddPlayerData", id, "identifer", id) | ||
TriggerEvent("livemap:internal_AddPlayerData", id, "name", GetPlayerName(index)) | ||
end | ||
|
||
--[[ | ||
Set some static data that isn't going to change | ||
e.g. Player's Identifer | ||
]] | ||
AddEventHandler("livemap:playerSpawned", function() | ||
local id = GetPlayerIdentifier(source, 0) -- Get the first id, it'll do | ||
setStaticDataFor(source, id) | ||
end) | ||
|
||
-- If any players are already on the server | ||
AddEventHandler("onResourceStart", function(name) | ||
if name == GetCurrentResourceName() then | ||
if GetNumPlayerIndices() ~= -1 then | ||
for i=0, GetNumPlayerIndices()-1 do | ||
local id = GetPlayerIdentifier(GetPlayerFromIndex(i), 0) | ||
setStaticDataFor(GetPlayerFromIndex(i), id) | ||
end | ||
end | ||
end | ||
end) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.