0

I'm integrating NextPeer and the simple integration is done and works fine but now I need to send a custom message to the other player. In NextPeer documentation is explained like this: To send data over an unreliable communication channel, use Nextpeer.UnreliablePushDataToOtherPlayers(byte[] data). And this is what I'm trying to do:

Code (CSharp):

public void SendMessage(int intScore) {
      byte[ ] byteArray = BitConverter.GetBytes( intScore );
      Nextpeer.UnreliablePushDataToOtherPlayers(byte[] byteArray);
      // I tried printing it in cosole and works Debug.Log("To int " + BitConverter.ToInt16(byteArray, 0));
}

I'm getting this error in line where I'm calling Nextpeer.Unr...

Assets/scripts/nextpeer/NextpeerGameManager.cs(100,63): error CS1525: Unexpected symbol `[', expecting `.'

What is wrong?

Thanks in advance!

Brent Worden
  • 10,624
  • 7
  • 52
  • 57
benLIVE
  • 597
  • 3
  • 14
  • 29

1 Answers1

0

Should be Nextpeer.UnreliablePushDataToOtherPlayers(byteArray);

Muddy Waters
  • 113
  • 9