// September 2015 // Levee Patroller / Dijk Patrouille // This source file is (c) by Deltares. This source file is open source but only available to select users. Do not redistribute without written permission of Stichting Deltares, Delft, The Netherlands. // This header has been automatically generated. Class BYBrowser_HTTPLink Extends BufferedTCPLink; var PlayerController PC; //reference to our player controller Var String ServerAddress; Var String ServerPath; Var Int ServerPort; //Var BYBrowser_Page BYBP; Var Array LinesA; Var Array TotalRequestLines; var string TotalText; // hash_ui var string id; var string sessionid; var string username; Function RetrieveServers() { LinesA.Length = 0; ResetBuffer(); Resolve(ServerAddress); } Function Resolved(IpAddr Addr) { Addr.Port = 80; If (BindPort() == 0) Return; Open(Addr); } Event Opened() { Local String SendString; local string requesttext; TotalRequestLines.Length = 0; ///SendString = "GET " $ ServerPath $ " HTTP/1.0" $ CRLF $ "Host: " $ ServerAddress $ CRLF $ CRLF; requesttext = "u=" $ username $ "&sid=" $sessionid $ "&id=" $ id ; SendString = "POST "$ServerPath$" HTTP/1.0"$chr(13)$chr(10); SendString = SendString $ ("Host: "$ServerAddress$chr(13)$chr(10)); SendString = SendString $ ("User-Agent: HTTPTool/1.0"$Chr(13)$Chr(10)); SendString = SendString $ ("Content-Type: application/x-www-form-urlencoded"$chr(13)$chr(10)); //we use the length of our requesttext to tell the server //how long our content is SendString = SendString $ ("Content-Length: "$len(requesttext)$Chr(13)$Chr(10)); SendString = SendString $ (chr(13)$chr(10)); SendString = SendString $ (requesttext); SendString = SendString $ (chr(13)$chr(10)); SendString = SendString $ ("Connection: Close"); SendString = SendString $ (chr(13)$chr(10)$chr(13)$chr(10)); //Log(SendString); SendBufferedData(SendString); } Function Tick (Float TimeDelta) { DoBufferQueueIO(); } event ReceivedText(string Text) { TotalText = TotalText $ Text; /* Local int I; SplitIntoLines(Text); For (i=0;i 100)); //put in to stop a massive loop which might happen } DefaultProperties { ServerAddress="leveepatroller.deltares.nl" ServerPath="/index.php/leveecontrol/process_scenarios" ServerPort=80 }