import {PingProps} from './PingProps'; export function decodePing(value: string): PingProps { const [gameId, networkId, instanceId, playerId] = value.split('-'); return {gameId, networkId, instanceId, playerId}; } export function encodePing({gameId, networkId, instanceId, playerId}: PingProps): string { return [gameId, networkId, instanceId, playerId].join('-'); }