Merge branch 'general-devel' of https://github.com/nyxstudios/TShock into general-devel

This commit is contained in:
White 2015-07-07 11:14:24 +09:30
commit 0794b89407
5 changed files with 29 additions and 13 deletions

View file

@ -2419,15 +2419,15 @@ namespace TShockAPI
private static bool HandleProjectileNew(GetDataHandlerArgs args)
{
var ident = args.Data.ReadInt16();
short ident = args.Data.ReadInt16();
var pos = new Vector2(args.Data.ReadSingle(), args.Data.ReadSingle());
var vel = new Vector2(args.Data.ReadSingle(), args.Data.ReadSingle());
var knockback = args.Data.ReadSingle();
var dmg = args.Data.ReadInt16();
var owner = args.Data.ReadInt8();
var type = args.Data.ReadInt16();
var bits = (BitsByte) args.Data.ReadInt8();
owner = (byte)args.Player.Index;
float knockback = args.Data.ReadSingle();
short dmg = args.Data.ReadInt16();
byte owner = args.Data.ReadInt8();
short type = args.Data.ReadInt16();
BitsByte bits = args.Data.ReadInt8();
//owner = (byte)args.Player.Index;
float[] ai = new float[Projectile.maxAI];
for (int i = 0; i < Projectile.maxAI; i++)
@ -2474,7 +2474,7 @@ namespace TShockAPI
bool hasPermission = !TShock.CheckProjectilePermission(args.Player, index, type);
if (!TShock.Config.IgnoreProjUpdate && !hasPermission && !args.Player.Group.HasPermission(Permissions.ignoreprojectiledetection))
{
if (type == 100 || type == 164 || type == 180 || type == 261 || (type > 289 && type < 298) || (type >= 325 && type <= 328) || (type >= 345 && type <= 352))
if (type == 100 || type == 164 || type == 180 || type == 261 || (type > 289 && type < 298) || (type >= 325 && type <= 328) || (type >= 345 && type <= 352) || (type >= 435 && type <= 438))
{
TShock.Log.Debug("Certain projectiles have been ignored for cheat detection.");
}

View file

@ -79,12 +79,20 @@ namespace Rests
public virtual void Start()
{
if (listener == null)
try
{
listener = HttpListener.Create(Ip, Port);
listener.RequestReceived += OnRequest;
listener.Start(int.MaxValue);
}
catch (Exception ex)
{
TShock.Log.Error("Fatal Startup Exception");
TShock.Log.Error(ex.ToString());
TShock.Log.ConsoleError("Invalid REST configuration: \nYou may already have a REST service bound to port {0}. \nPlease adjust your configuration and restart the server. \nPress any key to exit.", Port);
Console.ReadLine();
Environment.Exit(1);
}
}
public void Start(IPAddress ip, int port)

View file

@ -422,15 +422,18 @@ namespace TShockAPI
public List<int> GetBuffByName(string name)
{
string nameLower = name.ToLower();
string buffname;
for (int i = 1; i < Main.maxBuffTypes; i++)
{
if (Main.buffName[i].ToLower() == nameLower)
buffname = Main.buffName[i];
if (!String.IsNullOrWhiteSpace(buffname) && buffname.ToLower() == nameLower)
return new List<int> {i};
}
var found = new List<int>();
for (int i = 1; i < Main.maxBuffTypes; i++)
{
if (Main.buffName[i].ToLower().StartsWith(nameLower))
buffname = Main.buffName[i];
if (!String.IsNullOrWhiteSpace(buffname) && buffname.ToLower().StartsWith(nameLower))
found.Add(i);
}
return found;