Support kcptun.

This commit is contained in:
Charlie Qiu
2017-01-11 20:49:37 +08:00
parent 6d4cbedcfa
commit f7cca35948
8 changed files with 196 additions and 23 deletions

View File

@ -107,6 +107,9 @@ class ServerProfile: NSObject, NSCopying {
if let ota = data["OTA"] {
profile.ota = ota as! Bool
}
if let enabledKcptun = data["EnabledKcptun"] {
profile.enabledKcptun = enabledKcptun as! Bool
}
if let kcptunData = data["KcptunProfile"] {
profile.kcptunProfile = KcptunProfile.fromDictionary(kcptunData as! [String:Any?])
}
@ -132,7 +135,7 @@ class ServerProfile: NSObject, NSCopying {
d["Password"] = password as AnyObject?
d["Remark"] = remark as AnyObject?
d["OTA"] = ota as AnyObject?
d["EnabledKcptun"] = enabledKcptun as AnyObject
d["EnabledKcptun"] = NSNumber(value: enabledKcptun)
d["KcptunProfile"] = kcptunProfile.toDictionary() as AnyObject
return d
}