Skip to content

Commit

Permalink
Merge branch 'main/atys-live' into feature/atys-core-merge
Browse files Browse the repository at this point in the history
  • Loading branch information
nimetu committed Jan 17, 2025
2 parents 585acfc + c454cb4 commit bdadba9
Show file tree
Hide file tree
Showing 65 changed files with 1,188 additions and 438 deletions.
4 changes: 2 additions & 2 deletions nel/include/nel/georges/load_form.h
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ void loadForm2(const std::vector<std::string> &sheetFilters, const std::string &
}
}

nlinfo ("%d sheets checked, %d need to be recomputed", filenames.size(), NeededToRecompute.size());
nlinfo ("%s: %d sheets checked, %d need to be recomputed", packedFilename.c_str(), filenames.size(), NeededToRecompute.size());

NLMISC::TTime last = NLMISC::CTime::getLocalTime ();
NLMISC::TTime start = NLMISC::CTime::getLocalTime ();
Expand Down Expand Up @@ -1036,7 +1036,7 @@ void loadForm (const std::vector<std::string> &sheetFilters, const std::string &
}
}

nlinfo ("%d sheets checked, %d need to be recomputed", sheetNames.size(), NeededToRecompute.size());
nlinfo ("%s: %d sheets checked, %d need to be recomputed", packedFilename.c_str(), sheetNames.size(), NeededToRecompute.size());

NLMISC::TTime lastTime = NLMISC::CTime::getLocalTime ();
NLMISC::TTime start = NLMISC::CTime::getLocalTime ();
Expand Down
4 changes: 3 additions & 1 deletion nel/include/nel/gui/lua_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ namespace NLGUI
void clear() { setTop(0); }
int getTop();
bool empty() { return getTop() == 0; }
void pushGlobalTable();
void pushGlobalTable();
void pushValue(int index); // copie nth element of stack to the top of the stack
void remove(int index); // remove nth element of stack
void insert(int index); // insert last element of the stack before the given position
Expand Down Expand Up @@ -380,7 +380,9 @@ namespace NLGUI
static const char * _NELSmallScriptTableName;

#ifdef _WIN32
#ifdef NL_DEBUG
HMODULE m_LuaSocket;
#endif
#endif

private:
Expand Down
4 changes: 4 additions & 0 deletions nel/include/nel/web/http_client_curl.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ class CCurlHttpClient
/// For a https server, call this with true to check for server certificate and host
bool verifyServer(bool verify);

/// Setup the user agent
void setUserAgent(const std::string& userAgent);

/// Send a 'get' request
bool sendGet(const std::string &url, const std::string &params = std::string(), bool verbose = false);

Expand Down Expand Up @@ -82,6 +85,7 @@ class CCurlHttpClient

std::vector<uint8> _ReceiveBuffer;
std::string _Auth; // must be kept here because curl only stores the char pointer
std::string _UserAgent;

std::vector<char> m_ErrorBuf;
bool m_Verify;
Expand Down
7 changes: 6 additions & 1 deletion nel/src/gui/lua_helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ namespace NLGUI
{
return std::string( "@{FC8F}" ).append( error );
}

