NetworkProtocolSpec
From MountainfortWiki
 (Created page with "<pre> C = Client S = Server  protokoll generell :  Each frame starts with a 0x00 byte, ends with a 0xFF byte, and contains UTF-8 data in between. json is used to encode data for ...")  | 
		|||
| Line 91: | Line 91: | ||
-- gehen verschachtelte arrays ? ja, man kann complexe verschachtelungen schicken  | -- gehen verschachtelte arrays ? ja, man kann complexe verschachtelungen schicken  | ||
ich würde aber nur eine 1d liste von controls schicken  | ich würde aber nur eine 1d liste von controls schicken  | ||
| - | -- {type:"gui_dialog",elements:[{...},{...},...],x,y,  | + | -- {type:"gui_dialog",elements:[{...},{...},...],x,y,w,h,dialog_id:1234}  | 
-- element types :    | -- element types :    | ||
| - | -- {type:  | + | -- {type:"image",x,y,w,h,src:'http://blub.de/bla.png',mouseovertxt:'...'}  | 
| - | -- {type:"button  | + | -- {type:"button",x,y,w,h,src:'http://blub.de/bla.png',src_pressed="...",mouseovertxt:'...', returncode:444, closes_dialog:true}  | 
| - | -- {type:"text"  | + | -- {type:"text",x,y,text="bla"} -- todo : font could be hard to realise in js -> later  | 
| + | -- {type:"textinput",x,y,w,h} -- no visual border, must be placed with image behind it if neccessary.  | ||
| + | -- TODO : scrollable list ? (workshop items to build...) could be realized serverside by scroll buttons that close the dialog and send a new one  | ||
| + | |||
| + | * C -> S gui button  | ||
| + | -- {type:"gui_button",dialog_id:1234,returncode:444}  | ||
| + | |||
| + | |||
</pre>  | </pre>  | ||