mirror of
https://github.com/moonlight-stream/moonlight-ios.git
synced 2025-07-27 06:32:59 +00:00
36 lines
985 B
Objective-C
36 lines
985 B
Objective-C
//
|
|
// ServerInfoResponse.m
|
|
// Moonlight
|
|
//
|
|
// Created by Diego Waxemberg on 2/1/15.
|
|
// Copyright (c) 2015 Moonlight Stream. All rights reserved.
|
|
//
|
|
|
|
#import "ServerInfoResponse.h"
|
|
#import <libxml2/libxml/xmlreader.h>
|
|
|
|
@implementation ServerInfoResponse
|
|
@synthesize data, statusCode, statusMessage;
|
|
|
|
- (void) populateWithData:(NSData *)xml {
|
|
self.data = xml;
|
|
[super parseData];
|
|
}
|
|
|
|
- (void) populateHost:(TemporaryHost*)host {
|
|
host.name = [[self getStringTag:TAG_HOSTNAME] trim];
|
|
host.externalAddress = [[self getStringTag:TAG_EXTERNAL_IP] trim];
|
|
host.localAddress = [[self getStringTag:TAG_LOCAL_IP] trim];
|
|
host.uuid = [[self getStringTag:TAG_UNIQUE_ID] trim];
|
|
host.mac = [[self getStringTag:TAG_MAC_ADDRESS] trim];
|
|
|
|
NSInteger pairStatus;
|
|
if ([self getIntTag:TAG_PAIR_STATUS value:&pairStatus]) {
|
|
host.pairState = pairStatus ? PairStatePaired : PairStateUnpaired;
|
|
} else {
|
|
host.pairState = PairStateUnknown;
|
|
}
|
|
}
|
|
|
|
@end
|