aboutsummaryrefslogtreecommitdiffstats
path: root/src/Types.hx
diff options
context:
space:
mode:
authorRblSb <msrblsb@gmail.com>2020-02-13 16:28:18 +0300
committerRblSb <msrblsb@gmail.com>2020-02-15 19:45:40 +0300
commit07d1955cefc093ffb12002902ed45e963030746e (patch)
tree8833eca2dc2ef07891aa8eb66daf7ad90f2ab0ce /src/Types.hx
Initial commit
Diffstat (limited to 'src/Types.hx')
-rw-r--r--src/Types.hx77
1 files changed, 77 insertions, 0 deletions
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<ClientData>,
+ isUnknownClient:Bool,
+ clientName:String,
+ videoList:Array<VideoItem>
+ },
+ ?login:{
+ clientName:String,
+ ?clients:Array<ClientData>,
+ ?isUnknownClient:Bool,
+ },
+ ?logout:{
+ clientName:String,
+ clients:Array<ClientData>,
+ },
+ ?message:{
+ clientName:String,
+ text:String
+ },
+ ?updateClients:{
+ clients:Array<ClientData>,
+ },
+ ?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;
+}
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage