} String ^between(String ^str1, String ^str2, String ^str3) { int start = str1->IndexOf(str2); int end = str1->IndexOf(str3,start); return str1->Substring(start + str2->Length, end - start - str2->Length); } String ^Get_GameServer_IP(String ^server, Int32 ^mapid){ String ^url = String::Format(L"http://{0}.darkorbit.com/spacemap/xml/maps.php",server); String ^search = String::Format(L"<map id=\"{0}\"",Convert::ToString(mapid)); String ^searchend = L"</map>"; String ^recvbuf = gcnew String(L""); try { WebClient ^wc = gcnew WebClient(); recvbuf = wc->DownloadString(url); } catch(WebException ^) { return L""; } return between(between(recvbuf,search,searchend),L"<gameserverIP>",L"</gameserverIP>"); } bool DownloadMainSWF(String ^server) { String ^url = String::Format(L"http://{0}.darkorbit.bigpoint.com/spacemap/main.swf",server); try { WebClient ^wc = gcnew WebClient(); wc->DownloadFile(url,L"main.swf"); } catch(WebException ^) { return false; } if(!File::Exists(L"main.swf")) return false; return true; } String ^MainSWFHash() { String ^result = gcnew String(L""); try { Stream ^input = gcnew FileStream(L"main.swf",FileMode::Open); MD5 ^md5 = gcnew MD5CryptoServiceProvider(); result = BitConverter::ToString(md5->ComputeHash(input)); result = result->Replace(L"-",L""); result = result->ToLower(); md5->Clear(); input->Close(); } catch(FileNotFoundException ^) { } return result; } String ^SiteHash() { //UDOBot which is dependant on a server would have used this.. String ^result = gcnew String(L"");