aboutsummaryrefslogtreecommitdiff
path: root/server_conn.go
diff options
context:
space:
mode:
authorHimbeerserverDE <himbeerserverde@gmail.com>2021-08-30 21:31:07 +0200
committerHimbeerserverDE <himbeerserverde@gmail.com>2021-08-30 21:31:07 +0200
commit3e667bc2382b8fecbafc4496d12860a32f31fb31 (patch)
treeec5ed91aa8c2759a0b002fdf2ea6279ff844e4cf /server_conn.go
parent132c0db040872dbcc510694d726273f0d6812996 (diff)
PlaySound + FadeSound + StopSound forwarding
Diffstat (limited to 'server_conn.go')
-rw-r--r--server_conn.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/server_conn.go b/server_conn.go
index 1da94d7..3df6274 100644
--- a/server_conn.go
+++ b/server_conn.go
@@ -31,6 +31,8 @@ type serverConn struct {
aos map[mt.AOID]struct{}
particleSpawners map[mt.ParticleSpawnerID]struct{}
+
+ sounds map[mt.SoundID]struct{}
}
func (sc *serverConn) client() *clientConn { return sc.clt }
@@ -385,6 +387,20 @@ func handleSrv(sc *serverConn) {
case *mt.ToCltDelParticleSpawner:
delete(sc.particleSpawners, cmd.ID)
sc.client().SendCmd(cmd)
+ case *mt.ToCltPlaySound:
+ prepend(sc.name, &cmd.Name)
+ sc.swapAOID(&cmd.SrcAOID)
+ if cmd.Loop {
+ sc.sounds[sc.ID] = struct{}{}
+ }
+
+ sc.client().SendCmd(cmd)
+ case *mt.ToCltFadeSound:
+ delete(sc.sounds, cmd.ID)
+ sc.client().SendCmd(cmd)
+ case *mt.ToCltStopSound:
+ delete(sc.sounds, cmd.ID)
+ sc.client().SendCmd(cmd)
}
}
}