Issue with BuddyVariables (dump included)

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

User avatar
Fraggle
Posts: 62
Joined: 02 Apr 2010, 06:41
Location: Paris, France

Issue with BuddyVariables (dump included)

Postby Fraggle » 07 Feb 2012, 18:17

Hi,

I have created a custom BuddyListStorage (quite simple) that load the buddy list from our API and set "buddy_avatar_url" as OfflineVariables so the user can see it's buddylist with his friends' pictures.

Here is the flow:

• In UserJoinZoneHandler I init the buddyList:

Code: Select all

SmartFoxServer.getInstance().getAPIManager().getBuddyApi().initBuddyList(u, false);


• In the BuddyCustomStorage, I create the Buddies like that:

Code: Select all

// buddyProperties is a HashMap<String, List<BuddyVariable>> used to store "offline variables"
List<BuddyVariable> list = new ArrayList<BuddyVariable>();
list.add(new SFSBuddyVariable("buddy_avatar_url", properties.getString("avatar_url")));
buddyProperties.put(buddyName, list);

// Create buddy
Buddy buddy = new SFSBuddy(buddyName);
buddy.setParentBuddyList(buddyList);
buddyList.addBuddy(buddy);


Then I let SmartFox does his thing.
Now, here is the scenario.
User A is logged in.
User B log in.
User A log out => A's buddy variable "buddy_avatar_url" exists and is visible by B
User A log in => A's buddy variable "buddy_avatar_url" no longer exists (at least, it is not visible by B)
User A log out/in etc.. the "buddy_avatar_url" is no more.

Here is a dump of the traffic seen by the Flash client. It seems to me that the bug lie somewhere in the AS3 lib as I cannot see any trace of the server asking to remove anything.

If you can help me, that would be great. I'm growing gray hairs here.

Thanks,

Sebastien

Code: Select all

Using Flex SDK 4.5 Debugger Adapter.[Info]
Listening to port 7935.
[Info] Connection as server to player via 7935 established.
[Loading] Loaded: Users:seb:Documents:Coding:smartfox:FantasyRivals_Flash_Smartforx:FantasyRivals.swf
[SFS - INFO] Object going out:
   (byte) c: 0
   (sfs_object) p:
      (utf_string) api: 0.9.17
      (utf_string) cl: FlashPlayer:StandAlone:MAC 11,0,1,152
   
   (short) a: 0

[SFS - INFO] Data written: Binary Size: 78
12 00 03 00 01 63 02 00 00 01 70 12 00 02 00 03    .....c....p.....
61 70 69 08 00 06 30 2E 39 2E 31 37 00 02 63 6C    api...0.9.17..cl
08 00 25 46 6C 61 73 68 50 6C 61 79 65 72 3A 53    ..%FlashPlayer:S
74 61 6E 64 41 6C 6F 6E 65 3A 4D 41 43 20 31 31    tandAlone:MAC.11
2C 30 2C 31 2C 31 35 32 00 01 61 03 00 00          ,0,1,152..a... 

[SFS - INFO] Data Read: Binary Size: 80
80 00 4D 12 00 03 00 01 61 03 00 00 00 01 63 02    ..M.....a.....c.
00 00 01 70 12 00 03 00 02 74 6B 08 00 20 62 66    ...p.....tk...bf
30 37 33 35 39 37 64 38 34 30 64 65 35 32 33 63    073597d840de523c
30 37 30 65 36 61 37 64 62 65 64 37 63 37 00 02    070e6a7dbed7c7..
63 74 04 00 00 04 00 00 02 6D 73 04 00 7A 12 00    ct.......ms..z..

[SFS - INFO] Handshake { Message id: 0 }
{ Dump: }

   (int) ms: 8000000
   (utf_string) tk: bf073597d840de523c070e6a7dbed7c7
   (int) ct: 1024

onConnection true
[SFS - INFO] Object going out:
   (byte) c: 0
   (sfs_object) p:
      (utf_string) zn: fantasyRivals
      (utf_string) un: oauth_token=XXXXXXXXXXX&oauth_token_secret=XXXXXXXXXXXXX
      (utf_string) pw:
   
   (short) a: 1

[SFS - INFO] Data written: Binary Size: 136
12 00 03 00 01 63 02 00 00 01 70 12 00 03 00 02    .....c....p.....
7A 6E 08 00 0D 66 61 6E 74 61 73 79 52 69 76 61    zn...fantasyRiva
6C 73 00 02 75 6E 08 00 52 6F 61 75 74 68 5F 74    ls..un..Roauth_t
6F 6B 65 6E 3D 74 4D 36 61 78 57 4C 67 4A 67 6B    oken=tM6axWLgJgk
46 68 53 4A 36 59 68 26 6F 61 75 74 68 5F 74 6F    FhSJ6Yh&oauth_to
6B 65 6E 5F 73 65 63 72 65 74 3D 36 62 4A 66 56    ken_secret=6bJfV
68 64 56 35 35 33 53 44 47 57 45 35 46 54 4B 54    hdV553SDGWE5FTKT
39 42 66 66 57 53 46 38 4E 64 78 00 02 70 77 08    9BffWSF8Ndx..pw.
00 00 00 01 61 03 00 01                            ....a...       

[SFS - INFO] Data Read: Binary Size: 160
80 00 9D 12 00 03 00 01 61 03 00 01 00 01 63 02    ........a.....c.
00 00 01 70 12 00 07 00 02 72 6C 11 00 01 11 00    ...p.....rl.....
09 04 00 00 00 00 08 00 09 54 68 65 20 4C 6F 62    .........The.Lob
62 79 08 00 07 64 65 66 61 75 6C 74 01 00 01 00    by...default....
01 00 03 00 01 03 03 E8 11 00 00 00 02 7A 6E 08    .............zn.
00 0D 66 61 6E 74 61 73 79 52 69 76 61 6C 73 00    ..fantasyRivals.
02 72 73 03 00 00 00 02 75 6E 08 00 03 73 65 62    .rs.....un...seb
00 02 69 64 04 00 00 00 04 00 01 70 12 00 01 00    ..id.......p....
12 24 46 53 5F 4E 45 57 5F 4C 4F 47 49 4E 5F 4E    .$FS_NEW_LOGIN_N
41 4D 45 08 00 03 73 65 62 00 02 70 69 03 00 00    AME...seb..pi...

