Make a diff file and post it to sourceforge, it is really easier for the SY.And of course I'd appreciate very much if this gets into the CVS :)
http://sourceforge.net/docman/display_d ... ommanddiff
Moderator: Moderators
Make a diff file and post it to sourceforge, it is really easier for the SY.And of course I'd appreciate very much if this gets into the CVS :)
You can, but I didn't. Feel free to change it. And the filenames do run from demo000.sdf to demo001.sdf etc. The benefits from the textfile come from the extra information you can store: events (e.g. player deaths), statistics (e.g. resource incomes), etc. But these aren't included atm.zwzsg wrote:Can't you include date, player names, maps, in the demo filename, like tademo99b2 does?
Code: Select all
Index: rts/Net.h
===================================================================
RCS file: /cvsroot/springrts/taspring/rts/Net.h,v
retrieving revision 1.4
diff -u -r1.4 Net.h
--- rts/Net.h 3 Jul 2005 12:04:10 -0000 1.4
+++ rts/Net.h 15 Jul 2005 12:15:49 -0000
@@ -131,7 +131,9 @@
void FlushConnection(int conn);
void SendRawPacket(int conn, unsigned char* data, int length, int packetNum);
- void CreateDemoFile(char* name);
+ char demoBinFile[50];
+ char demoTxtFile[50];
+ void CreateDemoFile(void);
void SaveToDemo(unsigned char* buf,int length);
bool FindDemoFile(const char* name);
Code: Select all
Index: rts/Net.cpp
===================================================================
RCS file: /cvsroot/springrts/taspring/rts/Net.cpp,v
retrieving revision 1.7
diff -u -r1.7 Net.cpp
--- rts/Net.cpp 3 Jul 2005 18:03:14 -0000 1.7
+++ rts/Net.cpp 15 Jul 2005 12:40:08 -0000
@@ -11,6 +11,7 @@
#include "scripthandler.h"
#include "gamesetup.h"
#include "team.h"
+#include "pregame.h"
//#include "mmgr.h"
//////////////////////////////////////////////////////////////////////
@@ -150,7 +151,7 @@
gu->spectating=true;
return 1;
} else {
- CreateDemoFile("test.sdf");
+ CreateDemoFile();
}
SOCKADDR_IN saOther;
@@ -543,14 +544,53 @@
}
}
-void CNet::CreateDemoFile(char* name)
+void CNet::CreateDemoFile()
{
- recordDemo=new ofstream(name, ios::out|ios::binary);
+ for(int a=0;a<9999;++a){
+ sprintf(demoBinFile,"demos/demo%03i.sdf",a);
+ sprintf(demoTxtFile,"demos/demo%03i.txt",a);
+ CFileHandler ifs(demoBinFile);
+ if(!ifs.FileExists())
+ break;
+ }
+
+ recordDemo=new ofstream(demoBinFile, ios::out|ios::binary);
if(gameSetup){
char c=1;
recordDemo->write(&c,1);
recordDemo->write((char*)&gameSetup->gameSetupTextLength,sizeof(int));
recordDemo->write(gameSetup->gameSetupText,gameSetup->gameSetupTextLength);
+
+ ofstream fout(demoTxtFile, ios::trunc);
+ fout << "*****************************\n";
+ fout << "* *\n";
+ fout << "* TA Spring demo file *\n";
+ fout << "* *\n";
+ fout << "*****************************\n";
+ fout << "\n";
+ fout << "\n";
+ fout << "Version:\t" << game->version << "\n";
+ fout << "Mapname:\t" << pregame->mapName << "\n";
+ fout << "\n";
+ fout << "\n";
+ fout << "================================================\n";
+ fout << "Side\t| Team\t| Ally team\t| Player\n";
+ fout << "------------------------------------------------\n";
+ for(int a=0;a<gameSetup->numPlayers;++a){
+ if(!gs->players[a]->spectator){ // we don't care for spectators
+ int team = gs->players[a]->team;
+ fout << gs->teams[team]->side << " \t| " << team << " \t| ";
+ fout << gs->team2allyteam[team] << " \t\t| " << gs->players[a]->playerName << "\n";
+ }
+ }
+ fout << "================================================\n";
+ fout << "\n";
+ fout << "\n";
+ fout << "================================================\n";
+ fout << "Time\t| Event\n";
+ fout << "------------------------------------------------\n";
+ fout << flush;
+ fout.close();
} else {
char c=0;
recordDemo->write(&c,1);
Code: Select all
Index: rts/Game.h
===================================================================
RCS file: /cvsroot/springrts/taspring/rts/Game.h,v
retrieving revision 1.5
diff -u -r1.5 Game.h
--- rts/Game.h 14 Jul 2005 17:02:14 -0000 1.5
+++ rts/Game.h 15 Jul 2005 09:59:23 -0000
@@ -65,6 +65,8 @@
float consumeSpeed;
int chatSound;
+ std::string version;
+ std::string fullversion;
bool playing;
bool allReady;
bool chatting;
Code: Select all
Index: rts/Game.cpp
===================================================================
RCS file: /cvsroot/springrts/taspring/rts/Game.cpp,v
retrieving revision 1.22
diff -u -r1.22 Game.cpp
--- rts/Game.cpp 14 Jul 2005 17:02:14 -0000 1.22
+++ rts/Game.cpp 15 Jul 2005 10:25:04 -0000
@@ -109,6 +109,8 @@
CGame::CGame(bool server,std::string mapname)
{
stupidGlobalMapname=mapname;
+ version = "0.51b2";
+ fullversion = "TA Spring " + version;
time(&starttime);
lastTick=clock();
@@ -244,7 +246,7 @@
userInput="";
showList=0;
- info->AddLine("TA Spring 0.51b1");
+ info->AddLine(fullversion);
if(!server){
netbuf[0]=NETMSG_EXECHECKSUM;
Code: Select all
Index: rts/Team.cpp
===================================================================
RCS file: /cvsroot/springrts/taspring/rts/Team.cpp,v
retrieving revision 1.5
diff -u -r1.5 Team.cpp
--- rts/Team.cpp 14 Jul 2005 17:02:14 -0000 1.5
+++ rts/Team.cpp 15 Jul 2005 12:44:41 -0000
@@ -8,6 +8,7 @@
#include "infoconsole.h"
#include "player.h"
#include "unit.h"
+#include "net.h"
//#include "mmgr.h"
//////////////////////////////////////////////////////////////////////
@@ -200,7 +201,7 @@
}
if(units.empty()){
- info->AddLine("Team%i(%s) is no more",teamNum,gs->players[leader]->playerName.c_str());
+ info->AddLine("Team %i (%s) is no more",teamNum,gs->players[leader]->playerName.c_str());
isDead=true;
for(int a=0;a<MAX_PLAYERS;++a){
if(gs->players[a]->active && gs->players[a]->team==teamNum){
@@ -208,7 +209,14 @@
if(a==gu->myPlayerNum)
gu->spectating=true;
}
- }
+ }
+ char time[10];
+ sprintf(time,"%02i:%02i",gs->frameNum/60/30,(gs->frameNum/30)%60);
+ ofstream fout(net->demoTxtFile, ios::app);
+ fout << time << "\t| ";
+ fout << "Team " << teamNum << " (" << gs->players[leader]->playerName << ") was annihilated\n";
+ fout << flush;
+ fout.close();
}
}
This probably came from an attempt to cut down work. Instead of programming extra stuff for spectating, they probably just reused the same features that allow you to play allied playing with the same army but make that player with a simple exception of making it unable to assign any kind of comands.shnorb wrote:... also, what is the reason for being able to teamchat when spectating in a game...? ...
No the space bar should do what it did in TA.# The space-key should be the one used to go to last sent message, instead of F3. It must be a large and easily pressed panic button instead of the F3 key lost in the middle of all the other keys.
Alliances made in the battleroom should be permanent throughout game, alliances thus can be made and broken ingame unless they conflict with pregame alliances or create an everyones allied situation.# Would be nice to have the ability to change the alliances in-game. Currently, people are loosing alot of time defining alliances in the Battlerooms and alot more, choosing the start positions in game and, sometimes, choosing wrong positions.