Skip to content
This repository has been archived by the owner on Oct 10, 2022. It is now read-only.

Commit

Permalink
v22.1.1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
xAranaktu committed Nov 15, 2021
1 parent 530f013 commit 2d1359a
Show file tree
Hide file tree
Showing 5 changed files with 849 additions and 29 deletions.
2 changes: 1 addition & 1 deletion FIFA22.CETRAINER
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<CheatEntries>
<CheatEntry>
<ID>0</ID>
<Description>"v22.1.1.4"</Description>
<Description>"v22.1.1.5"</Description>
<LastState Value="" RealAddress="00000000"/>
<Color>000040</Color>
<GroupHeader>1</GroupHeader>
Expand Down
146 changes: 143 additions & 3 deletions lua/consts.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7091,25 +7091,165 @@ NegotiationsStorageDao_STRUCT = {
impl = 0x8
}

Action_STRUCT = {
size = 0xC,

action_date = 0x0,
action_type = 0x8
}

NegotiationsStorageDaoImpl_STRUCT = {
CPU_CLUB_HIST_OFF = 0x8,
CPU_PLAYER_HIST_OFF = 0x10
CPU_PLAYER_HIST_OFF = 0x10,
CPU_CLUB_LOAN_HIST_OFF = 0x18,
CPU_PLAYER_LOAN_HIST_OFF = 0x20,
USER_CLUB_HIST_OFF = 0x28,
USER_CLUB_LOAN_HIST_OFF = 0x30,
USER_PLAYER_HIST_OFF = 0x38
}

USER_CLUB_LOAN_HIST_STRUCT = {
size = 0xF8,

playerid = 0x0,
toteamid = 0x4,
fromteamid = 0x8,
offers_vec = 0x10,
requests_vec = 0x30,
actions_vec = 0x50
}

USER_CLUB_TRANSFER_HIST_STRUCT = {
size = 0x98,

playerid = 0x0,
toteamid = 0x4,
fromteamid = 0x8,
offers_vec = 0x10,
requests_vec = 0x30,
actions_vec = 0x50
}

USER_PLAYER_TRANSFER_HIST_STRUCT = {
size = 0x98,

playerid = 0x0,
toteamid = 0x4,
fromteamid = 0x8,
seller_accepted = 0xC,
buyer_accepted = 0xD,
seller_rejected = 0xE,
buyer_rejected = 0xF,
offers_vec = 0x10,
requests_vec = 0x30,
actions_vec = 0x50
}

USER_TRANSFER_OFFER_STRUCT = {
size = 0x30,

exchange_playerid = 0x0,
sum = 0xC
}

USER_TRANSFER_REQUEST_STRUCT = {
size = 0x30,

exchange_playerid = 0x0,
sum = 0xC
}

CPU_TRANSFER_OFFER_STRUCT = {
size = 0xC,

sum = 0x0,
date = 0x4
}

CPU_TRANSFER_REQUEST_STRUCT = {
size = 0x14,

sum = 0x0,
date = 0xC
}

CPU_LOAN_OFFER_STRUCT = {
size = 0x14,

contract_len = 0x0,
fee = 0x4,
date = 0x8
}

CPU_LOAN_REQUEST_STRUCT = {
size = 0x14,

contract_len = 0x0,
fee = 0x4,
date = 0xC
}


CPU_CLUB_LOAN_HIST_STRUCT = {
size = 0xC0,

playerid = 0x0,
toteamid = 0x4,
fromteamid = 0x8,
offers_vec = 0x38,
requests_vec = 0x58,
seller_accepted = 0x78,
buyer_accepted = 0x79,
seller_rejected = 0x7A,
buyer_rejected = 0x7B,
last_action_idx = 0x7C,
actions_arr = 0x80
}

