Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Network commands broken?

Author
Message
Willie Mundermuffin
18
Years of Service
User Offline
Joined: 5th Jan 2006
Location:
Posted: 20th Dec 2012 08:44 Edited at: 20th Dec 2012 08:47
I've set up server and client apps, but no matter what the conditions, IsNetworkActive always returns 1. This is the case even when not connecting to any game and testing for active connection. Basically, the command is just returning the connection was successful no matter what.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 20th Dec 2012 15:53
What version of AppGameKit are you using?

Are you working in Tier 1 or Tier 2?

Quote: "but no matter what the conditions"

Does this mean that you are testing when the server app is NOT running and still get a return of one?

How long are you waiting between tests?

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 20th Dec 2012 17:25
All of the questions as Ancient Lady asks. In earlier versions, the network stays active for 30 seconds or longer. This has been reduced to a few seconds in later updates.

Personally I have a variable that holds the timer() value. If it stops incrementing, I know the network has disconnected. I can detect this in under a second where it is critical, or extend it to whatever value I prefer for non-critical scenarios.

Willie Mundermuffin
18
Years of Service
User Offline
Joined: 5th Jan 2006
Location:
Posted: 21st Dec 2012 05:49
Sorry for the long delay. I live in the states and work nights, so it takes a while to get back. I am using tier 2 (C++ in the latest Xcode). The thing is, even if I just put gibberish for a network address, it still returns successful. No matter what I do, it ALWAYS returns successful.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 21st Dec 2012 15:47
Please, what version of AppGameKit are you using? This is important to know.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Willie Mundermuffin
18
Years of Service
User Offline
Joined: 5th Jan 2006
Location:
Posted: 21st Dec 2012 17:40
Tier 2 1076 on the newest Mountain Lion update with the latest xcode (fully updated).
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 21st Dec 2012 17:46
This might be a dumb question, can you please show me the line of code you use to check the results?

I've seen the following happen a lot. Someone starts working with Tier 1, to get a feel for AppGameKit and then switches to Tier 2, maybe converting the Tier 1 files (like I did). And then in an if statement they do something like 'if (abc = 1)', which works perfectly in Tier 1 and does something completely different in Tier 2. In Tier 2, it actually assigns the value of one to abc and then the if statement resolves to true (and the variable has been corrupted).

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Willie Mundermuffin
18
Years of Service
User Offline
Joined: 5th Jan 2006
Location:
Posted: 21st Dec 2012 23:06
I've never touched tier 1. I've been a C++ programmer for 10 years

if(agk::IsNetworkActive(networkId) == 1)
JimHawkins
15
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 21st Dec 2012 23:45
Are we sure this isn't a firewall issue?

See the notes on the server side:

Quote: "Checks that the network is active, in the case of joining a network this will return 0 if the connection failed or for some reason the connection to the server broke. For a hoster this function will return 0 if it failed to listen on the specified port for clients, otherwise it will forever return 1 as it will not stop managing any connected clients, even if it is left on its own."


So is this client or host reporting?

-- Jim DO IT FASTER, EASIER AND BETTER WITH AppGameKit FOR PASCAL
Willie Mundermuffin
18
Years of Service
User Offline
Joined: 5th Jan 2006
Location:
Posted: 22nd Dec 2012 00:34
Both. No matter what I do. I could do nothing but turn on my phone, start the app, select client, out in gibberish for the ip and it'll still return successful connection.
SoftMotion3D
AGK Developer
19
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 22nd Dec 2012 02:09 Edited at: 22nd Dec 2012 02:26
Quote: " and it'll still return successful connection."


It will always be successful....

(i think it always returns a 1) if you create a join or a host...

Think of it as.... its created the network connection....or its created a join network.... (its always 1)

what you need to test for is if anyone else is joined into the network....

example...
GetNetworkNumClients( iNetID )

This command will let you know if its more then just 1 person on the network connection you just created.


Make sure that at least one of your test subjects is hosting however..... or the clients will not connect.

Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 22nd Dec 2012 02:13
This sounds like a legitimate bug.

Please post it, with example code for both server and client, in the google issue list.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
SoftMotion3D
AGK Developer
19
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 22nd Dec 2012 02:28 Edited at: 22nd Dec 2012 02:29
well... hold of on calling it a bug...

batvink's got a point.....

it may hang on for a good solid 30 seconds or so...

but it will turn to a 0 after it gives up trying...and nothings connected

however... it will call it a successful connection while its trying to make 1...

Willie Mundermuffin
18
Years of Service
User Offline
Joined: 5th Jan 2006
Location:
Posted: 22nd Dec 2012 02:33
There's nothing to hang on to. I don't even start the server side at all for hours and the client still returns successful connection. Plus, I don't put in a legit IP address.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 22nd Dec 2012 02:38
If you could post the code (both server and client side), it would help us diagnose the problem.

We will need this, as Community Testers, to properly tag the google list item as a true bug.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Willie Mundermuffin
18
Years of Service
User Offline
Joined: 5th Jan 2006
Location:
Posted: 22nd Dec 2012 02:55
Ok. I don't think I'll be able to until Sunday night. I'm out of town and the files are on my MacBook Pro at home.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 23rd Dec 2012 17:04
We need code to understand what you are reporting:

1. If you are setting up a host then it will always return 1

2. If you are setting up as a client then you have to connect to a network. You can't connect to nothing. If you are connecting to nothing then what network ID are you using in the command?

I can't get the IsNetworkActive() command to work without a legitimate network ID. If the command is working (ie not crashing) then you must have created a network. Once I connect and disconnect, then it takes a while to report zero again.

If you haven't created a network connection, then why are you checking? I know you have a good explanation, we just need a better understanding to help

Login to post a reply

Server time is: 2024-11-24 06:32:06
Your offset time is: 2024-11-24 06:32:06