diff options
Diffstat (limited to 'client/client_windows.cpp')
| -rw-r--r-- | client/client_windows.cpp | 62 |
1 files changed, 2 insertions, 60 deletions
diff --git a/client/client_windows.cpp b/client/client_windows.cpp index 02bf78e..7fdd467 100644 --- a/client/client_windows.cpp +++ b/client/client_windows.cpp @@ -47,68 +47,10 @@ int main( ) { if( !c.connect( ) )
return 2;
-
- auto msg = c.get_string( );
- if ( msg != xors( "hello" ) ) {
- std::cout << "connection failed." << std::endl;
- //return 0;
- }
-
- c.send_msg( "hello" );
-
- std::string username{ }, password{ };
- std::cout << "Enter your username" << std::endl << "> ";
- std::cin >> username;
-
- c.send_msg( username.c_str( ) );
- msg = c.get_string( );
- std::cout <<msg <<std::endl;
- if ( msg != xors( "correct username" ) ) {
- std::cout << "incorrect username" << std::endl;
- //return 0; // remember to close connection on server when bad values were sent.
- }
-
- std::cout << "Enter your password" << std::endl << "> ";
- std::cin >> password;
-
- c.send_msg( password.c_str( ) );
- if ( c.get_string( ) != xors( "correct password" ) ) {
- std::cout << "incorrect password";
- //return 0; // remember to close connection on server when bad values were sent.
- }
-
- // Receive list of games,
- msg = c.get_string( );
- std::cout << msg << std::endl;
-
-
-
- /*
- const char* yes = "hello server";
- char buf[ 255 ];
- memcpy( buf, yes, strlen( yes ) );
-
- c.send_msg( ( uint8_t* )( buf ), strlen( yes ) );
- printf( "message sent\n" );
-
- auto msg = c.get_msg( );
- while( !msg.size( ) ) {
- Sleep( 1 );
- }
-
- printf( "[message received]: " );
- for( auto& it : msg )
- printf( "%c", it );
-
- printf( "\n" );
-
- c.send_msg( ( uint8_t* )( buf ), strlen( yes ) );
- */
-
- // c.~c_connect( );
-
+ c.handle( );
system( "pause" );
+
return 0;
}
|