CPU_PLAYER_LOAN_HIST_STRUCT = {
size = 0x98,

playerid = 0x0,
toteamid = 0x4,
fromteamid = 0x8,
offers_vec = 0x10,
requests_vec = 0x30,
seller_accepted = 0x50,
buyer_accepted = 0x52,
seller_rejected = 0x53,
buyer_rejected = 0x54,
last_action_idx = 0x58,
actions_arr = 0x5C
}

CPU_CLUB_TRANSFER_HIST_STRUCT = {
size = 0xB0,

playerid = 0x0,
toteamid = 0x4,
fromteamid = 0x8
fromteamid = 0x8,
offers_vec = 0x20,
requests_vec = 0x40,
seller_accepted = 0x68,
buyer_accepted = 0x69,
seller_rejected = 0x6A,
buyer_rejected = 0x6B,
triggered_rlc = 0x6C,
last_action_idx = 0x70,
actions_arr = 0x74
}

CPU_PLAYER_TRANSFER_HIST_STRUCT = {
size = 0xB0,

playerid = 0x0,
toteamid = 0x4,
fromteamid = 0x8
fromteamid = 0x8,
buyer_accepted = 0xC,
buyer_rejected = 0xD,
seller_accepted_stalls = 0xE,
seller_accepted = 0xF,
seller_rejected = 0x10
}

IFCEInterface_STRUCT = {
Expand Down
56 changes: 56 additions & 0 deletions lua/helpers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,21 @@ function is_cm_loaded()
return false
end

-- Check if EASTL::Vector is valid and not empty
function is_vec_valid(addr)
local p = readPointer(addr)

-- nullptr
if p == 0 then return false end

-- mpEnd > mpBegin
return readPointer(addr + 8) > p
end

function get_last_vec_elem(addr_begin, sz)
return readPointer(addr_begin + 8) - sz
end

function get_comp_name_from_objid(_id)
local result = string.format("Unknown_%d", _id)

Expand All @@ -31,6 +46,47 @@ function get_comp_name_from_objid(_id)
return result
end

function get_team_label_by_id(teamid)
local result = ""
local record_addr = find_team_by_id(teamid)
if record_addr == 0 then
result = string.format("%s (ID: %d)", "Unknown", teamid)
else
local teamname = gCTManager.game_db_manager:get_table_record_field_value(record_addr, "teams", "teamname") or ""
result = string.format("%s (ID: %d)", teamname, teamid)
end

return result
end

function find_team_by_id(teamid)
if type(teamid) == 'string' then
teamid = tonumber(teamid)
end

local arr_flds = {
{
name = "teamid",
expr = "eq",
values = {teamid}
}
}

local addr = gCTManager.game_db_manager:find_record_addr(
"teams", arr_flds, 1
)
if #addr == 0 then
return 0
end
-- for i=1, #addr do
-- self.logger:debug(string.format("found team record at: 0x%X", addr[i]))
-- end

writeQword("pTeamsTableCurrentRecord", addr[1])

return addr[1]
end

function get_player_name(playerid)
if type(playerid) ~= "number" then
playerid = tonumber(playerid)
Expand Down
27 changes: 2 additions & 25 deletions lua/imports/FormManager.lua
Original file line number Diff line number Diff line change
Expand Up @@ -297,31 +297,8 @@ function FormManager:get_player_name(playerid)
end

function FormManager:find_team_by_id(teamid)
if type(teamid) == 'string' then
teamid = tonumber(teamid)
end

local arr_flds = {
{
name = "teamid",
expr = "eq",
values = {teamid}
}
}

local addr = self.game_db_manager:find_record_addr(
"teams", arr_flds, 1
)
if #addr == 0 then
return 0
end
for i=1, #addr do
self.logger:debug(string.format("found team record at: 0x%X", addr[i]))
end

writeQword("pTeamsTableCurrentRecord", addr[1])

return addr[1]
self.logger:debug("find_team_by_id")
return find_team_by_id(teamid)
end

function FormManager:fnCommonDBValGetter(addrs, table_name, field_name, raw)
Expand Down
Loading

0 comments on commit 2d1359a

Please sign in to comment.