Buddy List Unexplicable Error

Need help with SmartFoxServer? You didn't find an answer in our documentation? Please, post your questions here!

Moderators: Lapo, Bax

User avatar
mistermind
Posts: 131
Joined: 15 Sep 2007, 01:33
Contact:

Buddy List Unexplicable Error

Postby mistermind » 07 Mar 2008, 07:29

Hello there guys,
As usual I'm full of pickles. But this one I actually went dip into the cookie jar, and still couldn't find my solution. Here is the deal:
My buddy list was working just fine using its "basic mode", but then I decided to swap to a more robust scenario since I was in need for persistent off-line variables, but at the same time I didn't want my application to work using Buddy requests or mutual add. So this is how I ended up setting up my zone:

Code: Select all

<Zone name="Ederon Server 1" uCountUpdate="false" maxUsers="4000" customLogin="false">
         <BuddyList active="true">
           <size>50</size>
           <maxBuddyVariables>6</maxBuddyVariables>
           <mode>advanced</mode>
           <addBuddyPermission>false</addBuddyPermission>
           <offLineBuddyVariables>true</offLineBuddyVariables>
           <mutualAddBuddy>false</mutualAddBuddy>
           <mutualRemoveBuddy>false</mutualRemoveBuddy>
         </BuddyList>
....
</Zone>


Then on the actionscript, I've made sure I was working with off-line variables:

Code: Select all

var bVars:Object = new Object();
bVars.$picture = _root.myPicture;
bVars.$level = _root.myLevel;
bVars.$accType = _root.accType;
bVars.$clan = _root.clan;
bVars.inGame = 0;
smartfox.setBuddyVariables(bVars);


Everything looked just good, including the responses from debug, but for some reason, the buddy list was not being saved. Here are the responses from the server.
Attempt to save the buddy:

Code: Select all

[Sending]: <msg t='sys'><body action='addB' r='-1'><n>Mistermind</n></body></msg>

[Received]: <msg t="sys"><body action="bAdd" r="-1"><b s="1" i="98"><n>Mistermind</n><vs><v n="$picture">77.jpg</v><v n="$level">2</v><v n="inGame">0</v><v n="$accType">advanced</v><v n="$clan">Knights of Shadow</v></vs></b></body></msg>


Attempt to login again and retrieve the buddy list:

Code: Select all

[Sending]: <msg t='sys'><body action='loadB' r='-1'></body></msg>
[Received]: <msg t="sys"><body action="bList" r="-1"><bList /></body></msg>



After all that, I actually tried the adv buddy list 2.0 (Examples\AS2\24_pro_buddyList2) to see if that one worked. And it worked! I started then narrowing down the possibilities and the only possible explanation I got so far was the way the variables on config.xml are setted. I mean the variables on Ederon Server 1 on buddy list are advanced only to hold down offline variables while buddy list 2.0 has the permission request feature. But then I went to server log and saw these errors coming out:

Code: Select all

2008/03/07 00:15:10.078 - [ SEVERE ] [id: 34] (DbManager.executeQuery): DbManager error during query/result creation: SELECT OWNER FROM BLIST_456465726F6E205365727665722031 WHERE OWNER='Poia'
2008/03/07 00:15:10.250 - [ SEVERE ] [id: 34] (DbManager.executeCommand): DbManager error during command execution: INSERT INTO BLIST_456465726F6E205365727665722031 VALUES('Poia','Mistermind','0','$picture$levelinGame$accType$clan','41.jpg50advancedKnights of Shadow')
2008/03/07 00:15:10.281 - [ SEVERE ] [id: 34] (DbManager.executeQuery): DbManager error during query/result creation: SELECT OWNER FROM BLIST_456465726F6E205365727665722031 WHERE OWNER='Mistermind'
2008/03/07 00:15:10.375 - [ SEVERE ] [id: 34] (DbManager.executeCommand): DbManager error during command execution: INSERT INTO BLIST_456465726F6E205365727665722031 VALUES('Mistermind','','','$picture$levelinGame$accType$clan','77.jpg20advancedKnights of Shadow')


As far as I could tell my requests couldn't even create the links to hold the buddies database, but since the code seems good and I'm not receiving bugs from the debug I don't think the problem lies anywhere there.

