User:Www2/Development:Network:VSACCSPNG

From VsWiki
< User:Www2
Revision as of 02:57, 12 September 2010 by Www2 (talk | contribs) (New page: This is the first draft for the next generation account server protocol. <pre> Vega Srike ass protocall -------------------------------------------------------------------------------- 01...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This is the first draft for the next generation account server protocol.

Vega Srike ass protocall
--------------------------------------------------------------------------------
01 Generall infomation
--------------------------------------------------------------------------------
Here foling a small overfeew about the layout and basic info about the packet.

PORT STAND ALONE:	9070 (can be chance)
PORT WEBSOCKETS:	80 (non encrypte) 443 (tls/ssl)
SSL/TLS ENABEL:		YES		
END OF PACKET MARK:	HEX:	0xDE 0xAD 0x1E 0xAF 
CLOSE CONECTION:	HEX:	0xDE 0xAD 0xB0 0x0B
PING PACKET:		HEX:	0xDB 0xAF 0xG1 0x07
DATA STREAM:		JSON COMPREST USING GZDEFATION SEE PHP DOCUMENTATION

--------------------------------------------------------------------------------
low level
--------------------------------------------------------------------------------
The low level data stream that is a comprest JSON packet string that end with a
4 byte mark (HEX: 0xDE 0xAD 0x1E 0xAF).

DATA 
	* Json datastream comprest with gzdeflate
	* end op packet mark (4 byts) (allwase 0xDE 0xAD 0x1E 0xAF)


LAYOUT OF THE DATAPACKET:
---------------------------------------------------------------
| DATA   ... (n byte string) |END OF PACKETMARK (4byte/32 bit)|
---------------------------------------------------------------

PING is a simpel comando that need send dyrely to the sender with out the 
prosing form the reseaver.

DATA
	* comando (4 byte)
	* id number (32 bit random int)
	* respons flag (1 bit) (only on responts)

LAYOUT OF THE PING PACKET
----------------------------------------------------------------------
| ping comand (4 byte) | ping_id (32 bit int) | respons flag (1 bit) |
----------------------------------------------------------------------

For closing the conncetion we use a 4 byte string (0xDE 0xAD 0xB0 0x0B)

DATA
	* CLOSE CONECTION singaal (4 bytes) (allwase 0xDE 0xAD 0xB0 0x0B)

LAYOUT OF CLOSE CONECTION PACKET
-------------------------------------
|  CLOSE CONECTION singaal (4 byte) |
-------------------------------------



--------------------------------------------------------------------------------
JSON DATA
--------------------------------------------------------------------------------

---------------------------------------
Login / logout
---------------------------------------

---------------
LOGIN (C->A)
---------------

send login request to the server
DATA:
	login (array)
		username (string)
		password (string)
---------------
LOGIN_ERROR A->C
---------------
The server encount a error and clost the connetion

	login_err (array)
		error_flag (string) (see section flags)
		mgs	(string) (optinal)

FLAGS
code	| Description
----------------------------------
U	| username/password error
BU	| User ban
BI	| IP ban

---------------
LOGIN_ACCEPT A->C
---------------

DATA:
	login_accept (array)
		charater (array)
			[n] (array) (can more than one)
				charater_id (int)
				name (string)
				credits (int)
				location (string)
				current_ship (string)
		ingame news (array)
			[n] (array) (can more than one)
				tittel (string)
				date (int) (unix time format)
				text (string) (html)
				attecment (string/base64) (gzipt data)

-----------------
SELECT CHARATER C->A
-----------------
DATA:
	char_celect (array)
		charate_id (int)
		
-----------------
DELETE CHARATER C->A
-----------------
DATA:
	char_delete (array)
		charate_id (int)

-----------------
DELETE CHARATER C->A
-----------------
DATA:
	char_delete_ok (bool) (return false on error else true)
	
-----------------
NEW CHARATER C->A
-----------------
FIXME

-----------------
SEND_CHARATER A->C
-----------------
---------------------------------------
chat and mail
---------------------------------------

-----------------
CHEAT_CHANNEL C->A
-----------------
DATA:
	cheat_channel (array)
		channel (string) (format is the same as IRC)
		text (string) (text is in bbcode)
		context (string) (see context flags)
CONTEXT FLAGS:
N	Normaal
W	Wisper
S	shout
M	Same as /me in IRC

------------------
CHEAT_PM C -> A
------------------
DATA:
	cheat_pm (array)
		charater_id (int)
		text (string)
		(context) (see context lags in CHEAT_CHANNEL C->A)

-----------------
CHEAT_CHANNEL A -> C
-----------------
DATA:
	cheat_channel (array)
		[n] (array)
			channel (string) (format is the same as IRC)
			charater_name (string)
			time_stamp (int) (unix time format)
			text (string) (text is in bbcode)
			context (string) (see context flags in CHEAT_CHANNEL C->A)

------------------
CHEAT_PM A -> C
------------------
DATA:
	cheat_pm (array)
		[n] array
			charater_name (string)
			text (string)
			time_stamp (int) (unix time format)
			(context) (see context lags in CHEAT_CHANNEL C->A)

------------------
SEND_PM_REQUEST C -> A
------------------
send a pm request to the server and the server awnser with a CHEAT_PM C -> A
mgs.

	cheat_pm (array)
		charater_name (string)
		text (string)
		(context) (see context lags in CHEAT_CHANNEL C->A)

------------------
MAIL_SEND C -> A
------------------
DATA:
	mail_send (array)
		send_to (array) (charater_name and can more than one)
			[n] (array)
				charater_name (string)
				flag (string) (the blags are C,CC,BCC)
		tittel (string)
		mgs (string)