Beispiel #1
0
            private static void AssignSyncDelegateFunctions()
            {
                Debug.Log("Assign Sync Delegate Functions");

                var    onMatchCompletedFP = new VoidFP(onMatchCompleted);
                IntPtr onMatchCompletedIP = Marshal.GetFunctionPointerForDelegate(onMatchCompletedFP);

                InteropMethods._assignOnMatchCompletedFunc(onMatchCompletedIP);

                var    onDidReceiveDataFP = new IntPtrIntFP(onDidReceiveData);
                IntPtr onDidReceiveDataIP = Marshal.GetFunctionPointerForDelegate(onDidReceiveDataFP);

                InteropMethods._assignOnDidReceiveDataFunc(onDidReceiveDataIP);

                var    onOpponentHasLostConnectionFP = new IntFP(onOpponentHasLostConnection);
                IntPtr onOpponentHasLostConnectionIP = Marshal.GetFunctionPointerForDelegate(onOpponentHasLostConnectionFP);

                InteropMethods._assignOnOpponentHasLostConnectionFunc(onOpponentHasLostConnectionIP);

                var    OnOpponentHasReconnectedFP = new IntFP(onOpponentHasReconnected);
                IntPtr onOpponentHasReconnectedIP = Marshal.GetFunctionPointerForDelegate(OnOpponentHasReconnectedFP);

                InteropMethods._assignOnOpponentHasReconnectedFunc(onOpponentHasReconnectedIP);

                var    onOpponentHasLeftMatchFP = new IntFP(onOpponentHasLeftMatch);
                IntPtr onOpponentHasLeftMatchIP = Marshal.GetFunctionPointerForDelegate(onOpponentHasLeftMatchFP);

                InteropMethods._assignOnOpponentHasLeftMatchFunc(onOpponentHasLeftMatchIP);

                var    onCurrentPlayerHasLostConnectionFP = new VoidFP(onCurrentPlayerHasLostConnection);
                IntPtr onCurrentPlayerHasLostConnectionIP = Marshal.GetFunctionPointerForDelegate(onCurrentPlayerHasLostConnectionFP);

                InteropMethods._assignOnCurrentPlayerHasLostConnectionFunc(onCurrentPlayerHasLostConnectionIP);

                var    onCurrentPlayerHasReconnectedFP = new VoidFP(onCurrentPlayerHasReconnected);
                IntPtr onCurrentPlayerHasReconnectedIP = Marshal.GetFunctionPointerForDelegate(onCurrentPlayerHasReconnectedFP);

                InteropMethods._assignOnCurrentPlayerHasReconnectedFunc(onCurrentPlayerHasReconnectedIP);

                var    onCurrentPlayerHasLeftMatchFP = new VoidFP(onCurrentPlayerHasLeftMatch);
                IntPtr onCurrentPlayerHasLeftMatchIP = Marshal.GetFunctionPointerForDelegate(onCurrentPlayerHasLeftMatchFP);

                InteropMethods._assignOnCurrentPlayerHasLeftMatchFunc(onCurrentPlayerHasLeftMatchIP);
            }
Beispiel #2
0
 public void LaunchSkillz()
 {
     InteropMethods._launchSkillz();
 }
Beispiel #3
0
 long ISyncAPI.GetTimeLeftForReconnection(ulong playerId)
 {
     return(InteropMethods._reconnectTimeLeftForPlayer(playerId));
 }
Beispiel #4
0
 ulong ISyncAPI.GetCurrentPlayerId()
 {
     return(InteropMethods._currentPlayerId());
 }
Beispiel #5
0
 double ISyncAPI.GetServerTime()
 {
     return(InteropMethods._getServerTime());
 }
Beispiel #6
0
 public void SetSkillzBackgroundMusic(string fileName)
 {
     Debug.Log("SkillzAudio Api.cs setSkillzBackgroundMusic with file name: " + fileName);
     InteropMethods._setSkillzBackgroundMusic(fileName);
 }
Beispiel #7
0
 int ISyncAPI.GetConnectedPlayerCount()
 {
     return(InteropMethods._connectedPlayerCount());
 }
Beispiel #8
0
 public string SDKVersionShort()
 {
     return(Marshal.PtrToStringAnsi(InteropMethods._SDKShortVersion()));
 }
Beispiel #9
0
 public void AddMetadataForMatchInProgress(string metadataJson, bool forMatchInProgress)
 {
     InteropMethods._addMetadataForMatchInProgress(metadataJson, forMatchInProgress);
 }
Beispiel #10
0
 public void ReportFinalScore(float score)
 {
     InteropMethods._displayTournamentResultsWithFloatScore(score);
     _matchInfo = null;
 }
Beispiel #11
0
 public void ReportFinalScore(string score)
 {
     InteropMethods._displayTournamentResultsWithStringScore(score);
     _matchInfo = null;
 }
Beispiel #12
0
 public void UpdatePlayersCurrentScore(float score)
 {
     InteropMethods._updatePlayersCurrentScore(score);
 }
Beispiel #13
0
 public void UpdatePlayersCurrentScore(string score)
 {
     InteropMethods._updatePlayersCurrentStringScore(score);
 }
Beispiel #14
0
 public void AbortMatch()
 {
     InteropMethods._notifyPlayerAbortWithCompletion();
     _matchInfo = null;
 }