initial 8Kingdoms import

This commit is contained in:
Hans de Goede 2007-12-11 11:34:11 +00:00
commit d07f28267f
8 changed files with 6253 additions and 0 deletions

View file

@ -0,0 +1 @@
8Kingdoms-1.1.0.tar.gz

148
8Kingdoms-1.1.0-64bit.patch Normal file
View file

@ -0,0 +1,148 @@
diff -ur 8Kingdoms-1.1.0/gui/contexts/Game.cpp 8Kingdoms-1.1.0.new/gui/contexts/Game.cpp
--- 8Kingdoms-1.1.0/gui/contexts/Game.cpp 2007-07-22 03:32:57.000000000 +0200
+++ 8Kingdoms-1.1.0.new/gui/contexts/Game.cpp 2007-11-24 22:44:14.000000000 +0100
@@ -3216,7 +3216,7 @@
else
ei = GAME_EVENT(iPlayerOnTurn, eitUnitMembersDied, hid, rmtxti->getWChar(wtemp, LABEL_MAX_LENGTH, TEXT_EVENT_UNHEALEDMEN));
ei->data1 = (void*)u;
- ei->data2 = *((void**)&count);
+ ei->data2 = (void*)count;
}
else{
u->membersDied(count);
diff -ur 8Kingdoms-1.1.0/net/netinit.cpp 8Kingdoms-1.1.0.new/net/netinit.cpp
--- 8Kingdoms-1.1.0/net/netinit.cpp 2007-07-22 03:32:59.000000000 +0200
+++ 8Kingdoms-1.1.0.new/net/netinit.cpp 2007-11-24 22:43:29.000000000 +0100
@@ -325,7 +325,7 @@
if (freeprofilename==0) // pokud takovy profil neni uz pripojen
{
net_server->startPing(from);
- KSendMessage(RQUEUE,MSG_NEW_CONNECTION_ACCEPTED,MOD_NET,MOD_NET,*((void**)(&from)));
+ KSendMessage(RQUEUE,MSG_NEW_CONNECTION_ACCEPTED,MOD_NET,MOD_NET,(void*)from);
}
else
{
@@ -379,8 +379,8 @@
int from = new_connection_info->msgFrom();
net_server->stopAnnouncingMissingPlayers();
net_server->startPing(from);
- KSendMessage(RQUEUE,MSG_CLIENT_HAS_RECONNECTED,MOD_NET,BROADCAST,*((void**)(&from)));
- KSendMessage(RQUEUE,MSG_CLIENT_RECONNECTION_ACCEPTED,MOD_NET,MOD_NET,*((void**)(&from)));
+ KSendMessage(RQUEUE,MSG_CLIENT_HAS_RECONNECTED,MOD_NET,BROADCAST,(void*)from);
+ KSendMessage(RQUEUE,MSG_CLIENT_RECONNECTION_ACCEPTED,MOD_NET,MOD_NET,(void*)from);
}
}
@@ -435,9 +435,9 @@
net_client->addClientInfo(ni);
}
if (msgId==MSG_CLIENT_RECONNECTION_INFO)
- KSendMessage(RQUEUE,MSG_CLIENT_RECONNECTION_REPORT,MOD_NET,BROADCAST,*((void**)(&(ni->clientid))));
+ KSendMessage(RQUEUE,MSG_CLIENT_RECONNECTION_REPORT,MOD_NET,BROADCAST,(void*)(ni->clientid));
else
- KSendMessage(RQUEUE,MSG_NEW_CONNECTION_REPORT,MOD_NET,BROADCAST,*((void**)(&(ni->clientid))));
+ KSendMessage(RQUEUE,MSG_NEW_CONNECTION_REPORT,MOD_NET,BROADCAST,(void*)(ni->clientid));
delete(new_connetion_info);
KMemFree(ni);
@@ -489,7 +489,7 @@
{
net_client->removeClientInfo(who);
}
- KSendMessage(RQUEUE,MSG_CLIENT_DISCONNECTION_REPORT,MOD_NET,BROADCAST,*((void**)(&who)));
+ KSendMessage(RQUEUE,MSG_CLIENT_DISCONNECTION_REPORT,MOD_NET,BROADCAST,(void*)who);
delete(message);
}
break;
diff -ur 8Kingdoms-1.1.0/net/server.cpp 8Kingdoms-1.1.0.new/net/server.cpp
--- 8Kingdoms-1.1.0/net/server.cpp 2007-07-22 03:32:59.000000000 +0200
+++ 8Kingdoms-1.1.0.new/net/server.cpp 2007-11-24 22:42:03.000000000 +0100
@@ -259,7 +259,7 @@
// In case in profile is set to announce and is not currently announcing
- KSendMessage(RQUEUE,MSG_CLIENT_DISCONNECTION_ACCEPTED,MOD_NET,MOD_NET,*((void**)(&id)));
+ KSendMessage(RQUEUE,MSG_CLIENT_DISCONNECTION_ACCEPTED,MOD_NET,MOD_NET,(void*)id);
}
else
{
@@ -345,7 +345,7 @@
// printf("Socket se zavrel - klient %i\n",i);
if (that->status!=STATUS_ENDING)
{
- KSendMessage(RQUEUE,MSG_CLIENT_HAS_DISCONNECTED,MOD_NET,BROADCAST,*((void**)(&i)));
+ KSendMessage(RQUEUE,MSG_CLIENT_HAS_DISCONNECTED,MOD_NET,BROADCAST,(void*)i);
that->clientDisconnected(i);
}
}
@@ -655,8 +655,8 @@
GLOBALLOGID(PRIORITY_NEW_CONNECTION, "Server - A local client having id %i has connected, free space: %i",(*client)->clientid,this->getFreeClientCount());
// printf("\nKlient se pripojil id %i, port %i, volne: %i",(*client)->clientid,(*client)->fd,this->getFreeClientCount());
- KSendMessage(RQUEUE,MSG_LOCAL_CLIENT_ADDED,MOD_NET,MOD_NET,*((void**)(&((*client)->clientid))));
- KSendMessage(RQUEUE,MSG_NEW_CONNECTION_ACCEPTED,MOD_NET,MOD_NET,*((void**)(&((*client)->clientid))));
+ KSendMessage(RQUEUE,MSG_LOCAL_CLIENT_ADDED,MOD_NET,MOD_NET,(void*)((*client)->clientid));
+ KSendMessage(RQUEUE,MSG_NEW_CONNECTION_ACCEPTED,MOD_NET,MOD_NET,(void*)((*client)->clientid));
this->unlock();
return 1;
@@ -1223,7 +1223,7 @@
{
that->unlock();
if (that->status!=STATUS_ENDING)
- KSendMessage(RQUEUE,MSG_CLIENT_HAS_DISCONNECTED,MOD_NET,BROADCAST,*((void**)(&i)));
+ KSendMessage(RQUEUE,MSG_CLIENT_HAS_DISCONNECTED,MOD_NET,BROADCAST,(void*)i);
else
return 0;
that->lock();
diff -ur 8Kingdoms-1.1.0/world/world_server.cpp 8Kingdoms-1.1.0.new/world/world_server.cpp
--- 8Kingdoms-1.1.0/world/world_server.cpp 2007-07-22 03:33:12.000000000 +0200
+++ 8Kingdoms-1.1.0.new/world/world_server.cpp 2007-11-24 22:45:14.000000000 +0100
@@ -2032,7 +2032,7 @@
for (int i = 0; i < MAX_PLAYERS; i++)
{
- if (game_start_disconnections[i] == ((int) p))
+ if (game_start_disconnections[i] == ((long) p))
{
game_start_disconnections[i] = 0;
break;
@@ -2043,7 +2043,7 @@
else if (world_server->state == WSS_GAME_STARTED)
{
// Hra jiz bezi, tedy doslo k znovu pripojeni
- int client_id = (int)p;
+ int client_id = (long)p;
for (TPlayerIterator it = world_server->world.players.begin(); it != world_server->world.players.end(); it++)
{
int temp=it->second->data().client_data.oldclient_id;
@@ -2099,7 +2099,7 @@
// Az skonci nahravani hry, odpojeni klienta se vyresi dodatecne
for (int i = 0; i < MAX_PLAYERS; i++)
if (game_start_disconnections[i] == 0)
- game_start_disconnections[i] = (int)p;
+ game_start_disconnections[i] = (long)p;
break;
}
else if (world_server->state < WSS_GAME_STARTED) {
@@ -2110,7 +2110,7 @@
}
else if (world_server->state == WSS_GAME_STARTED) {
// Hra jiz bezi
- int client_id = (int)p;
+ int client_id = (long)p;
for (TPlayerIterator it = world_server->world.players.begin(); it != world_server->world.players.end(); it++) {
if (it->second->data().client_data.client_id == client_id) {
// odpojil se hrac it->first
diff -up 8Kingdoms-1.1.0/net/server.cpp~ 8Kingdoms-1.1.0/net/server.cpp
--- 8Kingdoms-1.1.0/net/server.cpp~ 2007-11-24 22:57:18.000000000 +0100
+++ 8Kingdoms-1.1.0/net/server.cpp 2007-11-24 22:57:18.000000000 +0100
@@ -415,7 +415,7 @@ int accept_thread(void * data)
#ifdef WIN32
int sin_size = sizeof(struct sockaddr_in); // Windows chteji do accept int
#else
- size_t sin_size = sizeof(struct sockaddr_in);
+ socklen_t sin_size = sizeof(struct sockaddr_in);
#endif
int s;

View file

@ -0,0 +1,33 @@
diff -up 8Kingdoms-1.1.0/world/world_engine.cpp~ 8Kingdoms-1.1.0/world/world_engine.cpp
--- 8Kingdoms-1.1.0/world/world_engine.cpp~ 2007-12-02 12:43:53.000000000 +0100
+++ 8Kingdoms-1.1.0/world/world_engine.cpp 2007-12-02 12:43:53.000000000 +0100
@@ -1214,7 +1214,10 @@ int TWorldServerEngine::unitMove(int uni
}
if (!can_move)
+ {
+ unlock();
return ERR_NotOperational;
+ }
TPacket_RCT_UNIT_MOVE * packet = new TPacket_RCT_UNIT_MOVE();
packet->unit_id = unit_id;
diff -up 8Kingdoms-1.1.0/world/world_client.cpp~ 8Kingdoms-1.1.0/world/world_client.cpp
--- 8Kingdoms-1.1.0/world/world_client.cpp~ 2007-12-02 12:09:28.000000000 +0100
+++ 8Kingdoms-1.1.0/world/world_client.cpp 2007-12-02 12:09:28.000000000 +0100
@@ -321,6 +321,7 @@ RVAL WORLD_CLIENT_MSG_HANDLER(MESSAGE_ID
if (world_client[i]->state == WCS_GAME_ENDED && action_type == AT_ENDGAME) {
// zprava o ukonceni hry pro jiz ukoncenou hru - ignoruji
+ world_client_mutex.unlock();
break;
}
else if (!(((action_type == AT_GAME_START) && (world_client[i]->state >= WCS_WORLD_INITIALIZED) && (world_client[i]->state < WCS_GAME_STARTED))
@@ -328,6 +329,7 @@ RVAL WORLD_CLIENT_MSG_HANDLER(MESSAGE_ID
(world_client[i]->state == WCS_GAME_STARTED)
)) {
// zprava prisla v nevhodnou chvili - ignoruji
+ world_client_mutex.unlock();
break;
}

7
8Kingdoms.desktop Normal file
View file

@ -0,0 +1,7 @@
[Desktop Entry]
Name=8 Kingdoms
Comment=A 3D turn-based fantasy strategic game
Exec=8Kingdoms-wrapper
Icon=8Kingdoms
Type=Application
Categories=Game;StrategyGame;

BIN
8Kingdoms.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

112
8Kingdoms.spec Normal file
View file

@ -0,0 +1,112 @@
# Copyright (c) 2007 oc2pus <toni@links2linux.de>
# Copyright (c) 2007 Hans de Goede <j.w.r.degoede@hhs.nl>
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
Name: 8Kingdoms
Version: 1.1.0
Release: 2%{?dist}
Summary: 8 Kingdoms is a 3D turn-based fantasy strategic game
Group: Amusements/Games
License: GPL+
URL: http://kralovstvi.sourceforge.net/
# This is:
# http://downloads.sourceforge.net/kralovstvi/%{name}-%{version}.tar.gz
# With external/extgl.h removed, as that contains parts of Windows gl.h and
# parts of a version of glext.h which falls under the "SGI Free Software
# License B", neither which are Free software.
Source0: %{name}-%{version}.tar.gz
# This is a Free replacement file with the troublesome parts replaced with
# parts from Mesa's gl.h and from The Kronos Group glext.h .
Source1: extgl.h
Source2: %{name}.desktop
Source3: %{name}.png
Patch0: 8Kingdoms-1.1.0-64bit.patch
Patch1: 8Kingdoms-1.1.0-locking.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: expat-devel SDL_mixer-devel tcl-devel desktop-file-utils
Requires: hicolor-icon-theme opengl-games-utils
%description
8 Kingdoms is a 3D turn-based fantasy strategic game in which
players become kings, build their empires and conquer enemy
kingdoms.
Theme of the game 8 Kingdoms is inspirated by the world of fantasy.
Players play on a fully 3D hex map. They construct buildings,
recruit units including infantry, mounted units, mages, catapults
and finally they attack enemy or help allies. Units gain experiences
during the battle, each unit can get some abilities upgraded to be
stronger. Data are stored in XML and freely accessible - from
language versions to units' attributes, moreover map editor with
random map generator is included for comfortable map editing.
%prep
%setup -q
%patch0 -p1
%patch1 -p1
cp -a %{SOURCE1} external
chmod -x doc/gui/gui_img1.png
# configure won't recognize --datadir ...
sed -i 's|games/8Kingdoms|share/8Kingdoms|g' configure
%build
%configure
make %{?_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT
# And here we must explicitly set pkgdatadir despite our earlier sed!
make install DESTDIR=$RPM_BUILD_ROOT pkgdatadir=%{_datadir}/%{name}
ln -s opengl-game-wrapper.sh $RPM_BUILD_ROOT%{_bindir}/%{name}-wrapper
# below is the desktop file and icon stuff.
mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications
desktop-file-install --vendor fedora \
--dir $RPM_BUILD_ROOT%{_datadir}/applications \
%{SOURCE2}
mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/96x96/apps
install -p -m 644 %{SOURCE3} \
$RPM_BUILD_ROOT%{_datadir}/icons/hicolor/96x96/apps
%clean
rm -rf $RPM_BUILD_ROOT
%post
touch --no-create %{_datadir}/icons/hicolor || :
if [ -x %{_bindir}/gtk-update-icon-cache ]; then
%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
fi
%postun
touch --no-create %{_datadir}/icons/hicolor || :
if [ -x %{_bindir}/gtk-update-icon-cache ]; then
%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
fi
%files
%defattr(-,root,root,-)
%doc AUTHORS ChangeLog COPYING README doc/*
%{_bindir}/%{name}*
%{_datadir}/%{name}
%{_datadir}/applications/fedora-%{name}.desktop
%{_datadir}/icons/hicolor/96x96/apps/%{name}.png
%changelog
* Sun Dec 2 2007 Hans de Goede <j.w.r.degoede@hhs.nl> 1.1.0-2
- Replace BuildRequires expat with expat-devel (oops)
- Add a patch which stops 8Kingdoms from hanging in certain cases
- Use opengl-games-utils wrapper to show error dialog when DRI is missing
* Sat Nov 24 2007 Hans de Goede <j.w.r.degoede@hhs.nl> 1.1.0-1
- Adapted Packman specfile for Fedora
* Fri Aug 10 2007 Toni Graffy <toni@links2linux.de> - 1.1.0-0.pm.1
- initial build 1.1.0

5951
extgl.h Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1 @@
bf70d7d21281852250116ab6894a3c33 8Kingdoms-1.1.0.tar.gz