BeBot - An Anarchy Online and Age Of Conan chat automaton

Archive => Age of Conan Archive => AoC 0.6 support => Topic started by: khayman on June 27, 2009, 05:16:15 pm

Title: AoC Patch 1.05 login information
Post by: khayman on June 27, 2009, 05:16:15 pm
The new loginsystem requires a bit more work than the old one, since you have to talk to 2 diffrent servers to receive the loginseed needed to log in to the chatserver. And an slightly unfortunate sideeffect of this is that you actually log in the bot character for a few minutes. This means that you can not log in with a bot/chat client while you are logged into the game with a normal character from the same account, and after you log in the bot you will probably have to wait 2 minutes before you are able to log in with a normal character.
That beeing said, this change was not (according to my sources in FC) made to break bots and the bot community, it is an unfortunate sideeffect of another problem FC had to solve.

So the actual login process is like this
1. Connect to UniverseManager
2. Once connected send InitializeAuthentication packet
3. Receive Challenge packet
4. Reply with AnswerChallenge (this is almost the same as the old login packet with the username and pwd encrypted)
5. Receive AckAuthenticate with the TerritoryManager address and a login seed
    (If anything went wrong you will Receive a LoginProblem packet
6. Disconnect from this server

7. Connect to the TerritoryManager through the address received earlier
8. Once connected send Authenticate packet
9. Receive AuthenticateAck
10. Send the GetStartupData
11. Receive UpdateClientPlayerData (character list)
12. Select your character and send LoginCharacter
13. If all went well you will receive ChatServerConnectReady with the login seed and address of the chat server you want
     (If anything went wrong you will receive a LoginProblem packet)
14. Disconnect from this server

15. Send the LoginPacket to the chatserver with the login seed

And thats it, not hard at all :p
I will add packet descriptions soon.
Title: Re: AoC Patch 1.05 login information
Post by: Shakor on June 27, 2009, 07:05:47 pm
Awesome info. Now hopefully one of the bebot devs could create a patch with these and the coming packet description post.
Nice work Khayman
Title: Re: AoC Patch 1.05 login information
Post by: khayman on June 27, 2009, 07:51:13 pm
The following packets are in FCs RemoteMethod format so they all follow some simple rules.

The base structure of each packet is like this:
Code: [Select]
uint32 : packet size (payload + 4 bytes for crc32)
uint32 : crc32 of the data (EID, EID, uint32, data)
EID    : caller EndpointID
EID    : target EndpointID
uint32 : remote method id
data   : The remote method arguments

Each EndpointID is structured like this:
Code: [Select]
string : endpoint name (remember this is uint16 + str data)
uint32 : endpoint instance
uint32 : endpoint token

Strings are streamed as:
Code: [Select]
uint16 : string length
char*  : string data

Packets:
Universe Manager:
All packets sendt to UM should contain the following EID
Code: [Select]
Caller Name     : UniverseInterface
Caller Instance : 1
Caller Token    : 0

Target Name     : UniverseAgent
Target Instance : 0
Target Token    : 0
All packets received from UM should contain the following EID (though you will never use them for anything, they can be skipped)
Code: [Select]
Caller Name     : UniverseAgent
Caller Instance : 1
Caller Token    : 0

Target Name     : UniverseInterface
Target Instance : some number i dont know what is but its not used
Target Token    : 0

InitializeAuthentication: to UniverseManager
Code: [Select]
Remote Method ID: 0
Arguments:
string : dev name (always empty on live universe, stream as uint16 value 0)
string : login name (your user account followed by the universe version ":2". ie. "mylogin:2"
uint32 : unknown, just stream the value 1

Challenge: from UniverseManager
Code: [Select]
Remote Method ID: 0
Arguments:
string : challenge (same as the chatserver used to give, the reply in AnswerChallenge should be encrypted like the old chat protocol)

AnswerChallenge: to UniverseManager
Code: [Select]
Remote Method ID: 1
Arguments:
string : answer (the string produced from the challenge string containing your encrypted username and password)

AckAuthenticate: from UniverseManager
Code: [Select]
Remote Method ID: 1
Arguments:
uint32 : authentication status (not used by conanchat)
uint32 : player id type (10002 not used by anything useful)
uint32 : player id instance (your account id)
string : territory manager address ("somewhere.host.com:7003")
uint32 : cookie (the cake is a lie)
uint32 : loginstatus (not sure if this can produce anything else than loginok without receiving LoginProblem instead)

LoginProblem: from UniverseManager
Code: [Select]
Remote Method ID: 2
Arguments:
uint32 : login problem error code
Title: Re: AoC Patch 1.05 login information
Post by: khayman on June 27, 2009, 07:56:22 pm
TerritoryManager:
All packets sendt to TM should contain the following EID
Code: [Select]
Caller Name     : PlayerInterface
Caller Instance : account id (received from the UM in AckAuthenticate
Caller Token    : 0

Target Name     : PlayerAgent
Target Instance : 0
Target Token    : 0
All packets received from TM should contain the following EID (though you will never use them for anything, they can be skipped)
Code: [Select]
Caller Name     : PlayerAgent
Caller Instance : 2
Caller Token    : 0

Target Name     : PlayerInterface
Target Instance : Account id
Target Token    : 0

Authenticate: to TerritoryManager
Code: [Select]
Remote Method ID: 0x9CB2CB03 (python hash of the name, could change with any version of python but FC is currently using 2.4)
Arguments:
uint32 : account id (received from UM)
uint32 : cookie (received from UM)

AuthenticateAck: from TerritoryManager
Code: [Select]
Remote Method ID: 0x5dc18991
Arguments:
uint32 : status (not used for anything)

GetStartupData: to TerritoryManager
Code: [Select]
Remote Method ID: 0x6A546D41
Arguments: None

UpdateClientPlayerData: from TerritoryManager
Code: [Select]
Remote Method ID: 0xc414c5ef
Arguments:
uint32 : account id
uint32 : (num characters + 1) * 1009 (ie 1009 = 0, 2018 = 1, 3027 = 2, 4036 = 3 ...) so take the number divide it by 1009 and subtract 1
loop for each character
  uint32 : character id
  uint32 : account id  (got to love the utter redundancy)
  uint32 : character id (and some more redundancy :p)
  string : character name
  uint32 : dimension id
  uint32 : login state
  uint32 : last login date
  uint32 : playtime (possibly how many seconds this character have been logged in)
  uint32 : location name id
  uint32 : level
  uint32 : class
  uint32 : state
  uint64 : last login holder (no idea what this is)
  uint32 : gender
  uint32 : race
  string : client language
  uint32 : blocked status
uint32 : max character slots

LoginCharacter: to TerritoryManager
Code: [Select]
Remote Method ID: 0xef616eb6
Arguments:
uint32 : character id
string : rdbdsn (stream as empty string)
string : language (stream whatever this character had in the UpdateClientPlayerData packet)

ChatServerConnectReady: from TerritoryManager
Code: [Select]
Remote Method ID: 0x23A632FA
Arguments:
uint32 : chatserver IP address
uint16: chatserver port
uint32 : cookie (the one the chatserver will expect)
uint32 : character id type
uint32 : character id

LoginProblem: from TerritoryManager
Code: [Select]
Remote Method ID: 0xD4063CA0
Arguments:
uint32 : login error code
Title: Re: AoC Patch 1.05 login information
Post by: khayman on June 27, 2009, 08:18:53 pm
Code: [Select]
enum LoginStatus {
  e_Error                                  = -1,
  e_LoginOK                                = 0,
  e_FIDTimeOut                             = 1,
  e_DimensionDown                          = 2,
  e_TooManyChars                           = 3,
  e_InvalidCharSlot                        = 4,
  e_NoGameServers                          = 5,
  e_CharNotAvailable                       = 6,
  e_CharBroken                             = 7,
  e_PlayfieldShuttingDown                  = 8,
  e_PlayfieldFull                          = 9,
  e_ThisDimensionFull                      = 10,
  e_UnableToLogin                          = 11,
  e_SystemError                            = 12,
  e_Banned                                 = 13,
  e_AuthFailure                            = 14,
  e_UnableToFindPlayerObject               = 15,
  e_UnableToFindDimensionObject            = 16,
  e_TooManyCharsInDimension                = 17,
  e_DBFailedCreatingCharacter              = 18,
  e_UnableToLoginHasAnotherOnlineCharacter = 19,
  e_DimensionCantCreateMoreCharacters      = 20,
  e_MissingFIDData                         = 21,
  e_NoAuthenticationData                   = 22,
  e_Frozen                                 = 23, ///< Account is frozen, most likely due to lack of payment
  e_AccountNotVerified                     = 24,
  e_UniverseVersionError                   = 25,
  e_NoReason                               = 26,
  e_LoginCanceled                          = 27,
  e_WrongLoginStepEncounteredPanic         = 28,
  e_UnableToStartAnyPlayfields             = 29,
  e_LoginTimedOut                          = 30,
  e_CharacterMagicallyAppearedOnAPlayfieldForUnknownReason = 31,
  e_CharacterTransferFail                  = 32,
  e_AccessDeniedToSelectedDimension        = 33, ///< The account does not have access to the selected dimension. This shouldn't happen (the client shouldn't see these dimensions), but in case we screw up, there's an error message for it.
  e_NoAllowedLanguageFound                 = 34,
  e_ThisDimensionFullForTrialAccounts      = 35,
};
Title: Re: AoC Patch 1.05 login information
Post by: khayman on June 27, 2009, 08:21:12 pm
That should hopefully be everything you need to get the ball rolling, just PM me if you have additional questions.

I might start trying to implement this myself to get the bots back into conan, but i dont have the time, energy or pressure from my guild to bother starting on it. So if anyone else fixes it ill be a happy camper (along with all the other conan bebot users)
Title: Re: AoC Patch 1.05 login information
Post by: Shakor on June 27, 2009, 09:26:09 pm
Come on man! *Sending pressure*
No but seriously how long would it take you to rewrite some of the core in AOChat.php from bebot to support this new authentication method?

You have done 80% now already. The hardest part is now done.

PS: The only problem is that bebot is a AO and AOC php bot. And now that AoC has changed the login authentication. It is going to pull the bebot bot apart from AO. (As AO is still using the old authProtocol.)
Title: Re: AoC Patch 1.05 login information
Post by: khayman on June 27, 2009, 09:51:19 pm
Well i dont really know the core workings of BeBot so i dont really know hom much work it would be to implement a new login path for conan while still retaining the ability to log in to ao.
And im too lazy to accept your pressure.
Title: Re: AoC Patch 1.05 login information
Post by: Shakor on June 27, 2009, 09:59:10 pm
Ok... That really sucks. Oh wait maybe this will help:

Quote from: -h4mi-;1345914
If you do, you should set up a paypal for donations. I would donate.
http://forums-eu.ageofconan.com/showpost.php?p=1345914&postcount=30
Title: Re: AoC Patch 1.05 login information
Post by: khayman on June 27, 2009, 10:55:10 pm
There are a few other ppl who PMed me about this so ill wait and see if they fix it ;)
Title: Re: AoC Patch 1.05 login information
Post by: Shakor on June 27, 2009, 11:14:25 pm
Nice :)
Title: Re: AoC Patch 1.05 login information
Post by: Vulkor on June 28, 2009, 05:06:52 am
Thanks for the update, seems like there is hope.
Title: Re: AoC Patch 1.05 login information
Post by: khayman on June 28, 2009, 08:46:55 am
It looks like chaoz (main conanchat dev) has taken it upon himself to fox bebot

http://forums-eu.ageofconan.com/showpost.php?p=1347633&postcount=35
Title: Re: AoC Patch 1.05 login information
Post by: Vhab on June 28, 2009, 01:21:53 pm
Ooh, that's pretty promising.
Chaoz is the right man for the job at least, he ported my c# lib to c++ so he should have quite some understand of the chat protocol.

@khayman: Thank you for the extensive breakdown :). Looks like I'll have to take some time to update the c# lib in a few weeks for the sake of completeness.
Though, we're getting awfully close to headless AoC clients now.

