Subversion Repositories Games.Chess Giants

Rev

Rev 179 | Rev 185 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 179 Rev 180
Line 1017... Line 1017...
1017
      ConvertTo7BitASCII (user_email, sizeof (user_email), options.registration.user_email);
1017
      ConvertTo7BitASCII (user_email, sizeof (user_email), options.registration.user_email);
1018
   else
1018
   else
1019
      strcpy_s (user_email, sizeof (user_email), "an+unregistered+user");
1019
      strcpy_s (user_email, sizeof (user_email), "an+unregistered+user");
1020
   length = strlen ("registrant=") + strlen (user_email)
1020
   length = strlen ("registrant=") + strlen (user_email)
1021
          + strlen ("&version=") + strlen (program_version)
1021
          + strlen ("&version=") + strlen (program_version)
-
 
1022
          + strlen ("&player1=") + 1
-
 
1023
          + strlen ("&player2=") + 1
1022
          + strlen ("&board=") + base64_encode (board_base64buffer, board_buffer, strlen (board_buffer))
1024
          + strlen ("&board=") + base64_encode (board_base64buffer, board_buffer, strlen (board_buffer))
1023
          + strlen ("&log=") + base64_encode (log_base64buffer, log_buffer, strlen (log_buffer))
1025
          + strlen ("&log=") + base64_encode (log_base64buffer, log_buffer, strlen (log_buffer))
1024
          + strlen ("&description=") + base64_encode (description_base64buffer, description_buffer, strlen (description_buffer));
1026
          + strlen ("&description=") + base64_encode (description_base64buffer, description_buffer, strlen (description_buffer));
1025
   sprintf_s (http_buffer, sizeof (http_buffer),
1027
   sprintf_s (http_buffer, sizeof (http_buffer),
1026
              "POST /chess/sendcrash.php HTTP/1.1\r\n"
1028
              "POST /chess/sendcrash.php HTTP/1.1\r\n"
1027
              "Host: pmbaty.com\r\n"
1029
              "Host: pmbaty.com\r\n"
1028
              "Content-Type: application/x-www-form-urlencoded\r\n"
1030
              "Content-Type: application/x-www-form-urlencoded\r\n"
1029
              "Content-Length: %d\r\n"
1031
              "Content-Length: %d\r\n"
1030
              "Connection: close\r\n"
1032
              "Connection: close\r\n"
1031
              "\r\n"
1033
              "\r\n"
1032
              "registrant=%s&version=%s&board=%s&log=%s&description=%s", length, user_email, program_version, board_base64buffer, log_base64buffer, description_base64buffer);
1034
              "registrant=%s&version=%s&player1=%c&player2=%c&board=%s&log=%s&description=%s", length,
-
 
1035
              user_email, // registrant=
-
 
1036
              program_version, // &version=
-
 
1037
              (the_board.players[COLOR_WHITE].type == PLAYER_INTERNET ? 'I' : (the_board.players[COLOR_WHITE].type == PLAYER_COMPUTER ? 'C' : 'H')), // &player1=
-
 
1038
              (the_board.players[COLOR_BLACK].type == PLAYER_INTERNET ? 'I' : (the_board.players[COLOR_BLACK].type == PLAYER_COMPUTER ? 'C' : 'H')), // &player2=
-
 
1039
              board_base64buffer, // &board=
-
 
1040
              log_base64buffer, // &log=
-
 
1041
              description_base64buffer); // &description=
1033
   length = strlen (http_buffer);
1042
   length = strlen (http_buffer);
1034
   write_index = send (s, http_buffer, length, 0); // send the HTTP query
1043
   write_index = send (s, http_buffer, length, 0); // send the HTTP query
1035
   if (write_index != length)
1044
   if (write_index != length)
1036
   {
1045
   {
1037
      closesocket (s); // finished communicating, close TCP socket
1046
      closesocket (s); // finished communicating, close TCP socket