AuthServer: Difference between revisions

From OuroDev
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
Responsible for user authentication and session creation. Cross-shard capabilities.
Responsible for user authentication and session creation. Has cross-shard capabilities.


==Communication Protocols==
==Communication Protocols==
In the sections below, the table column "Structure" is denoted in a similar format used by the server source. Minus the opcode, which is type '''''c''''' anyways.
In the sections below, the table column "Structure" is denoted in a similar format used by the server source. Minus the opcode, which is type '''''c''''' anyways.
<div style="overflow-x:scroll">
{| class="wikitable"
{| class="wikitable"
!Type
!Type
Line 31: Line 32:
|Conditional, based on config
|Conditional, based on config
|}
|}
</div>


===Game Server===
===Game Server===
Line 36: Line 38:


====Incoming Packets====
====Incoming Packets====
"DBServer Function / AuthServer Function"
<div style="overflow-x:scroll">
{| class="wikitable"
{| class="wikitable"
!Opcode
!Opcode
!Description
!Structure
!Structure
!DBServer Function
!AuthServer Function
|-
|-
|AS_PLAY_OK
|AS_PLAY_OK
|authSendPlayOK / ServerPlayOk
|dd
|dd
|authSendPlayOK
|ServerPlayOk
|-
|-
|AS_PLAY_FAIL
|AS_PLAY_FAIL
|authSendPlayFail / ServerPlayFail
|cd
|cd
|authSendPlayFail
|ServerPlayFail
|-
|-
|AS_PLAY_GAME
|AS_PLAY_GAME
|authSendPlayGame / ServerPlayGame
|d
|d
|authSendPlayGame
|ServerPlayGame
|-
|-
|AS_QUIT_GAME
|AS_QUIT_GAME
|authSendQuitGame / ServerPlayQuit
|dwd
|dwd
|authSendQuitGame
|ServerPlayQuit
|-
|-
|AS_KICK_ACCOUNT
|AS_KICK_ACCOUNT
|authSendKickAccount / ServerKickAccount
|dw
|dw
|authSendKickAccount
|ServerKickAccount
|-
|-
|AS_SERVER_USERNUM
|AS_SERVER_USERNUM
| - / ServerGetUserNum
|ww
|ww
| -
|ServerGetUserNum
|-
|-
|AS_BAN_USER
|AS_BAN_USER
|authSendBanAccount / ServerBanUser
|dw
|dw
|authSendBanAccount
|ServerBanUser
|-
|-
|AS_VERSION
|AS_VERSION
|authSendVersion / ServerVersion
|d
|d
|authSendVersion
|ServerVersion
|-
|-
|AS_PING
|AS_PING
|authSendPing / ServerPing
|d
|d
|authSendPing
|ServerPing
|-
|-
|AS_WRITE_USERDATA
|AS_WRITE_USERDATA
|authSendUserData / ServerWriteUserData
|db
|db
|authSendUserData
|ServerWriteUserData
|-
|-
|AS_SET_CONNECT
|AS_SET_CONNECT
|authSendSetConnect / ServerSetActive
|d
|d
|authSendSetConnect
|ServerSetActive
|-
|-
|AS_PLAY_USER_LIST
|AS_PLAY_USER_LIST
|authSendCurrentPlayers / ServerPlayUserList
|dsddddd
|dsddddd
|authSendCurrentPlayers
|ServerPlayUserList
|-
|-
|AS_SET_SERVER_ID
|AS_SET_SERVER_ID
| - / SetServerId
|cw
|cw
| -
|SetServerId
|-
|-
|AS_SERVER_USER_NUM_BY_QUEUE_LEVEL
|AS_SERVER_USER_NUM_BY_QUEUE_LEVEL
| - / ServerUserNumByQueueLevel
| -
| -
| -
|ServerUserNumByQueueLevel
|-
|-
|AS_FINISHED_QUEUE
|AS_FINISHED_QUEUE
| - / FinishedQueue
|d
|d
| -
|FinishedQueue
|-
|-
|AS_SET_LOGIN_FREQUENCY
|AS_SET_LOGIN_FREQUENCY
| - / SetLoginFrequency
| -
| -
| -
|SetLoginFrequency
|-
|-
|AS_QUEUE_SIZES
|AS_QUEUE_SIZES
| - / QueueSizes
|c[cdd]
|c[cdd]
| -
|QueueSizes
|-
|-
|AS_READ_USERDATA
|AS_READ_USERDATA
| - / ServerReadUserData
|d
|d
| -
|ServerReadUserData
|-
|-
|AS_WRITE_GAMEDATA
|AS_WRITE_GAMEDATA
|authSendUserData / ServerWriteGameData
|db
|db
|authSendUserData
|ServerWriteGameData
|-
|-
|AS_READ_GAMEDATA
|AS_READ_GAMEDATA
|authSendGameDataReq / ServerReadGameData
|d
|d
|authSendGameDataReq
|ServerReadGameData
|-
|-
|AS_SHARD_TRANSFER
|AS_SHARD_TRANSFER
|authSendShardTransfer / ServerShardTransfer
|dd
|dd
|authSendShardTransfer
|ServerShardTransfer
|}
|}
</div>


