diff --git a/tools/SRB2Launcher/ReadMe.txt b/tools/SRB2Launcher/ReadMe.txt deleted file mode 100644 index 9aafe08b8..000000000 --- a/tools/SRB2Launcher/ReadMe.txt +++ /dev/null @@ -1,35 +0,0 @@ -======================================================================== - WIN32 APPLICATION : SRB2Launcher -======================================================================== - - -AppWizard has created this SRB2Launcher application for you. - -This file contains a summary of what you will find in each of the files that -make up your SRB2Launcher application. - -SRB2Launcher.cpp - This is the main application source file. - -SRB2Launcher.dsp - This file (the project file) contains information at the project level and - is used to build a single project or subproject. Other users can share the - project (.dsp) file, but they should export the makefiles locally. - - -///////////////////////////////////////////////////////////////////////////// -Other standard files: - -StdAfx.h, StdAfx.cpp - These files are used to build a precompiled header (PCH) file - named SRB2Launcher.pch and a precompiled types file named StdAfx.obj. - - -///////////////////////////////////////////////////////////////////////////// -Other notes: - -AppWizard uses "TODO:" to indicate parts of the source code you -should add to or customize. - - -///////////////////////////////////////////////////////////////////////////// diff --git a/tools/SRB2Launcher/SRB2Launcher.cpp b/tools/SRB2Launcher/SRB2Launcher.cpp deleted file mode 100644 index 4138676d3..000000000 --- a/tools/SRB2Launcher/SRB2Launcher.cpp +++ /dev/null @@ -1,1155 +0,0 @@ -///////////////////////////// -// // -// Sonic Robo Blast 2 // -// Official Win32 Launcher // -// // -// By // -// SSNTails // -// ah518@tcnet.org // -// (Sonic Team Junior) // -// http://www.srb2.org // -// // -///////////////////////////// -// -// This source code is released under -// Public Domain. I hope it helps you -// learn how to write exciting Win32 -// applications in C! -// -// However, you may not alter this -// program and continue to call it -// the "Official Sonic Robo Blast 2 -// Launcher". -// -// NOTE: Not all files in this project -// are released under this license. -// Any license mentioned in accompanying -// source files overrides the license -// mentioned here, sorry! -// -// SRB2Launcher.cpp : Defines the entry point for the application. -// - -#include "stdafx.h" -#include -#include -#include "SRB2Launcher.h" - -char TempString[256]; - -char Arguments[16384]; - -HWND mainHWND; -HWND hostHWND; -HWND joinHWND; -HINSTANCE g_hInst; - -HANDLE ServerlistThread = 0; - -typedef struct -{ - char nospecialrings; - char suddendeath; - char scoringtype[16]; - char matchboxes[16]; - int respawnitemtime; - int timelimit; - int pointlimit; -} matchsettings_t; - -typedef struct -{ - char raceitemboxes[16]; - int numlaps; -} racesettings_t; - -typedef struct -{ - char nospecialrings; - char matchboxes[16]; - int respawnitemtime; - int timelimit; - int pointlimit; -} tagsettings_t; - -typedef struct -{ - char nospecialrings; - char matchboxes[16]; - int respawnitemtime; - int timelimit; - int flagtime; - int pointlimit; -} ctfsettings_t; - -typedef struct -{ - char nofile; - char nodownload; -} joinsettings_t; - -typedef struct -{ - matchsettings_t match; - racesettings_t race; - tagsettings_t tag; - ctfsettings_t ctf; - char gametype[16]; - char startmap[9]; - int maxplayers; - char advancestage[16]; - int inttime; - char forceskin; - char noautoaim; - char nosend; - char noadvertise; - - // Monitor Toggles... - char teleporters[8]; - char superring[8]; - char silverring[8]; - char supersneakers[8]; - char invincibility[8]; - char jumpshield[8]; - char watershield[8]; - char ringshield[8]; - char fireshield[8]; - char bombshield[8]; - char oneup[8]; - char eggmanbox[8]; -} hostsettings_t; - -typedef struct -{ - hostsettings_t host; - joinsettings_t join; - char EXEName[1024]; - char ConfigFile[1024]; - char ManualParameters[8192]; - char PlayerName[24]; - char PlayerColor[16]; - char PlayerSkin[24]; -} settings_t; - -// Whole structure is just dumped to a binary file when settings are saved. -settings_t launchersettings; - -#define APPTITLE "Official Sonic Robo Blast 2 Launcher" -#define APPVERSION "v0.1" -#define APPAUTHOR "SSNTails" -#define APPCOMPANY "Sonic Team Junior" - -LRESULT CALLBACK MainProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); - -// -// RunSRB2 -// -// Runs SRB2 -// returns true if successful -// -BOOL RunSRB2(void) -{ - SHELLEXECUTEINFO lpExecInfo; - BOOL result; - char EXEName[1024]; - - memset(&lpExecInfo, 0, sizeof(SHELLEXECUTEINFO)); - - lpExecInfo.cbSize = sizeof(SHELLEXECUTEINFO); - - SendMessage(GetDlgItem(mainHWND, IDC_EXENAME), WM_GETTEXT, sizeof(EXEName), (LPARAM)(LPCSTR)EXEName); - lpExecInfo.lpFile = EXEName; - lpExecInfo.lpParameters = Arguments; - lpExecInfo.nShow = SW_SHOWNORMAL; - lpExecInfo.hwnd = mainHWND; - lpExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS; - lpExecInfo.lpVerb = "open"; - - result = ShellExecuteEx(&lpExecInfo); - - if(!result) - { - MessageBox(mainHWND, "Error starting the game!", "Error", MB_OK|MB_APPLMODAL|MB_ICONERROR); - return false; - } - - return true; -} - -// -// ChooseEXEName -// -// Provides a common dialog box -// for selecting the desired executable. -// -void ChooseEXEName(void) -{ - OPENFILENAME ofn; - char FileBuffer[256]; - - ZeroMemory(&ofn, sizeof(ofn)); - ofn.hwndOwner = NULL; - FileBuffer[0] = '\0'; - ofn.lpstrFilter = "Executable Files\0*.exe\0All Files\0*.*\0\0"; - ofn.lpstrInitialDir = NULL; - ofn.lpstrFile = FileBuffer; - ofn.lStructSize = sizeof(ofn); - ofn.nMaxFile = sizeof(FileBuffer); - ofn.nFilterIndex = 1; - ofn.lpstrFileTitle = NULL; - ofn.nMaxFileTitle = 0; - ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY; - - if(GetOpenFileName(&ofn)) - { - SendMessage(GetDlgItem(mainHWND, IDC_EXENAME), WM_SETTEXT, 0, (LPARAM)(LPCSTR)FileBuffer); - strcpy(launchersettings.EXEName, FileBuffer); - } -} - -// -// ChooseConfigName -// -// Provides a common dialog box -// for selecting the desired cfg file. -// -void ChooseConfigName(void) -{ - OPENFILENAME ofn; - char FileBuffer[256]; - - ZeroMemory(&ofn, sizeof(ofn)); - ofn.hwndOwner = NULL; - FileBuffer[0] = '\0'; - ofn.lpstrFilter = "Config Files\0*.cfg\0All Files\0*.*\0\0"; - ofn.lpstrInitialDir = NULL; - ofn.lpstrFile = FileBuffer; - ofn.lStructSize = sizeof(ofn); - ofn.nMaxFile = sizeof(FileBuffer); - ofn.nFilterIndex = 1; - ofn.lpstrFileTitle = NULL; - ofn.nMaxFileTitle = 0; - ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY; - - if(GetOpenFileName(&ofn)) - { - SendMessage(GetDlgItem(mainHWND, IDC_CONFIGFILE), WM_SETTEXT, 0, (LPARAM)(LPCSTR)FileBuffer); - strcpy(launchersettings.ConfigFile, FileBuffer); - } -} - -// -// Add External File -// -// Provides a common dialog box -// for adding an external file. -// -void AddExternalFile(void) -{ - OPENFILENAME ofn; - char FileBuffer[256]; - - ZeroMemory(&ofn, sizeof(ofn)); - ofn.hwndOwner = NULL; - FileBuffer[0] = '\0'; - ofn.lpstrFilter = "WAD/SOC Files\0*.soc;*.wad\0All Files\0*.*\0\0"; - ofn.lpstrInitialDir = NULL; - ofn.lpstrFile = FileBuffer; - ofn.lStructSize = sizeof(ofn); - ofn.nMaxFile = sizeof(FileBuffer); - ofn.nFilterIndex = 1; - ofn.lpstrFileTitle = NULL; - ofn.nMaxFileTitle = 0; - ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY; - - if(GetOpenFileName(&ofn) && SendMessage(GetDlgItem(mainHWND, IDC_EXTFILECOMBO), CB_FINDSTRING, -1, (LPARAM)(LPCSTR)FileBuffer) == CB_ERR) - SendMessage(GetDlgItem(mainHWND, IDC_EXTFILECOMBO), CB_ADDSTRING, 0, (LPARAM)(LPCSTR)FileBuffer); -} - -// -// CompileArguments -// -// Go through ALL of the settings -// and put them into a parameter -// string. Yikes! -// -void CompileArguments(void) -{ - HWND temp; - int numitems; - int i; - - // Clear out the arguments, if any existed. - memset(Arguments, 0, sizeof(Arguments)); - - - // WAD/SOC Files Added - temp = GetDlgItem(mainHWND, IDC_EXTFILECOMBO); - - if ((numitems = SendMessage(temp, CB_GETCOUNT, 0, 0)) > 0) - { - char tempbuffer[1024]; - - strcpy(Arguments, "-file "); - - for (i = 0; i < numitems; i++) - { - SendMessage(temp, CB_GETLBTEXT, i, (LPARAM)(LPCSTR)tempbuffer); - strcat(Arguments, tempbuffer); - strcat(Arguments, " "); - } - } - - // Manual Parameters - temp = GetDlgItem(mainHWND, IDC_PARAMETERS); - - if (SendMessage(temp, WM_GETTEXTLENGTH, 0, 0) > 0) - { - char tempbuffer[8192]; - - SendMessage(temp, WM_GETTEXT, 8192, (LPARAM)(LPCSTR)tempbuffer); - - strcat(Arguments, tempbuffer); - } -} - -// -// GetConfigVariable -// -// Pulls a value out of the chosen -// config.cfg and places it into the -// string supplied in 'dest' -// -BOOL GetConfigVariable(char* varname, char* dest) -{ - FILE* f; - int size = 0; - char* buffer; - char* posWeWant; - char* stringstart; - char varnamecpy[256]; - - varnamecpy[0] = '\n'; - - strncpy(varnamecpy+1, varname, 255); - - if(!(f = fopen(launchersettings.ConfigFile, "rb"))) - return false; // Oops! - - // Get file size - while(!feof(f)) - { - size++; - fgetc(f); - } - - fseek(f, 0, SEEK_SET); - - buffer = (char*)malloc(size); - - fread(buffer, size, 1, f); - fclose(f); - - posWeWant = strstr(buffer, varname); - - if(posWeWant == NULL) - { - free(buffer); - return false; - } - - posWeWant++; - - // We are now at the line we want. - // Get the variable from it - - while(*posWeWant != '\"') posWeWant++; - - posWeWant++; - - stringstart = posWeWant; - - while(*posWeWant != '\"') posWeWant++; - - *posWeWant = '\0'; - - strcpy(dest, stringstart); - - free(buffer); - - // Phew! - return true; -} - -SOCKET ConnectSocket(char* IPAddress, int portnumber) -{ - DWORD dwDestAddr; - SOCKADDR_IN sockAddrDest; - SOCKET sockDest; - - // Create socket - sockDest = socket(AF_INET, SOCK_STREAM, 0); - - if(sockDest == SOCKET_ERROR) - { -// printf("Could not create socket: %d\n", WSAGetLastError()); - return INVALID_SOCKET; - } - - // Convert address to in_addr (binary) format - dwDestAddr = inet_addr(IPAddress); - - if(dwDestAddr == INADDR_NONE) - { - // It's not a xxx.xxx.xxx.xxx IP, so resolve through DNS - struct hostent* pHE = gethostbyname(IPAddress); - if(pHE == 0) - { -// printf("Unable to resolve address.\n"); - return INVALID_SOCKET; - } - - dwDestAddr = *((u_long*)pHE->h_addr_list[0]); - } - - // Initialize SOCKADDR_IN with IP address, port number and address family - memcpy(&sockAddrDest.sin_addr, &dwDestAddr, sizeof(DWORD)); - - sockAddrDest.sin_port = htons(portnumber); - sockAddrDest.sin_family = AF_INET; - - // Attempt to connect to server - if(connect(sockDest, (LPSOCKADDR)&sockAddrDest, sizeof(sockAddrDest)) == SOCKET_ERROR) - { -// printf("Could not connect to server socket: %d\n", WSAGetLastError()); - closesocket(sockDest); - return INVALID_SOCKET; - } - - return sockDest; -} - -// -// MS_Write(): -// -static int MS_Write(msg_t *msg, SOCKET socket) -{ -#ifdef NONET - msg = NULL; - return MS_WRITE_ERROR; -#else - int len; - - if (msg->length < 0) - msg->length = (long)strlen(msg->buffer); - len = msg->length + HEADER_SIZE; - - msg->type = htonl(msg->type); - msg->length = htonl(msg->length); - - if (send(socket, (char *)msg, len, 0) != len) - return MS_WRITE_ERROR; - return 0; -#endif -} - -// -// MS_Read(): -// -static int MS_Read(msg_t *msg, SOCKET socket) -{ -#ifdef NONET - msg = NULL; - return MS_READ_ERROR; -#else - if (recv(socket, (char *)msg, HEADER_SIZE, 0) != HEADER_SIZE) - return MS_READ_ERROR; - - msg->type = ntohl(msg->type); - msg->length = ntohl(msg->length); - - if (!msg->length) // fix a bug in Windows 2000 - return 0; - - if (recv(socket, (char *)msg->buffer, msg->length, 0) != msg->length) - return MS_READ_ERROR; - return 0; -#endif -} - -/** Gets a list of game servers from the master server. - */ -static inline int GetServersList(SOCKET socket) -{ - msg_t msg; - int count = 0; - - msg.type = GET_SERVER_MSG; - msg.length = 0; - if (MS_Write(&msg, socket) < 0) - return MS_WRITE_ERROR; - - while (MS_Read(&msg, socket) >= 0) - { - if (!msg.length) - { -// if (!count) -// printf("No server currently running.\n"); - return MS_NO_ERROR; - } - count++; - printf(msg.buffer); - } - - return MS_READ_ERROR; -} - -// -// RunSocketStuff -// -// Thread that checks the masterserver for new games. -void RunSocketStuff(HWND hListView) -{ - WSADATA wsaData; - SOCKET sock; - int i = 0; - char ServerAddressAndPort[256]; - char Address[256]; - char Port[8]; - - if(!GetConfigVariable("masterserver", ServerAddressAndPort)) // srb2.servegame.org:28900 - { - ServerlistThread = NULL; - return; - } - - strcpy(Address, ServerAddressAndPort); - - for(i = 0; i < (signed)strlen(Address); i++) - { - if(Address[i] == ':') - { - Address[i] = '\0'; - break; - } - } - - for(i = 0; i < (signed)strlen(ServerAddressAndPort); i++) - { - if(ServerAddressAndPort[i] == ':') - { - strcpy(Port, &ServerAddressAndPort[i+1]); - break; - } - } - - // Address now contains the hostname or IP - // Port now contains the port number - - - // Initialize WinSock - if(WSAStartup(MAKEWORD(1, 1), &wsaData) != 0) - { -// printf("Could not initialize sockets.\n"); - ServerlistThread = NULL; - return; - } - - // Create socket and connect to server - sock = ConnectSocket(/*IPAddress*/0, /*PortNumber*/0); - if(sock == INVALID_SOCKET) - { -// printf("Socket Error: %d\n", WSAGetLastError()); - ServerlistThread = NULL; - return; - } - - // We're connected! - // Now get information from server - - - // Add games to listview box. - ListView_DeleteAllItems(hListView); - -/* - while (MoreServersStillExist) - { - GetTheNextServerInformation(); - AddItemToList(hListView, servername, ping, players, gametype, level); - } -*/ - - // close socket - closesocket(sock); - - // Clean up WinSock - if(WSACleanup() == SOCKET_ERROR) - { -// printf("Could not cleanup sockets: %d\n", WSAGetLastError()); - ServerlistThread = NULL; - return; - } - - printf("Winsock thread terminated successfully.\n"); - ServerlistThread = NULL; - - return; -} - -BOOL GetGameList(HWND hListView) -{ - DWORD dwThreadID; - ServerlistThread = CreateThread( NULL, // default security - 0, // default stack - (LPTHREAD_START_ROUTINE)(void*)RunSocketStuff, // thread function - hListView, // arguments - 0, // default flags - &dwThreadID); // don't need this, but it makes it happy (and compatible with old Win32 OSes) - - if(ServerlistThread == NULL) - return false; - - return true; -} - -void RegisterDialogClass(char* name, WNDPROC callback) -{ - WNDCLASS wnd; - - wnd.style = CS_HREDRAW | CS_VREDRAW; - wnd.cbWndExtra = DLGWINDOWEXTRA; - wnd.cbClsExtra = 0; - wnd.hCursor = LoadCursor(NULL,MAKEINTRESOURCE(IDC_ARROW)); - wnd.hIcon = LoadIcon(NULL,MAKEINTRESOURCE(IDI_ICON1)); - wnd.hInstance = g_hInst; - wnd.lpfnWndProc = callback; - wnd.lpszClassName = name; - wnd.lpszMenuName = NULL; - wnd.hbrBackground = (HBRUSH)(COLOR_WINDOW); - - if(!RegisterClass(&wnd)) - { - return; - } -} - -int APIENTRY WinMain(HINSTANCE hInstance, - HINSTANCE hPrevInstance, - LPSTR lpCmdLine, - int nCmdShow) -{ - // Prevent multiples instances of this app. - CreateMutex(NULL, true, APPTITLE); - - if(GetLastError() == ERROR_ALREADY_EXISTS) - return 0; - - g_hInst = hInstance; - - RegisterDialogClass("SRB2Launcher", MainProc); - - DialogBox(g_hInst, (LPCSTR)IDD_MAIN, NULL, (DLGPROC)MainProc); - - return 0; -} - -// -// InitHostOptionsComboBoxes -// -// Does what it says. -// -void InitHostOptionsComboBoxes(HWND hwnd) -{ - HWND ctrl; - - ctrl = GetDlgItem(hwnd, IDC_MATCHBOXES); - - if(ctrl) - { - SendMessage(ctrl, CB_ADDSTRING, 0, (LPARAM)(LPCSTR)"Normal (Default)"); - SendMessage(ctrl, CB_ADDSTRING, 0, (LPARAM)(LPCSTR)"Random"); - SendMessage(ctrl, CB_ADDSTRING, 0, (LPARAM)(LPCSTR)"Non-Random"); - SendMessage(ctrl, CB_ADDSTRING, 0, (LPARAM)(LPCSTR)"None"); - } - - ctrl = GetDlgItem(hwnd, IDC_RACEITEMBOXES); - - if(ctrl) - { - SendMessage(ctrl, CB_ADDSTRING, 0, (LPARAM)(LPCSTR)"Normal (Default)"); - SendMessage(ctrl, CB_ADDSTRING, 0, (LPARAM)(LPCSTR)"Random"); - SendMessage(ctrl, CB_ADDSTRING, 0, (LPARAM)(LPCSTR)"Teleports"); - SendMessage(ctrl, CB_ADDSTRING, 0, (LPARAM)(LPCSTR)"None"); - } - - ctrl = GetDlgItem(hwnd, IDC_MATCH_SCORING); - - if(ctrl) - { - SendMessage(ctrl, CB_ADDSTRING, 0, (LPARAM)(LPCSTR)"Normal (Default)"); - SendMessage(ctrl, CB_ADDSTRING, 0, (LPARAM)(LPCSTR)"Classic"); - } -} - -LRESULT CALLBACK MatchOptionsDlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) -{ - switch(message) - { - case WM_INITDIALOG: - InitHostOptionsComboBoxes(hwnd); - break; - - case WM_DESTROY: - EndDialog(hwnd, LOWORD(wParam)); - break; - - case WM_COMMAND: - { - switch(LOWORD(wParam)) - { - case 2: - PostMessage(hwnd, WM_DESTROY, 0, 0); - break; - default: - break; - } - - break; - } - } - - return 0; -} - -LRESULT CALLBACK RaceOptionsDlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) -{ - switch(message) - { - case WM_INITDIALOG: - InitHostOptionsComboBoxes(hwnd); - break; - - case WM_DESTROY: - EndDialog(hwnd, LOWORD(wParam)); - break; - - case WM_COMMAND: - { - switch(LOWORD(wParam)) - { - case 2: - PostMessage(hwnd, WM_DESTROY, 0, 0); - break; - default: - break; - } - - break; - } - } - - return 0; -} - -LRESULT CALLBACK TagOptionsDlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) -{ - switch(message) - { - case WM_INITDIALOG: - InitHostOptionsComboBoxes(hwnd); - break; - - case WM_DESTROY: - EndDialog(hwnd, LOWORD(wParam)); - break; - - case WM_COMMAND: - { - switch(LOWORD(wParam)) - { - case 2: - PostMessage(hwnd, WM_DESTROY, 0, 0); - break; - default: - break; - } - - break; - } - } - - return 0; -} - -LRESULT CALLBACK CTFOptionsDlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) -{ - switch(message) - { - case WM_INITDIALOG: - InitHostOptionsComboBoxes(hwnd); - break; - - case WM_DESTROY: - EndDialog(hwnd, LOWORD(wParam)); - break; - - case WM_COMMAND: - { - switch(LOWORD(wParam)) - { - case 2: - PostMessage(hwnd, WM_DESTROY, 0, 0); - break; - default: - break; - } - - break; - } - } - - return 0; -} - -LRESULT CALLBACK HostProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) -{ - HWND temp; - - switch(message) - { - case WM_INITDIALOG: - hostHWND = hwnd; - - temp = GetDlgItem(hwnd, IDC_ADVANCEMAP); - SendMessage(temp, CB_ADDSTRING, 0, (LPARAM)(LPCSTR)"Off"); - SendMessage(temp, CB_ADDSTRING, 0, (LPARAM)(LPCSTR)"Next (Default)"); - SendMessage(temp, CB_ADDSTRING, 0, (LPARAM)(LPCSTR)"Random"); - - temp = GetDlgItem(hwnd, IDC_GAMETYPE); - SendMessage(temp, CB_ADDSTRING, 0, (LPARAM)(LPCSTR)"Coop"); - SendMessage(temp, CB_ADDSTRING, 0, (LPARAM)(LPCSTR)"Match"); - SendMessage(temp, CB_ADDSTRING, 0, (LPARAM)(LPCSTR)"Team Match"); - SendMessage(temp, CB_ADDSTRING, 0, (LPARAM)(LPCSTR)"Race"); - SendMessage(temp, CB_ADDSTRING, 0, (LPARAM)(LPCSTR)"Time-Only Race"); - SendMessage(temp, CB_ADDSTRING, 0, (LPARAM)(LPCSTR)"Tag"); - SendMessage(temp, CB_ADDSTRING, 0, (LPARAM)(LPCSTR)"CTF"); - - break; - - case WM_CREATE: - { - - break; - } - - case WM_DESTROY: - { - hostHWND = NULL; - EndDialog(hwnd, LOWORD(wParam)); - break; - } - - case WM_COMMAND: - { - switch(LOWORD(wParam)) - { - case 2: - PostMessage(hwnd, WM_DESTROY, 0, 0); - break; - case IDC_OPTIONS: - { - int gametype; - int dialognum; - DLGPROC callbackfunc; - - // Grab the current gametype from the IDC_GAMETYPE - // combo box and then display the appropriate - // options dialog. - temp = GetDlgItem(hostHWND, IDC_GAMETYPE); - switch(SendMessage(temp, CB_GETCURSEL, 0, 0)) - { - case 0: - gametype = 0; - break; - case 1: - gametype = 1; - break; - case 2: - gametype = 1; - break; - case 3: - gametype = 2; - break; - case 4: - gametype = 2; - break; - case 5: - gametype = 3; - break; - case 6: - gametype = 4; - break; - } - - switch(gametype) - { - case 1: - dialognum = IDD_MATCHOPTIONS; - callbackfunc = (DLGPROC)MatchOptionsDlgProc; - break; - case 2: - dialognum = IDD_RACEOPTIONS; - callbackfunc = (DLGPROC)RaceOptionsDlgProc; - break; - case 3: - dialognum = IDD_TAGOPTIONS; - callbackfunc = (DLGPROC)TagOptionsDlgProc; - break; - case 4: - dialognum = IDD_CTFOPTIONS; - callbackfunc = (DLGPROC)CTFOptionsDlgProc; - break; - case 0: - default: // ??? - dialognum = 0; - callbackfunc = NULL; - MessageBox(hostHWND, "This gametype does not have any additional options.", "Not Available", MB_OK|MB_APPLMODAL); - break; - } - - if(dialognum) - DialogBox(g_hInst, (LPCSTR)dialognum, hostHWND, callbackfunc); - } - break; - default: - break; - } - - break; - } - - case WM_PAINT: - { - break; - } - } - - return 0; -} - -// -// AddItemToList -// -// Adds a game to the list view. -// -void AddItemToList(HWND hListView, char* servername, - char* ping, char* players, - char* gametype, char* level) -{ - LVITEM lvTest; - - lvTest.mask = LVIF_TEXT | LVIF_STATE; - - lvTest.pszText = servername; - lvTest.iIndent = 0; - lvTest.stateMask = 0; - lvTest.state = 0; - - lvTest.iSubItem = 0; - lvTest.iItem = ListView_InsertItem(hListView, &lvTest); - - ListView_SetItemText(hListView,lvTest.iItem,1,ping); - - ListView_SetItemText(hListView,lvTest.iItem,2,players); - - ListView_SetItemText(hListView,lvTest.iItem,3,gametype); - - ListView_SetItemText(hListView,lvTest.iItem,4,level); -} - -// -// InitJoinGameColumns -// -// Initializes the column headers on the listview control -// on the Join Game page. -// -void InitJoinGameColumns(HWND hDlg) -{ - HWND hItemList; - LVCOLUMN columns[10]; - int i = 0; - - //Create the columns in the list control - hItemList = GetDlgItem(hDlg, IDC_GAMELIST); - - columns[i].mask = LVCF_TEXT | LVCF_WIDTH; - columns[i].pszText = "Server Name"; - columns[i].cchTextMax = 256; - columns[i].cx = 120; - columns[i].fmt = LVCFMT_LEFT; - ListView_InsertColumn(hItemList, i, &columns[i]); - - i++; - - columns[i].mask = LVCF_TEXT | LVCF_WIDTH; - columns[i].pszText = "Ping"; - columns[i].cchTextMax = 256; - columns[i].cx = 80; - columns[i].fmt = LVCFMT_LEFT; - ListView_InsertColumn(hItemList, i, &columns[i]); - - i++; - - columns[i].mask = LVCF_TEXT | LVCF_WIDTH; - columns[i].pszText = "Players"; - columns[i].cchTextMax = 256; - columns[i].cx = 80; - columns[i].fmt = LVCFMT_LEFT; - ListView_InsertColumn(hItemList, i, &columns[i]); - - i++; - - columns[i].mask = LVCF_TEXT | LVCF_WIDTH; - columns[i].pszText = "Game Type"; - columns[i].cchTextMax = 256; - columns[i].cx = 80; - columns[i].fmt = LVCFMT_LEFT; - ListView_InsertColumn(hItemList, i, &columns[i]); - - i++; - - columns[i].mask = LVCF_TEXT | LVCF_WIDTH; - columns[i].pszText = "Level"; - columns[i].cchTextMax = 256; - columns[i].cx = 120; - columns[i].fmt = LVCFMT_LEFT; - ListView_InsertColumn(hItemList, i, &columns[i]); -} - -LRESULT CALLBACK JoinProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) -{ - switch(message) - { - case WM_INITDIALOG: - joinHWND = hwnd; - InitJoinGameColumns(hwnd); - // Start server listing thread - // and grab game list. - GetGameList(GetDlgItem(hwnd, IDC_GAMELIST)); - break; - - case WM_DESTROY: - joinHWND = NULL; - // Terminate server listing thread. - EndDialog(hwnd, LOWORD(wParam)); - break; - - case WM_COMMAND: - { - switch(LOWORD(wParam)) - { - case 2: - PostMessage(hwnd, WM_DESTROY, 0, 0); - break; - case IDC_SEARCHGAMES: - if(ServerlistThread == NULL) - GetGameList(GetDlgItem(hwnd, IDC_GAMELIST)); - break; - default: - break; - } - - break; - } - - case WM_PAINT: - { - break; - } - } - - return 0; -} - -void InitializeDefaults(void) -{ - memset(&launchersettings, 0, sizeof(launchersettings)); - strcpy(launchersettings.EXEName, "srb2win.exe"); - strcpy(launchersettings.ConfigFile, "config.cfg"); -} - -LRESULT CALLBACK MainProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) -{ - HWND temp; - - switch(message) - { - case WM_INITDIALOG: - mainHWND = hwnd; - InitializeDefaults(); - SendMessage(GetDlgItem(hwnd, IDC_EXENAME), WM_SETTEXT, 0, (LPARAM)(LPCSTR)launchersettings.EXEName); - SendMessage(GetDlgItem(hwnd, IDC_CONFIGFILE), WM_SETTEXT, 0, (LPARAM)(LPCSTR)launchersettings.ConfigFile); - break; - - case WM_CREATE: - { - - break; - } - - case WM_DESTROY: - { - PostQuitMessage(0); - break; - } - - case WM_COMMAND: - { - switch(LOWORD(wParam)) - { - case 2: - PostMessage(hwnd, WM_DESTROY, 0, 0); - break; - case IDC_ABOUT: // The About button. - sprintf(TempString, "%s %s by %s - %s", APPTITLE, APPVERSION, APPAUTHOR, APPCOMPANY); - MessageBox(mainHWND, TempString, "About", MB_OK|MB_APPLMODAL); - break; - case IDC_FINDEXENAME: - ChooseEXEName(); - break; - case IDC_FINDCONFIGNAME: - ChooseConfigName(); - break; - case IDC_ADDFILE: - AddExternalFile(); - break; - case IDC_REMOVEFILE: - temp = GetDlgItem(mainHWND, IDC_EXTFILECOMBO); - SendMessage(temp, CB_DELETESTRING, SendMessage(temp, CB_GETCURSEL, 0, 0), 0); - break; - case IDC_HOSTGAME: - DialogBox(g_hInst, (LPCSTR)IDD_HOSTGAME, mainHWND, (DLGPROC)HostProc); - break; - case IDC_JOINGAME: - DialogBox(g_hInst, (LPCSTR)IDD_JOINGAME, mainHWND, (DLGPROC)JoinProc); - break; - case IDC_GO: - CompileArguments(); - RunSRB2(); - break; - default: - break; - } - - break; - } - - case WM_PAINT: - { - break; - } - } - - return 0; -} - diff --git a/tools/SRB2Launcher/SRB2Launcher.dsp b/tools/SRB2Launcher/SRB2Launcher.dsp deleted file mode 100644 index 386dc301c..000000000 --- a/tools/SRB2Launcher/SRB2Launcher.dsp +++ /dev/null @@ -1,144 +0,0 @@ -# Microsoft Developer Studio Project File - Name="SRB2Launcher" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Application" 0x0101 - -CFG=SRB2Launcher - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "SRB2Launcher.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "SRB2Launcher.mak" CFG="SRB2Launcher - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "SRB2Launcher - Win32 Release" (based on "Win32 (x86) Application") -!MESSAGE "SRB2Launcher - Win32 Debug" (based on "Win32 (x86) Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "SRB2Launcher - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /Yu"stdafx.h" /FD /c -# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /Yu"stdafx.h" /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:windows /machine:I386 - -!ELSEIF "$(CFG)" == "SRB2Launcher - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c -# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "SRB2Launcher - Win32 Release" -# Name "SRB2Launcher - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\SRB2Launcher.cpp -# End Source File -# Begin Source File - -SOURCE=.\StdAfx.cpp -# ADD CPP /Yc"stdafx.h" -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\lilsocklib.h -# End Source File -# Begin Source File - -SOURCE=.\resource.h -# End Source File -# Begin Source File - -SOURCE=.\SRB2Launcher.h -# End Source File -# Begin Source File - -SOURCE=.\StdAfx.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# Begin Source File - -SOURCE=.\bitmap1.bmp -# End Source File -# Begin Source File - -SOURCE=.\icon1.ico -# End Source File -# Begin Source File - -SOURCE=.\Script1.rc -# End Source File -# End Group -# Begin Source File - -SOURCE=.\ReadMe.txt -# End Source File -# End Target -# End Project diff --git a/tools/SRB2Launcher/SRB2Launcher.dsw b/tools/SRB2Launcher/SRB2Launcher.dsw deleted file mode 100644 index b716faced..000000000 --- a/tools/SRB2Launcher/SRB2Launcher.dsw +++ /dev/null @@ -1,29 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "SRB2Launcher"=.\SRB2Launcher.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/tools/SRB2Launcher/SRB2Launcher.h b/tools/SRB2Launcher/SRB2Launcher.h deleted file mode 100644 index 3b9049f82..000000000 --- a/tools/SRB2Launcher/SRB2Launcher.h +++ /dev/null @@ -1,8 +0,0 @@ -extern char TempString[256]; -extern char EXEName[1024]; -extern char Arguments[16384]; - -#define APPTITLE "Official Sonic Robo Blast 2 Launcher" -#define APPVERSION "v0.1" -#define APPAUTHOR "SSNTails" -#define APPCOMPANY "Sonic Team Junior" diff --git a/tools/SRB2Launcher/Script1.rc b/tools/SRB2Launcher/Script1.rc deleted file mode 100644 index 1a27c0414..000000000 --- a/tools/SRB2Launcher/Script1.rc +++ /dev/null @@ -1,355 +0,0 @@ -//Microsoft Developer Studio generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "afxres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_MAIN DIALOG DISCARDABLE 0, 0, 272, 226 -STYLE DS_3DLOOK | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | - WS_SYSMENU -CAPTION "Official Sonic Robo Blast 2 Launcher v0.1" -FONT 8, "MS Sans Serif" -BEGIN - COMBOBOX IDC_LAUNCHCONFIG,125,15,135,155,CBS_DROPDOWNLIST | - CBS_SORT | WS_VSCROLL | WS_TABSTOP - GROUPBOX "Saved Launch Configuration",IDC_STATIC,120,5,145,45 - GROUPBOX "WAD/SOC Files",IDC_STATIC,120,55,145,45 - COMBOBOX IDC_EXTFILECOMBO,125,65,135,95,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - CONTROL 102,IDC_STATIC,"Static",SS_BITMAP,5,90,107,79 - PUSHBUTTON "&About",IDC_ABOUT,125,210,25,10 - DEFPUSHBUTTON "&Go!",IDC_GO,60,150,50,14 - PUSHBUTTON "Add",IDC_ADDFILE,225,80,35,15 - PUSHBUTTON "Remove",IDC_REMOVEFILE,185,80,35,15 - PUSHBUTTON "Save",IDC_SAVELAUNCHCFG,220,30,40,15 - GROUPBOX "Multiplayer",IDC_STATIC,5,5,105,50 - PUSHBUTTON "&Join A Game",IDC_JOINGAME,10,15,50,15 - PUSHBUTTON "&Host A Game",IDC_HOSTGAME,55,35,50,15 - EDITTEXT IDC_PARAMETERS,160,190,105,30,ES_MULTILINE | - ES_AUTOVSCROLL | WS_VSCROLL - RTEXT "Manual Parameters:",IDC_STATIC,115,190,40,15 - GROUPBOX "Executable Name",IDC_STATIC,120,105,145,50 - EDITTEXT IDC_EXENAME,125,115,95,12,ES_AUTOHSCROLL - PUSHBUTTON "Choose...",IDC_FINDEXENAME,225,115,35,10 - PUSHBUTTON "General &Options",IDC_OPTIONS,55,60,50,20,BS_MULTILINE - EDITTEXT IDC_CONFIGFILE,125,140,95,12,ES_AUTOHSCROLL - LTEXT "Configuration File:",IDC_STATIC,125,130,60,10 - PUSHBUTTON "Choose...",IDC_FINDCONFIGNAME,225,140,35,10 - CONTROL "List1",IDC_LIST1,"SysListView32",WS_BORDER | WS_TABSTOP, - 20,180,85,40 -END - -IDD_JOINGAME DIALOG DISCARDABLE 0, 0, 367, 166 -STYLE DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_VISIBLE | WS_CAPTION | - WS_SYSMENU -CAPTION "Join Game" -FONT 8, "MS Sans Serif" -BEGIN - PUSHBUTTON "&Refresh List",IDC_SEARCHGAMES,5,140,55,20,BS_MULTILINE - CONTROL "List1",IDC_GAMELIST,"SysListView32",LVS_REPORT | - LVS_SINGLESEL | WS_BORDER | WS_TABSTOP,5,15,240,120 - EDITTEXT IDC_NAME,295,10,65,12,ES_AUTOHSCROLL - COMBOBOX IDC_COLOR,295,30,65,130,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - RTEXT "Name:",IDC_STATIC,265,10,25,10 - RTEXT "Color:",IDC_STATIC,265,30,25,10 - COMBOBOX IDC_SKIN,295,50,65,110,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - RTEXT "Character:",IDC_STATIC,255,50,35,10 - EDITTEXT IDC_ADDRESS,255,115,70,12,ES_AUTOHSCROLL - LTEXT "Manual Address:",IDC_STATIC,255,105,60,10 - CONTROL "Don't check server for files.",IDC_NOFILE,"Button", - BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,255,70,105, - 10 - DEFPUSHBUTTON "&Go!",IDC_JOINSTART,330,115,30,15 - LTEXT "Double-Click on a game to join:",IDC_STATIC,5,5,215,10 - CONTROL "Don't download files",IDC_NODOWNLOAD,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,255,90,105,10 -END - -IDD_HOSTGAME DIALOG DISCARDABLE 0, 0, 287, 156 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Host Game" -FONT 8, "MS Sans Serif" -BEGIN - GROUPBOX "Game Type",IDC_STATIC,5,5,110,65 - PUSHBUTTON "&Options...",IDC_OPTIONS,55,30,40,15 - COMBOBOX IDC_GAMETYPE,10,15,85,100,CBS_DROPDOWNLIST | WS_VSCROLL | - WS_TABSTOP - RTEXT "Max # of players:",IDC_STATIC,35,86,70,10 - EDITTEXT IDC_MAXPLAYERS,110,86,20,12,ES_AUTOHSCROLL - GROUPBOX "General Options",IDC_STATIC,5,75,275,75 - COMBOBOX IDC_STARTMAP,40,50,70,95,CBS_DROPDOWN | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - RTEXT "Start on map #:",IDC_STATIC,10,45,25,20 - CONTROL "Force players to use host's character",IDC_FORCESKIN, - "Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,140, - 85,135,10 - COMBOBOX IDC_ADVANCEMAP,45,105,85,50,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - RTEXT "Advance Stage:",IDC_STATIC,10,100,30,20 - CONTROL "Don't advertise server on Internet",IDC_INTERNETSERVER, - "Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,140, - 130,120,10 - RTEXT "Intermission Delay Between Levels (in seconds):", - IDC_STATIC,10,125,90,15 - EDITTEXT IDC_INTTIME,105,130,20,12,ES_AUTOHSCROLL | ES_NUMBER - CONTROL "Don't allow autoaim",IDC_DISABLEAUTOAIM,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,140,100,75,10 - CONTROL "Disable WAD/SOC Downloading",IDC_NODOWNLOAD,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,140,115,120,10 - PUSHBUTTON "Monitor &Toggles...",IDC_MONITORTOGGLES,125,45,40,20, - BS_MULTILINE -END - -IDD_MATCHOPTIONS DIALOG DISCARDABLE 0, 0, 142, 141 -STYLE DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_VISIBLE | WS_CAPTION | - WS_SYSMENU -CAPTION "Match Options" -FONT 8, "MS Sans Serif" -BEGIN - CONTROL "Don't use special ring weapons.",IDC_SPECIALRINGS, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,5,115,10 - RTEXT "Item Box Behavior:",IDC_STATIC,5,50,60,10 - EDITTEXT IDC_RESPAWNITEMTIME,115,70,20,12,ES_AUTOHSCROLL | - ES_NUMBER - COMBOBOX IDC_MATCHBOXES,70,50,65,65,CBS_DROPDOWN | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - RTEXT "Item Respawn Time (in seconds):",IDC_STATIC,5,70,105,10 - EDITTEXT IDC_TIMELIMIT,115,84,20,12,ES_AUTOHSCROLL | ES_NUMBER - RTEXT "Time Limit (in minutes):",IDC_STATIC,35,84,75,10 - RTEXT "Point Limit:",IDC_STATIC,70,100,40,10 - EDITTEXT IDC_POINTLIMIT,115,100,20,12,ES_AUTOHSCROLL | ES_NUMBER - CONTROL "Sudden Death Mode",IDC_SUDDENDEATH,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,15,20,80,10 - COMBOBOX IDC_MATCH_SCORING,70,35,65,65,CBS_DROPDOWNLIST | - CBS_SORT | WS_VSCROLL | WS_TABSTOP - RTEXT "Scoring Type:",IDC_STATIC,15,35,50,10 - PUSHBUTTON "Cance&l",IDC_CANCEL,100,120,35,15 - DEFPUSHBUTTON "O&K",IDC_OK,60,120,35,15 -END - -IDD_RACEOPTIONS DIALOG DISCARDABLE 0, 0, 142, 71 -STYLE DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_VISIBLE | WS_CAPTION | - WS_SYSMENU -CAPTION "Race Options" -FONT 8, "MS Sans Serif" -BEGIN - RTEXT "Item Box Behavior:",IDC_STATIC,5,10,60,10 - COMBOBOX IDC_RACEITEMBOXES,70,10,65,55,CBS_DROPDOWNLIST | - CBS_SORT | WS_VSCROLL | WS_TABSTOP - EDITTEXT IDC_NUMLAPS,115,30,20,12,ES_AUTOHSCROLL | ES_NUMBER - RTEXT "Number of Laps:",IDC_STATIC,55,30,55,10 - PUSHBUTTON "Cance&l",IDC_CANCEL,100,50,35,15 - DEFPUSHBUTTON "O&K",IDC_OK,60,50,35,15 -END - -IDD_CTFOPTIONS DIALOG DISCARDABLE 0, 0, 142, 126 -STYLE DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_VISIBLE | WS_CAPTION | - WS_SYSMENU -CAPTION "CTF Options" -FONT 8, "MS Sans Serif" -BEGIN - CONTROL "Don't use special ring weapons.",IDC_SPECIALRINGS, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,5,115,10 - RTEXT "Item Box Behavior:",IDC_STATIC,5,20,60,10 - COMBOBOX IDC_MATCHBOXES,70,20,65,60,CBS_DROPDOWNLIST | WS_VSCROLL | - WS_TABSTOP - RTEXT "Item Respawn Time (in seconds):",IDC_STATIC,5,40,105,10 - EDITTEXT IDC_RESPAWNITEMTIME,115,40,20,12,ES_AUTOHSCROLL | - ES_NUMBER - RTEXT "Time Limit (in minutes):",IDC_STATIC,35,70,75,10 - EDITTEXT IDC_TIMELIMIT,115,70,20,12,ES_AUTOHSCROLL | ES_NUMBER - RTEXT "Point Limit:",IDC_STATIC,70,86,40,10 - EDITTEXT IDC_POINTLIMIT,115,86,20,12,ES_AUTOHSCROLL | ES_NUMBER - RTEXT "Flag Respawn Time (in seconds):",IDC_STATIC,5,55,105,10 - EDITTEXT IDC_FLAGTIME,115,55,20,12,ES_AUTOHSCROLL | ES_NUMBER - PUSHBUTTON "Cance&l",IDC_CANCEL,100,105,35,15 - DEFPUSHBUTTON "O&K",IDC_OK,60,105,35,15 -END - -IDD_TAGOPTIONS DIALOG DISCARDABLE 0, 0, 142, 111 -STYLE DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_VISIBLE | WS_CAPTION | - WS_SYSMENU -CAPTION "Tag Options" -FONT 8, "MS Sans Serif" -BEGIN - CONTROL "Don't use special ring weapons.",IDC_SPECIALRINGS, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,5,115,10 - COMBOBOX IDC_MATCHBOXES,70,20,65,60,CBS_DROPDOWNLIST | WS_VSCROLL | - WS_TABSTOP - RTEXT "Item Box Behavior:",IDC_STATIC,5,20,60,10 - DEFPUSHBUTTON "O&K",IDC_OK,60,90,35,15 - PUSHBUTTON "Cance&l",IDC_CANCEL,100,90,35,15 - RTEXT "Item Respawn Time (in seconds):",IDC_STATIC,5,40,105,10 - EDITTEXT IDC_RESPAWNITEMTIME,115,40,20,12,ES_AUTOHSCROLL | - ES_NUMBER - RTEXT "Time Limit (in minutes):",IDC_STATIC,35,55,75,10 - EDITTEXT IDC_TIMELIMIT,115,55,20,12,ES_AUTOHSCROLL | ES_NUMBER - RTEXT "Point Limit:",IDC_STATIC,70,70,40,10 - EDITTEXT IDC_POINTLIMIT,115,70,20,12,ES_AUTOHSCROLL | ES_NUMBER -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE -BEGIN - IDD_MAIN, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 265 - TOPMARGIN, 7 - BOTTOMMARGIN, 219 - END - - IDD_JOINGAME, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 360 - TOPMARGIN, 7 - BOTTOMMARGIN, 159 - END - - IDD_HOSTGAME, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 280 - TOPMARGIN, 7 - BOTTOMMARGIN, 149 - END - - IDD_MATCHOPTIONS, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 135 - TOPMARGIN, 7 - BOTTOMMARGIN, 134 - END - - IDD_RACEOPTIONS, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 135 - TOPMARGIN, 7 - BOTTOMMARGIN, 64 - END - - IDD_CTFOPTIONS, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 135 - TOPMARGIN, 7 - BOTTOMMARGIN, 119 - END - - IDD_TAGOPTIONS, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 135 - TOPMARGIN, 7 - BOTTOMMARGIN, 104 - END -END -#endif // APSTUDIO_INVOKED - - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE DISCARDABLE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#include ""afxres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Bitmap -// - -IDB_BITMAP1 BITMAP DISCARDABLE "bitmap1.bmp" - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_ICON1 ICON DISCARDABLE "icon1.ico" - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog Info -// - -IDD_JOINGAME DLGINIT -BEGIN - IDC_SKIN, 0x403, 6, 0 -0x6f53, 0x696e, 0x0063, - IDC_SKIN, 0x403, 6, 0 -0x6154, 0x6c69, 0x0073, - IDC_SKIN, 0x403, 9, 0 -0x6e4b, 0x6375, 0x6c6b, 0x7365, "\000" - 0 -END - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/tools/SRB2Launcher/StdAfx.cpp b/tools/SRB2Launcher/StdAfx.cpp deleted file mode 100644 index 444cafebf..000000000 --- a/tools/SRB2Launcher/StdAfx.cpp +++ /dev/null @@ -1,8 +0,0 @@ -// stdafx.cpp : source file that includes just the standard includes -// SRB2Launcher.pch will be the pre-compiled header -// stdafx.obj will contain the pre-compiled type information - -#include "stdafx.h" - -// TODO: reference any additional headers you need in STDAFX.H -// and not in this file diff --git a/tools/SRB2Launcher/StdAfx.h b/tools/SRB2Launcher/StdAfx.h deleted file mode 100644 index 549cbf9ee..000000000 --- a/tools/SRB2Launcher/StdAfx.h +++ /dev/null @@ -1,29 +0,0 @@ -// stdafx.h : include file for standard system include files, -// or project specific include files that are used frequently, but -// are changed infrequently -// - -#if !defined(AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_) -#define AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_ - -#if _MSC_VER > 1000 -#pragma once -#endif // _MSC_VER > 1000 - -#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers - -#include -#include -#include -#include -#include -#include "lilsocklib.h" -#include "resource.h" - - -// TODO: reference additional headers your program requires here - -//{{AFX_INSERT_LOCATION}} -// Microsoft Visual C++ will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_) diff --git a/tools/SRB2Launcher/bitmap1.bmp b/tools/SRB2Launcher/bitmap1.bmp deleted file mode 100644 index 01b7cecd9..000000000 Binary files a/tools/SRB2Launcher/bitmap1.bmp and /dev/null differ diff --git a/tools/SRB2Launcher/i_tcp.c b/tools/SRB2Launcher/i_tcp.c deleted file mode 100644 index 259b416d3..000000000 --- a/tools/SRB2Launcher/i_tcp.c +++ /dev/null @@ -1,57 +0,0 @@ -// Emacs style mode select -*- C++ -*- -//----------------------------------------------------------------------------- -// -// MSERV SDK -// -// Copyright (C) 1998-2000 by DooM Legacy Team. -// Adapted by Oogaland. -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// -// -// DESCRIPTION: -// TCP/IP stuff. -// -//----------------------------------------------------------------------------- - - - - -#include -#include - - -#include "launcher.h" -#include "mserv.h" //Hurdler: support master server - - - - -static int init_tcp_driver = 0; - - -void I_InitTcpDriver(void) -{ - if (!init_tcp_driver) - { -#ifdef __WIN32__ - WSADATA winsockdata; - if( WSAStartup(MAKEWORD(1,1),&winsockdata) ) - I_Error("No Tcp/Ip driver detected"); -#endif -#ifdef __DJGPP_ - if( !__lsck_init() ) - I_Error("No Tcp/Ip driver detected"); -#endif - init_tcp_driver = 1; - } -} diff --git a/tools/SRB2Launcher/i_tcp.h b/tools/SRB2Launcher/i_tcp.h deleted file mode 100644 index 9cd34f930..000000000 --- a/tools/SRB2Launcher/i_tcp.h +++ /dev/null @@ -1,34 +0,0 @@ -// Emacs style mode select -*- C++ -*- -//----------------------------------------------------------------------------- -// -// MSERV SDK -// -// Copyright (C) 1998-2000 by DooM Legacy Team. -// Adapted by Oogaland. -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// -// -// DESCRIPTION: -// Header file for the TCP/IP routines -// -//----------------------------------------------------------------------------- - - -#ifndef _I_TCP_H_ -#define _I_TCP_H_ - -extern int sock_port; - -void I_InitTcpDriver(void); - -#endif // !defined(_I_TCP_H_) diff --git a/tools/SRB2Launcher/icon1.ico b/tools/SRB2Launcher/icon1.ico deleted file mode 100644 index f54ce0d6a..000000000 Binary files a/tools/SRB2Launcher/icon1.ico and /dev/null differ diff --git a/tools/SRB2Launcher/launcher.c b/tools/SRB2Launcher/launcher.c deleted file mode 100644 index 4967a95cc..000000000 --- a/tools/SRB2Launcher/launcher.c +++ /dev/null @@ -1,19 +0,0 @@ -#include - -#include "launcher.h" - -int WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpvReserved) -{ - return TRUE; -} - - -void CONS_Printf(char *fmt, ...) -{ - MessageBox(NULL, fmt, "Master Server", 0); -} - -void I_Error (char *error, ...) -{ - MessageBox(NULL, error, "Master Server", MB_ICONERROR); -} diff --git a/tools/SRB2Launcher/launcher.h b/tools/SRB2Launcher/launcher.h deleted file mode 100644 index 12b10aad5..000000000 --- a/tools/SRB2Launcher/launcher.h +++ /dev/null @@ -1,34 +0,0 @@ -// Emacs style mode select -*- C++ -*- -//----------------------------------------------------------------------------- -// -// MSERV SDK -// -// Copyright (C) 1998-2000 by DooM Legacy Team. -// Adapted by Oogaland. -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// -// -// DESCRIPTION: -// Header file for the launcher routines -// -//----------------------------------------------------------------------------- - - -#ifndef _LAUNCHER_H_ -#define _LAUNCHER_H_ - - -void CONS_Printf(char *fmt, ...); -void I_Error (char *error, ...); - -#endif // !defined(_LAUNCHER_H_) diff --git a/tools/SRB2Launcher/lilsocklib.h b/tools/SRB2Launcher/lilsocklib.h deleted file mode 100644 index 232f3753a..000000000 --- a/tools/SRB2Launcher/lilsocklib.h +++ /dev/null @@ -1,52 +0,0 @@ -// Unlike lilsocklib.c, since this takes code from SRB2, -// it is under the GPL, rather than public domain. =( -// -#ifndef __LILSOCKLIB_H__ -#define __LILSOCKLIB_H__ - -#define SD_BOTH 0x02 - -#define PACKET_SIZE 1024 - -#define MS_NO_ERROR 0 -#define MS_SOCKET_ERROR -201 -#define MS_CONNECT_ERROR -203 -#define MS_WRITE_ERROR -210 -#define MS_READ_ERROR -211 -#define MS_CLOSE_ERROR -212 -#define MS_GETHOSTBYNAME_ERROR -220 -#define MS_GETHOSTNAME_ERROR -221 -#define MS_TIMEOUT_ERROR -231 - -// see master server code for the values -#define ADD_SERVER_MSG 101 -#define REMOVE_SERVER_MSG 103 -#ifdef MASTERSERVERS12 -#define ADD_SERVERv2_MSG 104 -#endif -#define GET_SERVER_MSG 200 -#define GET_SHORT_SERVER_MSG 205 -#ifdef MASTERSERVERS12 -#define ASK_SERVER_MSG 206 -#define ANSWER_ASK_SERVER_MSG 207 -#endif - -#define HEADER_SIZE ((long)sizeof (long)*3) - -#define HEADER_MSG_POS 0 -#define IP_MSG_POS 16 -#define PORT_MSG_POS 32 -#define HOSTNAME_MSG_POS 40 - -/** A message to be exchanged with the master server. - */ -typedef struct -{ - long id; ///< Unused? - long type; ///< Type of message. - long length; ///< Length of the message. - char buffer[PACKET_SIZE]; ///< Actual contents of the message. -} msg_t; - -SOCKET ConnectSocket(char* IPAddress); -#endif diff --git a/tools/SRB2Launcher/mserv.c b/tools/SRB2Launcher/mserv.c deleted file mode 100644 index 0dd00e2bb..000000000 --- a/tools/SRB2Launcher/mserv.c +++ /dev/null @@ -1,400 +0,0 @@ -// Emacs style mode select -*- C++ -*- -//----------------------------------------------------------------------------- -// -// MSERV SDK -// -// Copyright (C) 1998-2000 by DooM Legacy Team. -// Adapted by Oogaland. -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// -// -// DESCRIPTION: -// Commands used to communicate with the master server -// -//----------------------------------------------------------------------------- - - -#ifdef WIN32 -#include // socket(),... -#else -#include -#endif - - - - -#include "launcher.h" - -#include "mserv.h" -#include "i_tcp.h" - - - - - -// ================================ DEFINITIONS =============================== - -#define PACKET_SIZE 1024 - -#define MS_NO_ERROR 0 -#define MS_SOCKET_ERROR -201 -#define MS_CONNECT_ERROR -203 -#define MS_WRITE_ERROR -210 -#define MS_READ_ERROR -211 -#define MS_CLOSE_ERROR -212 -#define MS_GETHOSTBYNAME_ERROR -220 -#define MS_GETHOSTNAME_ERROR -221 -#define MS_TIMEOUT_ERROR -231 - -// see master server code for the values -#define GET_SERVER_MSG 200 - - -#define HEADER_SIZE ((long)sizeof(long)*3) - -#define HEADER_MSG_POS 0 -#define IP_MSG_POS 16 -#define PORT_MSG_POS 32 -#define HOSTNAME_MSG_POS 40 - -#ifndef SOCKET -#define SOCKET int -#endif - -typedef struct { - long id; - long type; - long length; - char buffer[PACKET_SIZE]; -} msg_t; - - -// win32 or djgpp -#if defined( WIN32) || defined( __DJGPP__ ) -#define ioctl ioctlsocket -#define close closesocket -#endif - -#if defined( WIN32) || defined( __OS2__) -// it seems windows doesn't define that... maybe some other OS? OS/2 -int inet_aton(char *hostname, struct in_addr *addr) -{ - return ( (addr->s_addr=inet_addr(hostname)) != INADDR_NONE ); -} -#endif - - - -enum { MSCS_NONE, MSCS_WAITING, MSCS_REGISTERED, MSCS_FAILED } con_state = MSCS_NONE; - - -static SOCKET socket_fd = -1; // TCP/IP socket -static struct sockaddr_in addr; -static struct timeval select_timeout; -static fd_set wset; - -int MS_Connect(char *ip_addr, char *str_port, int async); -static int MS_Read(msg_t *msg); -static int MS_Write(msg_t *msg); -static int MS_GetIP(char *); - -void ExtractServerInfo(char *serverout, struct SERVERLIST *serverlist); - - - - - - - - - - -void CloseConnection(void) -{ - if(socket_fd > 0) close(socket_fd); - socket_fd = -1; -} - - - - -/* -** MS_GetIP() -*/ -static int MS_GetIP(char *hostname) -{ - struct hostent *host_ent; - - if (!inet_aton(hostname, &addr.sin_addr)) { - //TODO: only when we are connected to Internet, or use a non bloking call - host_ent = gethostbyname(hostname); - if (host_ent==NULL) - return MS_GETHOSTBYNAME_ERROR; - memcpy(&addr.sin_addr, host_ent->h_addr_list[0], sizeof(struct in_addr)); - } - return 0; -} - - - - - - -/* -** MS_Connect() -*/ -int MS_Connect(char *ip_addr, char *str_port, int async) -{ - memset(&addr, 0, sizeof(addr)); - addr.sin_family = AF_INET; - I_InitTcpDriver(); // this is done only if not already done - - if ((socket_fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) - return MS_SOCKET_ERROR; - - if (MS_GetIP(ip_addr)==MS_GETHOSTBYNAME_ERROR) - return MS_GETHOSTBYNAME_ERROR; - addr.sin_port = htons((u_short)atoi(str_port)); - - if (async) // do asynchronous connection - { - int res = 1; - - ioctl(socket_fd, FIONBIO, &res); - res = connect(socket_fd, (struct sockaddr *) &addr, sizeof(addr)); - if (res < 0) - { - // humm, on win32 it doesn't work with EINPROGRESS (stupid windows) - if (WSAGetLastError() != WSAEWOULDBLOCK) - { - con_state = MSCS_FAILED; - CloseConnection(); - return MS_CONNECT_ERROR; - } - } - con_state = MSCS_WAITING; - FD_ZERO(&wset); - FD_SET(socket_fd, &wset); - select_timeout.tv_sec = 0, select_timeout.tv_usec = 0; - } - else - { - if (connect(socket_fd, (struct sockaddr *) &addr, sizeof(addr)) < 0) - return MS_CONNECT_ERROR; - } - - return 0; -} - - - - - - -/* - * MS_Write(): - */ -static int MS_Write(msg_t *msg) -{ - int len; - - if (msg->length < 0) - msg->length = strlen(msg->buffer); - len = msg->length+HEADER_SIZE; - - //msg->id = htonl(msg->id); - msg->type = htonl(msg->type); - msg->length = htonl(msg->length); - - if (send(socket_fd, (char*)msg, len, 0) != len) - return MS_WRITE_ERROR; - - return 0; -} - - - - - - -/* - * MS_Read(): - */ -static int MS_Read(msg_t *msg) -{ - if (recv(socket_fd, (char*)msg, HEADER_SIZE, 0) != HEADER_SIZE) - return MS_READ_ERROR; - - msg->type = ntohl(msg->type); - msg->length = ntohl(msg->length); - - if (!msg->length) //Hurdler: fix a bug in Windows 2000 - return 0; - - if (recv(socket_fd, (char*)msg->buffer, msg->length, 0) != msg->length) - return MS_READ_ERROR; - - return 0; -} - - - - - - - - -/***************************************************************************/ - - - - - - - - - -/* GetServerListEx */ -EXPORT int __stdcall GetServerListEx(char *host, char *str_port, struct SERVERLIST serverlist[], short max_servers) -{ - msg_t msg; - int count = 0; - - - /* Attempt to connect to list server. */ - MS_Connect(host, str_port, 0); - - /* Poll the list server. If it fails, depart with an error code of -1. */ - msg.type = GET_SERVER_MSG; - msg.length = 0; - if (MS_Write(&msg) < 0) - return -1; - - - - /* Get a description of each server in turn. */ - /* What we get is exactly the same as the output to the console when using LISTSERV. */ - while (MS_Read(&msg) >= 0) - { - if(msg.length == 0 || count >= max_servers) - { - CloseConnection(); - return count; - } - - ExtractServerInfo(msg.buffer, &serverlist[count]); - - count++; - } - - - CloseConnection(); - return -2; -} - - - - - - - - - - - -/* GetServerList */ -/* Warning: Large kludge follows! This function is only included for backwards-compatibility. */ -/* Use GetServerListVB or GetServerListEx instead. */ -EXPORT int __stdcall GetServerList(char *host, char *str_port, - - struct SERVERLIST *serverlist1,struct SERVERLIST *serverlist2,struct SERVERLIST *serverlist3, - struct SERVERLIST *serverlist4,struct SERVERLIST *serverlist5,struct SERVERLIST *serverlist6, - struct SERVERLIST *serverlist7,struct SERVERLIST *serverlist8,struct SERVERLIST *serverlist9, - struct SERVERLIST *serverlist10,struct SERVERLIST *serverlist11,struct SERVERLIST *serverlist12, - struct SERVERLIST *serverlist13,struct SERVERLIST *serverlist14,struct SERVERLIST *serverlist15, - struct SERVERLIST *serverlist16) -{ - msg_t msg; - int count = 0; - struct SERVERLIST *serverlist[16]; - - - /* Attempt to connect to list server. */ - MS_Connect(host, str_port, 0); - - /* Poll the list server. If it fails, bomb with an error code of -1. */ - msg.type = GET_SERVER_MSG; - msg.length = 0; - if (MS_Write(&msg) < 0) - return -1; - - serverlist[0] = serverlist1; - serverlist[1] = serverlist2; - serverlist[2] = serverlist3; - serverlist[3] = serverlist4; - serverlist[4] = serverlist5; - serverlist[5] = serverlist6; - serverlist[6] = serverlist7; - serverlist[7] = serverlist8; - serverlist[8] = serverlist9; - serverlist[9] = serverlist10; - serverlist[10] = serverlist11; - serverlist[11] = serverlist12; - serverlist[12] = serverlist13; - serverlist[13] = serverlist14; - serverlist[14] = serverlist15; - serverlist[15] = serverlist16; - - - - - while (MS_Read(&msg) >= 0 && count < 16) - { - if(msg.length == 0 || count >= 16) - { - CloseConnection(); - return count; - } - - ExtractServerInfo(msg.buffer, serverlist[count]); - - count++; - } - - - CloseConnection(); - - - return -2; -} - - - -void ExtractServerInfo(char *serverout, struct SERVERLIST *serverlist) -{ - char *lines[5]; - int i; - - i=0; - lines[0] = strtok(serverout, "\r\n"); - for(i=1; i<5; i++) - { - lines[i] = strtok(NULL, "\r\n"); - } - - strcpy(serverlist->ip, strstr(lines[0], ": ")+2); - strcpy(serverlist->port, strstr(lines[1], ": ")+2); - strcpy(serverlist->name, strstr(lines[2], ": ")+2); - strcpy(serverlist->version, strstr(lines[3], ": ")+2); - strcpy(serverlist->perm, strstr(lines[4], ": ")+2); -} diff --git a/tools/SRB2Launcher/mserv.h b/tools/SRB2Launcher/mserv.h deleted file mode 100644 index 8f32ae632..000000000 --- a/tools/SRB2Launcher/mserv.h +++ /dev/null @@ -1,64 +0,0 @@ -// Emacs style mode select -*- C++ -*- -//----------------------------------------------------------------------------- -// -// MSERV SDK -// -// Copyright (C) 1998-2000 by DooM Legacy Team. -// Adapted by Oogaland. -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// -// -// DESCRIPTION: -// Header file for the master server routines -// -//----------------------------------------------------------------------------- - -#ifndef _MSERV_H_ -#define _MSERV_H_ - - - -#ifndef EXPORT -#ifdef __cplusplus -#define EXPORT extern "C" __declspec (dllexport) -#else -#define EXPORT __declspec (dllexport) -#endif -#endif - - - -struct SERVERLIST -{ - char ip[16]; - char port[6]; - char name[32]; - char version[16]; - char perm[4]; -}; - - - -EXPORT int __stdcall GetServerListEx(char *ip_addr, char *str_port, struct SERVERLIST serverlist[], short max_servers); -EXPORT int __stdcall GetServerList(char *ip_addr, char *str_port, - struct SERVERLIST *serverlist1,struct SERVERLIST *serverlist2,struct SERVERLIST *serverlist3, - struct SERVERLIST *serverlist4,struct SERVERLIST *serverlist5,struct SERVERLIST *serverlist6, - struct SERVERLIST *serverlist7,struct SERVERLIST *serverlist8,struct SERVERLIST *serverlist9, - struct SERVERLIST *serverlist10,struct SERVERLIST *serverlist11,struct SERVERLIST *serverlist12, - struct SERVERLIST *serverlist13,struct SERVERLIST *serverlist14,struct SERVERLIST *serverlist15, - struct SERVERLIST *serverlist16); - - - - -#endif // !defined(_MSERV_H_) diff --git a/tools/SRB2Launcher/mservsdk.h b/tools/SRB2Launcher/mservsdk.h deleted file mode 100644 index 722288e0b..000000000 --- a/tools/SRB2Launcher/mservsdk.h +++ /dev/null @@ -1,65 +0,0 @@ -// Emacs style mode select -*- C++ -*- -//----------------------------------------------------------------------------- -// -// MSERV SDK -// -// Copyright (C) 1998-2000 by DooM Legacy Team. -// Adapted by Oogaland. -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// -// -// DESCRIPTION: -// Header file for the master server SDK. -// -//----------------------------------------------------------------------------- - -#ifndef _MSERVSDK_H_ -#define _MSERVSDK_H_ - - - -#ifndef IMPORT -#ifdef __cplusplus -#define IMPORT extern "C" __declspec (dllimport) -#else -#define IMPORT __declspec (dllimport) -#endif -#endif - - - - -struct SERVERLIST -{ - char ip[16]; - char port[6]; - char name[32]; - char version[16]; - char perm[4]; -}; - - - -IMPORT int __stdcall GetServerListEx(char *host, char *str_port, struct SERVERLIST serverlist[], short max_servers); -IMPORT int __stdcall GetServerList(char *host, char *str_port, - struct SERVERLIST *serverlist1,struct SERVERLIST *serverlist2,struct SERVERLIST *serverlist3, - struct SERVERLIST *serverlist4,struct SERVERLIST *serverlist5,struct SERVERLIST *serverlist6, - struct SERVERLIST *serverlist7,struct SERVERLIST *serverlist8,struct SERVERLIST *serverlist9, - struct SERVERLIST *serverlist10,struct SERVERLIST *serverlist11,struct SERVERLIST *serverlist12, - struct SERVERLIST *serverlist13,struct SERVERLIST *serverlist14,struct SERVERLIST *serverlist15, - struct SERVERLIST *serverlist16); - - - - -#endif // !defined(_MSERVSDK_H_) diff --git a/tools/SRB2Launcher/resource.h b/tools/SRB2Launcher/resource.h deleted file mode 100644 index d787fef41..000000000 --- a/tools/SRB2Launcher/resource.h +++ /dev/null @@ -1,71 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Developer Studio generated include file. -// Used by Script1.rc -// -#define IDD_MAIN 101 -#define IDB_BITMAP1 102 -#define IDI_ICON1 103 -#define IDD_JOINGAME 104 -#define IDD_HOSTGAME 106 -#define IDD_MATCHOPTIONS 108 -#define IDD_RACEOPTIONS 109 -#define IDD_CTFOPTIONS 110 -#define IDD_TAGOPTIONS 111 -#define IDC_GO 1001 -#define IDC_LAUNCHCONFIG 1002 -#define IDC_EXTFILECOMBO 1003 -#define IDC_ABOUT 1005 -#define IDC_ADDFILE 1006 -#define IDC_REMOVEFILE 1007 -#define IDC_SAVELAUNCHCFG 1008 -#define IDC_JOINGAME 1010 -#define IDC_HOSTGAME 1011 -#define IDC_SOUNDOPTS 1012 -#define IDC_PARAMETERS 1013 -#define IDC_EXENAME 1014 -#define IDC_FINDEXENAME 1015 -#define IDC_SEARCHGAMES 1016 -#define IDC_GAMELIST 1018 -#define IDC_NAME 1020 -#define IDC_COLOR 1021 -#define IDC_SKIN 1022 -#define IDC_ADDRESS 1023 -#define IDC_NOFILE 1024 -#define IDC_JOINSTART 1026 -#define IDC_NODOWNLOAD 1027 -#define IDC_OPTIONS 1028 -#define IDC_GAMETYPE 1029 -#define IDC_MAXPLAYERS 1030 -#define IDC_STARTMAP 1031 -#define IDC_FORCESKIN 1032 -#define IDC_ADVANCEMAP 1033 -#define IDC_INTERNETSERVER 1034 -#define IDC_SPECIALRINGS 1036 -#define IDC_MATCHBOXES 1037 -#define IDC_OK 1038 -#define IDC_CANCEL 1039 -#define IDC_RESPAWNITEMTIME 1040 -#define IDC_TIMELIMIT 1041 -#define IDC_POINTLIMIT 1042 -#define IDC_FLAGTIME 1048 -#define IDC_RACEITEMBOXES 1051 -#define IDC_NUMLAPS 1052 -#define IDC_SUDDENDEATH 1060 -#define IDC_MATCH_SCORING 1061 -#define IDC_INTTIME 1064 -#define IDC_DISABLEAUTOAIM 1065 -#define IDC_MONITORTOGGLES 1067 -#define IDC_CONFIGFILE 1069 -#define IDC_FINDCONFIGNAME 1070 -#define IDC_LIST1 1071 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 117 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1072 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif