UDP Billing Protocol

From ASSS Wiki
Jump to: navigation, search

The UDP billing protocol is the original protocol written by VIE which was implemented in Subbill. It features more capabilities then the newer TCP Billing Protocol such as the ability to remotely restart or shutdown a game server, and save scores to a central location.

The protocol has never formally been documented and has been reversed engineered by individuals. However, it does utilize the same core protocol as the UDP Game Protocol.

ConnectionID is the temporary identifier that the zone uses for a player for this session. UserID is the player's biller identifier.

An attempt at documenting the protocol has been started below by doc flabby and CypherJF. It was compiled from ASSS and SSB2's source code.


Zone to Billing
---------------
Constants

BANNER_SIZE		96

Packets

Ping 0x01
offset	size	comment
0	1	0x01


ServerConnect 0x02
offset	size	comment
0	1	0x02
1	4	ServerID
5	4	GroupID
9	4	ScoreID
13	126	ServerName
139	4	Port
141	32	Password


ServerDisconnect 0x03
offset	size	comment
0	1	0x03


UserLogin 0x04
offset	size	comment
0	1	0x04
1	1	Make New User Flag
2	4	IP Address (32byte representation)
6	32	Username
38	32	Password
70	4	ConnectionID
74	4	MachineID
78	4	Timezone
82	1	Unused0
83	1	Sysop
84	2	Client Version
86	256	ClientExtraData (Continuum ID)


UserLogoff 0x05
offset	size	comment
0	1	0x05
1	4	ConnectionID
5	2	Disconnect Reason
7	2	Latency
9	2	Ping
11	2	Packetloss S2C
13	2	Packetloss C2S
15	2	Kills (Player Score)
17	2	Deaths (Player Score)
19	2	Flags (Player Score)
21	4	Score (Player Score)
25	4	Flag Score (Player Score)


UserPrivateChat 0x07
offset	size	comment
0	1	0x07
1	4	ConnectionID
5	4	GroupID
9	1	SubType
10	1	Sound
11	250*	Text (\0 terminated?)
* 250 max-length is based on asss 1.4.4 biller structures
* ASSS sends ConnectionID as -1 (0xffffffff) else it seems to broadcast
* (see asss/src/core/billing_ssc.c:onchatmsg)


UserDemographics 0x0D
offset	size	comment
0	1	0x0D
1	4	ConnectionID
5	765	Demographic Structure *
* See below for the structure details


UserBanner 0x10
offset	size	comment
0	1	0x10
1	4	ConnectionID
5	96	Banner (BANNER_SIZE constant)	


UserScore 0x11
offset	size	comment
0	1	0x11
1	4	ConnectionID
5	2	Kills (Player Score)
7	2	Deaths (Player Score)
9	2	Flags (Player Score)
11	4	Score (Player Score)
15	4	Flag Score (Player Score)


UserCommand 0x13
offset	size	comment
0	1	0x13
1	4	ConnectionID
5	250*	Data
* 250 max-length is based on asss 1.4.4 biller structures


UserChannelChat 0x14
offset	size	comment
0	1	0x14
1	4	ConnectionID
5	32	Channel Name
37	250*	Text (\0 terminated?)
* 250 max-length is based on asss 1.4.4 biller structures


ServerCapabilities 0x15
offset	size	comment
0	1	0x15
1	4	bitfield	
	:1	MultiCastChat
	:1	SupportDemographics*
	:30	Unused
* patch by snrrrub for isometry biller support



Billing to Zone
---------------
Constants

Login_Params

0	PRMEANING_ENTER		// Implemented
1	PRMEANING_ASK		// Implemented
2	PRMEANING_BADPW		// Implemented
3	PRMEANING_IPBLOCK	// Implemented
4	PRMEANING_NONEW		// Implemented
5	PRMEANING_BADNAME	// Implemented
6	PRMEANING_DEMO		// Unused
7	PRMEANING_BUSY		// Implemented
8	PRMEANING_REGFORM	// Implemented

