<commit_before>#include "stdafx.h"
#include "NetworkClient.hpp"

//fToServerStc NetworkClient::toServerData;



NetworkClient::NetworkClient() : NetworkWorker()
{
	tryToConnect = true;
	clientConnected = false;

	myType = CLIENT;
}

int NetworkClient::initialize(int port)
{
	last = now = AnnEngine::Instance()->getTimeFromStartUp(); 
	return 0;
}
void NetworkClient::update(){
	AnnDebug() << "client update";
	now = AnnEngine::Instance()->getTimeFromStartUp();
	float frameTime = now - last;
	last = now;
	communicate(frameTime);
}

// --- Do network communications ---
void NetworkClient::communicate(float frameTime)
{	
	AnnDebug() << "Com";
	if(clientConnected)
		getInfoFromServer(); // Get game state from server
	// Calculate elapsed time for network communications
	/*netTime += frameTime;
	if(netTime < netNS::NET_TIMER) // if not time to communicate*/
		//return;
	if(tryToConnect)
		connectToServer(); // Attempt to connect to game server
	else if(clientConnected)
	{
		AnnDebug() << "Should transmit data here";
		checkNetworkTimeout(); // check for disconnect from server
		sendInfoToServer(); //
	}<commit_msg>remove useless stuff in the client code<commit_after>#include "stdafx.h"
#include "NetworkClient.hpp"

//fToServerStc NetworkClient::toServerData;



NetworkClient::NetworkClient() : NetworkWorker()
{
	tryToConnect = true;
	clientConnected = false;

	myType = CLIENT;
}

int NetworkClient::initialize(int port)
{
	last = now = AnnEngine::Instance()->getTimeFromStartUp(); 
	return 0;
}
void NetworkClient::update(){
	//AnnDebug() << "client update";
	now = AnnEngine::Instance()->getTimeFromStartUp();
	float frameTime = now - last;
	last = now;
	communicate(frameTime);
}

// --- Do network communications ---
void NetworkClient::communicate(float frameTime)
{	
	//AnnDebug() << "Com";
	if(clientConnected)
		getInfoFromServer(); // Get game state from server
	// Calculate elapsed time for network communications
	/*netTime += frameTime;
	if(netTime < netNS::NET_TIMER) // if not time to communicate*/
		//return;
	if(tryToConnect)
		connectToServer(); // Attempt to connect to game server
	else if(clientConnected)
	{
		/*AnnDebug() << "Should transmit data here";*/
		//checkNetworkTimeout(); // check for disconnect from server
		sendInfoToServer(); //
	}
{'fraction_non_alphanumeric': 0.13922942206654992, 'fraction_numerical': 0.0008756567425569177, 'mean_word_length': 4.755667506297229, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5417040', 'n_tokens_mistral': 728, 'n_tokens_neox': 694, 'n_words': 184}