pellest/src/network.ml

11 lines
304 B
OCaml

let marshal o = Marshal.to_string o [] |> Format.sprintf "%S"
let unmarshal o =
let s = Scanf.sscanf o "%S" (fun s -> s) in
Marshal.from_string s 0
type server_message =
| Full_state of State.t
| Update_result of (State.action', string) result
type client_message = Action_msg of State.action