Code/Client/Private/NetImgui_Client.cpp
//=================================================================================================
// COMMUNICATIONS INITIALIZE
// Initialize a new connection to a RemoteImgui server
//=================================================================================================
COMMUNICATIONS INITIALIZE
Initialize a new connection to a RemoteImgui server
COMMUNICATIONS INITIALIZE Initialize a new connection to a RemoteImgui server
bool Communications_Initialize(ClientInfo& client)
{
	CmdVersion cmdVersionSend;
	CmdVersion cmdVersionRcv;	
	StringCopy(cmdVersionSend.mClientName, client.mName);
	bool bResultSend =		Network::DataSend(client.mpSocket, &cmdVersionSend, cmdVersionSend.mHeader.mSize);
	bool bResultRcv	=		Network::DataReceive(client.mpSocket, &cmdVersionRcv, sizeof(cmdVersionRcv));		
	client.mbConnected =	bResultRcv && bResultSend && 
							cmdVersionRcv.mHeader.mType == CmdHeader::eCommands::Version && 
							cmdVersionRcv.mVersion == CmdVersion::eVersion::_Current;
	client.mbConnectRequest = false;
	if( client.mbConnected )
	{
		client.mbHasTextureUpdate = true;
		for(auto& texture : client.mTextures)
			texture.mbSent = false;
		return true;
	}
	return false;
}
bool Communications_Initialize ( ClientInfo & client ) { CmdVersion cmdVersionSend ; CmdVersion cmdVersionRcv ; StringCopy ( cmdVersionSend . mClientName , client . mName ) ; bool bResultSend = Network :: DataSend ( client . mpSocket , & cmdVersionSend , cmdVersionSend . mHeader . mSize ) ; bool bResultRcv = Network :: DataReceive ( client . mpSocket , & cmdVersionRcv , sizeof ( cmdVersionRcv ) ) ; client . mbConnected = bResultRcv && bResultSend && cmdVersionRcv . mHeader . mType == CmdHeader :: eCommands :: Version && cmdVersionRcv . mVersion == CmdVersion :: eVersion :: _Current ; client . mbConnectRequest = false ; if ( client . mbConnected ) { client . mbHasTextureUpdate = true ; for ( auto & texture : client . mTextures ) texture . mbSent = false ; return true ; } return false ; }
COMMUNICATIONS INITIALIZE
Initialize a new connection to a RemoteImgui server
COMMUNICATIONS INITIALIZE Initialize a new connection to a RemoteImgui server