Updated to new binary (with the api merged).
Removed System.Drawing dependency
This commit is contained in:
parent
b95caf67c2
commit
b2f47f57ac
20 changed files with 82 additions and 96 deletions
|
|
@ -20,7 +20,7 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Drawing;
|
||||
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Xml;
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
|
||||
using MySql.Data.MySqlClient;
|
||||
using Terraria;
|
||||
|
||||
|
|
@ -43,7 +43,7 @@ namespace TShockAPI.DB
|
|||
creator.EnsureExists(table);
|
||||
}
|
||||
|
||||
public PointF GetLeavePos(string name, string IP)
|
||||
public Vector2 GetLeavePos(string name, string IP)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
|
@ -51,7 +51,7 @@ namespace TShockAPI.DB
|
|||
{
|
||||
if (reader.Read())
|
||||
{
|
||||
return new PointF(reader.Get<int>("X"), reader.Get<int>("Y"));
|
||||
return new Vector2(reader.Get<int>("X"), reader.Get<int>("Y"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -60,12 +60,12 @@ namespace TShockAPI.DB
|
|||
Log.Error(ex.ToString());
|
||||
}
|
||||
|
||||
return new PointF();
|
||||
return new Vector2();
|
||||
}
|
||||
|
||||
public void InsertLeavePos(string name, string IP, int X, int Y)
|
||||
{
|
||||
if (GetLeavePos(name, IP) == PointF.Empty)
|
||||
if (GetLeavePos(name, IP) == Vector2.Zero)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
|
||||
using System.IO;
|
||||
using System.Xml;
|
||||
using MySql.Data.MySqlClient;
|
||||
|
|
@ -173,11 +173,11 @@ namespace TShockAPI.DB
|
|||
{
|
||||
try
|
||||
{
|
||||
return new Warp(new PointF(reader.Get<int>("X"), reader.Get<int>("Y")), reader.Get<string>("WarpName"), reader.Get<string>("WorldID"), reader.Get<string>("Private"));
|
||||
return new Warp(new Vector2(reader.Get<int>("X"), reader.Get<int>("Y")), reader.Get<string>("WarpName"), reader.Get<string>("WorldID"), reader.Get<string>("Private"));
|
||||
}
|
||||
catch
|
||||
{
|
||||
return new Warp(new PointF(reader.Get<int>("X"), reader.Get<int>("Y")), reader.Get<string>("WarpName"), reader.Get<string>("WorldID"), "0");
|
||||
return new Warp(new Vector2(reader.Get<int>("X"), reader.Get<int>("Y")), reader.Get<string>("WarpName"), reader.Get<string>("WorldID"), "0");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -247,12 +247,12 @@ namespace TShockAPI.DB
|
|||
|
||||
public class Warp
|
||||
{
|
||||
public PointF WarpPos { get; set; }
|
||||
public Vector2 WarpPos { get; set; }
|
||||
public string WarpName { get; set; }
|
||||
public string WorldWarpID { get; set; }
|
||||
public string Private { get; set; }
|
||||
|
||||
public Warp(PointF warppos, string name, string worldid, string hidden)
|
||||
public Warp(Vector2 warppos, string name, string worldid, string hidden)
|
||||
{
|
||||
WarpPos = warppos;
|
||||
WarpName = name;
|
||||
|
|
@ -262,7 +262,7 @@ namespace TShockAPI.DB
|
|||
|
||||
public Warp()
|
||||
{
|
||||
WarpPos = PointF.Empty;
|
||||
WarpPos = Vector2.Zero;
|
||||
WarpName = null;
|
||||
WorldWarpID = string.Empty;
|
||||
Private = "0";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue