Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- login:function(user,pass){
- async.waterfall([
- function( cb ) {
- // Authenticate
- gameSparks.sendAs( null, ".AuthenticationRequest", {
- userName: user,
- password: pass
- },
- function( err, user ) {
- if ( err ) return cb( err );
- else return cb( null, user );
- });
- },
- function( user, cb ) {
- // Get the user's account details
- gameSparks.sendAs( user.userId, ".AccountDetailsRequest", {}, function( err, res ) {
- if ( err )
- //return false;
- return cb( err );
- console.log( "account details:", JSON.stringify( res, null, 2 ) );
- cb( null, user );
- });
- },
- ], function( err ) {
- if ( err ) console.log( err );
- // If you want to listen for messages back from the Gamesparks server, then do
- // not exit() here. Just sit around and wait ...
- /**/
- //process.exit(0);
- });
- },
- registro:function(){
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement