diff options
Diffstat (limited to 'src/teamspeak/mod.rs')
| -rw-r--r-- | src/teamspeak/mod.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/teamspeak/mod.rs b/src/teamspeak/mod.rs index 66d973c..fc10116 100644 --- a/src/teamspeak/mod.rs +++ b/src/teamspeak/mod.rs @@ -19,6 +19,7 @@ mod bbcode; pub use bbcode::*; pub struct TeamSpeakConnection { + id: ClientId, conn: Connection, } @@ -104,7 +105,8 @@ impl TeamSpeakConnection { }), ); - Ok(TeamSpeakConnection { conn }) + let id = conn.lock().own_client; + Ok(TeamSpeakConnection { conn, id }) } pub fn send_audio_packet(&self, samples: &[u8]) { @@ -167,6 +169,10 @@ impl TeamSpeakConnection { .channel } + pub fn my_id(&self) -> ClientId { + self.id + } + pub fn user_count(&self, channel: ChannelId) -> u32 { let conn = self.conn.lock(); let mut count = 0; |