ps. To all the posters on the AoC forums that might be lurking these forums. Funcom is not to blame, nor is there action from Funcom required, nor is anyone waiting for specific information from Funcom. Stop blaming Funcom for this situation on the forums.
Title: Re: AoC Patch 1.05 login information
Post by: Organizer on June 28, 2009, 02:57:04 pm
Sorry to say so but how is a last minute change and no information given to the community on the specifics not Funcom fault in each and every way?

Sure its not an supported feature, but they know about it, they know bots play a key role since AO days, and they surely know changing the protocol for whatever reason would screw up all the bots out there, how can you say they are not to blame?

It's blunt ignorance and bad community management... and this is not the only issue I'd be willing to claim the same statement for this year.
Title: Re: AoC Patch 1.05 login information
Post by: khayman on June 29, 2009, 10:57:16 am
Chaoz claims to have finished the work, so hopefully he will make it public soon.
Title: Re: AoC Patch 1.05 login information
Post by: Shakor on June 29, 2009, 12:45:24 pm
Lets hope so.
Title: Re: AoC Patch 1.05 login information
Post by: Nysom on June 30, 2009, 12:46:17 am
Ok, so does anyone have the server IP's and new ports? The php files open fairly easily in Excel and perhaps it can be a manual workaround for now... 
Title: Re: AoC Patch 1.05 login information
Post by: Shakor on June 30, 2009, 12:50:06 am
lol. Not really..
Title: Re: AoC Patch 1.05 login information
Post by: Drizzurdeen on June 30, 2009, 02:04:26 am
here are the ip's for mitra found with netstat -b, hope it helps

greez drizz

MITRA German PVE-Server

prodgame022.ams.ageofconan.com:7022
proddm02.ams.ageofconan.com 7004
proddm02.ams.ageofconan.com:7021

theses are the ip's for Mitra i found with netstat -b hope it woud help
Title: Re: AoC Patch 1.05 login information
Post by: Nysom on June 30, 2009, 04:26:23 am
Hmmm I need Cimmeria US PvP-RP...

The most important thing was our PEPGP system and I just loaded it up on my webserver.. trying that little workaround.

Addict.. maybe...
Title: Re: AoC Patch 1.05 login information
Post by: Vhab on June 30, 2009, 08:06:13 am
Ok, so does anyone have the server IP's and new ports? The php files open fairly easily in Excel and perhaps it can be a manual workaround for now... 

That's not the big issue preventing your BeBot from working.
FC changed the protocol, so the bot needs quite a heavy update.
But an update is on it's way on the AoC forums.
Title: Re: AoC Patch 1.05 login information
Post by: Huesos on July 03, 2009, 10:30:37 am
with Chaoz files , I had to update serverlist.php for Set server's port to 7000 and bot is up and running now!
SimplePortal 2.3.7 © 2008-2024, SimplePortal