Change send modifications
This commit is contained in:
parent
d553b72daf
commit
a8e0bac437
@ -46,12 +46,10 @@ class MultiplayerNetwork{
|
||||
}
|
||||
|
||||
func sendPlayerMove(unitcount:Int) {
|
||||
var playerMoveMsg = PlayerMove(messageType: MessageType.PlayerMove, unitCount: unitcount)
|
||||
|
||||
|
||||
let data = Data(bytes: &playerMoveMsg, count: MemoryLayout<PlayerMove>.size)
|
||||
|
||||
sendData(data: data)
|
||||
let playerMoveMsg = PlayerMove(messageType: MessageType.PlayerMove, unitCount: unitcount)
|
||||
let encoder = JSONEncoder()
|
||||
let encoded = (try? encoder.encode(playerMoveMsg))!
|
||||
sendData(data: encoded)
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user