Compare commits

...
This repository has been archived on 2026-01-16. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.

6 commits

Author SHA1 Message Date
Fedora Release Engineering
20172db18f dist-git conversion 2010-07-28 08:45:10 +00:00
Bill Nottingham
a25802fd47 Fix typo that causes a failure to update the common directory. (releng
#2781)
2009-11-25 23:49:52 +00:00
Hans de Goede
abd34cd195 - Fix divide by zero abort (bz 427485)
- Backport various fixes from CVS
2008-01-04 20:08:25 +00:00
Hans de Goede
2b55dc2ee0 - Fix crash undercertain conditions (bz 425799) 2008-01-03 21:51:50 +00:00
Hans de Goede
83da7d8476 - 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
2007-12-11 11:45:32 +00:00
Kevin Fenzi
955a82e8a4 Initialize branch F-8 for 8Kingdoms 2007-12-04 20:02:59 +00:00
14 changed files with 6633 additions and 21 deletions

View file

1
.gitignore vendored Normal file
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,13 @@
--- 8Kingdoms-1.1.0/gui/model/UnitFormation.cpp~ 2008-01-03 20:51:33.000000000 +0100
+++ 8Kingdoms-1.1.0/gui/model/UnitFormation.cpp 2008-01-03 20:51:33.000000000 +0100
@@ -148,8 +148,9 @@ void TFormation::setStandardFormation(P2
//vypocti polohy pro cleny
TUnitMemberPosition ump;
vumpPositions_c = 0;
- getUnitMemberDim(0, &ump.p2fDim);
int size = (int)unit->vMembers.size();
+ if (size)
+ getUnitMemberDim(0, &ump.p2fDim);
for(int i = 0; i < size; i++)
{
findFreeMemberPosition(vumpPositions_c, &(ump.p2fPos), &(ump.p2fDir));

View file

@ -0,0 +1,308 @@
--- 8Kingdoms-1.1.0/ai/Diplomacy/diplomacy.cpp 2007-07-22 03:32:49.000000000 +0200
+++ kralovstvi/ai/Diplomacy/diplomacy.cpp 2007-08-27 07:28:48.000000000 +0200
@@ -245,7 +245,11 @@
void CDiplomacyEngine::setOtherRelationshipPropertiesByIDs(TRelationshipProperties & relshp_prop,int dip1,int dip2)
{
DiplomatRelations[dip1][dip2].relationship_properties.offer_seen_by_enemy=relshp_prop.offer_seen_by_enemy;
+ if (relshp_prop.belief>MAXIMAL_BELIEF)
+ relshp_prop.belief=MAXIMAL_BELIEF;
DiplomatRelations[dip1][dip2].relationship_properties.belief=relshp_prop.belief;
+ if (relshp_prop.guess_belief>MAXIMAL_BELIEF)
+ relshp_prop.guess_belief=MAXIMAL_BELIEF;
DiplomatRelations[dip1][dip2].relationship_properties.guess_belief=relshp_prop.guess_belief;
}
@@ -993,6 +997,11 @@
{
if ((i!=dipid) && (DiplomatRecords[i].slotused))
{
+ // FOR SOME REASON belief can grow over MAXIMAL_BELIEF (tho it should not) - btw. the highest interval <ALLY_TRUCE_BORDER,MAXIMAL_BELIEF> represents alliance
+ if (DiplomatRelations[dipid][i].relationship_properties.guess_belief>MAXIMAL_BELIEF)
+ DiplomatRelations[dipid][i].relationship_properties.guess_belief=MAXIMAL_BELIEF;
+ if (DiplomatRelations[dipid][i].relationship_properties.belief>MAXIMAL_BELIEF)
+ DiplomatRelations[dipid][i].relationship_properties.belief=MAXIMAL_BELIEF;
TRelationship believedrs=getBeliefRelationship(DiplomatRelations[dipid][i].relationship_properties.belief);
if (DiplomatRelations[dipid][i].rs!=believedrs)
{
--- 8Kingdoms-1.1.0/ai/ai_makra.h 2007-07-22 03:32:49.000000000 +0200
+++ kralovstvi/ai/ai_makra.h 2007-07-26 09:10:48.000000000 +0200
@@ -11,8 +11,8 @@
#ifndef __PETR_ZITA_AI_MAKRA__
#define __PETR_ZITA_AI_MAKRA__
-#define PRIORITY_AI_FLOODFILL 1
-#define PRIORITY_AI_ALLOC 1
+#define PRIORITY_AI_FLOODFILL 10
+#define PRIORITY_AI_ALLOC 10
/** Makro urcujici, zdali se ma volat tah umele inteligence - ma ciste ladici vyznam. */
#define AI_STRATEGIZER_ENABLED
--- 8Kingdoms-1.1.0/common/rm/rmconf.cpp 2007-07-22 03:32:51.000000000 +0200
+++ kralovstvi/common/rm/rmconf.cpp 2007-07-26 09:10:34.000000000 +0200
@@ -108,7 +108,7 @@
if (retvalue!=0) // chyba pri cteni fajlu files.xml
{
GLOBALLOGID(PRIORITY_MISSING_FILE,"files.xml is missing or is damaged",XML_DIR);
- THROW(E_8K_RM,"files.xml is corrupted");
+ THROW(E_8K_RM,"files.xml cannot be found or is corrupted or is missing");
}
// ziskani profilu
--- 8Kingdoms-1.1.0/common/rm/rmmap.cpp 2007-07-22 03:32:51.000000000 +0200
+++ kralovstvi/common/rm/rmmap.cpp 2007-08-27 07:28:48.000000000 +0200
@@ -1855,6 +1855,12 @@
newmap.setDataInt((*this->mapsinfo[newtype])[this->idofmap]->roles[i]->relations[ii]->rs,"header",0,"roles",0,"role",i,"relations",0,"role",ii,"state",0,NULL);
newmap.setDataInt((*this->mapsinfo[newtype])[this->idofmap]->roles[i]->relations[ii]->offeredrs,"header",0,"roles",0,"role",i,"relations",0,"role",ii,"offered",0,NULL);
newmap.setDataInt((*this->mapsinfo[newtype])[this->idofmap]->roles[i]->relations[ii]->relationship_properties.offer_seen_by_enemy,"header",0,"roles",0,"role",i,"relations",0,"role",ii,"delivered",0,NULL);
+ if ((*this->mapsinfo[newtype])[this->idofmap]->roles[i]->relations[ii]->relationship_properties.belief>10000)
+ {
+ printf("This should not occure!!");
+ GLOBALLOGID(PRIORITY_FATAL,"Strange belief value role %i, belief %i",ii,(*this->mapsinfo[newtype])[this->idofmap]->roles[i]->relations[ii]->relationship_properties.belief);
+ }
+
newmap.setDataInt((*this->mapsinfo[newtype])[this->idofmap]->roles[i]->relations[ii]->relationship_properties.belief,"header",0,"roles",0,"role",i,"relations",0,"role",ii,"belief",0,NULL);
newmap.setDataInt((*this->mapsinfo[newtype])[this->idofmap]->roles[i]->relations[ii]->relationship_properties.guess_belief,"header",0,"roles",0,"role",i,"relations",0,"role",ii,"guessBelief",0,NULL);
}
--- 8Kingdoms-1.1.0/common/xml/strda.cpp 2007-07-22 03:32:52.000000000 +0200
+++ kralovstvi/common/xml/strda.cpp 2007-08-16 18:26:32.000000000 +0200
@@ -25,10 +25,10 @@
size_t j=count;
for (k=0;k<j;k++)
{
- (*big)[i+k]=smallstr[k];
+ (*big)[(int)(i+k)]=smallstr[(int)k];
}
if (terminate)
- (*big)[i+k]=0;
+ (*big)[(int)(i+k)]=0;
}
void addtoda(DA<char> *big,const char *smallstr,int terminate)
@@ -38,10 +38,10 @@
size_t j=strlen(smallstr);
for (k=0;k<j;k++)
{
- (*big)[i+k]=smallstr[k];
+ (*big)[(int)(i+k)]=smallstr[(int)k];
}
if (terminate)
- (*big)[i+k]=0;
+ (*big)[(int)(i+k)]=0;
}
void addtodawcs(DA<wchar_t> *big,const wchar_t *smallstr,int terminate)
@@ -51,10 +51,10 @@
size_t j=wcslen(smallstr);
for (k=0;k<j;k++)
{
- (*big)[i+k]=smallstr[k];
+ (*big)[(int)(i+k)]=smallstr[(int)k];
}
if (terminate)
- (*big)[i+k]=0;
+ (*big)[(int)(i+k)]=0;
}
void addtodastr(DA<char> *big,const char *smallstr,int terminate)
@@ -64,10 +64,10 @@
size_t j=strlen(smallstr);
for (k=0;k<j;k++)
{
- (*big)[i+k]=smallstr[k];
+ (*big)[(int)(i+k)]=smallstr[(int)k];
}
if (terminate)
- (*big)[i+k]=0;
+ (*big)[(int)(i+k)]=0;
}
void addtostr(char **big,const char *smallstr,int terminate)
@@ -77,10 +77,10 @@
size_t j=strlen(smallstr);
for (k=0;k<j;k++)
{
- (*big)[i+k]=smallstr[k];
+ (*big)[(int)(i+k)]=smallstr[(int)k];
}
if (terminate)
- (*big)[i+k]=0;
+ (*big)[(int)(i+k)]=0;
}
size_t newandstrcpy(char ** output, const char * input)
--- 8Kingdoms-1.1.0/common/xml/xml.cpp 2007-07-22 03:32:52.000000000 +0200
+++ kralovstvi/common/xml/xml.cpp 2007-08-16 18:26:33.000000000 +0200
@@ -1939,12 +1939,12 @@
}
-int TXMLdata::getData(char * data2,int size,int *ids,char ** tags, int number)
+int TXMLdata::getData(char * data2,size_t size,int *ids,char ** tags, int number)
// getData tentokrat s argumenty pole
{
if (number>0) // nema smysl se ptat na koren nebo neco co by melo byt nad
{
- int a;
+ size_t a;
xmlcontainer * xc=0;// = (xmlcontainer*) KMemAlloc(sizeof(xmlcontainer));
int result=this->getTag(&xc,ids,tags,number);
if ( (result!=XML_ERROR_NO_SUCH_A_PATH) && (xc!=NULL) && ((xc->content)!=NULL) && ((*(xc->content))[ids[number-1]]!=NULL) )
@@ -1964,7 +1964,7 @@
a=-1;
if (size>0) // zjistim kam dat posledni 0 - tesne za vraceny retezec
{
- int n;
+ size_t n;
if (a<(size-1))
n=a;
else
@@ -1976,7 +1976,7 @@
if ( (result!=XML_ERROR_NO_SUCH_A_PATH) && (xc!=NULL) && ((xc->content)!=NULL) && ((*(xc->content))[ids[number-1]]!=NULL) && (xc->content!=NULL) && ((*(xc->content))[ids[number-1]]->data!=NULL))
{
// KMemFree(xc);
- return (a);
+ return ((int)a);
}
else
{
@@ -1990,7 +1990,7 @@
}
}
-int TXMLdata::getData(char * data2,int size, char * firsttag, int firstid,...)
+int TXMLdata::getData(char * data2,size_t size, char * firsttag, int firstid,...)
// varci data urcena cestou
{
// v tuto chvili neni jeste dobre mit daTags v debug okne ;D ... neni to inicializovane
@@ -2104,7 +2104,7 @@
{
break;
}
- if ((result)>=size) // v result neni koncova 0
+ if ((result)>=(int)size) // v result neni koncova 0
{
if ((size!=0) && ((*data2)!=NULL))
KMemFree(*data2);
@@ -2113,7 +2113,7 @@
done=-1;
}
else
- done=size;
+ done=(int)size;
} while (done==-1);
}
--- 8Kingdoms-1.1.0/common/xml/xml.h 2007-07-22 03:32:52.000000000 +0200
+++ kralovstvi/common/xml/xml.h 2007-08-16 18:26:33.000000000 +0200
@@ -124,7 +124,7 @@
@param firstid id prvniho nekorenoveho tagu na ceste k mistu kam se vklada
@return Vraci \ref XML_ERROR_NO_SUCH_A_PATH pokud cesta neexistuje, jinak delku obsahu tagu (nezavisle na size) bez koncove 0
*/
- int getData(char * data2,int size, char * firsttag,int firstid,...);
+ int getData(char * data2,size_t size, char * firsttag,int firstid,...);
/** Ziska cely obsah tagu v podobe retezce.
Posledni parametr musi byt NULL, strida se vzdy tag a jeho id.
@@ -160,7 +160,7 @@
@param number delka cesty bez korenoveho tagu (take pocet prvku pole tags a ids)
@return Vraci \ref XML_ERROR_NO_SUCH_A_PATH pokud cesta neexistuje, jinak delku obsahu tagu (nezavisle na size)
*/
- int getData(char * data2,int size,int *ids,char ** tags, int number);
+ int getData(char * data2,size_t size,int *ids,char ** tags, int number);
/** Ziska okaz primo na data ulozena v xml.
Tato funkce se musi pouzivat s opatrnosti pouze na cteni dat. Posledni parametr musi byt NULL.
--- 8Kingdoms-1.1.0/net/comm.h 2007-07-22 03:32:59.000000000 +0200
+++ kralovstvi/net/comm.h 2007-08-16 18:26:57.000000000 +0200
@@ -194,7 +194,7 @@
int ping_time;
/** Maximalni doba, po kterou se neprijal ping */
- int max_timeout;
+ unsigned int max_timeout;
};
--- 8Kingdoms-1.1.0/net/queue.h 2007-07-22 03:32:59.000000000 +0200
+++ kralovstvi/net/queue.h 2007-08-16 18:26:57.000000000 +0200
@@ -32,7 +32,7 @@
char * data; ///< Vlasni data
mysocket to; ///< Adresat
struct TMessageBody * next; ///< Ukazatel na dalsi zpravu v seznamu
- int part_sent; ///< Jak velka cast byla poslana
+ size_t part_sent; ///< Jak velka cast byla poslana
size_t len; ///< Velikost
};
--- 8Kingdoms-1.1.0/net/server.cpp 2007-07-22 03:32:59.000000000 +0200
+++ kralovstvi/net/server.cpp 2007-08-16 18:26:58.000000000 +0200
@@ -818,7 +818,7 @@
mysocket fd;
j=0;
int set=0;
- int msglen3;
+ size_t msglen3;
server.sin_family = AF_INET;
server.sin_port = htons(80);
server.sin_addr = *((struct in_addr *)he->h_addr);
--- 8Kingdoms-1.1.0/world/players/player.cpp 2007-07-22 03:33:12.000000000 +0200
+++ kralovstvi/world/players/player.cpp 2007-08-27 07:28:48.000000000 +0200
@@ -72,6 +72,10 @@
if (_data->game_data.relations[i] != NULL) {
package->setInt(_data->game_data.relations[i]->rs, "relations", 0, "relationship", i, "rs", 0, NULL);
package->setInt(_data->game_data.relations[i]->offeredrs, "relations", 0, "relationship", i, "offeredrs", 0, NULL);
+ // this was missing!!
+ package->setInt(_data->game_data.relations[i]->relationship_properties.belief, "relations", 0, "relationship", i, "belief", 0, NULL);
+ package->setInt(_data->game_data.relations[i]->relationship_properties.offer_seen_by_enemy, "relations", 0, "relationship", i, "offer_seen_by_enemy", 0, NULL);
+ package->setInt(_data->game_data.relations[i]->relationship_properties.guess_belief, "relations", 0, "relationship", i, "guess_belief", 0, NULL);
}
}
}
@@ -119,6 +123,10 @@
_data->game_data.relations[i] = (ai_ns::diplomacy_ns::TDipRelation *)KMemAlloc(sizeof(ai_ns::diplomacy_ns::TDipRelation));
_data->game_data.relations[i]->rs = (ai_ns::diplomacy_ns::TRelationship)package->getInt("relations", 0, "relationship", i, "rs", 0, NULL);
_data->game_data.relations[i]->offeredrs = (ai_ns::diplomacy_ns::TRelationship)package->getInt("relations", 0, "relationship", i, "offeredrs", 0, NULL);
+ // this was missing!!
+ _data->game_data.relations[i]->relationship_properties.belief=(ai_ns::diplomacy_ns::TRelationship)package->getInt("relations", 0, "relationship", i, "belief", 0, NULL);
+ _data->game_data.relations[i]->relationship_properties.guess_belief=(ai_ns::diplomacy_ns::TRelationship)package->getInt("relations", 0, "relationship", i, "guess_belief", 0, NULL);
+ _data->game_data.relations[i]->relationship_properties.offer_seen_by_enemy=(ai_ns::diplomacy_ns::TRelationship)package->getInt("relations", 0, "relationship", i, "offer_seen_by_enemy", 0, NULL);
}
else {
@@ -204,7 +212,7 @@
info[it->first]->stats = it->second->data().statistics;
for (i = 1; i <= MAX_PLAYERS; i++) {
if (it->second->data().game_data.relations[i]) {
- *(info[it->first]->relations[i]) = *(it->second->data().game_data.relations[i]);
+ *(info[it->first]->relations[i]) = *(it->second->data().game_data.relations[i]);
}
else {
info[it->first]->relations[i] = NULL;
--- 8Kingdoms-1.1.0/world/world_engine.cpp 2007-07-22 03:33:12.000000000 +0200
+++ kralovstvi/world/world_engine.cpp 2007-08-03 21:22:13.000000000 +0200
@@ -1853,14 +1853,18 @@
// zaznamenam do statistik
_world.players.townCaptured(town_occupied->new_player_id, town_occupied->former_player_id);
- // dam o tom vedet diplomacii
- if (former_player_id != 0) {
- TPacket_Diplomacy_ConquerCity conquerCity;
- conquerCity.attacked_diplomat_world_id = former_player_id;
- conquerCity.attacking_diplomat_world_id = new_player_id;
- conquerCity.payment = _world.towns[town_id]->data().citysize * TOWN_INCOME;
+ // if the player is not dead or was not neutral, inform Diplomacy
+ if (former_player_id != 0)
+ {
+ if (_world.players[former_player_id]->data().game_data.state != PS_DEFEATED)
+ {
+ TPacket_Diplomacy_ConquerCity conquerCity;
+ conquerCity.attacked_diplomat_world_id = former_player_id;
+ conquerCity.attacking_diplomat_world_id = new_player_id;
+ conquerCity.payment = _world.towns[town_id]->data().citysize * TOWN_INCOME;
- KSendGlobalMessage(MSG_DIPLOMACY_CONQUER_CITY, MOD_WORLD_SERVER, MOD_DIPLOMACY, &conquerCity);
+ KSendGlobalMessage(MSG_DIPLOMACY_CONQUER_CITY, MOD_WORLD_SERVER, MOD_DIPLOMACY, &conquerCity);
+ }
}
}

View file

@ -0,0 +1,12 @@
diff -up ./res/xml/scripts/unit_recruit_elite.xml~ ./res/xml/scripts/unit_recruit_elite.xml
--- ./res/xml/scripts/unit_recruit_elite.xml~ 2008-01-04 20:07:15.000000000 +0100
+++ ./res/xml/scripts/unit_recruit_elite.xml 2008-01-04 20:07:15.000000000 +0100
@@ -60,7 +60,7 @@
# pomocna promenna pro uchovani poctu zbyvajicich zivotu
set missing_lives [expr $max_lives - $unit(lives)];
- if {$unit_types($unit(type), cure_cost) > 0} {
+ if {($unit_types($unit(type), cure_cost) > 0) && ($unit(level) > 0)} {
# pomocna promenna pro uchovani maximalniho poctu zivotu, na ktere
# ma hrac penize
set money [expr floor($player(money) / ($unit(level) * $unit_types($unit(type), cure_cost)))];

View file

@ -0,0 +1,31 @@
--- 8Kingdoms-1.1.0/common/TCL/tcl_struct.cpp~ 2008-01-03 18:45:05.000000000 +0100
+++ 8Kingdoms-1.1.0/common/TCL/tcl_struct.cpp 2008-01-03 18:45:05.000000000 +0100
@@ -6,6 +6,7 @@
*/
#include <stdio.h>
+#include <string.h>
#include "common/compatibility.h"
#include "common/types.h"
#include "tcl_struct.h"
--- 8Kingdoms-1.1.0/ai/Strategizer/attacks.cpp~ 2008-01-03 18:35:41.000000000 +0100
+++ 8Kingdoms-1.1.0/ai/Strategizer/attacks.cpp 2008-01-03 18:35:41.000000000 +0100
@@ -9,6 +9,7 @@
*/
#include "ai/Strategizer/attacks.h"
+#include <limits.h>
using namespace World;
--- 8Kingdoms-1.1.0/ai/MapAnalyzer/mapanalyzer.cpp~ 2008-01-03 18:34:48.000000000 +0100
+++ 8Kingdoms-1.1.0/ai/MapAnalyzer/mapanalyzer.cpp 2008-01-03 18:34:48.000000000 +0100
@@ -9,6 +9,8 @@
*/
#include "ai/MapAnalyzer/mapanalyzer.h"
+#include <limits.h>
+
using namespace World;
namespace ai_ns

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

128
8Kingdoms.spec Normal file
View file

@ -0,0 +1,128 @@
# 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: 4%{?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
Patch2: 8Kingdoms-1.1.0-crash.patch
Patch3: 8Kingdoms-1.1.0-gcc43.patch
Patch4: 8Kingdoms-1.1.0-divide-by-zero.patch
Patch5: 8Kingdoms-1.1.0-cvs-fixes.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
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -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
* Fri Jan 4 2008 Hans de Goede <j.w.r.degoede@hhs.nl> 1.1.0-4
- Fix divide by zero abort (bz 427485)
- Backport various fixes from CVS
* Thu Jan 3 2008 Hans de Goede <j.w.r.degoede@hhs.nl> 1.1.0-3
- Fix compiling with gcc 4.3
- Fix crash undercertain conditions (bz 425799)
* 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

View file

@ -1,21 +0,0 @@
# Makefile for source rpm: 8Kingdoms
# $Id$
NAME := 8Kingdoms
SPECFILE = $(firstword $(wildcard *.spec))
define find-makefile-common
for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
endef
MAKEFILE_COMMON := $(shell $(find-makefile-common))
ifeq ($(MAKEFILE_COMMON),)
# attept a checkout
define checkout-makefile-common
test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2
endef
MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
endif
include $(MAKEFILE_COMMON)

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