std::string formatLuaErrorNlWarn( const std::string &error )
{
// Remove color tags (see formatLuaErrorSC())
Expand Down Expand Up @@ -234,6 +234,7 @@ namespace NLGUI
#endif

#ifdef _WIN32
#ifdef NL_DEBUG
// Lua socket library for MobDebug, optional
if (NLMISC::CFile::fileExists("socket\\core.dll"))
{
Expand Down Expand Up @@ -270,6 +271,8 @@ namespace NLGUI
{
m_LuaSocket = NULL;
}

#endif
#endif

// open are buggy????
Expand Down Expand Up @@ -360,11 +363,13 @@ namespace NLGUI
_SmallScriptCache.clear();

#ifdef _WIN32
#ifdef NL_DEBUG
if (m_LuaSocket)
{
FreeLibrary(m_LuaSocket);
m_LuaSocket = NULL;
}
#endif
#endif
}

Expand Down
7 changes: 6 additions & 1 deletion nel/src/misc/path.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -486,11 +486,16 @@ string CFileContainer::lookup (const string &filename, bool throwException, bool
that no mutator is called while async loading
*/

map<string, string>::iterator itss;

// If the file already contains a @, it means that a lookup already proceed and returning a big file, do nothing
if (filename.find ("@") != string::npos)
{
NL_DISPLAY_PATH("PATH: CPath::lookup(%s): already found", filename.c_str());
itss = _RemappedFiles.find(filename);
if (itss != _RemappedFiles.end())
return itss->second;

return filename;
}

Expand All @@ -505,7 +510,7 @@ string CFileContainer::lookup (const string &filename, bool throwException, bool
str.resize (str.size()-1);
}

map<string, string>::iterator itss = _RemappedFiles.find(str);
itss = _RemappedFiles.find(str);
if (itss != _RemappedFiles.end())
str = itss->second;

Expand Down
7 changes: 7 additions & 0 deletions nel/src/web/http_client_curl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,11 @@ bool CCurlHttpClient::verifyServer(bool verify)
return true;
}

void CCurlHttpClient::setUserAgent(const std::string& userAgent)
{
_UserAgent = userAgent;
}

// ***************************************************************************
bool CCurlHttpClient::sendRequest(const std::string& methodWB, const std::string &url, const std::string &cookieName, const std::string &cookieValue, const std::string& postParams, bool verbose)
{
Expand Down Expand Up @@ -145,6 +150,8 @@ bool CCurlHttpClient::sendRequest(const std::string& methodWB, const std::string

// Include the header in the response
curl_easy_setopt(_Curl, CURLOPT_HEADER, 1);
if (!_UserAgent.empty())
curl_easy_setopt(_Curl, CURLOPT_USERAGENT, _UserAgent.c_str());

// Register the receive callback
curl_easy_setopt(_Curl, CURLOPT_WRITEFUNCTION, CCurlHttpClient::writeDataFromCurl);
Expand Down
2 changes: 1 addition & 1 deletion ryzom/client/client_default.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Gamma_max = 1.0;

Application = { "ryzom_live", "./client_ryzom_r.exe", "./" };
BackgroundDownloader = 0;
StartupHost = "shard.ryzom.com:40916";
StartupHost = "https://shard.ryzom.com:40917";
StartupPage = "/login/r2_login.php";
StartupVerify = 1;

Expand Down
4 changes: 2 additions & 2 deletions ryzom/client/data/gamedev/interfaces_v3/appzone.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ AppZone = {
-- use client.cfg value when available
local uri = getClientCfg("AppZoneUrl")
if uri == nil or uri == '' then
uri = 'http://app.ryzom.com/'
uri = "https://app.ryzom.com/"
end

AppZone.homeuri = uri .. AppZone.homeuri
Expand Down Expand Up @@ -192,4 +192,4 @@ function AppZone:handle(cmd)
end

-- VERSION --
RYZOM_APPZONE_VERSION = 324
RYZOM_APPZONE_VERSION = 324
102 changes: 88 additions & 14 deletions ryzom/client/data/gamedev/interfaces_v3/ark.lua
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,50 @@ function getArkScript(id, selected)
return url
end

function ArkUpdateItemVariant(db, id, vp, val, skin)
local item
if db then
runAH(nil, "set", "dblink=UI:TEMP:ARK_RYWARD_CHAR3D_"..db..":"..vp.."|value="..val)
item = getUI("ui:interface:encyclopedia:content:htmlC"):find("div_item_"..db)
else
item = getUI("ui:interface:encyclopedia:content:htmlC"):find(vp)
local scene = getUI("ui:interface:encyclopedia:content:htmlC"):find(vp):find("scene")
local shape = scene:getElement("shape#0")
if skin and skin ~= "" then
shape.name = skin
end
shape.textures = val
for token in string.gmatch(vp, "[^_]*") do
db = tonumber(token)
end
end

item:find("resell").active = false
item:find("apply").active = false
item:find("v").hardtext = id
item:find("infos").hardtext = i18n.get("uiPhraseTotal"):toUtf8().." = 0"

if db ~= nil then
if ArkItemVariantQuantities[db] ~= nil and ArkItemVariantQuantities[db][id] ~= nil then
ArkSelectedItemVariant[db] = id
if ArkItemVariantQuantities[db][id] > 0 then
if item:find("apply") ~= nil then
item:find("apply").active = true
end
if item:find("infos") ~= nil then
item:find("infos").hardtext = i18n.get("uiPhraseTotal"):toUtf8().." = "..tostring(ArkItemVariantQuantities[db][id])
end
end
if ArkItemVariantQuantities[db][id] >= ArkItemVariantMinToSell[db] then
if item:find("resell") ~= nil then
item:find("resell").active = true
end
end
end
end
end



--------------------------------------------------------------------------------
--- ARK DYNE ---
Expand Down Expand Up @@ -148,18 +192,13 @@ function DynE:OpenHelp(img)
end

function DynE:UpdateMapWindow()
if (nltime.getLocalTime() - DynE.lastWinUpdate) > 60000 then
local win_html = getUI("ui:interface:app2453:browser:content:html")
local map_html = getUI("ui:interface:map:content:map_content:lm_events:html")
map_html:browse("home")
if win_html ~= nil then
win_html:renderHtml(map_html.html)
end

if (nltime.getLocalTime() - DynE.lastWinUpdate) > 10000 then
DynE.lastWinUpdate = nltime.getLocalTime()
openUrlInBg("https://app.ryzom.com/app_arcc/index.php?action=mScript_Run&script=12517&command=reset_all")
end
end


--------------------------------------------------------------------------------
--- ARK MISSION CATALOG ---
--------------------------------------------------------------------------------
Expand All @@ -180,6 +219,17 @@ function openRyward(folder, event)
getUI(ArkMissionCatalog.window_id).active = true
end

function openRykea(folder, event)
folder = "f"..tostring(folder)
event = tostring(event)
if not (rykea_selected_path_B == folder and rykea_selected_path_C == event and getUI("ui:interface:encyclopedia").active == true) then
ArkMissionCatalog:OpenCat("rykea","https://app.ryzom.com/app_arcc/index.php?action=mScript_Run&script=11938&command=reset_all")
end
getUI(ArkMissionCatalog.window_id..":content:htmlB"):browse("https://app.ryzom.com/app_arcc/index.php?action=mScript_Run&script=11938&command=reset_all&pathB="..folder.."&pathC="..event)
getUI(ArkMissionCatalog.window_id).active = true
end


function ArkMissionCatalog:OpenWindow(urlA, urlB, dont_active)
local winframe = getUI(ArkMissionCatalog.window_id)
winframe.opened=true
Expand Down Expand Up @@ -339,6 +389,8 @@ function translateText(id, script, event, dst_lang)
setTopWindow(framewin)
if dst_lang then
dst_lang = "&dst_lang="..dst_lang
else
dst_lang = ""
end
framewin:find("html"):browse("https://app.ryzom.com/app_arcc/index.php?action=mTrads_Edit&event="..tostring(event).."&trad_name="..tostring(id).."&reload="..script..dst_lang)
end
Expand All @@ -347,14 +399,17 @@ end
function setupArkUrls()
debug("Setup Lm Events")
local ui = getUI("ui:interface:map:content:map_content:lm_events:html")
ui.home = "https://app.ryzom.com/app_arcc/index.php?action=mScript_Run&script=8297&command=reset_all&no_html_header=1&continent="..tostring(game.currentMapContinent)
ui.home = "https://app.ryzom.com/app_arcc/index.php?action=mScript_Run&script=12517&command=reset_all&no_html_header=1&continent=&posx=$posx$&posy=$posy$"
ui:browse("home")

debug("Setup Lm Icons")
ui = getUI("ui:interface:map:content:map_content:lm_dynicons:html")
ui.home = "https://app.ryzom.com/app_arcc/index.php?action=mScript_Run&script=11158&command=reset_all&no_html_header=1"
ui:browse("home")
game.updateRpItemsUrl = "https://app.ryzom.com/app_arcc/index.php?action=mScript_Run&script=11488&command=reset_all"

local ui = getUI("ui:interface:map")
addOnDbChange(ui, "@UI:VARIABLES:CURRENT_SERVER_TICK", "DynE:UpdateMapWindow()")
end


Expand Down Expand Up @@ -384,10 +439,12 @@ function ArkSelectRyform(curwin, id, mod)
end

function ArkSendForm(name)
ArkGetStageEdit(__CURRENT_WINDOW__):find(name.."__command:eb").input_string = "reset"
ArkGetStageEdit(__CURRENT_WINDOW__):find("send:b"):runLeftClickAction()
local ui = getUICaller().id
ArkGetStageEdit(ui):find(name.."__command:eb").input_string = "reset"
ArkGetStageEdit(ui):find("send:b"):runLeftClickAction()
end


function ArkGetStageEdit(curwin)
local sid = string.split(curwin, ":")
local eid = sid[#sid]
Expand Down Expand Up @@ -435,15 +492,32 @@ function ArkV5GetSelectEntity(prefix, input)
end
end

function fixUrl(url)
s, n = string.gsub(url, "{amp}", "&")
return s
function getVpx(vpx)
while string.len(vpx) < 16 do
vpx = "0"..vpx
end

local vpx1 = string.format("%06d", tonumber(vpx:sub(1, string.len(vpx)-2), 16)*256)
local vpx2 = string.format("%06d", tonumber(vpx:sub(string.len(vpx)-1, string.len(vpx)), 16)+tonumber(vpx1:sub(string.len(vpx1)-5, string.len(vpx1))))
local nvpx = vpx1:sub(1, string.len(vpx1)-6)..vpx2:sub(string.len(vpx2)-5, string.len(vpx2))
return nvpx
end

function openUrlInBg(url)
getUI("ui:interface:web_transactions"):find("html"):browse(fixUrl(url))
end

function arkWindowCloseMe(url)
local framewin = getUICaller()
framewin.parent.active = false
if url then
framewin:browse(fixUrl(url))
end
end

function game:displayWhatsUp()
getUI("ui:interface:npc_web_browser:content:html"):browse("https://app.ryzom.com/app_arcc/index.php?action=mScript_Run&script=11154&command=reset_all")
end

-- S2E1 STUFF --

Expand Down
12 changes: 9 additions & 3 deletions ryzom/client/data/gamedev/interfaces_v3/ark_lessons.lua
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,15 @@ function ArkLessons:ArkRevealLessonInfos(scriptid, i, total)
end
end

function openArkLessonScript(i, script_id, url)
function openArkLessonScript(i, script_id, url, rp_item, rp_item_url)
if i == ArkLessons.RevealStep[script_id] then
local right = getPlayerTag(5)
if getDbProp("LOCAL:INVENTORY:HAND:0:INDEX_IN_BAG") ~= 0 then
right = "_"
end
if rp_item ~= nil and rp_item_url ~= nil and right ~= rp_item then
WebQueue:push(rp_item_url)
end
getUI("ui:interface:ArkLessonWin"..tostring(script_id)).active = false
WebQueue:push(url)
end
Expand Down Expand Up @@ -419,6 +426,5 @@ function webig:openWin(ui_name)
end
end


-- VERSION --
RYZOM_ARK_LESSONS_VERSION = 324
RYZOM_ARK_LESSONS_VERSION = 324
6 changes: 3 additions & 3 deletions ryzom/client/data/gamedev/interfaces_v3/encyclopedia.xml
Original file line number Diff line number Diff line change
Expand Up @@ -270,19 +270,19 @@
group_onclick_r="active_menu" group_params_r="menu=ui:interface:base_menu_with_color" >
</group>
<group id="content" x="0" y="0" w="0" h="0" posref="TL TL">
<group id="htmlA" type="html" posref="TL TL" url="http://app.ryzom.com" title_prefix="" sizeref="h" x="-16" y="0" w="220" h="49" background_color="0 0 0 0" error_color="255 240 48 255" link_color="240 155 100 255" text_color="210 210 210 255" h1_color="255 255 255 255" h2_color="255 255 255 255" h3_color="255 255 255 255" h4_color="255 255 255 255" h5_color="255 255 255 255" h6_color="255 255 255 255" text_font_size="10" h1_font_size="16" h2_font_size="14" h3_font_size="13" h4_font_size="12" h5_font_size="11" h6_font_size="11" paragraph_begin_space="12" multi_line_space_factor="0.25" td_begin_space="0" li_begin_space="4" ul_begin_space="12" li_indent="-10" ul_indent="30" checkbox_bitmap_normal="w_slot_on.tga" checkbox_bitmap_pushed="w_opacity_on.tga" checkbox_bitmap_over="" background_bitmap_view="" home="" browse_next_time="false" timeout="0" form_text_area_group="edit_box_widget_multiline" >
<group id="htmlA" type="html" posref="TL TL" url="https://app.ryzom.com" title_prefix="" sizeref="h" x="-16" y="0" w="220" h="49" background_color="0 0 0 0" error_color="255 240 48 255" link_color="240 155 100 255" text_color="210 210 210 255" h1_color="255 255 255 255" h2_color="255 255 255 255" h3_color="255 255 255 255" h4_color="255 255 255 255" h5_color="255 255 255 255" h6_color="255 255 255 255" text_font_size="10" h1_font_size="16" h2_font_size="14" h3_font_size="13" h4_font_size="12" h5_font_size="11" h6_font_size="11" paragraph_begin_space="12" multi_line_space_factor="0.25" td_begin_space="0" li_begin_space="4" ul_begin_space="12" li_indent="-10" ul_indent="30" checkbox_bitmap_normal="w_slot_on.tga" checkbox_bitmap_pushed="w_opacity_on.tga" checkbox_bitmap_over="" background_bitmap_view="" home="" browse_next_time="false" timeout="0" form_text_area_group="edit_box_widget_multiline" >
<group id="black" posref="BR BR" sizeref="hw" w="-16" h="0" inherit_gc_alpha="true"/>
<view type="bitmap" id="black2" posparent="black" posref="MM MM" sizeref="wh" w="-2" h="-2" inherit_gc_alpha="true" scale="true" texture="blank.tga" global_color="false" color="255 255 255 0"/>
<group type="list" id="text_list" fontsize="9" posref="TL TL" posparent="black" x="2" y="-2" space="0" sizeref="hw" w="-4" h="-4" maxelements="2000"/>
<ctrl style="skin_scroll" id="scroll_bar" x="8"/>
</group>
<group id="htmlB" type="html" posref="TL TL" url="http://app.ryzom.com" title_prefix="" sizeref="h" x="190" y="0" w="740" h="49" background_color="0 0 0 255" error_color="255 240 48 255" link_color="240 155 100 255" text_color="210 210 210 255" h1_color="255 255 255 255" h2_color="255 255 255 255" h3_color="255 255 255 255" h4_color="255 255 255 255" h5_color="255 255 255 255" h6_color="255 255 255 255" text_font_size="10" h1_font_size="16" h2_font_size="14" h3_font_size="13" h4_font_size="12" h5_font_size="11" h6_font_size="11" paragraph_begin_space="12" multi_line_space_factor="0.25" td_begin_space="0" li_begin_space="4" ul_begin_space="12" li_indent="-10" ul_indent="30" checkbox_bitmap_normal="w_slot_on.tga" checkbox_bitmap_pushed="w_opacity_on.tga" checkbox_bitmap_over="" background_bitmap_view="" home="" browse_next_time="false" timeout="0" form_text_area_group="edit_box_widget_multiline" >
<group id="htmlB" type="html" posref="TL TL" url="https://app.ryzom.com" title_prefix="" sizeref="h" x="190" y="0" w="740" h="49" background_color="0 0 0 255" error_color="255 240 48 255" link_color="240 155 100 255" text_color="210 210 210 255" h1_color="255 255 255 255" h2_color="255 255 255 255" h3_color="255 255 255 255" h4_color="255 255 255 255" h5_color="255 255 255 255" h6_color="255 255 255 255" text_font_size="10" h1_font_size="16" h2_font_size="14" h3_font_size="13" h4_font_size="12" h5_font_size="11" h6_font_size="11" paragraph_begin_space="12" multi_line_space_factor="0.25" td_begin_space="0" li_begin_space="4" ul_begin_space="12" li_indent="-10" ul_indent="30" checkbox_bitmap_normal="w_slot_on.tga" checkbox_bitmap_pushed="w_opacity_on.tga" checkbox_bitmap_over="" background_bitmap_view="" home="" browse_next_time="false" timeout="0" form_text_area_group="edit_box_widget_multiline" >
<group id="black" posref="BR BR" sizeref="hw" w="-16" h="0" inherit_gc_alpha="true"/>
<view type="bitmap" id="black2" posparent="black" posref="MM MM" sizeref="wh" w="-2" h="-2" inherit_gc_alpha="true" scale="true" texture="blank.tga" global_color="false" color="255 255 255 0"/>
<group type="list" id="text_list" fontsize="9" posref="TL TL" posparent="black" x="2" y="-2" space="0" sizeref="hw" w="-4" h="-4" maxelements="2000"/>
<ctrl style="skin_scroll" id="scroll_bar" posref="TR TL" posparent="text_list" x="-8"/>
</group>
<group id="htmlC" type="html" posref="TL TL" url="http://app.ryzom.com" title_prefix="" sizeref="h" x="190" y="0" w="740" h="49" background_color="0 0 0 255" error_color="255 240 48 255" link_color="240 155 100 255" text_color="210 210 210 255" h1_color="255 255 255 255" h2_color="255 255 255 255" h3_color="255 255 255 255" h4_color="255 255 255 255" h5_color="255 255 255 255" h6_color="255 255 255 255" text_font_size="10" h1_font_size="16" h2_font_size="14" h3_font_size="13" h4_font_size="12" h5_font_size="11" h6_font_size="11" paragraph_begin_space="12" multi_line_space_factor="0.25" td_begin_space="0" li_begin_space="4" ul_begin_space="12" li_indent="-10" ul_indent="30" checkbox_bitmap_normal="w_slot_on.tga" checkbox_bitmap_pushed="w_opacity_on.tga" checkbox_bitmap_over="" background_bitmap_view="" home="" browse_next_time="false" timeout="0" form_text_area_group="edit_box_widget_multiline" >
<group id="htmlC" type="html" posref="TL TL" url="https://app.ryzom.com" title_prefix="" sizeref="h" x="190" y="0" w="740" h="49" background_color="0 0 0 255" error_color="255 240 48 255" link_color="240 155 100 255" text_color="210 210 210 255" h1_color="255 255 255 255" h2_color="255 255 255 255" h3_color="255 255 255 255" h4_color="255 255 255 255" h5_color="255 255 255 255" h6_color="255 255 255 255" text_font_size="10" h1_font_size="16" h2_font_size="14" h3_font_size="13" h4_font_size="12" h5_font_size="11" h6_font_size="11" paragraph_begin_space="12" multi_line_space_factor="0.25" td_begin_space="0" li_begin_space="4" ul_begin_space="12" li_indent="-10" ul_indent="30" checkbox_bitmap_normal="w_slot_on.tga" checkbox_bitmap_pushed="w_opacity_on.tga" checkbox_bitmap_over="" background_bitmap_view="" home="" browse_next_time="false" timeout="0" form_text_area_group="edit_box_widget_multiline" >
<group id="black" posref="BR BR" sizeref="hw" w="-16" h="0" inherit_gc_alpha="true"/>
<view type="bitmap" id="black2" posparent="black" posref="MM MM" sizeref="wh" w="-2" h="-2" inherit_gc_alpha="true" scale="true" texture="blank.tga" global_color="false" color="255 255 255 0"/>
<group type="list" id="text_list" fontsize="9" posref="TL TL" posparent="black" x="2" y="-2" space="0" sizeref="hw" w="-4" h="-4" maxelements="2000"/>
Expand Down
Loading

0 comments on commit bdadba9

Please sign in to comment.