IW4M-Admin/Admin/Connection.cs
RaidMax 57ddbebd8c added preliminary heartbeat system
modified the deployment of outdated message
inform user of invalid rcon password
reworked layout of first time server setup
fixed KDR not being properly truncated in some cases
fixed duplicate game-end event
more crash fixes
2015-03-10 15:45:20 -05:00

56 lines
1.2 KiB
C#

using System;
using System.Collections.Generic;
using System.Text;
using System.Net;
using System.IO;
namespace IW4MAdmin
{
class Connection
{
public Connection(String Loc)
{
Location = Loc;
ConnectionHandle = WebRequest.Create(Location);
ConnectionHandle.Proxy = null;
}
public String Read()
{
try
{
WebResponse Resp = ConnectionHandle.GetResponse();
StreamReader data_in = new StreamReader(Resp.GetResponseStream());
String result = data_in.ReadToEnd();
data_in.Close();
Resp.Close();
return result;
}
catch (System.Net.WebException E)
{
return null;
}
}
public void Request(String data)
{
try
{
WebResponse Resp = WebRequest.Create(data).GetResponse();
Resp.Close();
}
catch (System.Net.WebException E)
{
return;
}
}
private String Location;
private WebRequest ConnectionHandle;
}
}