Die Frage ist in wie weit ich beteiligt bin, Habe gerade nichtmal Zeit mich richtig ums Forum zu kümmern und mit iOS Kenn ich mich nicht mit aus / will ich mich nicht mit beschäftigen :'D
Solltest du Hilfe in Sachen Forum benötigen , versuche ich natürlich zu helfen
[iOS] MG-App
- Scheffi
- Geschlossen
-
-
Die Source Server Query Library ist ganz hilfreich :)
Code
Alles anzeigen#include "ssq.h" SSQ_Initialize( false ); SSQ_SetTimeout( SSQ_GS_TIMEOUT, 3000 ); // 3 Sekunden bool connectionSuccess = SSQ_SetGameServer( "212.224.101.115:27030" ); if( connectionSuccess ) { PSSQ_INFO_REPLY reply = new SSQ_INFO_REPLY; // Private Member mit Memory Leak!!!!! if( SSQ_GetInfoReply( reply ) ) { char logmsg[4]; if( reply ) { Q_snprintf( logmsg, sizeof(logmsg), "%c", reply ->dedicated ); Log( (const char*) logmsg ); } } } SSQ_Initialize( true);Code
Alles anzeigen//SSQ_INFO_REPLY gibt dir diese Daten zurück typedef struct{ char version; char hostname[256]; char map[32]; char game_directory[32]; char game_description[256]; short app_id; char num_players ; char max_players; char num_of_bots; char dedicated; char os; char password; char secure; char game_version[32]; }SSQ_INFO_REPLY, *PSSQ_INFO_REPLY; //Das sieht schwerer aus als es ist ^^Binary: SSQbeta1.zip & Mirror
Source: SSQbeta2_src.zip & MirrorOder programmierst du nicht in C/C++? ^^
Wenn du in ObjC programmierst musst du mal gucken ob du das trotzdem irgendwie hinkriegst :P Die Source & die Binary sind beide in C programmiert/compiled also müsste es eigentlich gehen
#SorryWegenDoppelpostAberSonstÜbersiehtErEs
Falls du es selbst machen willst
Hier ist nochmal der Code hinter SSQ_INFO_REPLY (Falls du das schon verstehst. Ansonsten nimm einfach den Code oben [Dir fehlen hier sowieso noch Funktionen :D])
Code
Alles anzeigenBOOL WINAPI SSQ_GetInfoReply(PSSQ_INFO_REPLY info_reply) { static int bytes_received; static int index; static int string_length; if(HIWORD(info_reply)==0||is_initialized==FALSE) { SSQ_OutputDebugString(EXTERNAL_SSQ_GET_INFO_REPLY,0,1,0); return FALSE; } else if(send(ssq_socket[SSQ_UDP_GS],A2S_INFO,A2S_INFO_LENGTH,0)==SOCKET_ERROR) { SSQ_OutputDebugString(EXTERNAL_SSQ_GET_INFO_REPLY,1,1,(DWORD)send); return FALSE; } bytes_received = recv(ssq_socket[SSQ_UDP_GS],rs_buffer,max_rs_size,0); if(bytes_received==SOCKET_ERROR||bytes_received==0) { SSQ_OutputDebugString(EXTERNAL_SSQ_GET_INFO_REPLY,1,1,(DWORD)recv); return FALSE; } else if(rs_buffer[4]!=S2A_INFO) { SSQ_OutputDebugString(EXTERNAL_SSQ_GET_INFO_REPLY,0,1,0); return FALSE; } info_reply->version = rs_buffer[5]; index = 6; if((string_length = lstrlen(&rs_buffer[index]))>(sizeof(info_reply->hostname)-1)) { if(lstrcpyn(info_reply->hostname,&rs_buffer[index],sizeof(info_reply->hostname)-1)==0) { SSQ_OutputDebugString(EXTERNAL_SSQ_GET_INFO_REPLY,0,1,(DWORD)lstrcpyn); return FALSE; } rs_buffer[index+(sizeof(info_reply->hostname)-1)] = 0; } else if(rs_buffer[index]!=0) { if(lstrcpyn(info_reply->hostname,&rs_buffer[index],string_length+1)==0) { SSQ_OutputDebugString(EXTERNAL_SSQ_GET_INFO_REPLY,0,1,(DWORD)lstrcpyn); return FALSE; } } else { info_reply->hostname[0] = 0; } index += string_length+1; if((string_length = lstrlen(&rs_buffer[index]))>(sizeof(info_reply->map)-1)) { if(lstrcpyn(info_reply->map,&rs_buffer[index],sizeof(info_reply->map)-1)==0) { SSQ_OutputDebugString(EXTERNAL_SSQ_GET_INFO_REPLY,0,1,(DWORD)lstrcpyn); return FALSE; } rs_buffer[index+(sizeof(info_reply->map)-1)] = 0; } else if(rs_buffer[index]!=0) { if(lstrcpyn(info_reply->map,&rs_buffer[index],string_length+1)==0) { SSQ_OutputDebugString(EXTERNAL_SSQ_GET_INFO_REPLY,0,1,(DWORD)lstrcpyn); return FALSE; } } else { info_reply->map[0] = 0; } index += string_length+1; if((string_length = lstrlen(&rs_buffer[index]))>(sizeof(info_reply->game_directory)-1)) { if(lstrcpyn(info_reply->game_directory,&rs_buffer[index],sizeof(info_reply->game_directory)-1)==0) { SSQ_OutputDebugString(EXTERNAL_SSQ_GET_INFO_REPLY,0,1,(DWORD)lstrcpyn); return FALSE; } rs_buffer[index+(sizeof(info_reply->game_directory)-1)] = 0; } else if(rs_buffer[index]!=0) { if(lstrcpyn(info_reply->game_directory,&rs_buffer[index],string_length+1)==0) { SSQ_OutputDebugString(EXTERNAL_SSQ_GET_INFO_REPLY,0,1,(DWORD)lstrcpyn); return FALSE; } } else { info_reply->game_directory[0] = 0; } index += string_length+1; if((string_length = lstrlen(&rs_buffer[index]))>(sizeof(info_reply->game_description)-1)) { if(lstrcpyn(info_reply->game_description,&rs_buffer[index],sizeof(info_reply->game_description)-1)==0) { SSQ_OutputDebugString(EXTERNAL_SSQ_GET_INFO_REPLY,0,1,(DWORD)lstrcpyn); return FALSE; } rs_buffer[index+(sizeof(info_reply->game_description)-1)] = 0; } else if(rs_buffer[index]!=0) { if(lstrcpyn(info_reply->game_description,&rs_buffer[index],string_length+1)==0) { SSQ_OutputDebugString(EXTERNAL_SSQ_GET_INFO_REPLY,0,1,(DWORD)lstrcpyn); return FALSE; } } else { info_reply->game_description[0] = 0; } index += string_length+1; info_reply->app_id = *(short*)&rs_buffer[index]; info_reply->num_players = rs_buffer[index+2]; info_reply->max_players = rs_buffer[index+3]; info_reply->num_of_bots = rs_buffer[index+4]; info_reply->dedicated = rs_buffer[index+5]; info_reply->os = rs_buffer[index+6]; info_reply->password = rs_buffer[index+7]; info_reply->secure = rs_buffer[index+8]; index += 9; if((string_length = lstrlen(&rs_buffer[index]))>(sizeof(info_reply->game_version)-1)) { if(lstrcpyn(info_reply->game_version,&rs_buffer[index],sizeof(info_reply->game_version)-1)==0) { SSQ_OutputDebugString(EXTERNAL_SSQ_GET_INFO_REPLY,0,1,(DWORD)lstrcpyn); return FALSE; } rs_buffer[index+(sizeof(info_reply->game_version)-1)] = 0; } else if(rs_buffer[index]!=0) { if(lstrcpyn(info_reply->game_version,&rs_buffer[index],string_length+1)==0) { SSQ_OutputDebugString(EXTERNAL_SSQ_GET_INFO_REPLY,0,1,(DWORD)lstrcpyn); return FALSE; } } else { info_reply->game_version[0] = 0; } return TRUE; } -
Wie lade ich sie runter?
-
Ich programmiere mit Swift :D a.k.a. xCode
Ok also ObjC :) Swift basiert darauf.
Swift ist die Programmiersprache und xCode ist eine Programmierumgebung bzw. ein Compiler
Mit xCode kannst du auch in C/C++/ObjC programmieren ^^
Swift kam vor ner Weile erst raus und ist Apples eigene Programmiersprache -
Ach so ok.
Schön zu wissen. -
Ach so ok.
Schön zu wissen.Sorry aber das ist die Programmierersection ^^ Du wirst sie wahrscheinlich hier im Forum runterladen können sobald seine fertig ist
-
Ok das wollte ich wissen xD
Ich halte mich hier dann mal raus. -
Fang mit C# an bei Windows ^^
Hol dir Visual Studio dafür :P Wenn dir das zu teuer ist gibt's da andere Wege ;) -
Dann guck ob's was 4 free gibt :)
-
System
Hat das Thema aus dem Forum PC und Technik nach Archiv verschoben.