The database bugs didn't seem to have any query string problem, and since the buddy list 2.0 is working on the same server, it doesn't make much sense on where the bug is at really.
So I ask you: Any ideas?
User avatar
mistermind
Posts: 131
Joined: 15 Sep 2007, 01:33
Contact:

Postby mistermind » 08 Mar 2008, 01:55

any ideas on this matter?
User avatar
mistermind
Posts: 131
Joined: 15 Sep 2007, 01:33
Contact:

Postby mistermind » 10 Mar 2008, 03:59

Here are some more tests I'm making:
I've tried everything I could so far:
- Made both approaches (Ederon Zone and advBuddy Zone) exactly the same, and still having errors on Ederon Zone.

So what I've done now is make the simplest task of all: loadBuddyList() right after the event onJoinRoom. Here is the error directly from SFS Prompt:

Code: Select all

01:41:46.859 - [ SEVERE ] > DbManager error during query/result creation: SELECT
 * FROM BLIST_456465726F6E205365727665722031 WHERE OWNER='Mindblaster'
org.h2.jdbc.JdbcSQLException: Table BLIST_456465726F6E205365727665722031 not fou
nd; SQL statement:
SELECT * FROM BLIST_456465726F6E205365727665722031 WHERE OWNER='Mindblaster' [42
S02-60]
        at org.h2.message.Message.getSQLException(Message.java:84)
        at org.h2.message.Message.getSQLException(Message.java:88)
        at org.h2.message.Message.getSQLException(Message.java:66)
        at org.h2.command.Parser.readTableOrView(Parser.java:3911)
        at org.h2.command.Parser.readTableFilter(Parser.java:862)
        at org.h2.command.Parser.parseSelectSimpleFromPart(Parser.java:1343)
        at org.h2.command.Parser.parseSelectSimple(Parser.java:1437)
        at org.h2.command.Parser.parseSelectSub(Parser.java:1337)
        at org.h2.command.Parser.parseSelectUnion(Parser.java:1224)
        at org.h2.command.Parser.parseSelect(Parser.java:1212)
        at org.h2.command.Parser.parsePrepared(Parser.java:364)
        at org.h2.command.Parser.parse(Parser.java:260)
        at org.h2.command.Parser.parse(Parser.java:232)
        at org.h2.command.Parser.prepareCommand(Parser.java:204)
        at org.h2.engine.Session.prepareLocal(Session.java:172)
        at org.h2.server.TcpServerThread.process(TcpServerThread.java:176)
        at org.h2.server.TcpServerThread.run(TcpServerThread.java:97)
        at java.lang.Thread.run(Unknown Source)

        at org.h2.engine.SessionRemote.done(SessionRemote.java:298)
        at org.h2.command.CommandRemote.prepare(CommandRemote.java:55)
        at org.h2.command.CommandRemote.<init>(CommandRemote.java:38)
        at org.h2.engine.SessionRemote.prepareCommand(SessionRemote.java:246)
        at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:971)
        at org.h2.jdbc.JdbcStatement.executeQuery(JdbcStatement.java:63)
        at org.apache.commons.dbcp.DelegatingStatement.executeQuery(DelegatingSt
atement.java:205)
        at it.gotoandplay.smartfoxserver.db.DbManager.executeQuery(DbManager.jav
a:281)
        at it.gotoandplay.smartfoxserver.db.DbManager.executeQuery(DbManager.jav
a:248)
        at it.gotoandplay.smartfoxserver.data.buddylist.persistence.AdvancedBudd
yListPersister.loadList(AdvancedBuddyListPersister.java:60)
        at it.gotoandplay.smartfoxserver.data.buddylist.BuddyListManager.loadBud
dyList(BuddyListManager.java:306)
        at it.gotoandplay.smartfoxserver.data.Zone.loadBuddyList(Zone.java:1130)

        at it.gotoandplay.smartfoxserver.data.Zone.addName(Zone.java:383)
        at it.gotoandplay.smartfoxserver.SmartFoxServer.canLogin(SmartFoxServer.
java:2377)
        at it.gotoandplay.smartfoxserver.controllers.SystemHandler.defaultLogin(
SystemHandler.java:559)
        at it.gotoandplay.smartfoxserver.controllers.SystemHandler.handleLoginRe
quest(SystemHandler.java:442)
        at it.gotoandplay.smartfoxserver.controllers.SystemHandler.processEvent(
SystemHandler.java:194)
        at it.gotoandplay.smartfoxserver.controllers.SystemHandler.run(SystemHan
dler.java:143)
        at java.lang.Thread.run(Unknown Source)


From what I understood, the BLIST table is not being created on my zone and I don't know why. The code on the zone couldn't be more simple and direct:

Code: Select all

<BuddyList active="true">
<size>50</size>
<maxBuddyVariables>6</maxBuddyVariables>
<mode>advanced</mode>
<addBuddyPermission>false</addBuddyPermission>
<offLineBuddyVariables>true</offLineBuddyVariables>
<mutualAddBuddy>false</mutualAddBuddy>
<mutualRemoveBuddy>false</mutualRemoveBuddy>
</BuddyList>
User avatar
mistermind
Posts: 131
Joined: 15 Sep 2007, 01:33
Contact:

Postby mistermind » 10 Mar 2008, 04:43

Fixed!
Now Lapo, you will ask yourself "how? did THAT fix it?"
Here is what I've done, and that is defiantly a bug.
I've CHANGED the order of the zones, positioning "Ederon Server" AFTER advBuddyList zone. Here is the output from the prompt after the zone creations:

Code: Select all

02:11:36.359 - [ FINE ] > AdvancedBuddyListPersister <INIT>
Zone: advBuddyList

        Lobby              (id: 117, max: 10000, pass:N)

02:11:36.359 - [ FINE ] > AdvancedBuddyListPersister <INIT>
02:11:36.375 - [ FINER ] > Table BLIST_456465726F6E205365727665722031 created!
Zone: Ederon Server 1

        Main Room          (id: 118, max: 1000, pass:N)
        The Lobby          (id: 119, max: 1000, pass:N)
        Trade Room         (id: 120, max: 1000, pass:N)


Now don't ask me why, but only by doing that the Table BLIST_456465726F6E205365727665722031 was actually created. I also don't understand why this message is not displayed on advBuddyList output.
At first I thought the bug was obvious: SFS can only hold one advanced buddy list per server, but after that I've tested the advBuddyList and it worked just fine. So for the record, when Ederon Server 1 had room ids 94, 95 and 96, the BList wasnt working. Now reallocating the zone it works.
If you find a reason for that, I'm really curious to know :) Or at least answer this topic saying "good" cause I'm feeling a bit left out here after spending 4 days straights solving it =P
User avatar
Lapo
Site Admin
Posts: 21362
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 10 Mar 2008, 07:03

Thanks for reporting, we'll check more in depth and see if there's bug.

cheers
Lapo
--
gotoAndPlay()
...addicted to flash games
User avatar
mistermind
Posts: 131
Joined: 15 Sep 2007, 01:33
Contact:

More bugs...

Postby mistermind » 11 Mar 2008, 16:14

Everything WAS working just fine and all of a sudden I got this "warning" coming out of the logs right after the request for buddy list load ([Sending]: <msg t='sys'><body action='loadB' r='-1'></body></msg>)

Here is the error:

Code: Select all

 2008/03/11 13:55:28.781 - [ WARNING ] [id: 18] (SystemHandler.processEvent): Unexpected Exception: java.lang.ArrayIndexOutOfBoundsException: 4



This "warning" is stopping the server from triggering the onBuddyList event
User avatar
mistermind
Posts: 131
Joined: 15 Sep 2007, 01:33
Contact:

Postby mistermind » 11 Mar 2008, 16:35

Solution:
I've tried removing all zones one by one to see what could possibly be the trigger for this error. For some reason after I removed some of the zones with extensions (probably the one related to database connection) it worked.
I've ended up only having my zone on the list of zones in order for this to work. I'm still not sure how to force the bug to happen again, but it seems that if you have a certain number of zones it will cause the advanced buddy list to malfunction. I'll let you know when I manage to force the bug again.
User avatar
Pompel
Posts: 8
Joined: 21 May 2008, 11:18

Postby Pompel » 21 May 2008, 20:29

I'm just having this same bug happen to me. Removing all zones but my own helped, so I agree there must be a bug somewhere.
User avatar
Lapo
Site Admin
Posts: 21362
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 22 May 2008, 08:19

Please check the following: viewtopic.php?t=2881
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SmartFoxServer 1.x Discussions and Help”

Who is online

Users browsing this forum: No registered users and 20 guests