コード例 #1
0
logical pc0_ImportProtokoll :: ImportXMLActions (TP_ImportGlobals *imp_globals )
{
  DataSourceHandle  xml_datasource;
  NString           cpath;
  dttm              datetime;
  char             *ori_kennung    = GetSysVariable("EIGENTUEMER_KENNUNG");
  int16             ori_dateformat = dfs::GetDateFormat();
  logical           del_globals    = imp_globals ? NO : YES;
  logical           term           = NO;
  ODABAClient       tmpoclient;
  WriteMessages("Start",NO);
  SetSysVariable("EIGENTUEMER_KENNUNG","P");
  SetStatus(IMPORT_gestartet,YES);
  dfs::ChangeDate(DFS_YYMMDD_point);

  if ( !imp_globals )
    imp_globals = new TP_ImportGlobals(GetDBHandle());
  else
    imp_globals->Clear();
    
  GetImportFolder(cpath);
  cpath += GetString("xml_file_name");
  SetSysVariable("XML_FILE",cpath);
  if ( xml_datasource.Open(tmpoclient,"XMLImport") )
  {
    imp_globals->Message("Import-Datei konnte nicht geöffner werden");
    SetStatus(IMPORT_fehlerhaft_beendet,NO);
  }
  else
  {
    ImportXMLActions(imp_globals->get_vs_hr() ,xml_datasource.dbhandle,"HRAction",imp_globals);
    ImportXMLActions(imp_globals->get_vs_rs() ,xml_datasource.dbhandle,"RSAction",imp_globals);
    ImportXMLActions(imp_globals->get_vs_un() ,xml_datasource.dbhandle,"UNAction",imp_globals);
    ImportXMLActions(imp_globals->get_vs_phv(),xml_datasource.dbhandle,"PHVAction",imp_globals);
    ImportXMLActions(imp_globals->get_vs_hhv(),xml_datasource.dbhandle,"HHVAction",imp_globals);
    ImportXMLActions(imp_globals->get_vs_rhv(),xml_datasource.dbhandle,"RHVAction",imp_globals);
    ImportXMLActions(imp_globals->get_vs_whg(),xml_datasource.dbhandle,"WHGAction",imp_globals);
    ImportXMLActions(imp_globals->get_vs_kfz(),xml_datasource.dbhandle,"KFZAction",imp_globals);
  }
  
  dfs::ChangeDate(ori_dateformat);

  WriteMessages(imp_globals->GetMessages(),NO);
  WriteMessages("Stop",NO);
  datetime.SetCurrent();
  *GPH("terminated") = datetime;
  SetStatus(IMPORT_erfolgreich_beendet,NO);

  if ( del_globals )
    delete imp_globals;
  SetSysVariable("EIGENTUEMER_KENNUNG",ori_kennung ? ori_kennung : "");
  return(term);
}
コード例 #2
0
void CHLTVDemoRecorder::RecordPacket()
{
	if( m_MessageData.GetBasePointer() )
	{
		WriteMessages( dem_packet, m_MessageData );
		m_MessageData.Reset(); // clear message buffer
	}
}
コード例 #3
0
void CHLTVDemoRecorder::WriteFrame( CHLTVFrame *pFrame )
{
	byte		buffer[ NET_MAX_PAYLOAD ];
	bf_write	msg( "CHLTVDemo::RecordFrame", buffer, sizeof( buffer ) );

	assert( hltv->IsMasterProxy() ); // this works only on the master since we use sv.

	//first write reliable data
	bf_write *data = &pFrame->m_Messages[HLTV_BUFFER_RELIABLE];
	if ( data->GetNumBitsWritten() )
		msg.WriteBits( data->GetBasePointer(), data->GetNumBitsWritten() );

	//now send snapshot data

	// send tick time
	NET_Tick tickmsg( pFrame->tick_count, host_frametime_unbounded, host_frametime_stddeviation );
	tickmsg.WriteToBuffer( msg );


#ifndef SHARED_NET_STRING_TABLES
	// Update shared client/server string tables. Must be done before sending entities
	sv.m_StringTables->WriteUpdateMessage( NULL, max( m_nSignonTick, m_nDeltaTick ), msg );
#endif

	// get delta frame
	CClientFrame *deltaFrame = hltv->GetClientFrame( m_nDeltaTick ); // NULL if delta_tick is not found or -1
	
	// send entity update, delta compressed if deltaFrame != NULL
	sv.WriteDeltaEntities( hltv->m_MasterClient, pFrame, deltaFrame, msg );

	// send all unreliable temp ents between last and current frame
	CFrameSnapshot * fromSnapshot = deltaFrame?deltaFrame->GetSnapshot():NULL;
	sv.WriteTempEntities( hltv->m_MasterClient, pFrame->GetSnapshot(), fromSnapshot, msg, 255 );

	// write sound data
	data = &pFrame->m_Messages[HLTV_BUFFER_SOUNDS];
	if ( data->GetNumBitsWritten() )
		msg.WriteBits( data->GetBasePointer(), data->GetNumBitsWritten()  );

	// write voice data
	data = &pFrame->m_Messages[HLTV_BUFFER_VOICE];
	if ( data->GetNumBitsWritten() )
		msg.WriteBits( data->GetBasePointer(), data->GetNumBitsWritten()  );

	// last write unreliable data
	data = &pFrame->m_Messages[HLTV_BUFFER_UNRELIABLE];
	if ( data->GetNumBitsWritten() )
		msg.WriteBits( data->GetBasePointer(), data->GetNumBitsWritten()  );

	// update delta tick just like fakeclients do
	m_nDeltaTick = pFrame->tick_count;

	// write packet to demo file
	WriteMessages( dem_packet, msg ); 
}
コード例 #4
0
int CHLTVDemoRecorder::WriteSignonData()
{
	int start = m_DemoFile.GetCurPos( false );

	// on the master demos are using sv object, on relays hltv
	CBaseServer *pServer = hltv->IsMasterProxy()?(CBaseServer*)(&sv):(CBaseServer*)(hltv);

	m_nSignonTick = pServer->m_nTickCount;		

	WriteServerInfo();

	RecordServerClasses( serverGameDLL->GetAllServerClasses() );

	byte		buffer[ NET_MAX_PAYLOAD ];
	bf_write	msg( "CHLTVDemo::WriteSignonData", buffer, sizeof( buffer ) );

	// use your class infos, CRC is correct
	SVC_ClassInfo classmsg( true, pServer->serverclasses );
	classmsg.WriteToBuffer( msg );

	// Write the regular signon now
	msg.WriteBits( hltv->m_Signon.GetData(), hltv->m_Signon.GetNumBitsWritten() );

	// write new state
	NET_SignonState signonMsg1( SIGNONSTATE_PRESPAWN, pServer->GetSpawnCount() );
	signonMsg1.WriteToBuffer( msg );

	WriteMessages( dem_signon, msg ); 
	msg.Reset();

	// set view entity
	SVC_SetView viewent( hltv->m_nViewEntity );
	viewent.WriteToBuffer( msg );

	// Spawned into server, not fully active, though
	NET_SignonState signonMsg2( SIGNONSTATE_SPAWN, pServer->GetSpawnCount() );
	signonMsg2.WriteToBuffer( msg );

	WriteMessages( dem_signon, msg ); 
	
	return m_DemoFile.GetCurPos( false ) - start;
}
コード例 #5
0
void CHLTVDemoRecorder::WriteServerInfo()
{
	byte		buffer[ NET_MAX_PAYLOAD ];
	bf_write	msg( "CHLTVDemoRecorder::WriteServerInfo", buffer, sizeof( buffer ) );

	SVC_ServerInfo serverinfo;	// create serverinfo message

	// on the master demos are using sv object, on relays hltv
	CBaseServer *pServer = hltv->IsMasterProxy()?(CBaseServer*)(&sv):(CBaseServer*)(hltv);
	
	hltv->FillServerInfo( serverinfo ); // fill rest of info message
	
	serverinfo.WriteToBuffer( msg );

	// send first tick
	NET_Tick signonTick( m_nSignonTick, 0, 0 );
	signonTick.WriteToBuffer( msg );

	// write stringtable baselines

#ifndef SHARED_NET_STRING_TABLES
	pServer->m_StringTables->WriteBaselines( msg );
#endif
	
	// Write replicated ConVars to non-listen server clients only
	NET_SetConVar convars;

	// build a list of all replicated convars
	Host_BuildConVarUpdateMessage( &convars, FCVAR_REPLICATED, true );

	if ( hltv->IsMasterProxy() )
	{
		// for SourceTV server demos write set "tv_transmitall 1" even
		// if it's off for the real broadcast
		NET_SetConVar::cvar_t acvar;
		Q_strncpy( acvar.name, "tv_transmitall", MAX_OSPATH );
		Q_strncpy( acvar.value, "1", MAX_OSPATH );
		convars.m_ConVars.AddToTail( acvar );
	}

	// write convars to demo
	convars.WriteToBuffer( msg );
	
	// send signon state
	NET_SignonState signonMsg( SIGNONSTATE_NEW, pServer->GetSpawnCount() );
	signonMsg.WriteToBuffer( msg );

	WriteMessages( dem_signon, msg );
}
コード例 #6
0
ファイル: widgetchat.cpp プロジェクト: CPI4Admin/BomberMan
 void widgetChat::SendMessages()
{
    // Envoi du message
    WriteMessages(ui->saisiMessage->text(),"Moi");
    ui->saisiMessage->setText("");
}
コード例 #7
0
ファイル: widgetchat.cpp プロジェクト: CPI4Admin/BomberMan
void widgetChat::GetMessages(QString msg, QString JoueurQuiLaEnvoye)
{
   WriteMessages(msg,JoueurQuiLaEnvoye);
}