fix for 1.2
This commit is contained in:
parent
504d0fbd18
commit
8b3e4a2c43
@ -68,7 +68,7 @@ class SocketPacket {
|
||||
}
|
||||
|
||||
func getEvent() -> String {
|
||||
return data?.removeAtIndex(0) as String
|
||||
return data?.removeAtIndex(0) as! String
|
||||
}
|
||||
|
||||
func addData(data:NSData) -> Bool {
|
||||
@ -226,7 +226,7 @@ class SocketPacket {
|
||||
// if it is a placeholder for data
|
||||
if let str = value as? String {
|
||||
if let num = str["~~(\\d)"].groups() {
|
||||
newDict[key as! String] = self.datas[num[1].toInt()!]
|
||||
newDict[key as! String] = self.binary[num[1].toInt()!]
|
||||
} else {
|
||||
newDict[key as! String] = str
|
||||
}
|
||||
|
||||
@ -93,7 +93,7 @@ class SocketParser {
|
||||
let d = String(arr[++i...arr.count-1])
|
||||
let noPlaceholders = d["(\\{\"_placeholder\":true,\"num\":(\\d*)\\})"] ~= "\"~~$2\""
|
||||
|
||||
let data = SocketParser.parseData(noPlaceholders) as [AnyObject]
|
||||
let data = SocketParser.parseData(noPlaceholders) as! [AnyObject]
|
||||
|
||||
return SocketPacket(type: SocketPacketType(str: type), data: data,
|
||||
nsp: nsp, placeholders: placeholders, id: id)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user