====Outgoing Packets====
====Outgoing Packets====
"AuthServer Function / DBServer Function"
<div style="overflow-x:scroll">
{| class="wikitable"
{| class="wikitable"
!Opcode
!Opcode
!Description
!Structure
!Structure
!AuthServer Function
!DBServer Function
|-
|-
|SQ_ABOUT_TO_PLAY
|SQ_ABOUT_TO_PLAY
|AccountDB::AboutToPlay / handleAboutToPlay
|dsdddd
|dsdddd
|AccountDB::AboutToPlay
|handleAboutToPlay
|-
|-
|SQ_KICK_ACCOUNT
|SQ_KICK_ACCOUNT
|AccountDB::KickAccount / handleKickAccount
|dcs
|dcs
|AccountDB::KickAccount
|handleKickAccount
|-
|-
|SQ_SERVER_NUM
|SQ_SERVER_NUM
|RequestUserCounts / handleNumOnline
|
|
|RequestUserCounts
|handleNumOnline
|-
|-
|SQ_VERSION
|SQ_VERSION
|CSocketServer::OnCreate / handleVersion
|sd(d)
|sd(d)
|CSocketServer::OnCreate
|handleVersion
|-
|-
|SQ_PING
|SQ_PING
|ServerPing / handlePing
|d
|d
|ServerPing
|handlePing
|-
|-
|SQ_COMPLETE_USERLIST
|SQ_COMPLETE_USERLIST
|ServerPlayUserList / handleCompleteUserList
|d
|d
|ServerPlayUserList
|handleCompleteUserList
|-
|-
|SQ_USER_DATA
|SQ_USER_DATA
|ServerReadUserData / -
|db
|db
|ServerReadUserData
| -
|-
|-
|SQ_GAME_DATA
|SQ_GAME_DATA
|ServerReadGameData / handleRecvGameData
|db
|db
|ServerReadGameData
|handleRecvGameData
|}
|}
</div>


===Game Client===
===Game Client===
Line 171: Line 206:


====Incoming Packets====
====Incoming Packets====
"DBServer function / AuthServer function"
<div style="overflow-x:scroll">
{| class="wikitable"
{| class="wikitable"
!Opcode
!Opcode
!Description
!Structure
!Structure
!Game Function
!AuthServer Function
|-
|-
|AQ_LOGIN
|AQ_LOGIN
|<nowiki>- / LoginPacket</nowiki>
|dbdw(c)
|dbdw(c)
| -
|LoginPacket
|-
|-
|AQ_SERVER_LIST
|AQ_SERVER_LIST
|<nowiki>- / DeprecatedPacket</nowiki>
|ddc(c[d])
|ddc(c[d])
| -
| -
|-
|-
|AQ_ABOUT_TO_PLAY
|AQ_ABOUT_TO_PLAY
|acSendAboutToPlay / SelectServerPacket
|ddc
|ddc
|acSendAboutToPlay
|SelectServerPacket
|-
|-
|AQ_LOGOUT
|AQ_LOGOUT
|acSendLogout / LogoutPacket
|dd
|dd
|acSendLogout
|LogoutPacket
|-
|-
|AQ_LOGIN_MD5
|AQ_LOGIN_MD5
|acSendLoginMD5 / LoginPacketMd5Key
|dbdw(c)
|dbdw(c)
|acSendLoginMD5
|LoginPacketMd5Key
|-
|-
|AQ_SERVER_LIST_EXT
|AQ_SERVER_LIST_EXT
|acSendServerList / ServerListExtPacket
|ddc(c[d])
|ddc(c[d])
|acSendServerList
|ServerListExtPacket
|-
|-
|AQ_LOGIN_MD5_MD5
|AQ_LOGIN_MD5_MD5
|acSendLoginMD5 / -
|dbdw(c)
|dbdw(c)
|acSendLoginMD5
| -
|}
|}
</div>


