-
-
Notifications
You must be signed in to change notification settings - Fork 7
API Communication
Communication module
-
Functions
- Musician.Comm.Init
- Musician.Comm.JoinChannel
- Musician.Comm.GetGroupChatType
- Musician.Comm.BroadcastCommMessage
- Musician.Comm.GetChannel
- Musician.Comm.ChannelIsReady
- Musician.Comm.InChatMessagingLockdown
- Musician.Comm.CanBroadcast
- Musician.Comm.CanPlay
- Musician.Comm.PlaySong
- Musician.Comm.TogglePlaySong
- Musician.Comm.StreamSongChunk
- Musician.Comm.StreamCompressedSongChunk
- Musician.Comm.GetBandwidthColor
- Musician.Comm.ProcessChunk
- Musician.Comm.OnChunk
- Musician.Comm.StopSong
- Musician.Comm.IsSongPlaying
- Musician.Comm.OnStopSong
- Musician.Comm.GetReadyBandPlayers
- Musician.Comm.OnGroupJoined
- Musician.Comm.QueryBandReady
- Musician.Comm.OnBandReadyQuery
- Musician.Comm.OnGroupLeft
- Musician.Comm.OnRosterUpdate
- Musician.Comm.GetCurrentSongCrc32
- Musician.Comm.UpdateCurrentSongCrc32
- Musician.Comm.OnSongLoaded
- Musician.Comm.IsBandPlayReady
- Musician.Comm.ToggleBandPlayReady
- Musician.Comm.SetBandPlayReady
- Musician.Comm.OnBandPlayReady
- Musician.Comm.PlaySongBand
- Musician.Comm.OnBandPlay
- Musician.Comm.StopSongBand
- Musician.Comm.OnBandStop
- Musician.Comm.OnSongPlay
- Musician.Comm.OnSongStop
- Musician.Comm.OnDead
Initialize communication
Musician.Comm.Init()Join the communication channel and keep it joined
Musician.Comm.JoinChannel()Return communication chat type for group
chatType = Musician.Comm.GetGroupChatType()Returns
- chatType (string)
Broadcast communication message using appropriate channels
Musician.Comm.BroadcastCommMessage(message, type, groupType)Arguments
- message (string)
- type (string)
- groupType (string) (optional)
Return the communication channel ID
channelId = Musician.Comm.GetChannel()Returns
- channelId (string)
Return true if the communication channel is ready
isReady = Musician.Comm.ChannelIsReady()Returns
- isReady (boolean)
Return true if the game is in messaging lockdown (ie during a boss fight in a dungeon)
inLockdown = Musician.Comm.InChatMessagingLockdown()Returns
- inLockdown (boolean)
Return true if the player can broadcast via the channel or the group chat
canBroadcast = Musician.Comm.CanBroadcast()Returns
- canBroadcast (boolean)
Return true if the player can play music
canPlay = Musician.Comm.CanPlay()Returns
- canPlay (boolean)
Play song
success = Musician.Comm.PlaySong()Returns
- success (boolean)
Toggle play song
Musician.Comm.TogglePlaySong()Stream a packed song chunk
Musician.Comm.StreamSongChunk(packedChunk)Arguments
- packedChunk (string)
Stream a compressed song chunk
success = Musician.Comm.StreamCompressedSongChunk(compressedChunk)Arguments
- compressedChunk (string)
Returns
- success (boolean)
Get bandwidth color
r, g, b = Musician.Comm.GetBandwidthColor(bandwidth, blink)Arguments
- bandwidth (number)
- blink (boolean)
Returns
- r (number)
- g (number)
- b (number)
Process a packed chunk
Musician.Comm.ProcessChunk(packedChunk, sender)Arguments
- packedChunk (string)
- sender (string)
Receive compressed chunk
Musician.Comm.OnChunk()Stop song
success = Musician.Comm.StopSong()Returns
- success (boolean)
Indicate if the player song is playing
isSongPlaying = Musician.Comm.IsSongPlaying()Returns
- isSongPlaying (boolean)
Stop a song
Musician.Comm.OnStopSong()Return the list of ready band players for the current source song
readyPlayers = Musician.Comm.GetReadyBandPlayers()Returns
- readyPlayers (table)
OnGroupJoined
Musician.Comm.OnGroupJoined()QueryBandReady
Musician.Comm.QueryBandReady()OnBandReadyQuery
Musician.Comm.OnBandReadyQuery()OnGroupLeft
Musician.Comm.OnGroupLeft()OnRosterUpdate
Musician.Comm.OnRosterUpdate()Return current song CRC32
songCrc32 = Musician.Comm.GetCurrentSongCrc32()Returns
- songCrc32 (number)
Update current song CRC32
Musician.Comm.UpdateCurrentSongCrc32(songCrc32)Arguments
- songCrc32 (number)
OnSongLoaded
Musician.Comm.OnSongLoaded()Indicate if the player is ready for band play
isBandPlayReady = Musician.Comm.IsBandPlayReady()Returns
- isBandPlayReady (boolean)
Toggle band play ready
Musician.Comm.ToggleBandPlayReady()Set band play ready
success = Musician.Comm.SetBandPlayReady(isReady)Arguments
- isReady (boolean)
Returns
- success (boolean)
Receive band ready or not ready message
Musician.Comm.OnBandPlayReady()Play song as a band
success = Musician.Comm.PlaySongBand()Returns
- success (boolean)
OnBandPlay
Musician.Comm.OnBandPlay()Stop song as a band
success = Musician.Comm.StopSongBand()Returns
- success (boolean)
OnBandStop
Musician.Comm.OnBandStop()OnSongPlay
Musician.Comm.OnSongPlay()OnSongStop
Musician.Comm.OnSongStop()OnDead
Stop music when dead
Musician.Comm.OnDead()Table of contents
- User guide (FR)
- Optional modules
- What the FAQ
- Tips and Tricks
- Music producer guide
- Localization
- Technical design
- API documentation
Discord / MusicianList / Patreon / Donate