new masterserver code

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4656 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
driAn
2009-10-12 19:00:46 +00:00
parent 6b4e06c311
commit d0e041bfa7
11 changed files with 958 additions and 41 deletions
+90
View File
@@ -0,0 +1,90 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{A00CFDD5-210C-415F-A172-386E92A52D9B}</ProjectGuid>
<ProjectTypeGuids>{349C5851-65DF-11DA-9384-00065B846F21};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<AssemblyName>AcMasterserver</AssemblyName>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin</OutputPath>
<DefineConstants>DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Web" />
<Reference Include="System.Xml" />
<Reference Include="System.Web.Services" />
<Reference Include="ActionCube, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\Desktop\master\Bin\ActionCube.dll</HintPath>
</Reference>
<Reference Include="API, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\Desktop\master\Bin\API.dll</HintPath>
</Reference>
<Reference Include="Cube, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\Desktop\master\Bin\Cube.dll</HintPath>
</Reference>
<Reference Include="CubeEngineBase, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\Desktop\master\Bin\CubeEngineBase.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data" />
<Reference Include="MySql.Data, Version=6.1.2.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\Desktop\mysql-connector-net-6.1.2-noinstall\mysql.data.dll</HintPath>
</Reference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v8.0\WebApplications\Microsoft.WebApplication.targets" />
<ProjectExtensions>
<MonoDevelop>
<Properties VerifyCodeBehindFields="true" VerifyCodeBehindEvents="true" InternalTargetFrameworkVersion="3.5">
<XspParameters Port="8080" Address="127.0.0.1" SslMode="None" SslProtocol="Default" KeyType="None" CertFile="" KeyFile="" PasswordOptions="None" Password="" Verbose="true" />
</Properties>
</MonoDevelop>
</ProjectExtensions>
<ItemGroup>
<None Include="Blacklist.xml" />
<None Include="README.txt" />
</ItemGroup>
<ItemGroup>
<Content Include="Default.aspx" />
<Content Include="web.config" />
<Content Include="App_Themes\Pro\StyleSheet.css" />
</ItemGroup>
<ItemGroup>
<Compile Include="Default.aspx.cs">
<DependentUpon>Default.aspx</DependentUpon>
</Compile>
<Compile Include="App_Code\CubeMasterDAL.cs" />
<Compile Include="App_Code\CubeMsRequestHandler.cs" />
<Compile Include="App_Code\IPTools.cs" />
<Compile Include="App_Code\RickRoll.cs" />
<Compile Include="App_Code\ServerBlacklist.cs" />
</ItemGroup>
<ItemGroup>
<Folder Include="App_Code\" />
<Folder Include="App_Themes\" />
<Folder Include="App_Themes\Pro\" />
</ItemGroup>
</Project>
Binary file not shown.
+235
View File
@@ -0,0 +1,235 @@
using System;
using System.Data;
using System.Data.Common;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Net;
using System.Xml;
using System.IO;
//using System.Data.SqlClient;
using System.Text;
using System.Linq;
using MySql.Data.MySqlClient;
using AHSoftware.CubeMon;
using AHSoftware.CubeMon.Games.ActionCube.v094;
/// <summary>
/// Summary description for CubeMS
/// </summary>
public class CubeMasterDAL
{
string connectionString;
//DbProviderFactory factory;
public string ConnectionString
{
get { return connectionString; }
set { connectionString = value; }
}
public CubeMasterDAL()
{
// factory = new MySql.Data.MySqlClient.MySqlClientFactory();
}
IDbConnection CreateConnection()
{
IDbConnection con = new MySqlConnection(); //factory.CreateConnection();
con.ConnectionString = ConnectionString;
//con.Open();
return con;
}
private void AddServer(IPEndPoint address, string name, string description)
{
//SqlConnection con = new SqlConnection(connectionString);
//SqlCommand cmd = new SqlCommand("AddServer", con);
IDbConnection con = CreateConnection();
IDbCommand cmd = con.CreateCommand();
cmd.CommandText = "DELETE FROM Servers WHERE IP=@IP AND Port=@Port; INSERT INTO Servers VALUES(@IP, @Port, @Name, @Description, @Date)";
var param = cmd.CreateParameter();
param.ParameterName = "IP";
param.Value = IPTools.IPToInt(address.Address);
cmd.Parameters.Add(param);
param = cmd.CreateParameter();
param.ParameterName = "Port";
param.Value = address.Port;
cmd.Parameters.Add(param);
param = cmd.CreateParameter();
param.ParameterName = "Name";
param.Value = name;
cmd.Parameters.Add(param);
param = cmd.CreateParameter();
param.ParameterName = "Description";
param.Value = description;
cmd.Parameters.Add(param);
param = cmd.CreateParameter();
param.ParameterName = "Date";
param.Value = DateTime.Now;
cmd.Parameters.Add(param);
Console.WriteLine("opening");
con.Open();
cmd.ExecuteNonQuery();
Console.WriteLine("done");
}
public void Register(IPEndPoint address)
{
Client c = new Client();
c.Socket = new IPEndPoint(address.Address, address.Port + 1);
ServerInfo info = null;
try
{
info = (ServerInfo)c.RequestInfo();
}
catch
{
throw new ApplicationException("Could not ping you. Make sure your server is accessible from the internet.");
}
string name = string.Empty;
try
{
name = Dns.GetHostEntry(info.Socket.Address).HostName;
}
catch { };
if (info.MaxClients > 20)
{
throw new ApplicationException("Your server must have a maxclients setting of 20 or less. Check your configuration.");
}
AddServer(address, name, info.Description);
}
public string GetServers(bool xml)
{
System.Diagnostics.Debug.Assert(xml == false);
IDbConnection con = CreateConnection();
IDbCommand cmd = con.CreateCommand(); //new SqlCommand(xml ? "GetServersXML" : "GetServers", con);
cmd.CommandText = "DELETE FROM Servers WHERE LastModified + INTERVAL 70 MINUTE < NOW(); SELECT * FROM Servers;"; // fixme, xml
try
{
con.Open();
IDataReader r = cmd.ExecuteReader();
StringBuilder sb = new StringBuilder();
if(xml)
{
// sql server handles xml conversion for us, just embed in a new xmldoc
sb.AppendLine("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
sb.AppendLine("<Servers>");
if(r.Read())
{
sb.AppendLine(r[0] as string);
}
sb.AppendLine("</Servers>");
}
else
{
// construct server list as cubescript
while(r.Read())
{
sb.AppendFormat("addserver {0} {1};{2}", IPTools.IntToIp((int)r["IP"]).ToString(), r["Port"], Environment.NewLine);
}
}
return sb.ToString();
}
catch
{
return null;
}
finally
{
con.Close();
}
}
public string GetClientScript(string HTTPAgent)
{
IDbConnection con = CreateConnection();
IDbCommand cmd = con.CreateCommand(); // new SqlCommand("GetClientScript", con);
//cmd.Parameters.AddWithValue("HTTPAgent", HTTPAgent);
cmd.CommandText = "SELECT * FROM ClientScripts WHERE HTTPAgent = @HTTPAgent";
var param = cmd.CreateParameter();
param.ParameterName = "HTTPAgent";
param.Value = HTTPAgent;
cmd.Parameters.Add(param);
try
{
con.Open();
IDataReader r = cmd.ExecuteReader();
r.Read();
return r["Script"] as string;
}
catch
{
return null;
}
finally
{
con.Close();
}
}
public enum EventType : int
{
RegistrationFailed = 0,
RegistrationSuceeeded,
RetrieveServers,
Exception,
}
public void AddEvent(EventType type, string data, IPEndPoint address)
{
IDbConnection con = CreateConnection();
IDbCommand cmd = con.CreateCommand(); //new SqlCommand("AddEvent", con);
cmd.CommandText = "INSERT INTO Events (Type, Data, IP, Time) VALUES (@Type, @Data, @IP, @Time)";
var param = cmd.CreateParameter();
param.ParameterName = "Type";
param.Value = type;
cmd.Parameters.Add(param);
param = cmd.CreateParameter();
param.ParameterName = "Data";
param.Value = data;
cmd.Parameters.Add(param);
param = cmd.CreateParameter();
param.ParameterName = "IP";
param.Value = IPTools.IPToInt(address.Address);
cmd.Parameters.Add(param);
param = cmd.CreateParameter();
param.ParameterName = "Time";
param.Value = DateTime.Now;
cmd.Parameters.Add(param);
con.Open();
cmd.ExecuteNonQuery();
con.Close();
}
}
+75 -23
View File
@@ -22,15 +22,17 @@ using AHSoftware.CubeMon.Games.ActionCube.v094;
/// </summary>
public class CubeMsRequestHandler : IHttpHandler
{
Log log = new Log();
CubeMS master;
CubeMasterDAL masterDal;
ServerBlacklist blacklist;
int serverListCacheMinutes;
CubeMsRequestHandler()
public CubeMsRequestHandler()
{
master = new CubeMS();
master.ConnectionString = WebConfigurationManager.ConnectionStrings["CubeMS"].ConnectionString;
masterDal = new CubeMasterDAL();
masterDal.ConnectionString = WebConfigurationManager.ConnectionStrings["CubeMS"].ConnectionString;
serverListCacheMinutes = int.Parse(WebConfigurationManager.AppSettings["ServerListCacheMinutes"] ?? "0");
blacklist = new ServerBlacklist(HttpContext.Current.Server.MapPath("/Blacklist.xml"));
}
#region IHttpHandler Members
@@ -42,14 +44,18 @@ public class CubeMsRequestHandler : IHttpHandler
public void ProcessRequest(HttpContext context)
{
IPEndPoint address = new IPEndPoint(IPAddress.Parse(context.Request.UserHostAddress), 0);
string serverAddress = context.Request.UserHostAddress;
IPEndPoint address = new IPEndPoint(IPAddress.Parse(serverAddress), 0);
string requestFile = Path.GetFileName(context.Request.FilePath);
try
{
if(requestFile == "register.do" && context.Request.QueryString["action"] == "add")
{
context.Response.ContentType = "text/plain";
// fixme
//context.Response.ContentType = "text/plain";
try
{
@@ -58,28 +64,65 @@ public class CubeMsRequestHandler : IHttpHandler
catch
{
context.Response.Write("Server not registered, invalid request. Maybe you use an older server version?");
log.AddEvent(Log.EventType.RegistrationFailed, "invalid request", address);
masterDal.AddEvent(CubeMasterDAL.EventType.RegistrationFailed, "invalid request", address);
return;
}
if(master.Register(address))
if (blacklist.IsBlacklisted(serverAddress) || context.Request.QueryString["bansample"] == "1")
{
/*
context.Response.Write(RickRoll.RickRollMeNow());
context.Response.Flush();
*/
string lyrics = RickRoll.RickRollMeNow();
using(StringReader reader = new StringReader(lyrics))
{
string line = reader.ReadLine();
while(line != null)
{
// rick roll them.. line by line
context.Response.Write(line);
context.Response.Write(Environment.NewLine);
context.Response.Flush();
//System.Threading.Thread.Sleep(250);
line = reader.ReadLine();
}
}
context.Response.Write(Environment.NewLine);
context.Response.Write("Behave and try again in a few days..");
masterDal.AddEvent(CubeMasterDAL.EventType.RegistrationFailed, "blacklisted", address);
return;
}
try
{
masterDal.Register(address);
// TODO: *DOS safety
context.Response.Write("Registration successful. Due to caching it might take a few minutes to see the your server in the serverlist");
log.AddEvent(Log.EventType.RegistrationSuceeeded, null, address);
}
else
masterDal.AddEvent(CubeMasterDAL.EventType.RegistrationSuceeeded, null, address);
}
catch (Exception ex)
{
context.Response.Write("Server not registered, could not ping you. Make sure your server is accessible from the internet.");
log.AddEvent(Log.EventType.RegistrationFailed, "ping", address);
context.Response.Write("Server not registered: " + ex.Message + ex.StackTrace);
masterDal.AddEvent(CubeMasterDAL.EventType.RegistrationFailed, null, address);
}
}
else if(requestFile == "retrieve.do")
{
string type = context.Request.QueryString["item"];
if(type == "list")
{
context.Response.ContentType = "text/plain";
// fixme
context.Response.ContentType = "text/plain";
try
{
@@ -88,13 +131,13 @@ public class CubeMsRequestHandler : IHttpHandler
string servers = context.Cache[type] as string;
if(servers == null || servers.Length == 0) // empty cache, or empty server list
{
servers = master.GetServers(false);
servers = masterDal.GetServers(false);
if(serverListCacheMinutes > 0) context.Cache.Add(type, servers, null, Cache.NoAbsoluteExpiration, new TimeSpan(0, serverListCacheMinutes, 0), CacheItemPriority.Normal, null);
}
context.Response.Write(servers);
context.Response.Write(servers);
context.Response.Flush();
log.AddEvent(Log.EventType.RetrieveServers, "list", address);
masterDal.AddEvent(CubeMasterDAL.EventType.RetrieveServers, "list", address);
// append client script if its an older or unknown client
if(bool.Parse((WebConfigurationManager.AppSettings["EnableClientScripts"] ?? "false")) && context.Request.UserAgent != WebConfigurationManager.AppSettings["ClientAgent"])
@@ -102,7 +145,7 @@ public class CubeMsRequestHandler : IHttpHandler
string script = context.Cache["script"] as string;
if(script == null)
{
if((script = master.GetClientScript(context.Request.UserAgent)) != null)
if((script = masterDal.GetClientScript(context.Request.UserAgent)) != null)
{
int cacheminutes = int.Parse(WebConfigurationManager.AppSettings["ClientScriptCacheMinutes"] ?? "0");
context.Cache.Add("script", script, null, Cache.NoAbsoluteExpiration, new TimeSpan(0, cacheminutes, 0), CacheItemPriority.Normal, null);
@@ -113,10 +156,11 @@ public class CubeMsRequestHandler : IHttpHandler
{
context.Response.Write(script);
context.Response.Flush();
log.AddEvent(Log.EventType.RetrieveServers, "script", address);
masterDal.AddEvent(CubeMasterDAL.EventType.RetrieveServers, "script", address);
}
}
}
/*
catch
{
// send error to the client
@@ -124,6 +168,10 @@ public class CubeMsRequestHandler : IHttpHandler
context.Response.Flush();
throw; // log errors globally
}
*/
finally
{
}
}
else if(context.Request.QueryString["item"] == "xml")
{
@@ -132,17 +180,18 @@ public class CubeMsRequestHandler : IHttpHandler
string serversXml = context.Cache[type] as string;
if(serversXml == null || serversXml.Length == 0) // empty cache, or empty server list
{
serversXml = master.GetServers(true);
serversXml = masterDal.GetServers(true);
if(serverListCacheMinutes > 0) context.Cache.Add(type, serversXml, null, Cache.NoAbsoluteExpiration, new TimeSpan(0, serverListCacheMinutes, 0), CacheItemPriority.Normal, null);
}
context.Response.Write(serversXml);
context.Response.Flush();
log.AddEvent(Log.EventType.RetrieveServers, "xml", address);
masterDal.AddEvent(CubeMasterDAL.EventType.RetrieveServers, "xml", address);
}
}
}
/*
catch(Exception ex)
{
try
@@ -151,7 +200,10 @@ public class CubeMsRequestHandler : IHttpHandler
// log.AddEvent(Log.EventType.Exception, ex.Message, address);
}
catch { }
}
}*/
finally
{
}
}
#endregion
+24
View File
@@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
/// <summary>
/// Summary description for RickRoll
/// </summary>
public static class RickRoll
{
static readonly string lyrics = @"Never gonna give you up.
Never gonna let you down.
Never gonna run around and desert you.
Never gonna make you cry.
Never gonna say goodbye.
Never gonna tell a lie and hurt you. ";
public static string RickRollMeNow()
{
return lyrics;
}
}
+29
View File
@@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Xml.Linq;
/// <summary>
/// Summary description for ServerBlacklist
/// </summary>
public class ServerBlacklist
{
List<string> serverIps = new List<string>();
public ServerBlacklist(string blacklistFile)
{
XDocument document = XDocument.Load(blacklistFile);
var servers = document.Descendants("Server");
foreach (var server in servers)
{
serverIps.Add(server.Attribute("IP").Value);
}
}
public bool IsBlacklisted(string serverIp)
{
return serverIps.Contains(serverIp);
}
}
Binary file not shown.
+402
View File
@@ -0,0 +1,402 @@
<?xml version="1.0" encoding="utf-8" ?>
<ServerBlacklist>
<BlacklistedServers>
<Server IP="127.0.0.2"/>
<!--
Description: Localhost
DateAdded: 19/07/09
Added by: driAn
-->
<Server IP="88.101.81.214"/>
<!--
DateAdded: 19/07/09
-->
<Server IP="98.15.197.20"/>
<!--
DateAdded: 19/07/09
-->
<Server IP="84.117.195.176"/>
<!--
DateAdded: 19/07/09
-->
<!--
<Server IP="84.23.66.190"/>
ServerName: NoH OSOK 1 / NoH OSOK 2 / NoH CTF 1 / |NoH|Dave
DateAdded: 19/07/09
ServerPort: 28763 / 38376 / 2837 / 2839
Added by: makkE
Removed by: makkE, maprot clean.
Re-banned by: RandumKiwi - Their other (below) server was running a forced dust2 rotation
Unbanned again: makkE: Dave understood now.
-->
<!--
<Server IP="84.23.66.216"/>
ServerName: -NoH-Shaka / NoH-RedRaven / |NoH|Dave's Funny server
BanReason: EzJem forced maprot
ServerPort: 28888 / 2000 / 2839
DateAdded: 19/07/09
Added by: RandumKiwi
Removed by: makkE: Maprot clean.
Re-banned by: RandumKiwi: This server was running a forced dust2 rotation.
Unbanned by: makkE: Let's hope they behave now. Spoke to Dave and explained it.
-->
<!--
<Server IP="83.79.189.61"/>
<Server IP="85.3.160.157"/>
<Server IP="83.79.140.73"/>
Description: Daves funny Server
DateAdded: 27/07/09
Added by: RandumKiwi
ServerPort: 28763
BanReason: Ban evasion, see above.
RemovedBy: RandumKiwi: Since makkE had already unbanned those other servers. See above.
-->
<Server IP="92.51.163.228"/>
<!--
Description: BS's bullshit
DateAdded: 19/07/09
Added by: makkE
-->
<!--
<Server IP="77.57.207.219"/>
ServerName: FunDog Funserver
DateAdded: 19/07/09
Added by: makkE
Removed by: makkE 20/07/09 Maplist now clean.
-->
<Server IP="84.117.195.176"/>
<!--
ServerName: Rot's Dust2
DateAdded: 19/07/09
Added by: makkE
-->
<Server IP="76.115.28.80"/>
<!--
ServerName: sfurules dust2
DateAdded: 19/07/09
Added by: makkE
-->
<Server IP="65.190.249.208"/>
<!--
ServerName: Mizu Clan Server
DateAdded: 19/07/09
Added by: makkE
-->
<!--
<Server IP="78.47.111.46"/>
ServerName: hanze osok 2
DateAdded: 19/07/09
Added by: makkE
Removed by: makkE 20/07/09
-->
<!--
<Server IP="78.47.111.48"/>
ServerName: hanze osok 1
DateAdded: 19/07/09
Added by: makkE
Removed by: makkE 20/07/09
-->
<Server IP="87.98.142.93"/>
<!--
ServerName: DSA| Clan Server
DateAdded: 19/07/09
Added by: makkE
ServerPort: 28763
-->
<Server IP="207.158.11.105"/>
<!--
Description: rot2 ??
DateAdded: 19/07/09
Added by: makkE
-->
<Server IP="85.214.18.115"/>
<!--
ServerName: [b4] Deutschland Server www.battle4.de
DateAdded: 19/07/09
Added by: makkE
ServerPort: 28763
-->
<Server IP="83.18.153.222"/>
<!--
ServerName: [PL] intec.uni.cc AssaultCube [dust2]
BanReason: Forced dust2 maprot
ServerPort: 28763
DateAdded: 19/07/09
Added by: RandumKiwi
-->
<Server IP="76.249.29.219"/>
<!--
ServerName: N/A
BanReason: EzJem forced maprot
ServerPort: 7777
DateAdded: 19/07/09
Added by: RandumKiwi
-->
<Server IP="85.114.130.199"/>
<!--
ServerName: TEST-ONLY
BanReason: Longhorn forced maprot
ServerPort: 28763
DateAdded: 19/07/09
Added by: RandumKiwi
-->
<Server IP="189.53.152.243"/>
<!--
ServerName: FRAGaLOT !! The FRaG PLAcE o.0 !!
BanReason: Noob maprot
ServerPort: 28763
DateAdded: 20/07/09
Added by: RandumKiwi
-->
<Server IP="68.36.206.106"/>
<!--
ServerName: K.I.A Clan Server
BanReason: Pushing bad kia_* maps
ServerPort: 28763
DateAdded: 19/07/09
Added by: makkE
-->
<!--
<Server IP="143.107.130.171"/>
ServerName: IF USP BRASIL 2 (laggy maps)
BanReason: Noob maprot
ServerPort: 28765
DateAdded: 20/07/09
Added by: RandumKiwi
Removed by: RandumKiwi because maprot now clean.
-->
<Server IP="75.126.24.124"/>
<!--
ServerName: WhiteHouseWest_TX
BanReason: Noob maprot (no maps for the maprot on the server either).
ServerPort: 28763
DateAdded: 20/07/09
Added by: RandumKiwi
-->
<Server IP="79.85.139.50"/>
<!--
ServerName: #TDMC#RoyeurServer
BanReason: gema-gema-gema
ServerPort: 28765
DateAdded: 20/07/09
Added by: makkE
-->
<!--
<Server IP="91.189.136.7"/>
ServerName: NS - Servers
BanReason: Unmoderated, becomming a playground for crap.
Talk to nissarin when he comes back from vaccation, he will mod them surely.
ServerPorts: 28763, 28765, 28769, 28771
DateAdded: 23/07/09
Added by: makkE
RemovedBy: RandumKiwi... It's been sorted.
-->
<Server IP="189.61.109.184"/>
<Server IP="189.61.103.121"/>
<Server IP="189.61.113.60"/>
<Server IP="189.61.114.125"/>
<Server IP="189.6.28.104"/>
<Server IP="189.61.114.45"/>
<Server IP="189.61.101.175"/>
<Server IP="189.6.22.218"/>
<Server IP="189.24.176.242"/>
<Server IP="189.24.9.81"/>
<Server IP="189.24.34.54"/>
<Server IP="189.61.107.55"/>
<!--
RepeatOffender: 189.*.*.* range
BanReason: Forced dust2 rotation
ServerPort: 28763
Added by: RandumKiwi
Comment: DON'T EVER UNBAN THESE GUYS.
RangeBan: This is a brazillian range. A range ban for these guys would be: 189.60/14
Also: 189.24/15 Haven't seen any from this range for a while, we'll leave it off for now.
Also: 189.4/14 same for this
-->
<Server IP="187.21.17.72"/>
<Server IP="187.61.114.125"/>
<Server IP="187.21.18.76"/>
<Server IP="187.21.23.113"/>
<Server IP="187.21.24.218"/>
<!--
RepeatOffender: 187.*.*.* range
BanReason: Forced dust2 rotation
ServerPort: 28763
Added by: RandumKiwi
Comment: DON'T EVER UNBAN THESE GUYS.
RangeBan: This is a brazillian range. A range ban for these guys would be: 187.20/14
-->
<Server IP="189.177.121.19"/>
<!--
BanReason: Forced gema
ServerPort: 28765
Added by: RandumKiwi
DateAdded: 29/07/09
Comment: Different IP to the ranges above. Brazillian range.
-->
<Server IP="189.24.98.145"/>
<Server IP="189.24.0.7"/>
<!--
ServerName: dust 2
BanReason: dust2 maprot
ServerPort: 28763
Added by: RandumKiwi
DateAdded: 01/08/09
-->
<Server IP="189.177.41.153"/>
<!--
ServerName: |SK|Gema server
BanReason: obvious
ServerPort: 6304
Added by: RandumKiwi
DateAdded: 03/08/09
-->
<Server IP="189.106.22.209"/>
<Server IP="189.106.164.229"/>
<!--
ServerName: DUST 2
BanReason: obvious
ServerPort: 28763
Added by: RandumKiwi
DateAdded: 09/08/09
-->
<Server IP="78.47.123.193"/>
<!--
ServerName: |TD Group|
BanReason: These are run by as0m. See previous bans
ServerPort: 28763, 28765, 28767
Added by: RandumKiwi
DateAdded: 12/08/09
-->
<Server IP="67.83.76.211"/>
<!--
ServerName: THESOUNDOFRAP
BanReason: Owner/Admin keeps voting terrible maps.
ServerPort: 28750
Added by: RandumKiwi
DateAdded: 24/08/09
-->
<Server IP="82.24.211.176"/>
<!--
ServerName: NSL:CiD's Lax Server :)
BanReason: CiD is a BS member.
ServerPort: 28763
Added by: RandumKiwi
DateAdded: 26/08/09
-->
<Server IP="83.157.83.62"/>
<!--
ServerName: |EC*FR| TEAM S3RV3UR website_http://ecfr.e-monsite.com
BanReason: Server admins keep abusing admin far too much. Banning/kicking innocent players.
Voting crap maps.
Quote: Dreamer said: "I go into this server, and in about 30 seconds, get put through about 10 map changes,
from EZJemVille to SkyScraper City to yadayada, watch 4 or 5 kicks, and 2 or 3 bans, before I say,
'You should stop voting to change maps and abusing admin'. I am then promptly banned as well."
ServerPort: 28763
Added by: RandumKiwi
DateAdded: 28/08/09
-->
<Server IP="189.61.118.31"/>
<!--
ServerName: AndrewFeng's server
BanReason: See |NZ| blacklist...
// Name: AndrewFeng
// BanReason: Offensive, vote-kick abuse, impersonation.
// BanDate: 2009-06-19
118.92.203.181
118.92.197.244
118.93.164.38
118.93.240.242
118.92.196.171
222.154.36.28
Seriously, this guy is VERY offensive. NEVER REMOVE!
This servers IP is brazillian, so, it is not actually AndrewFeng
(he has New Zealand IP's. So, it's some brazillian prick trying to fuck with us).
ServerPort: 28763
Added by: RandumKiwi
DateAdded: 05/09/09
-->
<Server IP="87.238.79.2"/>
<!--
ServerName: UK LONDON PRO SERVER
BanReason: Admin voting "heil hitler" maps.
ServerPort: 28763
Added by: RandumKiwi
DateAdded: 12/09/09
-->
<Server IP="70.187.91.6"/>
<!--
ServerName: Vagina Server! :DDDDD
BanReason: Bad server name
ServerPort: 1337
Added by: RandumKiwi
DateAdded: 12/09/09
-->
<Server IP="92.51.147.234"/>
<!--
ServerName: No OSOK
BanReason: Bad maprot
ServerPort: 28763
Added by: RandumKiwi
DateAdded: 23/09/09
-->
<Server IP="67.183.108.39"/>
<!--
ServerName: Warzone Server
BanReason: Bad maprot
ServerPort: 28763
Added by: RandumKiwi
DateAdded: 23/09/09
-->
<Server IP="88.192.235.161"/>
<!--
ServerName: Finland Assault Cuber Server - Toppeli
BanReason: "hitler" maprot.
ServerPort: 28763
Added by: RandumKiwi
DateAdded: 25/09/09
-->
</BlacklistedServers>
</ServerBlacklist>
+3 -8
View File
@@ -12,13 +12,14 @@
<h1>AssaultCube Master Server</h1>
<h2>Server List</h2>
&nbsp;
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="4"
<asp:GridView ID="GridView1" AutoGenerateColumns="False" CellPadding="4"
DataKeyNames="IP" DataSourceID="SqlDataSource1" ForeColor="#333333" GridLines="None">
<FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<Columns>
<asp:TemplateField>
<ItemTemplate>
<%# IPTools.IntToIp((int)DataBinder.Eval(Container.DataItem, "IP")).ToString() %>
<%-- <%# IPTools.IntToIp((int)DataBinder.Eval(Container.DataItem, "IP")).ToString() %> --%>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="Port" HeaderText="Port" SortExpression="Port" />
@@ -35,14 +36,8 @@
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:CubeMS %>"
SelectCommand="GetServers" SelectCommandType="StoredProcedure"></asp:SqlDataSource>
<h2>Interfaces</h2>
<p>
You can retrieve the server list data using those url's:
</p>
<ul>
<li><a href="retrieve.do?item=xml">XML Server List (use for AJAX)</a></li>
<li><a href="retrieve.do?item=list">CubeScript Server List</a></li>
</ul>
@@ -0,0 +1,6 @@
This directory is required to fool apache.
The masterserver http handler dispatches requests matching *.do
However apache always checks if the requested file/dir actually exists,
if not the request is being aborted. Therefore we need this directory
to ensure that the request reaches our http handler.
+94 -10
View File
@@ -8,16 +8,32 @@
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration>
<configSections>
<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere" />
<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
<section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
</sectionGroup>
</sectionGroup>
</sectionGroup>
</configSections>
<appSettings>
<add key="ClientAgent" value="AssaultCube Client 1000"/>
<add key="ServerAgent" value="AssaultCube Server 1000"/>
<add key="EnableClientScripts" value="true"/>
<add key="ServerListCacheMinutes" value="0"/>
<add key="ClientScriptCacheMinutes" value="0"/>
<add key="ClientAgent" value="AssaultCube Client 1000" />
<add key="ServerAgent" value="AssaultCube Server 1000" />
<add key="EnableClientScripts" value="false" />
<add key="ServerListCacheMinutes" value="0" />
<add key="ClientScriptCacheMinutes" value="0" />
</appSettings>
<connectionStrings>
<add name="CubeMS" connectionString="Data Source=ADRIAN\SQLEXPRESS;Initial Catalog=k0890;Integrated Security=True;Pooling=False"
providerName="System.Data.SqlClient" />
<!--
<add name="CubeMS" connectionString="Data Source=IMVSRV52;Initial Catalog=k0890;User Id=k0890db;Password=25 Cubers online!" providerName="System.Data.SqlClient" />
-->
<add name="CubeMS" connectionString="Server=localhost;Database=?;Uid=?;Pwd=?" providerName="MySql.Data.MySqlClient" />
</connectionStrings>
<system.web>
<!--
@@ -26,7 +42,12 @@
affects performance, set this value to true only
during development.
-->
<compilation debug="true"/>
<compilation debug="true">
<assemblies>
<add assembly="Mono.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756" />
<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</assemblies>
</compilation>
<!--
The <authentication> section enables configuration
of the security authentication mode used by
@@ -44,10 +65,73 @@
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
<customErrors mode="Off" />
<httpHandlers>
<add verb="GET" path="*.do" type="CubeMsRequestHandler" validate="false"/>
<add verb="GET" path="*.do" type="CubeMsRequestHandler" validate="false" />
<remove verb="*" path="*.asmx" />
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add verb="GET,HEAD" path="ScriptResource.axd" validate="false" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</httpHandlers>
<pages theme="Pro"></pages>
<pages theme="Pro">
<controls>
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</controls>
</pages>
<httpModules>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</httpModules>
</system.web>
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CSharp.CSharpCodeProvider,System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4">
<providerOption name="CompilerVersion" value="v3.5" />
<providerOption name="WarnAsError" value="false" />
</compiler>
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4">
<providerOption name="CompilerVersion" value="v3.5" />
<providerOption name="OptionInfer" value="true" />
<providerOption name="WarnAsError" value="false" />
</compiler>
</compilers>
</system.codedom>
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<modules>
<remove name="ScriptModule" />
<add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</modules>
<handlers>
<remove name="WebServiceHandlerFactory-Integrated" />
<remove name="ScriptHandlerFactory" />
<remove name="ScriptHandlerFactoryAppServices" />
<remove name="ScriptResource" />
<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add name="ScriptResource" verb="GET,HEAD" path="ScriptResource.axd" preCondition="integratedMode" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</handlers>
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<system.diagnostics>
<trace autoflush="true">
<listeners>
<add name="ConsoleListener" type="System.Diagnostics.ConsoleTraceListener"/>
</listeners>
</trace>
</system.diagnostics>
</configuration>