====Outgoing Packets====
====Outgoing Packets====
<div style="overflow-x:scroll">
{| class="wikitable"
{| class="wikitable"
!Opcode
!Opcode
!Description
!Structure
!Structure
!AuthServer Function
!Game Function
|-
|-
|AC_PROTOCOL_VER
|AC_PROTOCOL_VER
|Exchange common protocol version with client
|dddbdb
|dddbdb
|CSocketServerEx::OnCreate
|acGetProtocolVer
|-
|-
|AC_LOGIN_FAIL
|AC_LOGIN_FAIL
|Reject client authentication
|c
|c
|CAccount::CheckPassword
AccountDB::RegAccount
AccountDB::CheckPersonalPayStat
LoginPacketSecure
|acGetLoginFail
|-
|-
|AC_BLOCKED_ACCOUNT
|AC_BLOCKED_ACCOUNT
|Account banned for X until Y
|dd
|dd
|LoginPacketSecure
|acGetBlockedAccount
|-
|-
|AC_LOGIN_OK
|AC_LOGIN_OK
|Allow client authentication
|dddddddddddd(dd)
|dddddddddddd(dd)
|AccountDB::RegAccount
|acGetLoginOK
|-
|-
|AC_SEND_SERVERLIST
|AC_SEND_SERVERLIST
|Send list of shards
|c[cddccwwcc(cs)]
|c[cddccwwcc(cs)]
|CServerList::MakeServerListPacket
|acGetSendServerList
|-
|-
|AC_SEND_SERVER_FAIL
|AC_SEND_SERVER_FAIL
|Something unexpected happened
|c
|c
|ServerListExtPacket
|acGetSendServerFail
|-
|-
|AC_PLAY_FAIL
|AC_PLAY_FAIL
|Server selected, but down possibly?
|cd
|c
|AccountDB::AboutToPlay
 
ServerPlayFail
 
SelectServerPacket
|acGetPlayFail
|-
|-
|AC_PLAY_OK
|AC_PLAY_OK
|Server selected, continue
|ddc
|ddc
|ServerPlayOk
|acGetPlayOK
|-
|-
|AC_ACCOUNT_KICKED
|AC_ACCOUNT_KICKED
|Account kicked for X
|c
|c
|AccountDB::KickAccount
|acGetAccountKicked
|-
|-
|AC_BLOCKED_ACCOUNT_WITH_MSG
|AC_BLOCKED_ACCOUNT_WITH_MSG
|Account permabanned for X
|s
|s
|LoginPacketSecure
|acGetBlockedAccountWithMsg
|-
|-
|AC_SC_CHECK_REQ
|AC_SC_CHECK_REQ
| -
| -
| -
| -
|
|-
|-
|AC_QUEUE_SIZE
|AC_QUEUE_SIZE
|Queue length and wait time
|c[ccdd]
|c[ccdd]
|CServerList::MakeQueueSizePacket
|acGetQueueSize
|-
|-
|AC_HANDOFF_TO_QUEUE
|AC_HANDOFF_TO_QUEUE
|Wait in server queue
|ddc
|ddc
|ServerPlayOk
|acGetHandoffToQueue
|-
|-
|AC_POSITION_IN_QUEUE
|AC_POSITION_IN_QUEUE
| -
| -
| -
| -
|
|}
|}
</div>


===GM Tools===
===GM Tools===
Line 273: Line 343:


====Incoming Packets====
====Incoming Packets====
<div style="overflow-x:scroll">
{| class="wikitable"
{| class="wikitable"
!Opcode
!Opcode
!Description
!Structure
!Structure
!AuthServer Function
|-
|-
|IA_SERVER_VERSION
|IA_SERVER_VERSION
|d
|GetConnectSessionKey
|GetConnectSessionKey
|d
|-
|-
|IA_IP_KIND
|IA_IP_KIND
Line 287: Line 358:
|-
|-
|IA_IP_USE
|IA_IP_USE
|dcdd
|GetIPAcquireSuccess
|GetIPAcquireSuccess
|dcdd
|-
|-
|IA_IP_START_OK
|IA_IP_START_OK
|dcddd
|StartIPCharge
|StartIPCharge
|dcddd
|-
|-
|IA_IP_START_FAIL
|IA_IP_START_FAIL
|dcddds
|StartIPChargeFail
|StartIPChargeFail
|dcddds
|-
|-
|IA_IP_USE_FAIL
|IA_IP_USE_FAIL
|dc
|GetIPAcquireFail
|GetIPAcquireFail
|dc
|-
|-
|IA_IP_SESSIONKEY
|IA_IP_SESSIONKEY
Line 315: Line 386:
|-
|-
|IA_IP_KICK
|IA_IP_KICK
|dddsd
|GetIPKick
|GetIPKick
|dddsd
|-
|-
|IA_IP_READY_FAIL
|IA_IP_READY_FAIL
|dc
|ReadyIPFail
|ReadyIPFail
|dc
|-
|-
|IA_IP_READY_OK
|IA_IP_READY_OK
|dcddd
|ReadyIPOK
|ReadyIPOK
|dcddd
|-
|-
|IA_IP_SET_STARTTIME_OK
|IA_IP_SET_STARTTIME_OK
Line 331: Line 402:
|-
|-
|IA_IP_SET_STARTTIME_FAIL
|IA_IP_SET_STARTTIME_FAIL
|d
|SetStartTimeFail
|SetStartTimeFail
|d
|}
|}
</div>


====Outgoing Packets====
====Outgoing Packets====
<div style="overflow-x:scroll">
{| class="wikitable"
{| class="wikitable"
!Opcode
!Opcode
!Description
!Structure
!Structure
!AuthServer Function
|-
|-
|AI_SERVER_VERSION
|AI_SERVER_VERSION
|
|sc
|sc
|CIPSocket::OnCreate
|-
|-
|AI_IP_KIND
|AI_IP_KIND
Line 350: Line 423:
|-
|-
|AI_IP_ACQUIRE
|AI_IP_ACQUIRE
|
|sddd
|sddd
|CIPSessionDB::AcquireSessionRequest
|-
|-
|AI_IP_RELEASE
|AI_IP_RELEASE
|
|ddddd
|ddddd
|CIPSessionDB::ReleaseSessionRequest
|-
|-
|AI_IP_START_CHARGE
|AI_IP_START_CHARGE
|
|dddcdd
|dddcdd
|CIPSessionDB::StartIPCharge
|-
|-
|AI_IP_STOP_CHARGE
|AI_IP_STOP_CHARGE
|
|ddddcddsd
|ddddcddsd
|CIPSessionDB::StopIPCharge
|-
|-
|AI_IP_INSTANT_START_GAME
|AI_IP_INSTANT_START_GAME
Line 378: Line 451:
|-
|-
|AI_IP_READY_GAME
|AI_IP_READY_GAME
|
|dddcdd
|dddcdd
|CIPSessionDB::ReadyToIPCharge
|-
|-
|AI_IP_SET_START_TIME
|AI_IP_SET_START_TIME
|
|dddcdd
|dddcdd
|CIPSessionDB::ConfirmIPCharge
|}
|}
</div>

Latest revision as of 00:28, 3 September 2020

Responsible for user authentication and session creation. Has cross-shard capabilities.

Communication Protocols

In the sections below, the table column "Structure" is denoted in a similar format used by the server source. Minus the opcode, which is type c anyways.

Type Description
c Char
w Word / Short
d DWord / Int
q QWord / Long
b Byte Array
s NUL-terminated C String
[] Array
() Conditional, based on config

Game Server

TCP Port 2104. AuthServer and DBServer communicate through this port.

Incoming Packets

Opcode Structure DBServer Function AuthServer Function
AS_PLAY_OK dd authSendPlayOK ServerPlayOk
AS_PLAY_FAIL cd authSendPlayFail ServerPlayFail
AS_PLAY_GAME d authSendPlayGame ServerPlayGame
AS_QUIT_GAME dwd authSendQuitGame ServerPlayQuit
AS_KICK_ACCOUNT dw authSendKickAccount ServerKickAccount
AS_SERVER_USERNUM ww - ServerGetUserNum
AS_BAN_USER dw authSendBanAccount ServerBanUser
AS_VERSION d authSendVersion ServerVersion
AS_PING d authSendPing ServerPing
AS_WRITE_USERDATA db authSendUserData ServerWriteUserData
AS_SET_CONNECT d authSendSetConnect ServerSetActive
AS_PLAY_USER_LIST dsddddd authSendCurrentPlayers ServerPlayUserList
AS_SET_SERVER_ID cw - SetServerId
AS_SERVER_USER_NUM_BY_QUEUE_LEVEL - - ServerUserNumByQueueLevel
AS_FINISHED_QUEUE d - FinishedQueue
AS_SET_LOGIN_FREQUENCY - - SetLoginFrequency
AS_QUEUE_SIZES c[cdd] - QueueSizes
AS_READ_USERDATA d - ServerReadUserData
AS_WRITE_GAMEDATA db authSendUserData ServerWriteGameData
AS_READ_GAMEDATA d authSendGameDataReq ServerReadGameData
AS_SHARD_TRANSFER dd authSendShardTransfer ServerShardTransfer

Outgoing Packets

