MergGK Game Center Peer to Peer
Posted: Tue Aug 29, 2023 12:53 am
Hey all,
I'm working on trying to incorporate online multiplayer into my game via MergGk http://mergext.com/home/merggk/. I've managed to integrate the app with Game Center. I have the app logged into a Game Center account on the test iPhone simulator and a different account on an actual iPhone. I definitely manage to get authentication. I use:
on mergGKLocalPlayerAuthenticated pPlayerID,pPlayerAlias,pPlayerDisplayName
put pPlayerID into field "playerID"
end mergGKLocalPlayerAuthenticated
Comes up with the respective IDs on each test source.
What I cant do is any of the peer-to-peer stuff.
The documentation says that the command mergGKStartPeer 'Register(s) as a peer in the GameKit peer-to-peer session'. But what session is this, does it start a session?
I have both test sources using this command and then I've tried sending some data.
On one of the sources:
put field "data" into pData
mergGKSendToAllPeers pData
Then I make sure one can recieve the data. In the documentation it says the message mergGKDataReceived is sent to the control that called mergGKStartPeer when a peer sends some data. (pPeerID,pData)
So I tried putting this in the card since that's where I put mergGKStartPeer:
on mergGKDataReceived pData
put pData into field "incomingdata"
end mergGKDataReceived
Nothing.
I tried puttting the pPeerID in a field on each test source and both are '1'...?
Obviously missing something, can anyone point me in the right direction?
I'm working on trying to incorporate online multiplayer into my game via MergGk http://mergext.com/home/merggk/. I've managed to integrate the app with Game Center. I have the app logged into a Game Center account on the test iPhone simulator and a different account on an actual iPhone. I definitely manage to get authentication. I use:
on mergGKLocalPlayerAuthenticated pPlayerID,pPlayerAlias,pPlayerDisplayName
put pPlayerID into field "playerID"
end mergGKLocalPlayerAuthenticated
Comes up with the respective IDs on each test source.
What I cant do is any of the peer-to-peer stuff.
The documentation says that the command mergGKStartPeer 'Register(s) as a peer in the GameKit peer-to-peer session'. But what session is this, does it start a session?
I have both test sources using this command and then I've tried sending some data.
On one of the sources:
put field "data" into pData
mergGKSendToAllPeers pData
Then I make sure one can recieve the data. In the documentation it says the message mergGKDataReceived is sent to the control that called mergGKStartPeer when a peer sends some data. (pPeerID,pData)
So I tried putting this in the card since that's where I put mergGKStartPeer:
on mergGKDataReceived pData
put pData into field "incomingdata"
end mergGKDataReceived
Nothing.
I tried puttting the pPeerID in a field on each test source and both are '1'...?
Obviously missing something, can anyone point me in the right direction?