Server Help

Bot Questions - TWCore Bot Login Failur

z.alpha+ - Wed Nov 15, 2006 8:05 pm
Post subject: TWCore Bot Login Failur
I'm currently working with a TWCore bot with ASSS with sgcompat enabled.

Whenver the bot tries to login i get the following error in the ASSS console:

Code: Show/Hide

[pid =1] bad login packet length (107)
[] [pid=1] disconnected


any idea on this?
BDwinsAlt - Wed Nov 15, 2006 8:40 pm
Post subject:
I tried to connect to as3 with twcore once, since you have to use continuum 0.39 to enter as3 I guess you have to mess with the packets.
Bak - Thu Nov 16, 2006 3:28 am
Post subject:
can't sysops send a null encryption key which disables encryption?

The password / login packet from http://wiki.minegoboom.com/index.php/UDP_Game_Protocol
Code: Show/Hide
0x09   Game   0x40C0E7   Password/Login

-      0   1   Type
-      1   1   Boolean: New user (1 = New, 0 = Not New)
-      2   32   Name
-      34   32   Password
-      66   4   Machine ident (drive serial number - can be random for bots)
-      70   1   ConnectType (0x00 is a good idea)
-      71   2   Timezone bias
-      73   2   Unkown
-      75   2   Client version (0x24 = Ctm, 0x86 = SS)
-      77   4   Unkown, memory checksum, Set to = 444
-      81   4   Unkown, memory checksum, Set to = 555
-      85   4   Permission ident
-      89   12   Unkown


is of length 101, whereas twcore's implementation (from GamePacketGenerator.java)

Code: Show/Hide
public void sendPasswordPacket( String name, String password ){

        ByteArray      bytearray = new ByteArray( 107 );
        int[]          arr = { 0x86, 0x00, 0xBC, 0x01,
        0x00, 0x00, 0x2B, 0x02,
        0x00, 0x00 };

        bytearray.addByte( 0x09 );
        bytearray.addByte( 0x00 );
        bytearray.addPaddedString( name, 32 );       //Name
        bytearray.addPaddedString( password, 32 );   //Password

        bytearray.addByte( 0xd8 ); // Machine ID
        bytearray.addByte( 0x67 );
        bytearray.addByte( 0xeb );
        bytearray.addByte( 0x64 );

        bytearray.addByte( 0x04 ); // Machine ID
        bytearray.addByte( 0xE0 );
        bytearray.addByte( 0x01 );
        bytearray.addByte( 0x57 );
        bytearray.addByte( 0xFC );

        bytearray.addLittleEndianShort( (short)134 );
        bytearray.addLittleEndianInt( 444 );
        bytearray.addLittleEndianInt( 555 );
        bytearray.addLittleEndianInt( 0x92f88614 );
        bytearray.repeatAdd( 0x0, 12 );       //Last

        sendReliableMessage( bytearray );
    }


is sending a 107 length packet (even though it's only populating the first 101 bytes), which is of an incorrect length (and hence the error).

Change
Code: Show/Hide
ByteArray      bytearray = new ByteArray( 107 );
to
Code: Show/Hide
ByteArray      bytearray = new ByteArray( 101 );
and try again.
z.alpha+ - Thu Nov 16, 2006 8:14 am
Post subject:
that removed the bad packet error.

however, whenever I try to log in now, twcore shows the bot trying to login as follows:

Code: Show/Hide

bot is logging in.
bot failed to log in. Login timed out.
bot is disconnecting...


and ass shows

Code: Show/Hide

<net> [pid=0] new connection from 192.168.1.1.:2041
<core> [pid=0] login request: 'bot'
<core> authentcating with 'auth-ban'
<capman> [bot] assigned to group 'sysop' (global)
<core> [bot] [pid=0] player logged in
<net>  [bot] [pid=0] disconnected


when i run the same bot against subgame2 with ssbilling2, it connects fine. are there any additional ass modules that i need load or unload? i have the bot assigned to the sysop group, and it does login to group 'sysop', but it's not connecting to the asss server.




icon_biggrin.gif
Smong - Thu Nov 16, 2006 1:59 pm
Post subject:
It's probably because the bot expects a packet (0x31) that only subgame sends when a biller is connected.

BTW what version of twcore do you have?
z.alpha+ - Thu Nov 16, 2006 2:52 pm
Post subject:
0.89

is that the latest?


and does mean that as is, twcore will not work with ass?
Bak - Thu Nov 16, 2006 3:18 pm
Post subject:
give us a packet log and we'll find the problem. They're both open source so it shouldn't be too hard.
Cerium - Thu Nov 16, 2006 6:29 pm
Post subject:
Actually, what Smong said is exactly right. For reasons unknown grel decided NOT to send 0x31, which TWCore waits for before attempting to enter an arena. As a result, the bot gets kicked after about 3-5 seconds.

Distort would be the best person to reply as to what class(es) need(s) to be modified to get the TWCore compatible with ASSS.


Alternatively, you can give Hybrid a try with the TWCore emulator. But I think you'd have less trouble modifying the actual TWCore than you would setting the emulator up.
z.alpha+ - Thu Nov 16, 2006 9:09 pm
Post subject:
which approach would be best modify asss, or modify twcore.

my initial thought is that it would be best to remove the twcore wait, since it's not required.

my next question is if i remove this from the twcore will it still work with subgame.

so much to do, so little time. icon_biggrin.gif

thanks for the help guys!!
BDwinsAlt - Thu Nov 16, 2006 9:28 pm
Post subject:
I'm guessing if you remove the wait for it to recieve the packet and just allow it to go ahead and go in then it would work on subgame and asss. Just create a backup and see.
D1st0rt - Fri Nov 17, 2006 1:33 am
Post subject:
I actually fixed this back in April of '05, but naturally it hasn't been released. The good news is that a "release" of sorts will happen very soon biggrin.gif

Here's a quick fixed GPI I hacked together from a couple code diffs that should tide you over until then
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group