Development:Network:process login
From Ghoulwiki
STUB article, some incomplete notes:
Contents
multiplayer modes
Vegastrike Multiplayer supports 2 modes :
- deathmatch, for lan instant action. vegastrike multiplayer dialog : "Independent Server"
- mmo (massive multiplayer online). vegastrike multiplayer dialog : "Online Account Server"
Deathmatch mode
by default a system with no jumps and just 1 planet for buying stuff
MMO mode
MMO mode is meant for more persistent gameplay than deathmatch mode, for this a accountserver is needed.
- to join an MMO Server, select "Online Account Server" under vegastrike multiplayer dialog
- at the time of writing there are no public MMO servers available (see forum for tharin server, in case it gets back online someday), but it can be run locally:
- see "HOWTO: Setup and configure vegaserver." http://forums.vega-strike.org/viewtopic.php?f=37&t=17701
- mmo-mode : instead of logging into the game server directly, the game first logs into the account server via http request
- the account server replies via http with success/failure status, and in case of success the ip and port of the gameserver to log in to
deathmatch login notes
(C: sent from client, S: sent from server) C: CMD_CONNECT (ser=CLIENT_NETVERSION,empty) S: CMD_CONNECT (ser=0,serial:netversion,str:clientip) C: CMD_LOGIN (ser=0,str:callsign,str:passwd) S: CMD_CHOOSESHIP (ser=0,short:#shipnames,str:shipnames[1],str:shipnames[2],...) C: CMD_CHOOSESHIP (ser=0,short:shipidx,str:shipname) S: LOGIN_ACCEPT (ser=X,str:stardate,str:savegame[0],str:savegame[1],str:systemname.system,short:crypto-hash-size,data:crypto-hash,short:zoneid,..) -- big data, 9k in sample S: CMD_TXTMESSAGE (ser=0,data:??"...Welcome, asd...") C: CMD_DOWNLOAD (ser=0,data:??..Crucible/Cephid_17.system) S: CMD_DOWNLOAD (ser=0,data:??..Crucible/Cephid_17.system) ... several CMD_DOWNLOAD ... C:CMD_SERVERTIME several times... ping? C:CMD_ADDCLIENT -- undock or sth like that ? or final ingame confirm S:CMD_ADDEDYOU S:CMD_ENTERCLIENT S:CMD_SNAPCARGO S:CMD_CREDITS S:CMD_SNAPCARGO huge data, planet contents atlantis ?? 37kb S:CMD_DOCK S:CMD_SAVEDATA dozens of times.. total about 30kb... mission texts etc ? S:CMD_CARGOUPGRADE a few times, ships ? C:CMD_CUSTOM ...campaign_readsave! S:CMD_CARGOUPGRADE a few times, ships ? C:CMD_CUSTOM ...mission_lib!...CreateFixerMissions!. S:CMD_CUSTOM ...mission_lib!...AddNewMission S:CMD_CUSTOM a few times, missions ?
mmo mode : account server protocol
- the reply of the account server (http answer payload) is plaintext using the format <number>SPACE
- see also data/cgi-accountserver/accountserver.py
- first char is message type :
- ACCT_LOGIN='l'
- ACCT_LOGIN_DATA='d',(field username),(field warning),(field serverip),(field serverport) -- sent by server when login is accepted
- ACCT_LOGIN_ERROR='e'
- ACCT_LOGIN_ALREADY='f'
- ACCT_LOGIN_NEW='n'
- ACCT_LOGIN_ACCEPT='a'
- ACCT_LOGOUT='o'
- ACCT_SAVE_LOGOUT='S'
- ACCT_RESYNC='r'
- ACCT_SAVE='s'
- ACCT_NEWCHAR='c'
- ACCT_NEWSUBSCRIBE='u'
- ACCT_SUCCESS='!'
login request
- client sends http "d6 asdasd6 asdasd" (ACCT_LOGIN_DATA, username=asdasd password=asdasd)
- server sends http "d6 asdasd0 9 127.0.0.14 6777" (ACCT_LOGIN_DATA, username=asdasd, warning=emptystring, serverip=127.0.0.1, port=6777)
example packetlog
packetlog by wireshark, mmo, accountserver part (http:8080)
// username=asdasd password=asdasd serverip=192.168.178.26 serverport=6777 // client to accountserver 00000000 50 4f 53 54 20 2f 63 67 69 2d 62 69 6e 2f 61 63 POST /cg i-bin/ac 00000010 63 6f 75 6e 74 73 65 72 76 65 72 2e 70 79 20 48 countser ver.py H 00000020 54 54 50 2f 31 2e 31 0d 0a 48 6f 73 74 3a 20 31 TTP/1.1. .Host: 1 00000030 39 32 2e 31 36 38 2e 31 37 38 2e 32 36 3a 38 30 92.168.1 78.26:80 00000040 38 30 0d 0a 55 73 65 72 2d 41 67 65 6e 74 3a 20 80..User -Agent: 00000050 56 73 6e 65 74 2f 31 2e 30 0d 0a 43 6f 6e 6e 65 Vsnet/1. 0..Conne 00000060 63 74 69 6f 6e 3a 20 6b 65 65 70 2d 61 6c 69 76 ction: k eep-aliv 00000070 65 0d 0a 41 63 63 65 70 74 3a 20 6d 65 73 73 61 e..Accep t: messa 00000080 67 65 2f 78 2d 76 73 6e 65 74 2d 70 61 63 6b 65 ge/x-vsn et-packe 00000090 74 0d 0a 4b 65 65 70 2d 41 6c 69 76 65 3a 20 33 t..Keep- Alive: 3 000000A0 30 30 0d 0a 43 6f 6e 74 65 6e 74 2d 54 79 70 65 00..Cont ent-Type 000000B0 3a 20 6d 65 73 73 61 67 65 2f 78 2d 76 73 6e 65 : messag e/x-vsne 000000C0 74 2d 70 61 63 6b 65 74 0d 0a 43 6f 6e 74 65 6e t-packet ..Conten 000000D0 74 2d 4c 65 6e 67 74 68 3a 20 31 37 0d 0a 0d 0a t-Length : 17.... 000000E0 64 36 20 61 73 64 61 73 64 36 20 61 73 64 61 73 d6 asdas d6 asdas 000000F0 64 d // accountserver to client 00000000 48 54 54 50 2f 31 2e 30 20 32 30 30 20 53 63 72 HTTP/1.0 200 Scr 00000010 69 70 74 20 6f 75 74 70 75 74 20 66 6f 6c 6c 6f ipt outp ut follo 00000020 77 73 0d 0a ws.. // accountserver to client 00000024 53 65 72 76 65 72 3a 20 42 61 73 65 48 54 54 50 Server: BaseHTTP 00000034 2f 30 2e 33 20 50 79 74 68 6f 6e 2f 32 2e 37 2e /0.3 Pyt hon/2.7. 00000044 31 2b 0d 0a 44 61 74 65 3a 20 53 75 6e 2c 20 31 1+..Date : Sun, 1 00000054 37 20 4a 75 6e 20 32 30 31 32 20 31 35 3a 35 39 7 Jun 20 12 15:59 00000064 3a 32 38 20 47 4d 54 0d 0a 0d 0a 64 36 20 61 73 :28 GMT. ...d6 as 00000074 64 61 73 64 30 20 31 34 20 31 39 32 2e 31 36 38 dasd0 14 192.168 00000084 2e 31 37 38 2e 32 36 34 20 36 37 37 37 0a .178.264 6777.
packetlog by wireshark, mmo, tcp part parsed
full log here : https://github.com/ghoulsblade/vegaogre/blob/master/packetlogs/login-mmo-2-tcp.c
-- packetlogs/login-mmo-2-tcp.c Packet({from=client,cmd=CMD_CONNECT,head={{len=16,pri=1,flags=0x0},{cmd=46,serial=4995,datalen=0,flags=0x0}}}) Packet({from=server,cmd=CMD_CONNECT,head={{len=38,pri=1,flags=0x7a},{cmd=46,serial=0,datalen=22,flags=0x0}}}) Packet({from=client,cmd=CMD_LOGIN,head={{len=36,pri=1,flags=0x0},{cmd=1,serial=0,datalen=20,flags=0x0}}}) Packet({from=server,cmd=LOGIN_ACCEPT,head={{len=9927,pri=1,flags=0x7a},{cmd=4,serial=132,datalen=9911,flags=0x0}}}) Packet({from=server,cmd=CMD_TXTMESSAGE,head={{len=58,pri=1,flags=0x7a},{cmd=33,serial=0,datalen=42,flags=0x0}}}) Packet({from=client,cmd=CMD_DOWNLOAD,submd=ResolveRequest,head={{len=52,pri=1,flags=0x0},{cmd=30,serial=0,datalen=36,flags=0x10}}}) Packet({from=server,cmd=CMD_DOWNLOAD,submd=ResolveResponse,head={{len=52,pri=1,flags=0x7a},{cmd=30,serial=0,datalen=36,flags=0x10}}}) Packet({from=client,cmd=CMD_DOWNLOAD,submd=DownloadRequest,head={{len=52,pri=1,flags=0x0},{cmd=30,serial=0,datalen=36,flags=0x10}}}) Packet({from=server,cmd=CMD_DOWNLOAD,submd=DownloadFirstFragment,head={{len=1030,pri=1,flags=0x7a},{cmd=30,serial=0,datalen=1014,flags=0x10}}}) Packet({from=server,cmd=CMD_DOWNLOAD,submd=DownloadFragment,head={{len=1027,pri=1,flags=0x7a},{cmd=30,serial=0,datalen=1011,flags=0x10}}}) Packet({from=server,cmd=CMD_DOWNLOAD,submd=DownloadFragment,head={{len=1027,pri=1,flags=0x7a},{cmd=30,serial=0,datalen=1011,flags=0x10}}}) Packet({from=server,cmd=CMD_DOWNLOAD,submd=DownloadFragment,head={{len=1027,pri=1,flags=0x7a},{cmd=30,serial=0,datalen=1011,flags=0x10}}}) Packet({from=server,cmd=CMD_DOWNLOAD,submd=DownloadFragment,head={{len=1027,pri=1,flags=0x7a},{cmd=30,serial=0,datalen=1011,flags=0x10}}}) Packet({from=server,cmd=CMD_DOWNLOAD,submd=DownloadLastFragment,head={{len=296,pri=1,flags=0x7a},{cmd=30,serial=0,datalen=280,flags=0x10}}}) Packet({from=client,cmd=CMD_SERVERTIME,head={{len=19,pri=1,flags=0x0},{cmd=0,serial=0,datalen=3,flags=0x0}}}) Packet({from=client,cmd=CMD_SERVERTIME,head={{len=19,pri=1,flags=0x0},{cmd=0,serial=0,datalen=3,flags=0x0}}}) Packet({from=client,cmd=CMD_SERVERTIME,head={{len=19,pri=1,flags=0x0},{cmd=0,serial=0,datalen=3,flags=0x0}}}) Packet({from=client,cmd=CMD_SERVERTIME,head={{len=19,pri=1,flags=0x0},{cmd=0,serial=0,datalen=3,flags=0x0}}}) Packet({from=client,cmd=CMD_SERVERTIME,head={{len=19,pri=1,flags=0x0},{cmd=0,serial=0,datalen=3,flags=0x0}}}) Packet({from=client,cmd=CMD_SERVERTIME,head={{len=19,pri=1,flags=0x0},{cmd=0,serial=0,datalen=3,flags=0x0}}}) Packet({from=client,cmd=CMD_SERVERTIME,head={{len=19,pri=1,flags=0x0},{cmd=0,serial=0,datalen=3,flags=0x0}}}) Packet({from=client,cmd=CMD_SERVERTIME,head={{len=19,pri=1,flags=0x0},{cmd=0,serial=0,datalen=3,flags=0x0}}}) Packet({from=client,cmd=CMD_SERVERTIME,head={{len=19,pri=1,flags=0x0},{cmd=0,serial=0,datalen=3,flags=0x0}}}) Packet({from=client,cmd=CMD_SERVERTIME,head={{len=19,pri=1,flags=0x0},{cmd=0,serial=0,datalen=3,flags=0x0}}}) Packet({from=client,cmd=CMD_ADDCLIENT,head={{len=16,pri=1,flags=0x0},{cmd=12,serial=132,datalen=0,flags=0x0}}}) Packet({from=server,cmd=CMD_SAVEDATA,head={{len=37,pri=1,flags=0x7a},{cmd=49,serial=0,datalen=21,flags=0x0}}}) Packet({from=server,cmd=CMD_ADDEDYOU,head={{len=67,pri=1,flags=0x7a},{cmd=15,serial=132,datalen=51,flags=0x0}}}) Packet({from=server,cmd=CMD_ENTERCLIENT,head={{len=10397,pri=1,flags=0x7a},{cmd=13,serial=0,datalen=10381,flags=0x0}}}) Packet({from=server,cmd=CMD_SNAPCARGO,head={{len=20,pri=1,flags=0x7a},{cmd=40,serial=0,datalen=4,flags=0x0}}}) Packet({from=server,cmd=CMD_CREDITS,head={{len=21,pri=1,flags=0x7a},{cmd=42,serial=132,datalen=5,flags=0x0}}}) Packet({from=server,cmd=CMD_SNAPCARGO,head={{len=37368,pri=1,flags=0x7a},{cmd=40,serial=0,datalen=37352,flags=0x0}}})
packetlog by wireshark, deathmatch
-- packetlogs/login-deathmatch.c Packet({from=client,cmd=CMD_CONNECT,head={{len=16,pri=1,flags=0x0},{cmd=46,serial=4995,datalen=0,flags=0x0}}}) Packet({from=server,cmd=CMD_CONNECT,head={{len=33,pri=1,flags=0x0},{cmd=46,serial=0,datalen=17,flags=0x0}}}) Packet({from=client,cmd=CMD_LOGIN,head={{len=36,pri=1,flags=0x0},{cmd=1,serial=0,datalen=20,flags=0x0}}}) Packet({from=server,cmd=CMD_CHOOSESHIP,head={{len=1515,pri=1,flags=0x0},{cmd=47,serial=0,datalen=1499,flags=0x0}}}) Packet({from=client,cmd=CMD_CHOOSESHIP,head={{len=39,pri=1,flags=0x0},{cmd=47,serial=0,datalen=23,flags=0x0}}}) Packet({from=server,cmd=LOGIN_ACCEPT,head={{len=9955,pri=1,flags=0x0},{cmd=4,serial=40,datalen=9939,flags=0x0}}}) Packet({from=server,cmd=CMD_TXTMESSAGE,head={{len=58,pri=1,flags=0x0},{cmd=33,serial=0,datalen=42,flags=0x0}}}) Packet({from=client,cmd=CMD_DOWNLOAD,submd=ResolveRequest,head={{len=49,pri=1,flags=0x0},{cmd=30,serial=0,datalen=33,flags=0x10}}}) Packet({from=server,cmd=CMD_DOWNLOAD,submd=ResolveResponse,head={{len=49,pri=1,flags=0x0},{cmd=30,serial=0,datalen=33,flags=0x10}}}) Packet({from=client,cmd=CMD_DOWNLOAD,submd=DownloadRequest,head={{len=49,pri=1,flags=0x0},{cmd=30,serial=0,datalen=33,flags=0x10}}}) Packet({from=server,cmd=CMD_DOWNLOAD,submd=Download,head={{len=818,pri=1,flags=0x0},{cmd=30,serial=0,datalen=802,flags=0x10}}}) Packet({from=client,cmd=CMD_SERVERTIME,head={{len=19,pri=1,flags=0x0},{cmd=0,serial=0,datalen=3,flags=0x0}}}) Packet({from=client,cmd=CMD_SERVERTIME,head={{len=19,pri=1,flags=0x0},{cmd=0,serial=0,datalen=3,flags=0x0}}}) Packet({from=client,cmd=CMD_SERVERTIME,head={{len=19,pri=1,flags=0x0},{cmd=0,serial=0,datalen=3,flags=0x0}}}) Packet({from=client,cmd=CMD_SERVERTIME,head={{len=19,pri=1,flags=0x0},{cmd=0,serial=0,datalen=3,flags=0x0}}}) Packet({from=client,cmd=CMD_SERVERTIME,head={{len=19,pri=1,flags=0x0},{cmd=0,serial=0,datalen=3,flags=0x0}}}) Packet({from=client,cmd=CMD_SERVERTIME,head={{len=19,pri=1,flags=0x0},{cmd=0,serial=0,datalen=3,flags=0x0}}}) Packet({from=client,cmd=CMD_SERVERTIME,head={{len=19,pri=1,flags=0x0},{cmd=0,serial=0,datalen=3,flags=0x0}}}) Packet({from=client,cmd=CMD_SERVERTIME,head={{len=19,pri=1,flags=0x0},{cmd=0,serial=0,datalen=3,flags=0x0}}}) Packet({from=client,cmd=CMD_SERVERTIME,head={{len=19,pri=1,flags=0x0},{cmd=0,serial=0,datalen=3,flags=0x0}}}) Packet({from=client,cmd=CMD_SERVERTIME,head={{len=19,pri=1,flags=0x0},{cmd=0,serial=0,datalen=3,flags=0x0}}}) Packet({from=client,cmd=CMD_ADDCLIENT,head={{len=16,pri=1,flags=0x0},{cmd=12,serial=40,datalen=0,flags=0x0}}}) Packet({from=server,cmd=CMD_ADDEDYOU,head={{len=67,pri=1,flags=0x0},{cmd=15,serial=40,datalen=51,flags=0x0}}}) Packet({from=server,cmd=CMD_ENTERCLIENT,head={{len=9981,pri=1,flags=0x0},{cmd=13,serial=0,datalen=9965,flags=0x0}}}) Packet({from=server,cmd=CMD_SNAPCARGO,head={{len=225,pri=1,flags=0x0},{cmd=40,serial=0,datalen=209,flags=0x0}}}) Packet({from=server,cmd=CMD_CREDITS,head={{len=21,pri=1,flags=0x0},{cmd=42,serial=40,datalen=5,flags=0x0}}}) Packet({from=server,cmd=CMD_SNAPCARGO,head={{len=8670,pri=1,flags=0x0},{cmd=40,serial=0,datalen=8654,flags=0x0}}})