Пример #1
0
 /// <summary>
 /// Create a new GGPO.net session.
 /// </summary>
 /// <param name="callbacks">A GGPOSessionCallbacks structure which contains the callbacks you implement
 /// to help GGPO.net synchronize the two games. You must implement all functions in the callbacks, even
 /// if they do nothing but 'return true'</param>
 /// <param name="game">The name of the game. This is used internally for GGPO for logging purposes only.</param>
 /// <param name="numPlayers">The number of players which will be in this game. The number of players per
 /// session is fixed. If you need to change the number of players or any player disconnects, you must
 /// start a new session.</param>
 /// <param name="inputSize">The size of the game inputs which will be passed to AddLocalInput.</param>
 /// <param name="localPort">The port GGPO should bind to for UDP traffic.</param>
 /// <returns></returns>
 public ErrorCode StartSession(GGPOSessionCallbacks callbacks, string game, int numPlayers, int inputSize, int localPort)
 {
     this.callbacks = callbacks;
     unsafe
     {
         fixed(GGPOSession **s = &session)
         {
             fixed(GGPOSessionCallbacks *cb = &this.callbacks)
             {
                 return(ggpo_start_session(s, cb, game, numPlayers, inputSize, localPort));
             }
         }
     }
 }
Пример #2
0
 /// <summary>
 /// Used to being a new GGPO.net sync test session.  During a sync test, every
 /// frame of execution is run twice: once in prediction mode and once again to
 /// verify the result of the prediction.If the checksums of your save states
 /// do not match, the test is aborted.
 /// </summary>
 /// <param name="callbacks">A GGPOSessionCallbacks structure which contains the callbacks you implement
 /// to help GGPO.net synchronize the two games. You must implement all functions in the callbacks, even
 /// if they do nothing but 'return true'</param>
 /// <param name="game">The name of the game. This is used internally for GGPO for logging purposes only.</param>
 /// <param name="numPlayers">The number of players which will be in this game. The number of players per
 /// session is fixed. If you need to change the number of players or any player disconnects, you must
 /// start a new session.</param>
 /// <param name="inputSize">The size of the game inputs which will be passed to ggpo_add_local_input.</param>
 /// <param name="frames">The number of frames to run before verifying the prediction. The recommended
 /// value is 1.</param>
 /// <returns></returns>
 public ErrorCode StartSyncTest(GGPOSessionCallbacks callbacks, string game, int numPlayers, int inputSize, int frames)
 {
     this.callbacks = callbacks;
     unsafe
     {
         fixed(GGPOSession **s = &session)
         {
             fixed(GGPOSessionCallbacks *cb = &this.callbacks)
             {
                 return(ggpo_start_synctest(s, cb, game, numPlayers, inputSize, frames));
             }
         }
     }
 }