mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-14 09:13:25 +01:00
Prioritizes AltServer that originally installed AltStore over others
This commit is contained in:
@@ -44,8 +44,20 @@ enum ConnectionError: LocalizedError
|
||||
|
||||
struct Server: Equatable
|
||||
{
|
||||
var identifier: String
|
||||
var service: NetService
|
||||
|
||||
var isPreferred = false
|
||||
|
||||
init?(service: NetService, txtData: Data)
|
||||
{
|
||||
let txtDictionary = NetService.dictionary(fromTXTRecord: txtData)
|
||||
guard let identifierData = txtDictionary["serverID"], let identifier = String(data: identifierData, encoding: .utf8) else { return nil }
|
||||
|
||||
self.identifier = identifier
|
||||
self.service = service
|
||||
}
|
||||
|
||||
func send<T: Encodable>(_ payload: T, via connection: NWConnection, prependSize: Bool = true, completionHandler: @escaping (Result<Void, Error>) -> Void)
|
||||
{
|
||||
do
|
||||
|
||||
Reference in New Issue
Block a user