freeso/TSOClient/FSO.Common.DatabaseService/Model/SearchRequest.cs
riperiperi b57ebbd141 Cleanup: Remove most unused usings and MPL per-file licenses
MPL per-file was used in older project files, but should apply to the whole project, so having it there was redundant.
2023-11-25 03:45:29 +00:00

33 lines
937 B
C#

using Mina.Core.Buffer;
using FSO.Common.Serialization;
using FSO.Common.DatabaseService.Framework;
namespace FSO.Common.DatabaseService.Model
{
[DatabaseRequest(DBRequestType.Search)]
[DatabaseRequest(DBRequestType.SearchExactMatch)]
public class SearchRequest : IoBufferSerializable, IoBufferDeserializable
{
public string Query { get; set; }
public SearchType Type { get; set; }
public void Deserialize(IoBuffer input, ISerializationContext context)
{
this.Query = input.GetPascalVLCString();
this.Type = (SearchType)input.GetUInt32();
}
public void Serialize(IoBuffer output, ISerializationContext context)
{
output.PutPascalVLCString(this.Query);
output.PutUInt32((uint)Type);
}
}
public enum SearchType
{
SIMS = 0x01,
LOTS = 0x02,
NHOOD = 0x03
}
}