Based db and accounts and log in where you logged out

This commit is contained in:
2025-01-19 21:52:56 +01:00
parent bb01dccf2b
commit e45066b2a8
5 changed files with 37 additions and 8 deletions
+2 -1
View File
@@ -53,6 +53,7 @@ func (c *Chat) HandleServerMessages(messages []*pb.ChatMessage) {
for _, msg := range messages {
localMsg := types.ChatMessage{
PlayerID: msg.PlayerId,
Username: msg.Username,
Content: msg.Content,
Time: time.Unix(0, msg.Timestamp),
}
@@ -117,7 +118,7 @@ func (c *Chat) Draw(screenWidth, screenHeight int32) {
for i := startIdx; i < endIdx; i++ {
msg := c.messages[i]
text := fmt.Sprintf("[%d]: %s", msg.PlayerID, msg.Content)
text := fmt.Sprintf("%s: %s", msg.Username, msg.Content)
rl.DrawText(text, int32(chatX)+5, int32(messageY), 20, rl.White)
messageY += messageHeight
}