Page 1 of 1
how to keep connection live for NPC users
Posted: 08 Jul 2009, 07:00
by smartkid
HI
Iam using java extension to create NPC users, they are kicked out when max idle time is reached. Surprising thing is even am updating NPC users positions to the server by every 5 seconds, still it is disconnecting when max idle time is reached.
My question are
1) How to keep connection live for NPC players.
2) How does SFS kicks an user even it getting updates from that client.
3) Is there any method other than reconnecting NPC from "userLost" event?(i am looking for NPC never disconnects from server

)
any help?
Thanks in advance.
Posted: 09 Jul 2009, 09:02
by Fun Bobby
hi,
npcs are disconneced after a certain idle-time, you declared in the config.xml.
try user.updateMessageTime() on all 2-3 minutes to keep the npcs alive, depending on your config-settings.
you can keep npcs alive for all time this way.
"Surprising thing is even am updating NPC users positions to the server by every 5 seconds, still it is disconnecting when max idle time is reached"
--> how do you do this. this should keep them alive too.
Posted: 10 Jul 2009, 03:10
by smartkid
hi thanks for reply.
iam using the following code to update AI players, still disconnecting after max-idle reached.
Code: Select all
vars.put("px", new UserVariable(String.valueOf(px), UserVariable.TYPE_NUMBER));
vars.put("py", new UserVariable(String.valueOf(py), UserVariable.TYPE_NUMBER));
api.setUserVariables(npcUser, vars, true);
Posted: 10 Jul 2009, 04:22
by smartkid
I checked this one
It seems working.
Thanks

Posted: 10 Jul 2009, 12:31
by A-lEX
i do it too and it not working((((
and SFS kicks user about 20-30 seconds not 300 as in config.xml ((
Posted: 10 Jul 2009, 13:55
by Lapo
A-lEX
Please provide more details about what you are doing.
How do you create NPCs? In server side code, or using an external application?
Are you calling the updateMessageTime at regular intervals?
Plase help how to develop Player and Bot(System) game?
Posted: 08 Oct 2011, 10:25
by gopala.susurla
HI,
I had develop multi player game through SFS via java extension,It was working properly.Thing is in same scenario I will develop single player in that game AI setup and AI information comes from JAVA(server) and human setup and human information comes from flex(client).In that game both flex and Java can maintain game state of the game.
Here I faced the problem is how to connect AI to human through SFS.I read the previous topics there is method like CreateNPC? what is NPC how to use in singleplayer?
Please update me as early as possible.