×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Jun 2006
    Posts
    14

    Question Getting players' presence

    Hi,
    How can I get friends' presence?
    I know that when friend's presence changes I get event 307 (IMPS_IM_PRESENCE).
    However, when player logs-in he/she needs precense of friends at the moment of login. How can I get it?

  2. #2
    Registered User
    Join Date
    Jun 2006
    Posts
    25

    Re: Getting players' presence

    If you are using the extendedLogin function of the API, a client is automatically logged into the IMPS subsystem. In addition, that function will automatically set your client's IMPS presence to available. Once you login and declare your presence to IMPS, the IMPS server will automatically send you all presence status of friends who are online.

    Try logging in 2 clients who are friends and then log in a 3rd. Watch how the presence of the first 2 friends are automatically sent to the 3rd friend immediatly after login.

    Please not that you must have started the snap event listner to receive these asyncronous events.

    Thanks,
    Matt

  3. #3
    Registered User
    Join Date
    Jun 2006
    Posts
    14

    Exclamation Re: Getting players' presence

    Hehe, and I was wandering why I got those 307 notifications after logging ;-)

    Now I'm trying to parse stuff from 307. Could you please tell me what "presence" string is build of? I got: v=1.0,0,29555,0,Game=1. I believe third number is game class ID. What are other things?

    BTW, it seems there's some mistake in documentation - SNAP Game Dev. Guide 2.1 says that 307 has "fromUserID" and "fromUserName" members. In fact SNAP sends ItemList with "snapUserID" and "fromName" inside.

  4. #4
    Registered User
    Join Date
    Jan 2004
    Posts
    12

    Re: Getting players' presence

    Hi,

    If you are getting a presence string inside of IMPS_IM_PRESENCE updates that looks like this:

    "v=1.0,0,29555,0,Game=1"

    Then I believe you are using an older (deprecated) version of the client and/or server emulator. One of the biggest differences moving to the v1.1.1 release (and also in the brand new v1.2 release) is a new expanded way of handling presence that both:

    1) Parses apart presence information into separate return values for you (so you don't have to manually parse apart presence information embedded in a string like the one above)

    2) Returns much more information about each user

    You should make sure you are running with the latest releases of the client and the emulator --- both are available as of today/yesterday at:

    http://snapmobile.nokia.com/n-gage/w...obile_v1_2.zip

    (the server emulator is inside the /tools directory).

    The new version will not require you to parse apart any Presence strings to get user info (apart from your own application-specific uses for the Presence string -- which now has no default contents, only what you choose to put in it.)

    If you believe you are already running with the latest versions of the client/server, please post back! Your presence string looks like an older version (pre-March 2006 release), so I would be eager to find out what is going on...

    As for the API documentation, you may also have a mismatch between API versions and documentation versions... I will double check.

    Thanks,
    Sam

  5. #5
    Registered User
    Join Date
    Jun 2006
    Posts
    14

    Re: Getting players' presence

    I've been using SDK 1.1.1 version. As for server I don't use emulator but live server (unfortunatley I don't know which version). I'll try to switch to SDK 1.2 and see what happens.

  6. #6
    Registered User
    Join Date
    Jun 2006
    Posts
    14

    Thumbs up Re: Getting players' presence

    I've switched to SDK 1.2 and now there's "fromID" inside 307 ItemList which I use to change local friends list.

Similar Threads

  1. Replies: 0
    Last Post: 2005-10-06, 08:35
  2. Presence server disconnect after calling
    By EdwinZ in forum Smart Messaging
    Replies: 1
    Last Post: 2004-07-08, 11:56
  3. Nokia Presence Server
    By laurapacini in forum Smart Messaging
    Replies: 0
    Last Post: 2003-05-26, 16:47
  4. Nokia Presence Server
    By laurapacini in forum General Messaging
    Replies: 0
    Last Post: 2003-05-26, 16:46
  5. Nokia Presence Server
    By laurapacini in forum General Messaging
    Replies: 1
    Last Post: 2003-05-26, 13:42

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×