how to keep connection live for NPC users

Post here your questions about Actionscript and Java server side extensions development.

Moderators: Lapo, Bax

Post Reply
smartkid
Posts: 3
Joined: 08 Jul 2009, 06:41

how to keep connection live for NPC users

Post 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.
Fun Bobby
Posts: 48
Joined: 26 Sep 2008, 11:23

Post 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.
smartkid
Posts: 3
Joined: 08 Jul 2009, 06:41

Post 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);
smartkid
Posts: 3
Joined: 08 Jul 2009, 06:41

Post by smartkid »

I checked this one

Code: Select all

user.updateMessageTime()
It seems working.

Thanks :D
A-lEX
Posts: 1
Joined: 10 Jul 2009, 12:28

Post by A-lEX »

Code: Select all

user.updateMessageTime() 
i do it too and it not working((((
and SFS kicks user about 20-30 seconds not 300 as in config.xml ((
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post 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?
Lapo
--
gotoAndPlay()
...addicted to flash games
gopala.susurla
Posts: 31
Joined: 15 May 2011, 16:09
Contact:

Plase help how to develop Player and Bot(System) game?

Post 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.
GopalaSusurla
Post Reply