[Scummvm-git-logs] scummvm master -> b1e97b283219ffd0468b4a41ed7218159df7e5e6

lolbot-iichan lolbot_iichan at mail.ru
Sun May 30 17:16:02 UTC 2021


This automated email contains information about 5 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
6513bab7af ACHIEVEMENTS: Add an API to store platform-specific special strings like ClientSecret
86b2728ce3 AGS: Use GOG gameid as AchMan's appId
4fcfbfeb42 WINTERMUTE: Use GOG gameid as AchMan's appId
5782ca7917 AGS: Store client's ID and Secret with AchMan at AGS2Client::Initialize
b1e97b2832 WINTERMUTE: Store client's ID and Secret with AchMan at SXWMEGalaxyAPI's InitGalaxy()


Commit: 6513bab7af1bd6e07bc945c2ac8257f235750178
    https://github.com/scummvm/scummvm/commit/6513bab7af1bd6e07bc945c2ac8257f235750178
Author: lb_ii (lolbot_iichan at mail.ru)
Date: 2021-05-30T20:15:55+03:00

Commit Message:
ACHIEVEMENTS: Add an API to store platform-specific special strings like ClientSecret

Changed paths:
    common/achievements.cpp
    common/achievements.h


diff --git a/common/achievements.cpp b/common/achievements.cpp
index 19f1045a40..f2e291b24c 100644
--- a/common/achievements.cpp
+++ b/common/achievements.cpp
@@ -46,11 +46,11 @@ bool AchievementsManager::setActiveDomain(const AchievementsInfo &info) {
 		return false;
 	}
 
-	const char* prefix = info.platform == STEAM_ACHIEVEMENTS ? "steam" :
+	const char* platform = info.platform == STEAM_ACHIEVEMENTS ? "steam" :
 					info.platform == GALAXY_ACHIEVEMENTS ? "galaxy" :
 					"achman";
 