Kick_Reasons
0	KICK_SYSTEM		// Other reason
1	KICK_FLOOD		// Player command-flooded
2	KICK_BAN		// Player was banned (Or BanID..)


Packets

Player Response 0x01
offset	size	comment
0	1	0x01
1	1	Login_Params (see top)
2	4	PlayerId
6	24	PlayerName
30	24	Squad Name
54	96	Banner
150	4	Total Seconds (Player Usage)
154	2	Year (Account Creation)
156	2	Month (Account Creation)
158	2	Day (Account Creation)
160	2	Hour (Account Creation)
162	2	Minute (Account Creation)
164	2	Second (Account Creation)
166	4	Extra 1
170	4	ScoreID
174	4	Extra 2
178	2	Wins *
180	2	Losses *
182	2	GoalCount *
184	4	Points *
188	4	Event Points *
* only sent if Login_Params is PRMEANING_ENTER (0x00) according to asss 1.4.4 biller structure


Player Private Chat (aka pm) 0x03
offset	size	comment
0	1	0x03
1	4	Source Server ID
5	1	0x02
6	1	Sound
7	varies	Message Terminated with \0


Zone Recycle 0x04
offset	size	comment
0	1	0x04
1	1	0x00
2	4	0x00000001
6	4	0x00000002


Kick Player 0x08
offset	size	comment
0	1	0x08
1	4	Connection Id
5	4	Kick_Reasons (see top)


Command Message 0x09  (?blogin etc)
offset	size	comment
0	1	0x09
1	4	ConnectionId
5	varies  Message Terminated with \0


Chat Message 0x0A
offset	size	comment
0	1	0x0A
1	4	ConnectionId
5	1	Channel
6	varies	Message Terminated with \0


ScoreReset 0x31
offset	size	comment
0	1	0x31
1	4	ScoreId
5	4	-ScoreId


User Packet 0x32
offset	size	comment
0	1	0x32
1	4	ConnectionId
5	1024	Data


Billing Identity 0x33
offset	size	comment
0	1	0x33
1	256	Billing Identity


User Multichannel Chat 0x34
offset	size	comment
0	1	0x34
1	1	Count
N	4	ConnectionId*
N+4	1	ChannelNumber*
M	250	Message**
* This section is nested and repeats Count times
** 250 max-length is based on asss 1.4.4 biller structures

Demographic Packet

New players are prompted to provide user information when their account is new to the biller. This is an extract based on Catid's comments in Mervbot.

Field	Length	Description
0		32		Real name
32		64		Email
96		32		City
128		24		State
152		1		Sex('M'/'F')
153		1		Age

Connecting from...
154		1		Home
155		1		Work
156		1		School

System information
157		4		Processor type (586)
161		2		?
163		2		?

Windows registration information (SSC RegName ban)
165		40		Real name
205		40		Organization

Windows NT-based OS's do not send any hardware information (DreamSpec HardwareID ban)
245		40		System\CurrentControlSet\Services\Class\Display\0000
285		40		System\CurrentControlSet\Services\Class\Monitor\0000
325		40		System\CurrentControlSet\Services\Class\Modem\0000
365		40		System\CurrentControlSet\Services\Class\Modem\0001
405		40		System\CurrentControlSet\Services\Class\Mouse\0000
445		40		System\CurrentControlSet\Services\Class\Net\0000
485		40		System\CurrentControlSet\Services\Class\Net\0001
525		40		System\CurrentControlSet\Services\Class\Printer\0000
565		40		System\CurrentControlSet\Services\Class\MEDIA\0000
605		40		System\CurrentControlSet\Services\Class\MEDIA\0001
645		40		System\CurrentControlSet\Services\Class\MEDIA\0002
685		40		System\CurrentControlSet\Services\Class\MEDIA\0003
725		40		System\CurrentControlSet\Services\Class\MEDIA\0004