hedgewars/uFLNet.pas
branchqmlfrontend
changeset 10896 5a74923120d5
child 10898 f373838129c2
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hedgewars/uFLNet.pas	Thu Apr 16 23:31:13 2015 +0300
@@ -0,0 +1,37 @@
+unit uFLNet;
+interface
+
+procedure connectOfficialServer;
+
+procedure initModule;
+procedure freeModule;
+
+implementation
+uses SDLh;
+
+var sock: PTCPSocket;
+    fds: PSDLNet_SocketSet;
+
+procedure connectOfficialServer;
+var ipaddr: TIPAddress;
+begin
+    if sock <> nil then 
+        exit;
+
+    if SDLNet_ResolveHost(ipaddr, PChar('netserver.hedgewars.org'), 46631) = 0 then
+        sock:= SDLNet_TCP_Open(ipaddr)
+end;
+
+procedure initModule;
+begin
+    sock:= nil;
+
+    SDLNet_Init;
+    fds:= SDLNet_AllocSocketSet(1);
+end;
+
+procedure freeModule;
+begin
+end;
+
+end.