-	String iniFileName = String::format("%s-%s.dat", prefix, info.appId.c_str());
+	String iniFileName = String::format("%s-%s.dat", platform, info.appId.c_str());
 
 	if (_iniFileName == iniFileName) {
 		return true;
@@ -67,6 +67,9 @@ bool AchievementsManager::setActiveDomain(const AchievementsInfo &info) {
 
 	_descriptions = info.descriptions;
 
+	setSpecialString("platform", platform);
+	setSpecialString("gameId", info.appId);
+
 	return true;
 }
 
@@ -220,6 +223,17 @@ int AchievementsManager::getStatInt(String const &id) {
 }
 
 
+bool AchievementsManager::setSpecialString(String const &id, String const &value) {
+	if (!isReady()) {
+		return false;
+	}
+
+	_iniFile->setKey(id, "special", value);
+	_iniFile->saveToSaveFile(_iniFileName);
+	return 0;
+}
+
+
 bool AchievementsManager::resetAllAchievements() {
 	if (!isReady()) {
 		return false;
diff --git a/common/achievements.h b/common/achievements.h
index 4f9543eef5..20c74c5da1 100644
--- a/common/achievements.h
+++ b/common/achievements.h
@@ -179,6 +179,22 @@ public:
 
 	/** @} */
 
+	/**
+	 * @name Methods for storing platform-specific data
+	 * @{
+	 */
+
+	/**
+	 * Store provided key and value pair in additional section.
+	 * May be useful for posting achievements to original platform.
+	 *
+	 * @param[in] id	Internal ID of the achievement.
+	 * @param[in] value Value to which the statistic is set.
+	 */
+	bool setSpecialString(const String &id, const String &value);
+
+	/** @} */
+
 private:
 	float getStatFloatEx(const String &id, const String &section);
 	bool setStatFloatEx(const String &id, float value, const String &section);


Commit: 86b2728ce341c4982dfa5e91dd44aca19cf66533
    https://github.com/scummvm/scummvm/commit/86b2728ce341c4982dfa5e91dd44aca19cf66533
Author: lb_ii (lolbot_iichan at mail.ru)
Date: 2021-05-30T20:15:55+03:00

Commit Message:
AGS: Use GOG gameid as AchMan's appId

Changed paths:
    engines/ags/achievements_tables.h


diff --git a/engines/ags/achievements_tables.h b/engines/ags/achievements_tables.h
index e1d9eb6f7f..d69b4c3bec 100644
--- a/engines/ags/achievements_tables.h
+++ b/engines/ags/achievements_tables.h
@@ -41,7 +41,7 @@ static const AchievementDescriptionList achievementDescriptionList[] = {
 	{
 		"detectivegallo",
 		Common::GALAXY_ACHIEVEMENTS,
-		"50086217303942317",
+		"1745746005",
 		{
 			ACHIEVEMENT_SIMPLE_ENTRY("Achiev_01", "Vigilante", "That taxi driver picked up his last fare\xe2\x80\xa6"),
 			ACHIEVEMENT_SIMPLE_ENTRY("Achiev_02", "Alcoholic", "Cocktails go to my head."),
@@ -75,7 +75,7 @@ static const AchievementDescriptionList achievementDescriptionList[] = {
 	{
 		"guardduty",
 		Common::GALAXY_ACHIEVEMENTS,
-		"53208190275284474",
+		"1455980545",
 		{
 			ACHIEVEMENT_SIMPLE_ENTRY("ACH_KICKED_OUT", "Airborne", "Get kicked out of the Castle"),
 			ACHIEVEMENT_SIMPLE_ENTRY("ACH_FROG_KISS", "Pucker Up", "Girtrude finds a new friend"),
@@ -104,7 +104,7 @@ static const AchievementDescriptionList achievementDescriptionList[] = {
 	{
 		"kathyrain",
 		Common::GALAXY_ACHIEVEMENTS,
-		"49013395759351343",
+		"1460710709",
 		{
 			ACHIEVEMENT_SIMPLE_ENTRY("FinishDayOne", "Get on the Katmobile", "Finished day one"),
 			ACHIEVEMENT_SIMPLE_ENTRY("FinishDayTwo", "Wow, they're hypnotic...", "Finished day two"),
@@ -133,7 +133,7 @@ static const AchievementDescriptionList achievementDescriptionList[] = {
 	{
 		"mage",
 		Common::GALAXY_ACHIEVEMENTS,
-		"51907450760339722",
+		"1469845437",
 		{
 			ACHIEVEMENT_SIMPLE_ENTRY("DABBLING", "Dabbling", "Earn your first spells from the Sphere of Knowledge."),
 			ACHIEVEMENT_SIMPLE_ENTRY("BACK_OFF_BACKERS", "Back Off Backers", "Beat both Mage sparring partners."),
@@ -186,7 +186,7 @@ static const AchievementDescriptionList achievementDescriptionList[] = {
 	{
 		"oott",
 		Common::GALAXY_ACHIEVEMENTS,
-		"48480489121931650",
+		"1444830704",
 		{
 			ACHIEVEMENT_SIMPLE_ENTRY("tkc_TwoGirls", "He is Gnomor'", "The girls, Snow and Red, tried to save the gnome but alas, they failed."),
 			ACHIEVEMENT_SIMPLE_ENTRY("tkc_HighPriest", "High Priest", "The high priest hightailed it out of the Faerie Realm."),
@@ -208,7 +208,7 @@ static const AchievementDescriptionList achievementDescriptionList[] = {
 	{
 		"whispersofamachine",
 		Common::GALAXY_ACHIEVEMENTS,
-		"51996409849683928",
+		"1845001352",
 		{
 			ACHIEVEMENT_SIMPLE_ENTRY("CaseClosed", "Case Closed", "Finished the game"),
 			ACHIEVEMENT_SIMPLE_ENTRY("PathOfTyr", "Path of Tyr", "Finished the game assertively"),


Commit: 4fcfbfeb42bb439be44b73fca3a466dac928187e
    https://github.com/scummvm/scummvm/commit/4fcfbfeb42bb439be44b73fca3a466dac928187e
Author: lb_ii (lolbot_iichan at mail.ru)
Date: 2021-05-30T20:15:55+03:00

Commit Message:
WINTERMUTE: Use GOG gameid as AchMan's appId

Changed paths:
    engines/wintermute/achievements_tables.h


diff --git a/engines/wintermute/achievements_tables.h b/engines/wintermute/achievements_tables.h
index fb4583a8cf..474e2b41dd 100644
--- a/engines/wintermute/achievements_tables.h
+++ b/engines/wintermute/achievements_tables.h
@@ -38,7 +38,7 @@ static const AchievementDescriptionList achievementDescriptionList[] = {
 	{
 		"juliastars",
 		Common::GALAXY_ACHIEVEMENTS,
-		"48891696681534931",
+		"1457085654",
 		{
 			ACHIEVEMENT_SIMPLE_ENTRY("ACHI_LAND", "Good morning Xenophon!", "You've managed to land on a planet."),
 			ACHIEVEMENT_SIMPLE_ENTRY("ACHI_MIND", "Observant player", "You've obtained your first Mind'o'Matic."),


Commit: 5782ca79170e2756f3be0cc2cc42834d2d17268a
    https://github.com/scummvm/scummvm/commit/5782ca79170e2756f3be0cc2cc42834d2d17268a
Author: lb_ii (lolbot_iichan at mail.ru)
Date: 2021-05-30T20:15:55+03:00

Commit Message:
AGS: Store client's ID and Secret with AchMan at AGS2Client::Initialize

Changed paths:
    engines/ags/plugins/ags_galaxy_steam/ags_galaxy_steam.cpp


diff --git a/engines/ags/plugins/ags_galaxy_steam/ags_galaxy_steam.cpp b/engines/ags/plugins/ags_galaxy_steam/ags_galaxy_steam.cpp
index e5c4ff5763..ed5549fb13 100644
--- a/engines/ags/plugins/ags_galaxy_steam/ags_galaxy_steam.cpp
+++ b/engines/ags/plugins/ags_galaxy_steam/ags_galaxy_steam.cpp
@@ -146,6 +146,9 @@ void AGS2Client::FindLeaderboard(ScriptMethodParams &params) {
 }
 
 void AGS2Client::Initialize(ScriptMethodParams &params) {
+	PARAMS2(char *, clientId, char *, clientSecret);
+	AchMan.setSpecialString("clientId", clientId);
+	AchMan.setSpecialString("clientSecret", clientSecret);
 	params._result = 0;
 }
 


Commit: b1e97b283219ffd0468b4a41ed7218159df7e5e6
    https://github.com/scummvm/scummvm/commit/b1e97b283219ffd0468b4a41ed7218159df7e5e6
Author: lb_ii (lolbot_iichan at mail.ru)
Date: 2021-05-30T20:15:55+03:00

Commit Message:
WINTERMUTE: Store client's ID and Secret with AchMan at SXWMEGalaxyAPI's InitGalaxy()

Changed paths:
    engines/wintermute/ext/wme_galaxy.cpp


diff --git a/engines/wintermute/ext/wme_galaxy.cpp b/engines/wintermute/ext/wme_galaxy.cpp
index 14fdae4207..d7deebf168 100644
--- a/engines/wintermute/ext/wme_galaxy.cpp
+++ b/engines/wintermute/ext/wme_galaxy.cpp
@@ -77,7 +77,9 @@ bool SXWMEGalaxyAPI::scCallMethod(ScScript *script, ScStack *stack, ScStack *thi
 		stack->correctParams(2);
 		const char *clientId = stack->pop()->getString();
 		const char *clientSecret = stack->pop()->getString();
-		_gameRef->LOG(0, "InitGalaxy(%s, %s)", clientId, clientSecret);
+
+		AchMan.setSpecialString("clientId", clientId);
+		AchMan.setSpecialString("clientSecret", clientSecret);
 
 		stack->pushNULL();
 		return STATUS_OK;




More information about the Scummvm-git-logs mailing list