Skip to content

Commit

Permalink
Updated
Browse files Browse the repository at this point in the history
  • Loading branch information
ov-anisa committed Jun 12, 2022
1 parent 82e8c01 commit 7ad656a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
11 changes: 5 additions & 6 deletions [Handler]/player_handler/handlers/party.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ local imports = {
outputChatBox = outputChatBox,
removeElementData = removeElementData,
addCommandHandler = addCommandHandler,
string = string,
assetify = assetify
string = string
}


Expand Down Expand Up @@ -77,18 +76,18 @@ imports.addCommandHandler("party", function(player, _, category, ...)
imports.outputChatBox("━━ Party: Request has been sent to the player.", player, 0, 255, 0)
imports.outputChatBox("━━ Party: Type /party accept to join " .. imports.getPlayerName(player) .. "'s party. Invite expires after " .. FRAMEWORK_CONFIGS["Party"]["Accept_Time"] .. " seconds", target, 0, 255, 0)
local timer = imports.setTimer(function()
if imports.assetify.syncer.getEntityData(target, "party:request") then
if CGame.getEntityData(target, "party:request") then
imports.removeElementData(target, "party:request")
end
end, FRAMEWORK_CONFIGS["Party"]["Accept_Time"] * 1000, 1)
imports.assetify.syncer.setEntityData(target, "party:request", {player, timer})
CGame.setEntityData(target, "party:request", {player, timer})
elseif category == "accept" then
local request = imports.assetify.syncer.getEntityData(player, "party:request")
local request = CGame.getEntityData(player, "party:request")
if request then
local party = getPlayerParty(request[1])
if party ~= nil then
invitePartyMember(party.id, player)
imports.assetify.syncer.setEntityData(player, "party:request", nil)
CGame.setEntityData(player, "party:request", nil)
if imports.isTimer(request[2]) then imports.killTimer(request[2]) end
end
end
Expand Down
5 changes: 2 additions & 3 deletions [Handler]/player_handler/handlers/resumer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ local imports = {
json = json,
table = table,
string = string,
assetify = assetify,
thread = thread,
network = network
}
Expand Down Expand Up @@ -155,8 +154,8 @@ imports.network:create("Player:onResume"):on(function(source, character, charact
end

local characterIdentity = CCharacter.CBuffer[characterID].identity
imports.assetify.syncer.setEntityData(source, "Character:ID", characterID)
imports.assetify.syncer.setEntityData(source, "Character:Identity", characterIdentity)
CGame.setEntityData(source, "Character:ID", characterID)
CGame.setEntityData(source, "Character:Identity", characterIdentity)
CPlayer.setData(self, serial, {
{"character", character}
})
Expand Down
4 changes: 2 additions & 2 deletions [Handler]/player_handler/utilities/server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ end
CGame.execOnModuleLoad(function()
imports.network:create("onServerRender")
local serverTickSyncer = imports.createElement("Server:TickSyncer")
imports.assetify.syncer.setGlobalData("Server:TickSyncer", serverTickSyncer)
CGame.setGlobalData("Server:TickSyncer", serverTickSyncer)
imports.setTimer(function(cSyncer)
local cTick = imports.getTickCount()
imports.assetify.syncer.setEntityData(cSyncer, "Server:TickSyncer", cTick)
CGame.setEntityData(cSyncer, "Server:TickSyncer", cTick)
network:emit("onServerRender", false, cTick, FRAMEWORK_CONFIGS["Game"]["Sync_Rate"])
end, FRAMEWORK_CONFIGS["Game"]["Sync_Rate"], 0, serverTickSyncer)
imports.setFPSLimit(FRAMEWORK_CONFIGS["Game"]["FPS_Limit"])
Expand Down

0 comments on commit 7ad656a

Please sign in to comment.