Advertisement
Guest User

Untitled

a guest
Aug 4th, 2018
1,316
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. login:function(user,pass){
  2. async.waterfall([
  3. function( cb ) {
  4. // Authenticate
  5. gameSparks.sendAs( null, ".AuthenticationRequest", {
  6. userName: user,
  7. password: pass
  8. },
  9. function( err, user ) {
  10. if ( err ) return cb( err );
  11. else return cb( null, user );
  12. });
  13. },
  14. function( user, cb ) {
  15. // Get the user's account details
  16. gameSparks.sendAs( user.userId, ".AccountDetailsRequest", {}, function( err, res ) {
  17. if ( err )
  18. //return false;
  19. return cb( err );
  20. console.log( "account details:", JSON.stringify( res, null, 2 ) );
  21. cb( null, user );
  22. });
  23. },
  24. ], function( err ) {
  25. if ( err ) console.log( err );
  26.  
  27. // If you want to listen for messages back from the Gamesparks server, then do
  28. // not exit() here. Just sit around and wait ...
  29. /**/
  30. //process.exit(0);
  31. });
  32. },
  33. registro:function(){
  34.  
  35. }
  36. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement