VERSION: 0.8.1

CHANGELOG:
-no longer have `world` client handle broken events
-hopefully fixed an issue with clients missing connection event
-fixed ban order in webfront
-fixed alias output duplicating
-fixed missing evade reason
-cleaned up project files
This commit is contained in:
RaidMax 2015-04-11 12:31:04 -05:00
parent 6b6b5f4a1c
commit 8e31cbe138
9 changed files with 91 additions and 119 deletions

View File

@ -1,11 +0,0 @@
<?xml version="1.0"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="lib" />
</assemblyBinding>
</runtime>
</configuration>

View File

@ -725,9 +725,11 @@ namespace IW4MAdmin
E.Origin.Tell(message.ToString());
}
message = new StringBuilder();
if (E.Target.Alias.getIPS() != null)
{
message.Append("IPS: ");
message.Append("IPs: ");
foreach (Player P2 in playerAliases)
{

View File

@ -56,18 +56,22 @@
<PropertyGroup>
<TargetZone>LocalIntranet</TargetZone>
</PropertyGroup>
<PropertyGroup>
<ApplicationManifest>Properties\app.manifest</ApplicationManifest>
</PropertyGroup>
<PropertyGroup />
<PropertyGroup>
<SignManifests>true</SignManifests>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>4D1.ico</ApplicationIcon>
<ApplicationIcon>IW4MAdmin.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup>
<StartupObject>IW4MAdmin.Program</StartupObject>
</PropertyGroup>
<PropertyGroup>
<NoWin32Manifest>true</NoWin32Manifest>
</PropertyGroup>
<PropertyGroup>
<RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent>
</PropertyGroup>
<ItemGroup>
<Reference Include="Kayak">
<HintPath>..\packages\Kayak.0.7.2\lib\Kayak.dll</HintPath>
@ -97,12 +101,6 @@
<Compile Include="Main.cs" />
<Compile Include="Maps.cs" />
<Compile Include="Player.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<DependentUpon>Settings.settings</DependentUpon>
</Compile>
<Compile Include="RCON.cs" />
<Compile Include="Report.cs" />
<Compile Include="Server.cs" />
@ -138,9 +136,6 @@
<Content Include="webfront\stats.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<None Include="App.config">
<SubType>Designer</SubType>
</None>
<Content Include="config\maps.cfg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
@ -168,8 +163,6 @@
<None Include="m2demo\settings\main.gsc">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="packages.config" />
<None Include="Properties\app.manifest" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
@ -188,9 +181,8 @@
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<Content Include="4D1.ico" />
<Content Include="IW4MAdmin.ico" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>copy $(TargetDir)$(TargetFileName) $(SolutionDir)OFFICIAL\Release\$(TargetFileName)

View File

Before

Width:  |  Height:  |  Size: 361 KiB

After

Width:  |  Height:  |  Size: 361 KiB

View File

@ -33,5 +33,5 @@ using System.Resources;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.1.*")]
[assembly: AssemblyVersion("0.8.1")]
[assembly: NeutralResourcesLanguageAttribute("en")]

View File

@ -209,26 +209,14 @@ namespace IW4MAdmin
aliasDB.updatePlayer(NewPlayer.Alias);
clientDB.updatePlayer(NewPlayer);
List<Player> newPlayerAliases = new List<Player>();
getAliases(newPlayerAliases, NewPlayer);
foreach (Player aP in newPlayerAliases)
if (NewPlayer.getLevel() == Player.Permission.Banned) // their guid is already banned so no need to check aliases
{
if (aP == null)
continue;
String Message;
if (aP.getLevel() == Player.Permission.Flagged)
NewPlayer.setLevel(Player.Permission.Flagged);
String Reason = String.Empty;
String Message = String.Empty;
if (NewPlayer.getLevel() == Player.Permission.Banned)
{
Log.Write("Banned client " + P.getName() + " trying to connect...", Log.Level.Debug);
if (aP.getLastO() != null)
Message = "^7Player Kicked: Previously banned for ^5" + aP.getLastO() + " ^7(appeal at " + Website+ ")";
if (NewPlayer.getLastO() != null)
Message = "^7Player Kicked: Previously banned for ^5" + NewPlayer.getLastO() + " ^7(appeal at " + Website + ")";
else
Message = "Player Kicked: Previous Ban";
@ -245,14 +233,23 @@ namespace IW4MAdmin
return true;
}
List<Player> newPlayerAliases = new List<Player>();
getAliases(newPlayerAliases, NewPlayer);
foreach (Player aP in newPlayerAliases) // lets check their aliases
{
if (aP == null)
continue;
if (aP.getLevel() == Player.Permission.Flagged)
NewPlayer.setLevel(Player.Permission.Flagged);
Ban B = isBanned(aP);
if (B != null && aP != null)
if (B != null)
{
Log.Write("Banned alias " + aP.getName() + " trying to connect...", Log.Level.Debug);
aP.lastEvent = NewPlayer.lastEvent;
aP.LastOffense = "Evading";
Log.Write(String.Format("Banned client {0} is connecting with new alias {1}", aP.getName(), NewPlayer.getName()), Log.Level.Debug);
NewPlayer.LastOffense = String.Format("Evading ( {0} )", aP.getName());
if (B.getReason() != null)
NewPlayer.Ban("^7Previously Banned: ^5" + B.getReason() + " ^7(appeal at " + Website + ")", NewPlayer);
@ -276,7 +273,7 @@ namespace IW4MAdmin
#if DEBUG == FALSE
NewPlayer.Tell("Welcome ^5" + NewPlayer.getName() + " ^7this is your ^5" + Utilities.timesConnected(NewPlayer.getConnections()) + " ^7time connecting!");
#endif
Log.Write("Client " + NewPlayer.getName() + " connecting...", Log.Level.Debug);
Log.Write("Client " + NewPlayer.getName() + " connecting...", Log.Level.Debug); // they're clean
if (NewPlayer.getLevel() == Player.Permission.Flagged)
ToAdmins("^1NOTICE: ^7Flagged player ^5" + NewPlayer.getName() + "^7 has joined!");
@ -384,6 +381,10 @@ namespace IW4MAdmin
//Check ban list for every banned player and return ban if match is found
public Ban isBanned(Player C)
{
if (C.getLevel() == Player.Permission.Banned)
return Bans.Find(p => p.getID().Equals(C.getID()));
foreach (Ban B in Bans)
{
if (B.getID().Length < 5 || B.getIP().Length < 5)
@ -584,7 +585,7 @@ namespace IW4MAdmin
if (event_ != null)
{
if (event_.Origin == null)
event_.Origin = new Player("WORLD", "-1", -1, 0);
continue;
event_.Origin.lastEvent = event_;
event_.Origin.lastEvent.Owner = this;
@ -631,25 +632,13 @@ namespace IW4MAdmin
{
lastPoll = DateTime.Now;
timesFailed = 0;
if (statusPlayers.Count > clientnum)
if (statusPlayers.Count != clientnum)
{
lock (statusPlayers)
{
foreach (var P in statusPlayers.Values)
{
if (P == null)
continue;
if (!addPlayer(P))
Log.Write("Error adding " + P.getName() + " at client slot #" + P.getClientNum(), Log.Level.Debug);
}
}
}
else if (statusPlayers.Count < clientnum)
{
List<Player> toRemove = new List<Player>();
lock (players)
{
foreach (Player P in players)
{
if (P == null)
@ -665,6 +654,20 @@ namespace IW4MAdmin
removePlayer(Removing.getClientNum());
}
foreach (var P in statusPlayers.Values)
{
if (P == null)
{
Log.Write("Null player found in statusPlayers", Log.Level.Debug);
continue;
}
if (!addPlayer(P))
Log.Write("Error adding " + P.getName() + " at client slot #" + P.getClientNum(), Log.Level.Debug);
}
}
}
clientnum = statusPlayers.Count;
}
@ -694,6 +697,7 @@ namespace IW4MAdmin
if (infoResponse == null || infoResponse.Length < 2)
{
Log.Write("Could not get server status!", Log.Level.All);
hostname = "Offline"; // for the web front
return false;
}
@ -728,7 +732,7 @@ namespace IW4MAdmin
Website = infoResponseDict["_website"];
}
catch (Exception E)
catch (Exception)
{
Website = "this server's website";
Log.Write("Seems not to have website specified", Log.Level.Debug);
@ -820,7 +824,7 @@ namespace IW4MAdmin
logPath = Basepath + '\\' + "m2demo" + '\\' + log;
else
logPath = Basepath + '\\' + Mod + '\\' + log;
//#if DEBUG == FALSE && System.Environment.GetEnvironmentVariable("COMPUTERNAME") != "michael-surface"
if (!File.Exists(logPath))
{
Log.Write("Gamelog does not exist!", Log.Level.All);
@ -828,7 +832,6 @@ namespace IW4MAdmin
}
logFile = new file(logPath);
//#endif
Log.Write("Log file is " + logPath, Log.Level.Debug);
//get players ip's
@ -847,7 +850,6 @@ namespace IW4MAdmin
System.IO.Stream ftpStream = tmp.GetResponse().GetResponseStream();
String ftpLog = new StreamReader(ftpStream).ReadToEnd();*/
//logPath = "games_old.log";
//logFile = new file("C:\\Users\\Michael\\text.txt");
#endif
Log.Write("Now monitoring " + this.getName(), Log.Level.Debug);
return true;
@ -862,7 +864,7 @@ namespace IW4MAdmin
//Process any server event
public bool processEvent(Event E)
{
/*if (E.Type == Event.GType.Connect)
/*if (E.Type == Event.GType.Connect) // this is anow handled by rcon status :(
{
if (E.Origin == null)
Log.Write("Connect event triggered, but no client is detected!", Log.Level.Debug);
@ -870,6 +872,11 @@ namespace IW4MAdmin
return true;
}*/
if (E.Type == Event.GType.Connect)
{
return true;
}
if (E.Type == Event.GType.Disconnect)
{
if (E.Origin == null)
@ -924,7 +931,7 @@ namespace IW4MAdmin
Log.Write(E.Origin.getName() + " killed " + E.Target.getName() + " with a " + E.Data, Log.Level.Debug);
}
else //Suicide
else // suicide/falling
{
E.Origin.stats.Deaths++;
E.Origin.stats.updateKDR();
@ -991,6 +998,7 @@ namespace IW4MAdmin
String[] statusResponse = E.Data.Split('\\');
if (statusResponse.Length >= 15 && statusResponse[13] == "mapname")
mapname = maps.Find(m => m.Name.Equals(statusResponse[14])).Alias; //update map for heartbeat
return true;
}
if (E.Type == Event.GType.MapEnd)
@ -1325,7 +1333,6 @@ namespace IW4MAdmin
//Will probably move this later
//public Dictionary<String, String> IPS;
public Dictionary<String, Player> statusPlayers;
public bool isRunning;
private DateTime lastPoll;

View File

@ -120,7 +120,7 @@ namespace IW4MAdmin_Web
List<IW4MAdmin.Ban> Bans = new List<IW4MAdmin.Ban>();
if (totalBans > 0)
Bans = IW4MAdmin.Program.Servers[0].Bans.GetRange(start, range);
Bans = IW4MAdmin.Program.Servers[0].Bans.GetRange(start, range).OrderByDescending(x => x.getTime()).ToList();
else
Bans.Add(new IW4MAdmin.Ban("No Bans", "0", "0", DateTime.Now, ""));
@ -180,7 +180,7 @@ namespace IW4MAdmin_Web
range = (totalStats - start);
else
range = 30;
List<IW4MAdmin.Stats> Stats = IW4MAdmin.Program.Servers[server].statDB.getMultipleStats(start, range);
List<IW4MAdmin.Stats> Stats = IW4MAdmin.Program.Servers[server].statDB.getMultipleStats(start, range).OrderByDescending(x => x.Skill).ToList();
buffer.Append("<tr><th style=text-align:left;>Name</th><th style=text-align:left;>Kills</th><th style=text-align:left;>Deaths</th><th style=text-align:left;>KDR</th><th style='width: 175px; text-align:right;'>Rating</th></tr>");
cycleFix = 0;
for (int i = 0; i < totalStats; i++)

View File

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Kayak" version="0.7.2" targetFramework="net40" />
</packages>

View File

@ -1,22 +1,8 @@
VERSION: 0.8
VERSION: 0.8.1
CHANGELOG:
-added mask command
-added baninfo command
-added alias command and removed redundant output from `find`
-added rcon command
-added webfront (http://127.0.0.1:1624)
-true skill is officially implemented
-find now shows last connect time
-noise on pm (if gsc_enabled)
-force 8 line chat height (if gsc_enabled)
-tell admins the number of reports on join
-enhanced ban tracking
-ip wait timeout added
-remove report on ban
-can't report yourself
-remove reported players when banned
-fixed rare crash with toadmins backend
-fixed crash when finding player stats that don't exist
-fixed a bug that caused owner command to reactivate only `creator` rank player existed
-fixed a bug that caused certain notifications to be sent to all players
-various small fixes
-no longer have `world` client handle broken events
-hopefully fixed an issue with clients missing connection event
-fixed ban order in webfront
-fixed alias output duplicating
-fixed missing evade reason
-cleaned up project files