From 07d1955cefc093ffb12002902ed45e963030746e Mon Sep 17 00:00:00 2001 From: RblSb Date: Thu, 13 Feb 2020 16:28:18 +0300 Subject: Initial commit --- src/Types.hx | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 src/Types.hx (limited to 'src/Types.hx') diff --git a/src/Types.hx b/src/Types.hx new file mode 100644 index 0000000..3d4ac4f --- /dev/null +++ b/src/Types.hx @@ -0,0 +1,77 @@ +package; + +import Client.ClientData; + +typedef VideoItem = { + url:String, + title:String, + author:String, + duration:Float +} + +typedef WsEvent = { + type:WsEventType, + ?connected:{ + clients:Array, + isUnknownClient:Bool, + clientName:String, + videoList:Array + }, + ?login:{ + clientName:String, + ?clients:Array, + ?isUnknownClient:Bool, + }, + ?logout:{ + clientName:String, + clients:Array, + }, + ?message:{ + clientName:String, + text:String + }, + ?updateClients:{ + clients:Array, + }, + ?addVideo:{ + item:VideoItem + }, + ?removeVideo:{ + url:String + }, + ?pause:{ + time:Float + }, + ?play:{ + time:Float + }, + ?getTime:{ + time:Float, + paused:Bool + }, + ?setTime:{ + time:Float + }, + ?setLeader:{ + clientName:String + } +} + +enum abstract WsEventType(String) { + var Connected; + var Login; + var LoginError; + var Logout; + var Message; + var UpdateClients; + // var AddClient; + // var RemoveClient; + var AddVideo; + var RemoveVideo; + var VideoLoaded; + var Pause; + var Play; + var GetTime; + var SetTime; + var SetLeader; +} -- cgit v1.2.3