[SFS - INFO] Login { Message id: 1 }
{ Dump: }

   (utf_string) un: seb
   (int) id: 4
   (sfs_object) p:
      (utf_string) $FS_NEW_LOGIN_NAME: seb
   
   (sfs_array) rl:
      (sfs_array)
         (int) 0
         (utf_string) The Lobby
         (utf_string) default
         (bool) false
         (bool) false
         (bool) false
         (short) 1
         (short) 1000
         (sfs_array)
            
         
      
   
   (short) rs: 0
   (short) pi: 0
   (utf_string) zn: fantasyRivals

[SFS - INFO] Object going out:
   (byte) c: 0
   (sfs_object) p:
      (utf_string) n: The Lobby
   
   (short) a: 4

[SFS - INFO] Data written: Binary Size: 35
12 00 03 00 01 63 02 00 00 01 70 12 00 01 00 01    .....c....p.....
6E 08 00 09 54 68 65 20 4C 6F 62 62 79 00 01 61    n...The.Lobby..a
03 00 04                                           ...             

[SFS - INFO] Data Read: Binary Size: 671
80 00 B3 12 00 03 00 01 61 03 00 0C 00 01 63 02    ........a.....c.
00 00 01 70 12 00 02 00 01 75 04 00 00 00 04 00    ...p.....u......
02 76 6C 11 00 03 11 00 03 08 00 02 78 70 02 02    .vl.........xp..
04 00 00 05 1E 11 00 03 08 00 07 63 6F 75 6E 74    ...........count
72 79 02 04 08 00 04 6E 75 6C 6C 11 00 03 08 00    ry.....null.....
0A 61 76 61 74 61 72 5F 75 72 6C 02 04 08 00 56    .avatar_url....V
68 74 74 70 3A 2F 2F 66 61 6E 74 61 73 79 2D 6D    http://fantasy-m
65 64 69 61 2D 64 65 76 2E 73 33 2E 61 6D 61 7A    edia-dev.s3.amaz
6F 6E 61 77 73 2E 63 6F 6D 2F 70 6C 61 79 65 72    onaws.com/player
73 2F 37 63 33 64 38 38 64 30 35 65 64 65 38 32    s/7c3d88d05ede82
38 36 34 37 63 35 38 34 65 65 38 65 31 34 31 63    8647c584ee8e141c
30 35 2E 6A 70 67 80 00 45 12 00 03 00 01 61 03    05.jpg..E.....a.
00 0D 00 01 63 02 01 00 01 70 12 00 02 00 01 63    ....c....p.....c
08 00 0C 70 6C 61 79 65 72 2E 69 6E 66 6F 73 00    ...player.infos.
01 70 12 00 02 00 04 67 6F 6C 64 04 00 00 00 00    .p.....gold.....
00 07 63 72 65 64 69 74 73 04 00 00 00 00 80 01    ..credits.......
9E 12 00 03 00 01 61 03 00 04 00 01 63 02 00 00    ......a.....c...
01 70 12 00 02 00 01 72 11 00 09 04 00 00 00 00    .p.....r........
08 00 09 54 68 65 20 4C 6F 62 62 79 08 00 07 64    ...The.Lobby...d
65 66 61 75 6C 74 01 00 01 00 01 00 03 00 02 03    efault..........
03 E8 11 00 00 00 02 75 6C 11 00 02 11 00 05 04    .......ul.......
00 00 00 03 08 00 08 6C 6F 72 61 6E 67 65 72 03    .......loranger.
00 00 03 00 00 11 00 03 11 00 03 08 00 0A 61 76    ..............av
61 74 61 72 5F 75 72 6C 02 04 08 00 56 68 74 74    atar_url....Vhtt
70 3A 2F 2F 66 61 6E 74 61 73 79 2D 6D 65 64 69    p://fantasy-medi
61 2D 64 65 76 2E 73 33 2E 61 6D 61 7A 6F 6E 61    a-dev.s3.amazona
77 73 2E 63 6F 6D 2F 70 6C 61 79 65 72 73 2F 63    ws.com/players/c
31 63 38 62 33 35 31 31 36 37 37 62 31 66 64 31    1c8b3511677b1fd1
65 30 38 37 34 62 63 63 66 62 32 65 62 34 64 2E    e0874bccfb2eb4d.
70 6E 67 11 00 03 08 00 02 78 70 02 02 04 00 00    png......xp.....
04 EC 11 00 03 08 00 07 63 6F 75 6E 74 72 79 02    ........country.
04 08 00 04 6E 75 6C 6C 11 00 05 04 00 00 00 04    ....null........
08 00 03 73 65 62 03 00 00 03 00 00 11 00 03 11    ...seb..........
00 03 08 00 0A 61 76 61 74 61 72 5F 75 72 6C 02    .....avatar_url.
04 08 00 56 68 74 74 70 3A 2F 2F 66 61 6E 74 61    ...Vhttp://fanta
73 79 2D 6D 65 64 69 61 2D 64 65 76 2E 73 33 2E    sy-media-dev.s3.
61 6D 61 7A 6F 6E 61 77 73 2E 63 6F 6D 2F 70 6C    amazonaws.com/pl
61 79 65 72 73 2F 37 63 33 64 38 38 64 30 35 65    ayers/7c3d88d05e
64 65 38 32 38 36 34 37 63 35 38 34 65 65 38 65    de828647c584ee8e
31 34 31 63 30 35 2E 6A 70 67 11 00 03 08 00 02    141c05.jpg......
78 70 02 02 04 00 00 05 1E 11 00 03 08 00 07 63    xp.............c
6F 75 6E 74 72 79 02 04 08 00 04 6E 75 6C 6C       ountry.....null

