- New Release Build (2651)

- Removed test code for multiplayer file transfer (we have now a new branch for multiplayer: https://81.169.133.124/source/ja2/branches/Wanne/JA2 1.13 MP)


git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@2653 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2009-04-01 13:49:36 +00:00
parent 335747c3ff
commit 538c62455a
5 changed files with 12 additions and 242 deletions
+5 -77
View File
@@ -5,14 +5,6 @@
#include "RakNetStatistics.h"
#include "RakNetTypes.h"
#include "FileListTransfer.h"
#include "FileListTransferCBInterface.h"
#include "FileOperations.h"
#include "SuperFastHash.h"
#include "RakAssert.h"
#include "IncrementalReadInterface.h"
#include "BitStream.h"
#include "RakSleep.h"
#include <assert.h>
@@ -24,25 +16,9 @@
#include <time.h>
#include <list>
#include "connect.h"
#include "types.h"
#include "gamesettings.h"
// WANNE: FILE TRANSFER
unsigned int setID;
// Sender progress notification
class ServerFileListProgress : public FileListProgress
{
virtual void OnFilePush(const char *fileName, unsigned int fileLengthBytes, unsigned int offset, unsigned int bytesBeingSent, bool done, SystemAddress targetSystem)
{
printf("Sending %s bytes=%i offset=%i\n", fileName, bytesBeingSent, offset);
}
} serverFileListProgress;
char kbag[100];
char net_div[30];
INT32 gsMAX_MERCS;
@@ -53,7 +29,7 @@ int gsREPORT_NAME;
#include "text.h"
#include "network.h"
#include "connect.h"
#include "message.h"
#include "overhead.h"
#include "fresh_header.h"
@@ -85,16 +61,6 @@ unsigned char SpacketIdentifier;
RakPeerInterface *server;
// WANNE: FILE TRANSFER
FileListTransfer fltServer; // flt1
IncrementalReadInterface incrementalReadInterface;
FileList fileList;
int numreadyteams;
int readyteamreg[10];
@@ -517,15 +483,6 @@ void rSortArray(int* arr, int len)
}
}
void requestEXECUTABLE_DIR(RPCParameters *rpcParameters)
{
SystemAddress sender = rpcParameters->sender;//get senders address
STRING512 executableDir;
GetExecutableDirectory(executableDir);
server->RPC("recieveEXECUTABLE_DIR",(const char*)&executableDir, (int)sizeof(STRING512), HIGH_PRIORITY, RELIABLE, 0, UNASSIGNED_SYSTEM_ADDRESS, true, 0, UNASSIGNED_NETWORK_ID,0);
}
//************************* //UNASSIGNED_SYSTEM_ADDRESS
//START INTERNAL SERVER
@@ -627,9 +584,6 @@ void requestSETTINGS(RPCParameters *rpcParameters )
server->RPC("recieveSETTINGS",(const char*)&lan, (int)sizeof(settings_struct)*8, HIGH_PRIORITY, RELIABLE, 0, UNASSIGNED_SYSTEM_ADDRESS, true, 0, UNASSIGNED_NETWORK_ID,0);
} // end if(can_joingame)
}
@@ -850,7 +804,6 @@ void start_server (void)
REGISTER_STATIC_RPC(server, sendGUI);
REGISTER_STATIC_RPC(server, sendBULLET);
REGISTER_STATIC_RPC(server, requestSETTINGS);
REGISTER_STATIC_RPC(server, requestEXECUTABLE_DIR);
REGISTER_STATIC_RPC(server, sendSTATE);
REGISTER_STATIC_RPC(server, sendDEATH);
REGISTER_STATIC_RPC(server, sendhitSTRUCT);
@@ -873,35 +826,14 @@ void start_server (void)
REGISTER_STATIC_RPC(server, sendCHATMSG);
//REGISTER_STATIC_RPC(server, rINT);
//
if (b)
{
ScreenMsg( FONT_LTBLUE, MSG_CHAT, MPServerMessage[1]);
ScreenMsg( FONT_LTBLUE, MSG_CHAT, MPServerMessage[2]);
is_server = true;
// WANNE: FILE TRANSFER
server->AttachPlugin(&fltServer);
server->SetSplitMessageProgressInterval(1);
fltServer.SetCallback(&serverFileListProgress);
STRING512 executableDir;
STRING512 fileToSend;
GetExecutableDirectory(executableDir);
// 1st Testfile to send to the client
strcpy(fileToSend, executableDir);
strcat(fileToSend, "\\Data-1.13\\TableData\\Items.xml");
unsigned int fileLength = GetFileLength(fileToSend);
fileList.AddFile(fileToSend, 0, fileLength, fileLength, FileListNodeContext(0,0), true);
// 2nd Testfile to send to the client
strcpy(fileToSend, executableDir);
strcat(fileToSend, "\\Data-1.13\\TableData\\German.Items.xml");
fileLength = GetFileLength(fileToSend);
fileList.AddFile(fileToSend, 0, fileLength, fileLength, FileListNodeContext(0,0), true);
connect_client();//connect client to server
}
else
@@ -985,9 +917,6 @@ void server_packet ( void )
// make sure they can connect
CheckIncomingConnection(p);
//send_settings();//send off server set settings
// TODO.RW: Send the files to the connect clients
fltServer.Send(&fileList,server,p->systemAddress,setID,HIGH_PRIORITY,0,false, &incrementalReadInterface, 5000);
break;
case ID_MODIFIED_PACKET:
// Cheater!
@@ -1029,7 +958,6 @@ void server_disconnect (void)
{
server->Shutdown(300);
is_server = false;
fileList.Clear();
// We're done with the network
RakNetworkFactory::DestroyRakPeerInterface(server);
ScreenMsg( FONT_LTBLUE, MSG_CHAT, MPServerMessage[6]);
@@ -1038,4 +966,4 @@ void server_disconnect (void)
{
ScreenMsg( FONT_LTBLUE, MSG_CHAT, MPServerMessage[7]);
}
}
}