mirror of
https://github.com/ACEmulator/ACE
synced 2026-08-17 12:26:06 -04:00
The cache.bin, as well as the client use these data structs in WXYZ order. However, when you actually construct a Quaternion in ACE (Which uses a System.Numerics native type), the arguments are passed in XYZW. I prefer XYZW order, but, to keep things in lined with the client, I've univied angles to be WXYZ order in our cache.bin exporter and in ACE.
37 lines
1.3 KiB
C#
37 lines
1.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
|
|
using ACE.Database.Models.World;
|
|
|
|
namespace ACE.Database.SQLFormatters.World
|
|
{
|
|
public class HousePortalSQLWriter : SQLWriter
|
|
{
|
|
/// <summary>
|
|
/// Default is formed from: input.HouseId.ToString("00000")
|
|
/// </summary>
|
|
public string GetDefaultFileName(HousePortal input)
|
|
{
|
|
string fileName = input.HouseId.ToString("00000");
|
|
fileName = IllegalInFileName.Replace(fileName, "_");
|
|
fileName += ".sql";
|
|
|
|
return fileName;
|
|
}
|
|
|
|
public void CreateSQLDELETEStatement(IList<HousePortal> input, StreamWriter writer)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public void CreateSQLINSERTStatement(IList<HousePortal> input, StreamWriter writer)
|
|
{
|
|
writer.WriteLine("INSERT INTO `house_portal` (`house_Id`, `obj_Cell_Id`, `origin_X`, `origin_Y`, `origin_Z`, `angles_W`, `angles_X`, `angles_Y`, `angles_Z`)");
|
|
|
|
var lineGenerator = new Func<int, string>(i => $"{input[i].HouseId}, {input[i].ObjCellId}, {input[i].OriginX}, {input[i].OriginY}, {input[i].OriginZ}, {input[i].AnglesW}, {input[i].AnglesX}, {input[i].AnglesY}, {input[i].AnglesZ})");
|
|
|
|
ValuesWriter(input.Count, lineGenerator, writer);
|
|
}
|
|
}
|
|
}
|