[SFS - INFO] SetUserVariables { Message id: 12 }
{ Dump: }

   (int) u: 4
   (sfs_array) vl:
      (sfs_array)
         (utf_string) xp
         (byte) 2
         (int) 1310
      
      (sfs_array)
         (utf_string) country
         (byte) 4
         (utf_string) null
      
      (sfs_array)
         (utf_string) avatar_url
         (byte) 4
         (utf_string) http://fantasy-media-dev.s3.amazonaws.com/players/7c3d88d05ede828647c584ee8e141c05.jpg
      
   

[SFS - INFO] { Message id: 13 }
{ Dump: }

   (utf_string) c: player.infos
   (sfs_object) p:
      (int) credits: 0
      (int) gold: 0
   

[SFS - INFO] JoinRoom { Message id: 4 }
{ Dump: }

   (sfs_array) ul:
      (sfs_array)
         (int) 3
         (utf_string) loranger
         (short) 0
         (short) 0
         (sfs_array)
            (sfs_array)
               (utf_string) avatar_url
               (byte) 4
               (utf_string) http://fantasy-media-dev.s3.amazonaws.com/players/c1c8b3511677b1fd1e0874bccfb2eb4d.png
            
            (sfs_array)
               (utf_string) xp
               (byte) 2
               (int) 1260
            
            (sfs_array)
               (utf_string) country
               (byte) 4
               (utf_string) null
            
         
      
      (sfs_array)
         (int) 4
         (utf_string) seb
         (short) 0
         (short) 0
         (sfs_array)
            (sfs_array)
               (utf_string) avatar_url
               (byte) 4
               (utf_string) http://fantasy-media-dev.s3.amazonaws.com/players/7c3d88d05ede828647c584ee8e141c05.jpg
            
            (sfs_array)
               (utf_string) xp
               (byte) 2
               (int) 1310
            
            (sfs_array)
               (utf_string) country
               (byte) 4
               (utf_string) null
            
         
      
   
   (sfs_array) r:
      (int) 0
      (utf_string) The Lobby
      (utf_string) default
      (bool) false
      (bool) false
      (bool) false
      (short) 2
      (short) 1000
      (sfs_array)
         
      
   

[SFS - INFO] Data Read: Binary Size: 858
80 03 0E 12 00 03 00 01 61 03 00 C8 00 01 63 02    ........a.....c.
00 00 01 70 12 00 03 00 02 6D 76 11 00 01 11 00    ...p.....mv.....
03 08 00 10 62 75 64 64 79 5F 61 76 61 74 61 72    ....buddy_avatar
5F 75 72 6C 02 04 08 00 56 68 74 74 70 3A 2F 2F    _url....Vhttp://
66 61 6E 74 61 73 79 2D 6D 65 64 69 61 2D 64 65    fantasy-media-de
76 2E 73 33 2E 61 6D 61 7A 6F 6E 61 77 73 2E 63    v.s3.amazonaws.c
6F 6D 2F 70 6C 61 79 65 72 73 2F 37 63 33 64 38    om/players/7c3d8
38 64 30 35 65 64 65 38 32 38 36 34 37 63 35 38    8d05ede828647c58
34 65 65 38 65 31 34 31 63 30 35 2E 6A 70 67 00    4ee8e141c05.jpg.
02 62 73 10 00 03 00 09 41 76 61 69 6C 61 62 6C    .bs.....Availabl
65 00 04 41 77 61 79 00 08 4F 63 63 75 70 69 65    e..Away..Occupie
64 00 02 62 6C 11 00 05 11 00 04 04 FF FF FF FF    d..bl...........
08 00 07 6F 6B 61 69 69 6E 61 01 00 11 00 01 11    ...okaiina......
00 03 08 00 10 62 75 64 64 79 5F 61 76 61 74 61    .....buddy_avata
72 5F 75 72 6C 02 04 08 00 36 68 74 74 70 3A 2F    r_url....6http:/
2F 73 74 61 74 69 63 2E 73 65 62 2E 66 61 6E 74    /static.seb.fant
61 73 79 2D 72 69 76 61 6C 73 2E 63 6F 6D 2F 69    asy-rivals.com/i
6D 61 67 65 73 2F 61 76 61 74 61 72 2E 6A 70 67    mages/avatar.jpg
11 00 04 04 FF FF FF FF 08 00 06 46 61 6C 67 61    ...........Falga
6E 01 00 11 00 01 11 00 03 08 00 10 62 75 64 64    n...........budd
79 5F 61 76 61 74 61 72 5F 75 72 6C 02 04 08 00    y_avatar_url....
36 68 74 74 70 3A 2F 2F 73 74 61 74 69 63 2E 73    6http://static.s
65 62 2E 66 61 6E 74 61 73 79 2D 72 69 76 61 6C    eb.fantasy-rival
73 2E 63 6F 6D 2F 69 6D 61 67 65 73 2F 61 76 61    s.com/images/ava
74 61 72 2E 6A 70 67 11 00 04 04 FF FF FF FF 08    tar.jpg.........
00 04 61 64 61 75 01 00 11 00 01 11 00 03 08 00    ..adau..........
10 62 75 64 64 79 5F 61 76 61 74 61 72 5F 75 72    .buddy_avatar_ur
6C 02 04 08 00 4A 68 74 74 70 3A 2F 2F 66 61 6E    l....Jhttp://fan
74 61 73 79 2D 6D 65 64 69 61 2D 64 65 76 2E 73    tasy-media-dev.s
33 2E 61 6D 61 7A 6F 6E 61 77 73 2E 63 6F 6D 2F    3.amazonaws.com/
70 69 63 74 75 72 65 73 2F 41 64 72 69 65 6E 5F    pictures/Adrien_
44 61 75 76 65 72 67 6E 65 5F 31 2E 6A 70 65 67    Dauvergne_1.jpeg
11 00 04 04 FF FF FF FF 08 00 06 44 72 2E 49 64    ...........Dr.Id
6F 01 00 11 00 01 11 00 03 08 00 10 62 75 64 64    o...........budd
79 5F 61 76 61 74 61 72 5F 75 72 6C 02 04 08 00    y_avatar_url....
36 68 74 74 70 3A 2F 2F 73 74 61 74 69 63 2E 73    6http://static.s
65 62 2E 66 61 6E 74 61 73 79 2D 72 69 76 61 6C    eb.fantasy-rival
73 2E 63 6F 6D 2F 69 6D 61 67 65 73 2F 61 76 61    s.com/images/ava
74 61 72 2E 6A 70 67 11 00 04 04 00 00 00 03 08    tar.jpg.........
00 08 6C 6F 72 61 6E 67 65 72 01 00 11 00 02 11    ..loranger......
00 03 08 00 0D 24 5F 5F 42 56 5F 53 54 41 54 45    .....$__BV_STATE
5F 5F 02 04 08 00 09 41 76 61 69 6C 61 62 6C 65    __.....Available
11 00 03 08 00 10 62 75 64 64 79 5F 61 76 61 74    ......buddy_avat
61 72 5F 75 72 6C 02 04 08 00 56 68 74 74 70 3A    ar_url....Vhttp:
2F 2F 66 61 6E 74 61 73 79 2D 6D 65 64 69 61 2D    //fantasy-media-
64 65 76 2E 73 33 2E 61 6D 61 7A 6F 6E 61 77 73    dev.s3.amazonaws
2E 63 6F 6D 2F 70 6C 61 79 65 72 73 2F 63 31 63    .com/players/c1c
38 62 33 35 31 31 36 37 37 62 31 66 64 31 65 30    8b3511677b1fd1e0
38 37 34 62 63 63 66 62 32 65 62 34 64 2E 70 6E    874bccfb2eb4d.pn
67 80 00 46 12 00 03 00 01 61 03 00 CC 00 01 63    g..F.....a.....c
02 00 00 01 70 12 00 02 00 02 62 6E 08 00 03 73    ....p.....bn...s
65 62 00 02 62 76 11 00 01 11 00 03 08 00 0D 24    eb..bv.........$
5F 5F 42 56 5F 53 54 41 54 45 5F 5F 02 04 08 00    __BV_STATE__....
09 41 76 61 69 6C 61 62 6C 65                      .Available     

[SFS - INFO] InitBuddyList { Message id: 200 }
{ Dump: }

   (utf_string_array) bs: [Available,Away,Occupied]
   (sfs_array) mv:
      (sfs_array)
         (utf_string) buddy_avatar_url
         (byte) 4
         (utf_string) http://fantasy-media-dev.s3.amazonaws.com/players/7c3d88d05ede828647c584ee8e141c05.jpg
      
   
   (sfs_array) bl:
      (sfs_array)
         (int) -1
         (utf_string) okaiina
         (bool) false
         (sfs_array)
            (sfs_array)
               (utf_string) buddy_avatar_url
               (byte) 4
               (utf_string) http://static.seb.fantasy-rivals.com/images/avatar.jpg
            
         
      
      (sfs_array)
         (int) -1
         (utf_string) Falgan
         (bool) false
         (sfs_array)
            (sfs_array)
               (utf_string) buddy_avatar_url
               (byte) 4
               (utf_string) http://static.seb.fantasy-rivals.com/images/avatar.jpg
            
         
      
      (sfs_array)
         (int) -1
         (utf_string) adau
         (bool) false
         (sfs_array)
            (sfs_array)
               (utf_string) buddy_avatar_url
               (byte) 4
               (utf_string) http://fantasy-media-dev.s3.amazonaws.com/pictures/Adrien_Dauvergne_1.jpeg
            
         
      
      (sfs_array)
         (int) -1
         (utf_string) Dr.Ido
         (bool) false
         (sfs_array)
            (sfs_array)
               (utf_string) buddy_avatar_url
               (byte) 4
               (utf_string) http://static.seb.fantasy-rivals.com/images/avatar.jpg
            
         
      
      (sfs_array)
         (int) 3
         (utf_string) loranger
         (bool) false
         (sfs_array)
            (sfs_array)
               (utf_string) $__BV_STATE__
               (byte) 4
               (utf_string) Available
            
            (sfs_array)
               (utf_string) buddy_avatar_url
               (byte) 4
               (utf_string) http://fantasy-media-dev.s3.amazonaws.com/players/c1c8b3511677b1fd1e0874bccfb2eb4d.png
            
         
      
   

[SFS - INFO] SetBuddyVariables { Message id: 204 }
{ Dump: }

   (utf_string) bn: seb
   (sfs_array) bv:
      (sfs_array)
         (utf_string) $__BV_STATE__
         (byte) 4
         (utf_string) Available
      
   