Opcode Structure AuthServer Function DBServer Function
SQ_ABOUT_TO_PLAY dsdddd AccountDB::AboutToPlay handleAboutToPlay
SQ_KICK_ACCOUNT dcs AccountDB::KickAccount handleKickAccount
SQ_SERVER_NUM RequestUserCounts handleNumOnline
SQ_VERSION sd(d) CSocketServer::OnCreate handleVersion
SQ_PING d ServerPing handlePing
SQ_COMPLETE_USERLIST d ServerPlayUserList handleCompleteUserList
SQ_USER_DATA db ServerReadUserData -
SQ_GAME_DATA db ServerReadGameData handleRecvGameData

Game Client

TCP Port 2106. AuthServer and Game communicate through this port.

Incoming Packets

Opcode Structure Game Function AuthServer Function
AQ_LOGIN dbdw(c) - LoginPacket
AQ_SERVER_LIST ddc(c[d]) - -
AQ_ABOUT_TO_PLAY ddc acSendAboutToPlay SelectServerPacket
AQ_LOGOUT dd acSendLogout LogoutPacket
AQ_LOGIN_MD5 dbdw(c) acSendLoginMD5 LoginPacketMd5Key
AQ_SERVER_LIST_EXT ddc(c[d]) acSendServerList ServerListExtPacket
AQ_LOGIN_MD5_MD5 dbdw(c) acSendLoginMD5 -

Outgoing Packets

Opcode Structure AuthServer Function Game Function
AC_PROTOCOL_VER dddbdb CSocketServerEx::OnCreate acGetProtocolVer
AC_LOGIN_FAIL c CAccount::CheckPassword

AccountDB::RegAccount

AccountDB::CheckPersonalPayStat

LoginPacketSecure

acGetLoginFail
AC_BLOCKED_ACCOUNT dd LoginPacketSecure acGetBlockedAccount
AC_LOGIN_OK dddddddddddd(dd) AccountDB::RegAccount acGetLoginOK
AC_SEND_SERVERLIST c[cddccwwcc(cs)] CServerList::MakeServerListPacket acGetSendServerList
AC_SEND_SERVER_FAIL c ServerListExtPacket acGetSendServerFail
AC_PLAY_FAIL cd AccountDB::AboutToPlay

ServerPlayFail

SelectServerPacket

acGetPlayFail
AC_PLAY_OK ddc ServerPlayOk acGetPlayOK
AC_ACCOUNT_KICKED c AccountDB::KickAccount acGetAccountKicked
AC_BLOCKED_ACCOUNT_WITH_MSG s LoginPacketSecure acGetBlockedAccountWithMsg
AC_SC_CHECK_REQ - -
AC_QUEUE_SIZE c[ccdd] CServerList::MakeQueueSizePacket acGetQueueSize
AC_HANDOFF_TO_QUEUE ddc ServerPlayOk acGetHandoffToQueue
AC_POSITION_IN_QUEUE - -

GM Tools

TCP Port 2108. Used for internal administration?

Incoming Packets

Opcode Structure AuthServer Function
IA_SERVER_VERSION d GetConnectSessionKey
IA_IP_KIND - -
IA_IP_USE dcdd GetIPAcquireSuccess
IA_IP_START_OK dcddd StartIPCharge
IA_IP_START_FAIL dcddds StartIPChargeFail
IA_IP_USE_FAIL dc GetIPAcquireFail
IA_IP_SESSIONKEY - -
IA_IP_INSTANTLOGIN_OK - -
IA_IP_INSTANTLOGIN_FAIL - -
IA_IP_KICK dddsd GetIPKick
IA_IP_READY_FAIL dc ReadyIPFail
IA_IP_READY_OK dcddd ReadyIPOK
IA_IP_SET_STARTTIME_OK - -
IA_IP_SET_STARTTIME_FAIL d SetStartTimeFail

Outgoing Packets

Opcode Structure AuthServer Function
AI_SERVER_VERSION sc CIPSocket::OnCreate
AI_IP_KIND - -
AI_IP_ACQUIRE sddd CIPSessionDB::AcquireSessionRequest
AI_IP_RELEASE ddddd CIPSessionDB::ReleaseSessionRequest
AI_IP_START_CHARGE dddcdd CIPSessionDB::StartIPCharge
AI_IP_STOP_CHARGE ddddcddsd CIPSessionDB::StopIPCharge
AI_IP_INSTANT_START_GAME - -
AI_IP_INSTANT_STOP_GAME - -
AI_IP_KICKED - -
AI_IP_READY_GAME dddcdd CIPSessionDB::ReadyToIPCharge
AI_IP_SET_START_TIME dddcdd CIPSessionDB::ConfirmIPCharge