SafeNet/SN_Server/ServerMSGS/SM_IPList.cs
2021-02-24 13:50:23 +02:00

38 lines
959 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace SN_Server.ServerMSGS
{
public class SM_IPList
{
private ServerMSG _sm;
public List<ServerIdent> ipList;
public SM_IPList(ServerMSG sm)
{
_sm = sm;
ipList = new List<ServerIdent>();
DecodePayload(sm.Payload);
}
private void DecodePayload(string paylaod)
{
string[] temp = paylaod.Split('/');
foreach (string ident in temp)
{
Console.WriteLine("Got new serverIdent:" + ident);
ServerIdent si = new ServerIdent(ident);
ipList.Add(si);
}
}
public static byte[] GenRequestMsg()
{
string msg = ServerMSG.GenMsg(0x0005, ServerConnector.serialNr, "");
return System.Text.Encoding.ASCII.GetBytes(msg);
}
}
}