Add chat
This commit is contained in:
@ -5,6 +5,7 @@ import (
|
||||
"net"
|
||||
"time"
|
||||
|
||||
"gitea.boner.be/bdnugget/goonscape/game"
|
||||
"gitea.boner.be/bdnugget/goonscape/types"
|
||||
pb "gitea.boner.be/bdnugget/goonserver/actions"
|
||||
"google.golang.org/protobuf/proto"
|
||||
@ -112,5 +113,9 @@ func HandleServerCommunication(conn net.Conn, playerID int32, player *types.Play
|
||||
otherPlayers[state.PlayerId] = types.NewPlayer(state)
|
||||
}
|
||||
}
|
||||
|
||||
if g, ok := player.UserData.(*game.Game); ok && len(serverMessage.ChatMessages) > 0 {
|
||||
g.Chat.HandleServerMessages(serverMessage.ChatMessages)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user