void HeartBeat() { if (currentPlayers.ContainsKey(myAddress)) { pos = new currentPosition(); pos.X = currentPlayers[myAddress].transform.position.x; pos.Y = currentPlayers[myAddress].transform.position.y; pos.Z = currentPlayers[myAddress].transform.position.z; } Byte[] sendBytes = Encoding.ASCII.GetBytes(JsonUtility.ToJson(pos)); udp.Send(sendBytes, sendBytes.Length); }
// send player position on this client to server void SendPosition() { // create pos object currentPosition currPos = new currentPosition(); // sync with player movement currPos.position.x = currX; currPos.position.y = currY; currPos.position.z = currZ; // Debug.Log($"{currX},{currY}, {currZ}"); // send to server Byte[] senddata = Encoding.ASCII.GetBytes(JsonUtility.ToJson(currPos)); udp.Send(senddata, senddata.Length); }
foreach (var(currentPosition, currentSnapshot) in _incrementalSnapshots)
Direction.Forward => (this.ApplyShipForward(currentPosition, currentDirection, instruction.Value), currentDirection),
if (!this.ExpandRuns(newChild, paragraph, gfx, frame, startPosition, ref currentPosition, lines, currentLine, resolver, newContext, emScale)) { return(false);