This commit is contained in:
ahmed committed 2026-04-04 04:31:30 +03:00
1 parent 1339604bc5
commit 5f73cf7af7
298 files changed
+100 -501

No files matched your search

@@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Esiur.Net.Packets
{
public static class EpAuthExtensions
{
public static EpAuthPacketIAuthFormat GetIAuthFormat(this object value)
{
if (value is string)
return EpAuthPacketIAuthFormat.Text;
else if (value is int || value is uint
|| value is byte || value is sbyte
|| value is short || value is ushort
|| value is long || value is ulong)
return EpAuthPacketIAuthFormat.Number;
else if (value.GetType().IsArray)
return EpAuthPacketIAuthFormat.Choice;
throw new Exception("Unknown IAuth format");
}
}
}