Skip to content

Commit

Permalink
Fixed failing pull_game and changed default server (again...)
Browse files Browse the repository at this point in the history
  • Loading branch information
theZiz committed Aug 4, 2020
1 parent 0c91a25 commit faf7f20
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
14 changes: 8 additions & 6 deletions client.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ pMessage sendMessage(pMessage message,char* binary_name,void* binary,int count,c
int buffer_size = 65536;
char in_buffer[buffer_size];
char* buffer = in_buffer;
#ifndef WIN32
#ifdef INPUT_COMPRESSION
char out_buffer[buffer_size];
#endif
char header[4096]; //magic number ftw!
Expand Down Expand Up @@ -165,7 +165,7 @@ pMessage sendMessage(pMessage message,char* binary_name,void* binary,int count,c
"Connection: Close\r\n"
"Content-Type: multipart/form-data; boundary=%s\r\n"
"Content-Length: %i\r\n"
#ifndef WIN32
#ifdef INPUT_COMPRESSION
"Accept-Encoding: gzip\r\n"
#endif
"Host: %s\r\n"
Expand All @@ -180,7 +180,7 @@ pMessage sendMessage(pMessage message,char* binary_name,void* binary,int count,c
"Connection: Close\r\n"
"Content-Type: multipart/form-data; boundary=%s\r\n"
"Content-Length: %i\r\n"
#ifndef WIN32
#ifdef INPUT_COMPRESSION
"Accept-Encoding: gzip\r\n"
#endif
"Host: %s\r\n"
Expand Down Expand Up @@ -213,7 +213,7 @@ pMessage sendMessage(pMessage message,char* binary_name,void* binary,int count,c
buffer[14] != 'K')
return NULL;
pos = 15;
#ifndef WIN32
#ifdef INPUT_COMPRESSION
int encoded = 0;
#endif
int content_length = 0;
Expand All @@ -226,7 +226,7 @@ pMessage sendMessage(pMessage message,char* binary_name,void* binary,int count,c
{
if (buffer[pos] == 0)
return NULL;
#ifndef WIN32
#ifdef INPUT_COMPRESSION
if (
buffer[pos+ 0] == 'C' &&
buffer[pos+ 1] == 'o' &&
Expand Down Expand Up @@ -324,7 +324,7 @@ pMessage sendMessage(pMessage message,char* binary_name,void* binary,int count,c
buffer[work_pos] = 0;
content_length -= difference;
}
#ifndef WIN32
#ifdef INPUT_COMPRESSION
if (encoded)
{
z_stream strm;
Expand Down Expand Up @@ -370,6 +370,8 @@ pMessage sendMessage(pMessage message,char* binary_name,void* binary,int count,c

if (direction == -1) //incoming file
{
if (buffer[pos] == '\n')
pos++;
if (buffer[pos+0] == 'A' &&
buffer[pos+1] == 'C' &&
buffer[pos+2] == 'K')
Expand Down
11 changes: 6 additions & 5 deletions options.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ int op_direction_flip = 0;
int op_show_names = 1;
int op_show_map = 1;
int op_global_chat = 1;
char op_server[512] = "ziz.gp2x.de/hase.php";
char op_server[512] = "hase.schmidt-matthes.de/hase.php";
char op_username[32] = SP_DEVICE_STRING" User";
Uint32 op_game_options = (2 << 0) | (2 << 4) | (0 << 8) | (3 << 12) | (0 << 16) | (8 << 20) | (7 << 24);
int op_game_seconds = 45;
Expand Down Expand Up @@ -290,12 +290,13 @@ void load_options()
sop_music_volume(gop_music_volume());
sop_sample_volume(gop_sample_volume());
spConfigFree(conf);
if (gop_update_server() == 0)
if (gop_update_server() < 2)
{
if ( strcmp( gop_server(), "ziz.gp2x.de/hase.php" ) == 0 )
if ( strcmp( gop_server(), "ziz.gp2x.de/hase.php" ) == 0 ||
strcmp( gop_server(), "ziz.myftp.info/hase/hase.php" ) == 0 )
{
sop_update_server( 1 );
sop_server("ziz.myftp.info/hase/hase.php");
sop_update_server( 2 );
sop_server("hase.schmidt-matthes.de/hase.php");
save_options();
}
}
Expand Down

0 comments on commit faf7f20

Please sign in to comment.