SDK if we ever get one... (Wishlist)

SDK if we ever get one... // Wishlist

1  |  

strike rapier

Jul 7, 2004, 3:13pm
If we do ever get the new SDK I would like to request a small recode on
AWI's part to make the aw_connect async with a callback. I am not sure how
easy this would be because I am inexperienced with winsock in C++, however
if it is not too much trouble this would help a lot of bots from hanging
when connecting under high bandwidth strain.

C++ and VBSDK please :)

- MR

xelag

Jul 7, 2004, 7:11pm
I asked the same question to Roland Vilett. Loging into universe and
entering world are blocking, even if we have a callback to both:
AW_CALLBACK_LOGIN and AW_CALLBACK_ENTER His answer was that there had
been a security reason for this, but he did not remember what it was.
There is no such SDK method called aw_connect, this may be a VBSDK
thing, the only methods are preparing the connections with

(for universe)
aw_create(...),
aw_int_set(AW_LOGIN_OWNER, citnumber)
aw_string_set(AW_LOGIN_PRIVILEGE_PASSWORD, PrivPass)
aw_string_set(AW_LOGIN_LOGIN_APPLICATION, Application) <optional>
aw_string_set(AW_LOGIN_NAME, TheBotsName)
and then calling rc = aw_login()
and the callback is
AW_CALLBACK_LOGIN

(for world)
aw_bool_set(AW_ENTER_GLOBAL, GlobalMode)
rc = aw_enter(WorldName)
and the callback is AW_CALLBACK_ENTER

Both aw_login and aw_enter are blocking, so the callbacks is actually
there for nothing.

So until they find the reasons why, we're stuck with it :)

Alex

On 7 Jul 2004 13:13:15 -0400, "strike rapier"
[View Quote] >If we do ever get the new SDK I would like to request a small recode on
>AWI's part to make the aw_connect async with a callback. I am not sure how
>easy this would be because I am inexperienced with winsock in C++, however
>if it is not too much trouble this would help a lot of bots from hanging
>when connecting under high bandwidth strain.
>
>C++ and VBSDK please :)
>
>- MR
>

strike rapier

Jul 7, 2004, 11:31pm
Sorry, to correct myself:

aw_create is infact what I am requesting a callback for, being the longest
un-async function in the entire SDK as the entire TCP layre has to be
established.

- MR

[View Quote]

xelag

Jul 8, 2004, 8:47am
aw_create does not to my knowledge do anything with the tcp/ip socket
layer, it just reserves memory for the bot and assigns it a pointer
(instance) so you can reference it. I have never noticed a delay
there. aw_login is the one that uses sockets and, although it has a
callback, it blocks until the connection is established or fails, so
the callback is rather useless.

Alex

On 7 Jul 2004 21:31:27 -0400, "strike rapier"
[View Quote] >Sorry, to correct myself:
>
>aw_create is infact what I am requesting a callback for, being the longest
>un-async function in the entire SDK as the entire TCP layre has to be
>established.
>
>- MR
>
[View Quote]

xelag

Jul 8, 2004, 12:28pm
I stand corrected. I just received an enlightening email that shows
clearly that aw_create blocks. In aw_create, two blocking functions
occur: hostname resolution and connection to the universe server.

So yes you are right, strike rapier, a callback would be very welcome,
if it would work async... but considering that aw_login's callback
does not seem to work async, it might not be of much use either.

Alex

On 7 Jul 2004 21:31:27 -0400, "strike rapier"
[View Quote] >Sorry, to correct myself:
>
>aw_create is infact what I am requesting a callback for, being the longest
>un-async function in the entire SDK as the entire TCP layre has to be
>established.
>
>- MR
>
[View Quote]

strike rapier

Jul 8, 2004, 3:25pm
[View Quote] I presumed as much, I havent taken the SDK appart but I was guessing that it
would not use the WSAAsync (cheers Sleepy) functions, the TCP services
establishing the connection could probably be AsyncSelect'd... but
regardless I know very little about C++ Winsock 2, I just want a
callback!!!!

> So yes you are right, strike rapier, a callback would be very welcome,
> if it would work async... but considering that aw_login's callback
> does not seem to work async, it might not be of much use either.
>
> Alex

xelag

Jul 8, 2004, 6:04pm
Well, besides the fact that this whole thread belongs in SDK, not here
(LOL), I want to say this:

aw_create and aw_login are confusing. aw_create should not meddle
with sockets or connections, that is the task logically of aw_login.
In my talks with Roland, it seemed that tis was the case, that
confused me.

What aw_login seems to do according to what I now know is, once the
connection to the universe was established with aw_create (with 2
blocking funcs), just send the identification parameters of the bot
(cit, pw, application name) async, if the callback is installed.

To give another example: when aw_enter (the function used to enter a
world) is used, it blocks, even if it has a callback. It has to
retrieve from the uni server the ip, port etc of the world sever
(realised as a blocking function) and then login to the world (another
blocking function).

Why use blocking, that frezes your application and any other bot
instances in the program? Because the aw.dll knows nothing about
threads, I think, so this threading problem should be solved first,
before adding callbacks which would be useless.

Moreover, I would think that aw_create and aw_login could be either

1) make to do their own task: aw_create to reserve memory (create the
instance), aw_login to do the TCP/IP stuff (async i.e. in a thread)

2) merged into one function (async) with just one callback. After all,
why multiply functions that have as task to get the bot into a
universe?

Both 1 and 2 make sense in their own way, the current implementation
does not make any sense.

Alex

On 8 Jul 2004 13:25:02 -0400, "strike rapier"
[View Quote] [View Quote]

strike rapier

Jul 8, 2004, 6:33pm
As far as I know aw_create establishes the connection to get the cipher
keys, which are needed before the logon is sent as it needs to be
encrypted... But I havent really spent much time trying to hack AW to find
out...

I think the naming does sound about right.... aw_create is creating the
background systems needed for anything to happen, whereas aw_login is the
actual login handshaking to get the connection actually knowing whats going
on about it.

As for the world connect it seems to work pretty async for me? But then
again... im running the VBSDK for 3.4 here..

- MR



[View Quote]

xelag

Jul 8, 2004, 7:10pm
What seems is not what is (thanks Sleepy) :)

On 8 Jul 2004 16:33:43 -0400, "strike rapier"
[View Quote] >As far as I know aw_create establishes the connection to get the cipher
>keys, which are needed before the logon is sent as it needs to be
>encrypted... But I havent really spent much time trying to hack AW to find
>out...
>
>I think the naming does sound about right.... aw_create is creating the
>background systems needed for anything to happen, whereas aw_login is the
>actual login handshaking to get the connection actually knowing whats going
>on about it.
>
>As for the world connect it seems to work pretty async for me? But then
>again... im running the VBSDK for 3.4 here..
>
>- MR
>
>
>
[View Quote]

strike rapier

Jul 8, 2004, 10:03pm
We really should consider getting him to rewrite the SDK website...

- Mark R

[View Quote]

1  |  
Awportals.com is a privately held community resource website dedicated to Active Worlds.
Copyright (c) Mark Randall 2006 - 2021. All Rights Reserved.
Awportals.com   ·   ProLibraries Live   ·   Twitter   ·   LinkedIn