[SFS - INFO] Data Read: Binary Size: 407
A0 01 94 78 9C D5 D2 5B 4B C3 30 14 07 F0 56 45    ...x...[K.0...VE
7C F1 41 3F 41 C8 73 D7 F5 B2 B2 AD AF DE 5E 94    |.A?A.s.......^.
89 28 3E 88 8C 2C 39 DD A2 6D 52 9B D3 8D 39 F6    .(>..,9..mR...9.
DD 4D 9D A8 78 41 51 10 CC 5B D2 73 4E FF F9 91    .M..xAQ..[.sN...
5D 67 DD 71 D9 BA B3 ED B8 7C CD 75 DC 72 B7 39    ]g.q.....|.u.r.9
A8 36 9C 66 B9 7C CB D9 D1 A3 1B E0 28 A7 60 FC    .6.f.|......(.`.
BB 1A 0C 9A C7 22 D7 D9 5C ED B6 36 E2 AB 05 15    ....."..\..6....
0C 61 08 4A D0 94 9E D7 40 0E 61 44 82 2E 09 FB    .a.J....@.aD....
69 D0 4D 83 80 EC 1D 9C 93 28 08 23 EA D1 E7 71    i.M......(.#...q
34 5D 50 D4 C8 72 9A 26 1E 95 B6 35 F4 28 E3 13    4]P..r.&...5.(..
09 53 28 40 21 4D 33 96 1B F0 A8 00 C3 2B 59 A2    .S(@!M3......+Y.
D4 CA 8E BF 94 8A 24 64 C4 10 73 B0 E3 14 2B EC    ......$d..s...+.
24 7A C2 6E 81 30 72 3A C7 89 AD B2 3D 32 CB 24    $z.n.0r:....=2.$
AF 73 9C D3 B4 E3 D1 52 72 AC 2B B8 38 3B B6 B5    .s.....Rr.+.8;..
13 C4 32 6D B7 33 A6 90 99 79 AB 00 21 59 4B C0    ..2m.3...y..!YK.
D4 37 B1 CF 0A 76 AF 15 9B 19 9F EB A2 FD 72 F5    .7...v........r.
76 2C BA 10 F3 38 61 09 F0 5E D8 EF C5 19 EF F4    v,...8a..^......
B2 9E E8 27 A1 E8 87 41 E0 97 6A 6C FF 8B F3 B2    ...'...A..jl....
89 33 93 6A F8 14 71 E9 AD 70 46 30 96 EA 6B 9E    .3.j..q..pF0..k.
BB DA C6 92 4D EC 96 E5 A8 0D 54 C3 86 26 F6 A8    ....M.....T..&..
0D 54 E6 80 60 77 58 D5 B0 F4 16 1F 5A 46 49 B0    .T..`wX.....ZFI.
D2 EC 7C 47 73 5F 13 DB 40 84 BD F7 F8 15 E7 E0    ..|Gs_..@.......
E4 E8 0D 62 F4 F7 88 42 0F 9F 72 FD D8 30 FC DC    ...b...B..r..0..
F0 91 A3 41 FC DD D3 8D 56 D8 F1 77 B1 DF 51 EF    ...A....V..w..Q.
0F C8 B1 46 A2 B3 97 2F AF DD C3 7F E9 FE D5 DB    ...F.../........
BD 7E 00 CF A0 60 B5                               .~...`.         

[SFS - INFO] { Message id: 13 }
{ Dump: }

   (utf_string) c: objectives.quests
   (sfs_object) p:
      (utf_string) quests: [
         "date_end":"Tue Feb 07 19:07:00 CET 2012","objective":
            "total":5,"id":1,"achievement":false,"description":"Win 5 battle","name":"Make a Python","difficulty":4,"pictureURL":"http://fantasy-media-dev.s3.amazonaws.com/objectives/3d7e3c35a5ec81983fc48f8d951d9100.png","type":"win_battle"
         ,"date_begin":"Tue Feb 07 19:07:00 CET 2012","quantity":-1,"user_id":3,"completed":true
      ,
         "objective":
            "total":250,"id":4,"achievement":false,"description":"Do 250 damage","name":"OMG","difficulty":2,"pictureURL":"http://fantasy-media-dev.s3.amazonaws.com/objectives/3d7e3c35a5ec81983fc48f8d951d9100.png","type":"do_damage"
         ,"date_begin":"Tue Feb 07 19:07:00 CET 2012","quantity":11,"user_id":3,"completed":false
      ,
         "date_end":"Tue Feb 07 19:07:00 CET 2012","objective":
            "total":2,"id":3,"achievement":false,"description":"Do 2 damage","name":"DO Lot of damage","difficulty":1,"pictureURL":"http://fantasy-media-dev.s3.amazonaws.com/objectives/3d7e3c35a5ec81983fc48f8d951d9100.png","type":"do_damage"
         ,"date_begin":"Tue Feb 07 19:07:00 CET 2012","quantity":-1,"user_id":3,"completed":true
      ]
   
   (int) r: 0

[SFS - INFO] Data Read: Binary Size: 38
80 00 23 12 00 03 00 01 61 03 03 E9 00 01 63 02    ..#.....a.....c.
00 00 01 70 12 00 02 00 01 72 04 00 00 00 00 00    ...p.....r......
02 75 63 03 00 02                                  .uc...         

[SFS - INFO] UserCountChange { Message id: 1001 }
{ Dump: }

   (short) uc: 2
   (int) r: 0

[SFS - INFO] Data Read: Binary Size: 31
80 00 1C 12 00 03 00 01 61 03 03 EA 00 01 63 02    ........a.....c.
00 00 01 70 12 00 01 00 01 75 04 00 00 00 03       ...p.....u.....

[SFS - INFO] UserLost { Message id: 1002 }
{ Dump: }

   (int) u: 3

[SFS - INFO] Data Read: Binary Size: 104
80 00 31 12 00 03 00 01 61 03 00 CD 00 01 63 02    ..1.....a.....c.
00 00 01 70 12 00 03 00 01 6F 02 02 00 02 62 6E    ...p.....o....bn
08 00 08 6C 6F 72 61 6E 67 65 72 00 02 62 69 04    ...loranger..bi.
FF FF FF FF 80 00 31 12 00 03 00 01 61 03 00 CD    ......1.....a...
00 01 63 02 00 00 01 70 12 00 03 00 01 6F 02 02    ..c....p.....o..
00 02 62 6E 08 00 08 6C 6F 72 61 6E 67 65 72 00    ..bn...loranger.
02 62 69 04 FF FF FF FF                            .bi.....       

[SFS - INFO] GoOnline { Message id: 205 }
{ Dump: }

   (byte) o: 2
   (utf_string) bn: loranger
   (int) bi: -1

onBuddyOnlineStateUpdate
[Buddy: okaiina, id: -1],[Buddy: Dr.Ido, id: -1],[Buddy: adau, id: -1],[Buddy: loranger, id: -1],[Buddy: Falgan, id: -1]
=== BUDDY WENT OFFLINE ===
What's the value of buddy_avatar_url ? null
[SFS - INFO] GoOnline { Message id: 205 }
{ Dump: }

   (byte) o: 2
   (utf_string) bn: loranger
   (int) bi: -1

onBuddyOnlineStateUpdate
[Buddy: okaiina, id: -1],[Buddy: Dr.Ido, id: -1],[Buddy: adau, id: -1],[Buddy: loranger, id: -1],[Buddy: Falgan, id: -1]
=== BUDDY WENT OFFLINE ===
What's the value of buddy_avatar_url ? null
[SFS - INFO] Data Read: Binary Size: 38
80 00 23 12 00 03 00 01 61 03 03 E9 00 01 63 02    ..#.....a.....c.
00 00 01 70 12 00 02 00 01 72 04 00 00 00 00 00    ...p.....r......
02 75 63 03 00 01                                  .uc...         

[SFS - INFO] UserCountChange { Message id: 1001 }
{ Dump: }

   (short) uc: 1
   (int) r: 0

[SFS - INFO] Data Read: Binary Size: 206
80 00 CB 12 00 03 00 01 61 03 03 E8 00 01 63 02    ........a.....c.
00 00 01 70 12 00 02 00 01 72 04 00 00 00 00 00    ...p.....r......
01 75 11 00 05 04 00 00 00 05 08 00 08 6C 6F 72    .u...........lor
61 6E 67 65 72 03 00 00 03 00 00 11 00 03 11 00    anger...........
03 08 00 0A 61 76 61 74 61 72 5F 75 72 6C 02 04    ....avatar_url..
08 00 56 68 74 74 70 3A 2F 2F 66 61 6E 74 61 73    ..Vhttp://fantas
79 2D 6D 65 64 69 61 2D 64 65 76 2E 73 33 2E 61    y-media-dev.s3.a
6D 61 7A 6F 6E 61 77 73 2E 63 6F 6D 2F 70 6C 61    mazonaws.com/pla
79 65 72 73 2F 63 31 63 38 62 33 35 31 31 36 37    yers/c1c8b351167
37 62 31 66 64 31 65 30 38 37 34 62 63 63 66 62    7b1fd1e0874bccfb
32 65 62 34 64 2E 70 6E 67 11 00 03 08 00 02 78    2eb4d.png......x
70 02 02 04 00 00 04 EC 11 00 03 08 00 07 63 6F    p.............co
75 6E 74 72 79 02 04 08 00 04 6E 75 6C 6C          untry.....null 

[SFS - INFO] UserEnterRoom { Message id: 1000 }
{ Dump: }

   (sfs_array) u:
      (int) 5
      (utf_string) loranger
      (short) 0
      (short) 0
      (sfs_array)
         (sfs_array)
            (utf_string) avatar_url
            (byte) 4
            (utf_string) http://fantasy-media-dev.s3.amazonaws.com/players/c1c8b3511677b1fd1e0874bccfb2eb4d.png
         
         (sfs_array)
            (utf_string) xp
            (byte) 2
            (int) 1260
         
         (sfs_array)
            (utf_string) country
            (byte) 4
            (utf_string) null
         
      
   
   (int) r: 0

[SFS - INFO] Data Read: Binary Size: 38
80 00 23 12 00 03 00 01 61 03 03 E9 00 01 63 02    ..#.....a.....c.
00 00 01 70 12 00 02 00 01 72 04 00 00 00 00 00    ...p.....r......
02 75 63 03 00 02                                  .uc...         

[SFS - INFO] UserCountChange { Message id: 1001 }
{ Dump: }

   (short) uc: 2
   (int) r: 0

[SFS - INFO] Data Read: Binary Size: 130
80 00 31 12 00 03 00 01 61 03 00 CD 00 01 63 02    ..1.....a.....c.
00 00 01 70 12 00 03 00 01 6F 02 00 00 02 62 6E    ...p.....o....bn
08 00 08 6C 6F 72 61 6E 67 65 72 00 02 62 69 04    ...loranger..bi.
00 00 00 05 80 00 4B 12 00 03 00 01 61 03 00 CC    ......K.....a...
00 01 63 02 00 00 01 70 12 00 02 00 02 62 6E 08    ..c....p.....bn.
00 08 6C 6F 72 61 6E 67 65 72 00 02 62 76 11 00    ..loranger..bv..
01 11 00 03 08 00 0D 24 5F 5F 42 56 5F 53 54 41    .......$__BV_STA
54 45 5F 5F 02 04 08 00 09 41 76 61 69 6C 61 62    TE__.....Availab
6C 65                                              le             

[SFS - INFO] GoOnline { Message id: 205 }
{ Dump: }

   (byte) o: 0
   (utf_string) bn: loranger
   (int) bi: 5

onBuddyOnlineStateUpdate
[Buddy: okaiina, id: -1],[Buddy: Dr.Ido, id: -1],[Buddy: adau, id: -1],[Buddy: loranger, id: 5],[Buddy: Falgan, id: -1]
=== BUDDY WENT ONLINE ===
What's the value of buddy_avatar_url ? null
[SFS - INFO] SetBuddyVariables { Message id: 204 }
{ Dump: }

   (utf_string) bn: loranger
   (sfs_array) bv:
      (sfs_array)
         (utf_string) $__BV_STATE__
         (byte) 4
         (utf_string) Available
User avatar
Fraggle
Posts: 62
Joined: 02 Apr 2010, 06:41
Location: Paris, France

Postby Fraggle » 08 Feb 2012, 13:58

Okay, I found the issue.
Offline variables (as specified in the doc) must be prefixed by "$".

However, I still have another issue.
Whenever a buddy log out, I receive the BUDDY_ONLINE_STATE_UPDATE offline event twice (in AS3).

Any idea?
User avatar
Bax
Site Admin
Posts: 4609
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 09 Feb 2012, 11:05

Did you check the debug info? Are you receiving the event from the server twice? If not, maybe you are adding the listener more than once.
Paolo Bax
The SmartFoxServer Team
User avatar
Fraggle
Posts: 62
Joined: 02 Apr 2010, 06:41
Location: Paris, France

Postby Fraggle » 13 Feb 2012, 15:04

Bax wrote:Did you check the debug info? Are you receiving the event from the server twice? If not, maybe you are adding the listener more than once.


Twice:

Code: Select all

[SFS - INFO] Data Read: Binary Size: 135
80 00 1C 12 00 03 00 01 61 03 03 EA 00 01 63 02    ........a.....c.
00 00 01 70 12 00 01 00 01 75 04 00 00 00 07 80    ...p.....u......
00 31 12 00 03 00 01 61 03 00 CD 00 01 63 02 00    .1.....a.....c..
00 01 70 12 00 03 00 01 6F 02 02 00 02 62 6E 08    ..p.....o....bn.
00 08 6C 6F 72 61 6E 67 65 72 00 02 62 69 04 FF    ..loranger..bi..
FF FF FF 80 00 31 12 00 03 00 01 61 03 00 CD 00    .....1.....a....
01 63 02 00 00 01 70 12 00 03 00 01 6F 02 02 00    .c....p.....o...
02 62 6E 08 00 08 6C 6F 72 61 6E 67 65 72 00 02    .bn...loranger..
62 69 04 FF FF FF FF                               bi.....         

[SFS - INFO] UserLost { Message id: 1002 }
{ Dump: }

   (int) u: 7

[SFS - INFO] GoOnline { Message id: 205 }
{ Dump: }

   (byte) o: 2
   (utf_string) bn: loranger
   (int) bi: -1

[SFS - INFO] GoOnline { Message id: 205 }
{ Dump: }

   (byte) o: 2
   (utf_string) bn: loranger
   (int) bi: -1

[SFS - INFO] Data Read: Binary Size: 38
80 00 23 12 00 03 00 01 61 03 03 E9 00 01 63 02    ..#.....a.....c.
00 00 01 70 12 00 02 00 01 72 04 00 00 00 00 00    ...p.....r......
02 75 63 03 00 01                                  .uc...         

[SFS - INFO] UserCountChange { Message id: 1001 }
{ Dump: }

   (short) uc: 1
   (int) r: 0

[/code]
User avatar
Fraggle
Posts: 62
Joined: 02 Apr 2010, 06:41
Location: Paris, France

Re: Issue with BuddyVariables (dump included)

Postby Fraggle » 16 Feb 2012, 13:19

Just upgrade to the final release, now I get 3 offline notifications!
And I actually receive 3 notifications from the server:

Code: Select all

[SFS - INFO] Data Read: Binary Size: 187
80 00 1C 12 00 03 00 01 61 03 03 EA 00 01 63 02    ........a.....c.
00 00 01 70 12 00 01 00 01 75 04 00 00 00 04 80    ...p.....u......
00 31 12 00 03 00 01 61 03 00 CD 00 01 63 02 00    .1.....a.....c..
00 01 70 12 00 03 00 01 6F 02 02 00 02 62 6E 08    ..p.....o....bn.
00 08 6C 6F 72 61 6E 67 65 72 00 02 62 69 04 FF    ..loranger..bi..
FF FF FF 80 00 31 12 00 03 00 01 61 03 00 CD 00    .....1.....a....
01 63 02 00 00 01 70 12 00 03 00 01 6F 02 02 00    .c....p.....o...
02 62 6E 08 00 08 6C 6F 72 61 6E 67 65 72 00 02    .bn...loranger..
62 69 04 FF FF FF FF 80 00 31 12 00 03 00 01 61    bi.......1.....a
03 00 CD 00 01 63 02 00 00 01 70 12 00 03 00 01    .....c....p.....
6F 02 02 00 02 62 6E 08 00 08 6C 6F 72 61 6E 67    o....bn...lorang
65 72 00 02 62 69 04 FF FF FF FF                   er..bi.....     

[SFS - INFO] UserLost { Message id: 1002 }
{ Dump: }

   (int) u: 4

[SFS - INFO] GoOnline { Message id: 205 }
{ Dump: }

   (byte) o: 2
   (int) bi: -1
   (utf_string) bn: loranger

[SFS - INFO] GoOnline { Message id: 205 }
{ Dump: }

   (byte) o: 2
   (int) bi: -1
   (utf_string) bn: loranger

[SFS - INFO] GoOnline { Message id: 205 }
{ Dump: }

   (byte) o: 2
   (int) bi: -1
   (utf_string) bn: loranger

[SFS - INFO] Data Read: Binary Size: 38
80 00 23 12 00 03 00 01 61 03 03 E9 00 01 63 02    ..#.....a.....c.
00 00 01 70 12 00 02 00 01 72 04 00 00 00 01 00    ...p.....r......
02 75 63 03 00 01                                  .uc...         

[SFS - INFO] UserCountChange { Message id: 1001 }
{ Dump: }

   (short) uc: 1
   (int) r: 1

User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Issue with BuddyVariables (dump included)

Postby Lapo » 17 Feb 2012, 14:23

I am not able to follow, sorry.
Can we see the code of your custom Storage class. You can zip it and send it to our usual address: support@...

Thanks
Lapo
--
gotoAndPlay()
...addicted to flash games
User avatar
Fraggle
Posts: 62
Joined: 02 Apr 2010, 06:41
Location: Paris, France

Re: Issue with BuddyVariables (dump included)

Postby Fraggle » 17 Feb 2012, 14:34

Sent ! :)
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Issue with BuddyVariables (dump included)

Postby Lapo » 21 Feb 2012, 11:17

I think I can reproduce the double online/offline message. I will add a note in our bug-database for further inspection.
I don't get 3 messages however.

Thanks
Lapo

--

gotoAndPlay()

...addicted to flash games
User avatar
Fraggle
Posts: 62
Joined: 02 Apr 2010, 06:41
Location: Paris, France

Re: Issue with BuddyVariables (dump included)

Postby Fraggle » 21 May 2012, 13:14

Hi,

I still got thoses 3 notifications for offline.. any news on a fix? (or idea of a workaround)

Thanks,

Sebastien
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Issue with BuddyVariables (dump included)

Postby Lapo » 21 May 2012, 13:24

It is in the works.
There's a double message, not 3 as far as I know.
I think it will be part of the next update.
Lapo

--

gotoAndPlay()

...addicted to flash games
User avatar
Fraggle
Posts: 62
Joined: 02 Apr 2010, 06:41
Location: Paris, France

Re: Issue with BuddyVariables (dump included)

Postby Fraggle » 21 May 2012, 13:26

I definitely get 3 :)
Any idea when is coming the new update?

Here is a dump of the DEBUG log:
You can see 3 messages out, each from a different thread.

Code: Select all

15:20:44,851 INFO  [SocketReader] sessions.DefaultSessionManager     - Session removed: { Id: 3, Type: DEFAULT, Logged: Yes, IP: 10.25.0.81:53209 }
15:20:44,852 DEBUG [SocketReader] managers.SFSRoomManager     - User: Mac_Leod removed from Room: The Lobby
15:20:44,853 INFO  [SocketReader] entities.SFSZone     - User: Mac_Leod was disconnected.
15:20:44,853 DEBUG [SocketReader] protocol.SFSProtocolCodec     - {OUT}: OnUserLost
15:20:44,853 DEBUG [SocketReader] binary.BinaryIoHandler     - Binary size: 31
80 00 1C 12 00 03 00 01 61 03 03 EA 00 01 63 02    ........a.....c.
00 00 01 70 12 00 01 00 01 75 04 00 00 00 01       ...p.....u.....

15:20:44,856 INFO  [SocketReader] api.SFSApi     - User disconnected: ( User Name: Mac_Leod, Id: 1, Priv: 0, Sess: 10.25.0.81:53209 ) , SessionLen: 4001
15:20:44,856 DEBUG [SocketReader] v2.SmartFoxServer     - [( User Name: seb, Id: 0, Priv: 0, Sess: 10.25.0.81:53196 ) ]
15:20:44,856 DEBUG [pool-1-thread-3] buddylist.SFSBuddyListManager     - Skipping BuddyList save request. No BuddyList available for: Mac_Leod
15:20:44,859 DEBUG [pool-1-thread-3] protocol.SFSProtocolCodec     - {OUT}: GoOnline
15:20:44,859 DEBUG [pool-1-thread-3] binary.BinaryIoHandler     - Binary size: 52
80 00 31 12 00 03 00 01 61 03 00 CD 00 01 63 02    ..1.....a.....c.
00 00 01 70 12 00 03 00 01 6F 02 02 00 02 62 6E    ...p.....o....bn
08 00 08 4D 61 63 5F 4C 65 6F 64 00 02 62 69 04    ...Mac_Leod..bi.
FF FF FF FF                                        ....           

15:20:44,856 DEBUG [pool-1-thread-2] protocol.SFSProtocolCodec     - {OUT}: GoOnline
15:20:44,861 DEBUG [pool-1-thread-2] binary.BinaryIoHandler     - Binary size: 52
80 00 31 12 00 03 00 01 61 03 00 CD 00 01 63 02    ..1.....a.....c.
00 00 01 70 12 00 03 00 01 6F 02 02 00 02 62 6E    ...p.....o....bn
08 00 08 4D 61 63 5F 4C 65 6F 64 00 02 62 69 04    ...Mac_Leod..bi.
FF FF FF FF                                        ....           

15:20:44,856 DEBUG [pool-1-thread-1] buddylist.SFSBuddyListManager     - Skipping BuddyList save request. No BuddyList available for: Mac_Leod
15:20:44,862 DEBUG [pool-1-thread-1] protocol.SFSProtocolCodec     - {OUT}: GoOnline
15:20:44,862 DEBUG [pool-1-thread-1] binary.BinaryIoHandler     - Binary size: 52
80 00 31 12 00 03 00 01 61 03 00 CD 00 01 63 02    ..1.....a.....c.
00 00 01 70 12 00 03 00 01 6F 02 02 00 02 62 6E    ...p.....o....bn
08 00 08 4D 61 63 5F 4C 65 6F 64 00 02 62 69 04    ...Mac_Leod..bi.
FF FF FF FF                                        ....           

15:20:45,056 DEBUG [pool-2-thread-1] util.UserCountChangeResponseThrottler     - ---> Throttler running: com.smartfoxserver.bitswarm.io.Response@5b72c218
15:20:45,057 DEBUG [pool-2-thread-1] protocol.SFSProtocolCodec     - {OUT}: OnRoomCountChange
15:20:45,057 DEBUG [pool-2-thread-1] binary.BinaryIoHandler     - Binary size: 38
80 00 23 12 00 03 00 01 61 03 03 E9 00 01 63 02    ..#.....a.....c.
00 00 01 70 12 00 02 00 01 72 04 00 00 00 01 00    ...p.....r......
02 75 63 03 00 01                                  .uc...         
panthoz
Posts: 25
Joined: 09 Jan 2012, 19:58

Re: Issue with BuddyVariables (dump included)

Postby panthoz » 19 Jun 2012, 20:12

I am getting 2 offline messages with mine as well. Only one listener in the entire project.
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Issue with BuddyVariables (dump included)

Postby Lapo » 21 Jun 2012, 14:47

Yes, two messages is what we were able to reproduce and it will be fixed in the next release.
Besides that it does no harm.
Thanks
Lapo

--

gotoAndPlay()

...addicted to flash games
bbranislav
Posts: 81
Joined: 13 Sep 2011, 15:59
Location: Nitra, Slovakia
Contact:

Re: Issue with BuddyVariables (dump included)

Postby bbranislav » 04 Mar 2013, 20:57

I have same problem, my client event handler for SFSBuddyEvent.BUDDY_ONLINE_STATE_UPDATE, is fired twice, when my buddy is disconnected. SFS2X version 2.6.0

Thank you!
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Issue with BuddyVariables (dump included)

Postby Lapo » 05 Mar 2013, 07:52

Thanks, a fix is on its way in the next release.
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: Google [Bot] and 49 guests