Skip to content

Commit 130a6b3

Browse files
committed
Implement ServerFailedToJoinChannel packet
1 parent e80e851 commit 130a6b3

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

chat/channel.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ func (channel *Channel) AddUser(user *sessions.User) {
6767

6868
// TODO: Check for spectator / multiplayer
6969
if channel.AdminOnly && !isChatModerator(user.Info.UserGroups) {
70+
sessions.SendPacketToUser(packets.NewServerFailedToJoinChatChannel(channel.Name), user)
7071
return
7172
}
7273

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package packets
2+
3+
type ServerFailedToJoinChatChannel struct {
4+
Packet
5+
Channel string `json:"c"`
6+
}
7+
8+
func NewServerFailedToJoinChatChannel(channel string) *ServerFailedToJoinChatChannel {
9+
return &ServerFailedToJoinChatChannel{
10+
Packet: Packet{Id: PacketIdServerFailedToJoinChannelPacket},
11+
Channel: channel,
12+
}
13+
}

0 commit comments

Comments
 (0)