initial import

This commit is contained in:
2025-06-22 20:39:04 -05:00
commit f8a70886f0
3428 changed files with 302546 additions and 0 deletions

9
7kaa/7kaa.desktop Normal file
View File

@@ -0,0 +1,9 @@
[Desktop Entry]
Encoding=UTF-8
Name=Seven Kingdoms: Ancient Adversaries
Comment=Real-time strategy computer game
Exec=/usr/games/7kaa
Icon=7kaa.png
Terminal=false
Type=Application
Categories=Application;Game;StrategyGame;

BIN
7kaa/7kaa.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 569 B

3
7kaa/7kaa.sh Normal file
View File

@@ -0,0 +1,3 @@
#!/bin/sh
cd /usr/share/games/7kaa
./7kaa "$@"

70
7kaa/PKGBUILD Normal file
View File

@@ -0,0 +1,70 @@
# Maintainer: Jesus E. <heckyel@riseup.net>
pkgname=7kaa
pkgver=2.15.6
pkgrel=2
pkgdesc="Seven Kingdoms: Ancient Adversaries is a real-time strategy (RTS) computer game"
url='http://7kfans.com/'
arch=('i686' 'x86_64')
license=('GPL-2' 'CC-BY-4.0' 'CC-BY-3.0' 'CC-BY-SA-4.0')
depends=('openal' 'desktop-file-utils' 'enet' 'gcc-libs' 'sdl2')
groups=('games')
source=("https://sourceforge.net/projects/skfans/files/${pkgname}-${pkgver}.tar.gz"
"https://repo.hyperbola.info:50000/sources/${pkgname}/${pkgname}-music.tar.lz"{,.sig}
"${pkgname}.sh"
"${pkgname}.desktop"
"${pkgname}.png"
"remove-nonfree-services.patch")
sha512sums=('8387680b39a203a50bcf466424a4401416d9f60aa00078e4e78a44b89e7afc722a62e81a1f3b5cdb20e323983e4a6506919340261fb6b2829e3ca275e648a64f'
'd651ef19d66aec739d4aad504d27f804a44177f958675e4f35f9515d9b27ec7ede40ae5ef0da72518a17c376b0bf78f514c8e5eb05a774eda856fd80bc65bf02'
'SKIP'
'db0310f69fa44f9e9caba73c1f0825c36902052a36e14945ecf7a112283702e21f6d38480fe1b9fa0355390fa50d6e5d8d7958a6130c1c86dae3357d91fb56ad'
'2381d886b5e425ce0a0d11c044c2af582db40fef6ea5fd4b9b811d15bd3544044ded1ce59842d10ed6b85132dcbcc08b8a454799ca86ae04f6999bfe3bd41b99'
'7c72537ce58b73880756e45cf9056ce455282a1b34fb0a916994ff1fa8cfbe6e081d8a3f2ef2f772ac16945f15bed6ac04528ae44661c8a1b38b940b08f23c1b'
'01ef0d5473280ef4a244fc3da5fda26c30318abcf59a49bc37d335688c43d1fc70e259997de18ce41b539c91e4eb346b58e14f4b7db2a2cb7f6b2387dc71cae2')
validpgpkeys=('C92BAA713B8D53D3CAE63FC9E6974752F9704456') # André Silva
prepare() {
cd "${srcdir}/${pkgname}-${pkgver}"
patch -Np1 -i ${srcdir}/remove-nonfree-services.patch
}
build() {
cd "${srcdir}/${pkgname}-${pkgver}"
./configure
make
}
package() {
# install data files
install -dm755 "${pkgdir}/usr/share/games/${pkgname}/"
cd "${srcdir}/$pkgname-$pkgver/data/"
cp -r {ENCYC,ENCYC2,IMAGE,RESOURCE,SCENARI2,SCENARIO,SOUND,SPRITE,TUTORIAL} "${pkgdir}/usr/share/games/${pkgname}/"
# install music
cd "${srcdir}/$pkgname-music/"
cp -r MUSIC "${pkgdir}/usr/share/games/${pkgname}/"
# fix permissions
cd "${pkgdir}/usr/share/games/${pkgname}/"
find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 755 {} \;
# copy readme
install -D -m644 "${srcdir}/$pkgname-$pkgver/README" "${pkgdir}/usr/share/doc/${pkgname}/README"
# main file
install -dm755 "${pkgdir}/usr/share/games/${pkgname}/"
install -D -m755 "${srcdir}/${pkgname}-${pkgver}/src/${pkgname}" "${pkgdir}/usr/share/games/${pkgname}/${pkgname}"
# bash script
install -D -m755 "$srcdir/${pkgname}.sh" "${pkgdir}/usr/games/${pkgname}"
# desktop entry
install -D -m644 "$srcdir/${pkgname}.desktop" "${pkgdir}/usr/share/applications/${pkgname}.desktop"
install -D -m644 "${srcdir}/${pkgname}.png" "${pkgdir}/usr/share/pixmaps/${pkgname}.png"
# licenses
install -Dm644 "${srcdir}/$pkgname-$pkgver/COPYING" -t "${pkgdir}/usr/share/licenses/${pkgname}"
install -Dm644 "${srcdir}/${pkgname}-music/COPYING-Music.txt" -t "${pkgdir}/usr/share/licenses/${pkgname}"
}

View File

@@ -0,0 +1,243 @@
--- a/src/OGAMEMP.cpp 2022-04-29 03:09:22.000000000 +0200
+++ b/src/OGAMEMP.cpp 2022-04-29 15:17:16.264545936 +0200
@@ -585,22 +585,6 @@
return;
}
- if (service_mode == 3 || service_mode == 4)
- {
- mp_obj.set_service_provider("www.7kfans.com");
- }
-
- if (service_mode == 4)
- {
- if (!mp_get_leader_board())
- box.msg(_("Unable to retrieve leaderboard"));
-#ifdef HAVE_LIBCURL
- ws.deinit();
-#endif
- mp_obj.deinit();
- return;
- }
-
// create game or join game
switch( mp_select_mode(NULL, service_mode) )
{
@@ -844,22 +828,6 @@
return;
}
- if (service_mode == 3 || service_mode == 4)
- {
- mp_obj.set_service_provider("www.7kfans.com");
- }
-
- if (service_mode == 4)
- {
- if (!mp_get_leader_board())
- box.msg(_("Unable to retrieve leaderboard"));
-#ifdef HAVE_LIBCURL
- ws.deinit();
-#endif
- mp_obj.deinit();
- return;
- }
-
// count required player
int gamePlayerCount = 0;
for(nationRecno = 1; nationRecno <= nation_array.size(); ++nationRecno)
@@ -1039,19 +1007,17 @@
// --------- End of static function load_mp_game ----------//
-enum { SERVICE_BUTTON_NUM = 3 };
+enum { SERVICE_BUTTON_NUM = 2 };
const char *service_short_desc[SERVICE_BUTTON_NUM] =
{
N_("Local Area Network"),
// TRANSLATORS: This is a button label for entering a web or IP Address for connecting to an online game
N_("Enter Address"),
- "7kfans.com",
};
const char *service_long_desc[SERVICE_BUTTON_NUM] =
{
N_("Host or join a game using the local area network"),
N_("Join a game by entering an address"),
- N_("Host or join a game over the internet"),
};
//-------- Begin of function Game::mp_select_service --------//
//
@@ -1062,8 +1028,8 @@
//
int Game::mp_select_service()
{
- static short buttonX[SERVICE_BUTTON_NUM] = { 171, 171, 171 };
- static short buttonY[SERVICE_BUTTON_NUM] = { 57, 125, 193 };
+ static short buttonX[SERVICE_BUTTON_NUM] = { 171, 171 };
+ static short buttonY[SERVICE_BUTTON_NUM] = { 57, 125 };
#define SERVICE_BUTTON_WIDTH 459
#define SERVICE_BUTTON_HEIGHT 67
enum { DESC_MARGIN = 10, DESC_TOP_MARGIN = 6 };
@@ -1195,19 +1161,12 @@
}
//--------- End of function Game::mp_select_service ---------//
-
-const char *login_dialog_txt[] =
-{
- N_("Enter your 7kfans.com/forums account credentials to continue.\nTIP: If you have just previously logged in using the same username, you can leave your password blank, and the previous session is used."),
- N_("Username:"),
- N_("Password:")
-};
//-------- Begin of function Game::mp_select_mode --------//
// return 0 = cancel, 1 = create, 2 = join
int Game::mp_select_mode(char *defSaveFileName, int service_mode)
{
- static short buttonX[SERVICE_BUTTON_NUM] = { 171, 171, 171 };
- static short buttonY[SERVICE_BUTTON_NUM] = { 57, 125, 193 };
+ static short buttonX[SERVICE_BUTTON_NUM] = { 171, 171 };
+ static short buttonY[SERVICE_BUTTON_NUM] = { 57, 125 };
#define SERVICE_BUTTON_WIDTH 459
#define SERVICE_BUTTON_HEIGHT 67
enum { DESC_MARGIN = 10, DESC_TOP_MARGIN = 6 };
@@ -1431,28 +1390,6 @@
strncpy(username, config.player_name, MP_FRIENDLY_NAME_LEN);
username[MP_FRIENDLY_NAME_LEN] = 0;
password[0] = 0;
-
- if( input_name_pass(login_dialog_txt, username, MP_FRIENDLY_NAME_LEN+1, password, MP_FRIENDLY_NAME_LEN+1) )
- {
- int rc2;
- if( strlen(password) )
- rc2 = ws.login(username, password);
- else
- rc2 = ws.refresh(username);
- if( rc2 )
- {
- mp_obj.create_my_player(username); // reset name
- }
- else
- {
- box.msg(_("Unable to connect to 7kfans.com"));
- rc = 0;
- }
- }
- else
- {
- rc = 0;
- }
#endif
}
@@ -1735,12 +1672,6 @@
}
-#ifdef HAVE_LIBCURL
-const char *login_failed_msg = N_("Unable to connect to the 7kfans.com service. Verify your account information and try again.");
-#else
-const char *login_failed_msg = N_("Unable to connect to the 7kfans service.\n(No libcurl)");
-#endif
-
//-------- Begin of function Game::mp_select_session --------//
int Game::mp_select_session()
@@ -1934,7 +1865,6 @@
statusMsg = _("Trying to connect to the service provider");
break;
case MP_POLL_LOGIN_FAILED:
- box.msg(_(login_failed_msg));
goto exit_poll;
}
if( statusMsg )
@@ -1942,15 +1872,6 @@
vga_front.d3_panel_up(60, 65, VGA_WIDTH-60, 100, 2);
font_san.put(70, 75, statusMsg, 0, VGA_WIDTH-70);
}
-#if 0
- if (mp_obj.is_update_available() > 0)
- {
- String update_message;
- update_message = _("There is a new version of Seven Kingdoms: Ancient Adversaries at www.7kfans.com");
- vga_front.d3_panel_up(60, 65, VGA_WIDTH-60, 100, 2);
- font_san.put(70, 75, update_message, 0, VGA_WIDTH-70);
- }
-#endif
}
if( refreshFlag & SSOPTION_SCROLL_BAR )
@@ -2131,7 +2052,6 @@
if (pollStatus == MP_POLL_LOGIN_FAILED)
{
- box.msg(_(login_failed_msg));
return 0;
}
else if (pollStatus == MP_POLL_NO_SESSION)
@@ -2997,7 +2917,6 @@
pollStatus = mp_obj.poll_players();
if (pollStatus == MP_POLL_LOGIN_FAILED)
{
- box.msg(_(login_failed_msg));
break;
}
recvPtr = mp_obj.receive(&from, &recvLen, &sysMsgCount);
@@ -4903,7 +4822,6 @@
pollStatus = mp_obj.poll_players();
if (pollStatus == MP_POLL_LOGIN_FAILED)
{
- box.msg(_(login_failed_msg));
break;
}
recvPtr = mp_obj.receive(&from, &recvLen, &sysMsgCount);
@@ -5638,11 +5556,6 @@
retFlag = 1;
}
- if( pollStatus == MP_POLL_LOGIN_FAILED )
- {
- box.msg(_(login_failed_msg));
- }
-
return retFlag;
}
#ifdef Y_SHIFT
--- a/src/curl/WebService.cpp 2022-04-29 03:09:22.000000000 +0200
+++ b/src/curl/WebService.cpp 2022-04-29 15:12:54.294790812 +0200
@@ -82,36 +82,11 @@
int WebService::refresh(char *user)
{
CURLcode res;
-
- curl_easy_setopt(curl, CURLOPT_POST, 0);
- curl_easy_setopt(curl, CURLOPT_URL, "https://7kfans.com/forums/index.php");
- buffer = "";
-
- res = curl_easy_perform(curl);
return res == CURLE_OK;
}
int WebService::login(char *user, char *pass)
{
CURLcode res;
-
- /* the fields given by the user must be url encoded */
- std::string login = "login=Login&username=";
- char *encoded;
-
- encoded = curl_easy_escape(curl, user, 0);
- login += encoded;
- curl_free(encoded);
- login += "&password=";
- encoded = curl_easy_escape(curl, pass, 0);
- login += encoded;
- curl_free(encoded);
-
- curl_easy_setopt(curl, CURLOPT_POSTFIELDS, login.c_str());
- curl_easy_setopt(curl, CURLOPT_POST, 1);
- curl_easy_setopt(curl, CURLOPT_URL, "https://7kfans.com/forums/ucp.php?mode=login");
- buffer = "";
-
- res = curl_easy_perform(curl);
return res == CURLE_OK;
}