wesnoth / wesnoth

An open source, turn-based strategy game with a high fantasy theme.
https://www.wesnoth.org/
GNU General Public License v2.0
5.52k stars 1.02k forks source link

MP lobby chat log opens at first instead of last message #9211

Open white-haired-uncle opened 2 months ago

white-haired-uncle commented 2 months ago

Game and System Information

Automatically found a possible data directory at: /net/hawkeye/export/share/build/spartan/wesnoth-gui2 Battle for Wesnoth 1.19.2+dev

Library versions: Boost: 1.74 Lua: 5.4.6 OpenSSL/libcrypto: 3.0.0b-dev (runtime 3.0.0b-dev) libcurl: 7.81.0 (runtime 7.81.0) Cairo: 1.16.0 (runtime 1.16.0) Pango: 1.50.6 (runtime 1.50.6) SDL: 2.0.20 (runtime 2.0.20) SDL_image: 2.0.5 (runtime 2.0.5) SDL_mixer: 2.0.4 (runtime 2.0.4)

Optional features: Lua console completion: yes D-Bus notifications back end: yes



- **OS:**
Mint 21 (ubuntu 22.04)

### Description of the bug

Once you join the official MP server, attempting to connect to local game actually APPEARS to connect to official server.

### Steps to reproduce the behavior

1. Start a local server on port 12345
2. Start wesnoth > multiplayer > connect to server > address: localhost:12345 > connect
3. We're good, logout
4. w/o restarting wesnoth, multiplayer > join official server
5. Oops, didn't mean to do that, logout (this step is required to reproduce, don't be misled by "oops")
6. w/o restarting wesnoth, multiplayer > connect to server (you may re-enter localhost:12345, or just keep it from cache)-> connect
7. Observe that you are on the official server, not localhost (you are not, you're really on localhost, but you get a misleading message)

### Expected behavior

BTW, the connect interface is a little unclear.  When you connect to an address you type in it still looks like the official server is selected in the (listbox?).

![choose_server](https://github.com/user-attachments/assets/f6d6f573-5d95-4cb7-9d3b-c2ce86af746b)

### Additional context

Here we see two players connected to localhost.  Player1 first connected to the official server, while player2 did not.

![player1](https://github.com/user-attachments/assets/63a793aa-d43b-4bd8-b69e-b2a3efb7fa58)
![player2](https://github.com/user-attachments/assets/6a79bbd3-1294-4c26-851e-0d534fa9f2f0)
ProditorMagnus commented 2 months ago

Chat log is saved, it is not new message.

soliton- commented 2 months ago

I think there is an issue somewhere that the chat should be scrolled to the bottom.

white-haired-uncle commented 2 months ago

Okay, the chat log is just showing me the old info. That makes sense I guess.

However, since there's no new welcome message from my perspective I would swear I'm connected back to the official server. I was originally going to log this as if that's what was really happening (connect to official when trying to connect to local), but I ended up looking at netstat and realizing I WAS connected to localhost.

A generic welcome message telling me I'm connected to a "new" server would be very helpful ("Connected to localhost on port 12345"), or even just a "Goodbye" from the official server.

Feel free to close if you disagree, but I think the current behaviour is very misleading.

P.S. This is my first time using the MP gui.

ProditorMagnus commented 2 months ago

You are supposed to see https://github.com/wesnoth/wesnoth/blob/master/data/lan_server.cfg#L1

Wedge009 commented 2 months ago

I think there is an issue somewhere that the chat should be scrolled to the bottom.

So this is a duplicate and/or an elaboration of #1290?

white-haired-uncle commented 2 months ago

You are supposed to see https://github.com/wesnoth/wesnoth/blob/master/data/lan_server.cfg#L1

I do not see that message. There is some stuff that I have to scroll down to, but it's just something like "there is a tournament running..." or something like that - from the old chat I'm pretty sure.

So this is a duplicate and/or an elaboration of https://github.com/wesnoth/wesnoth/issues/1290?

Sounds like it to me, but I'm so new to the MP interface even I wouldn't take my word for it.

soliton- commented 2 months ago

Since you had a server running on port 12345 you presumably started it yourself. If you gave it no config file then it won't have a welcome message.

soliton- commented 2 months ago

That the chat is not scrolled to the bottom is certainly a bug. That just makes no sense. But even then it's true that if there happens to be no new messages it's still confusing.

I don't remember why we keep the chat log. If it's just an implementation artifact I'd just change that. If we want to keep it some UI clarification on what are old messages would be good.

white-haired-uncle commented 2 months ago

Since you had a server running on port 12345 you presumably started it yourself. If you gave it no config file then it won't have a welcome message.

I'm just copying from what the MP test script does (starting wesnothd from the CLI on 12345). This could very well be a problem of my own making.

ProditorMagnus commented 2 months ago

Old messages are intentional, but divider between would be nice.

white-haired-uncle commented 2 months ago

yeah, the red line in discord that separates new messages might be a good example

Mahoyomu commented 2 weeks ago

So...make a red line to mark up new messages, and automatically roll to the latest msg, this is a expected and nice behavior, am I correct?

soliton- commented 1 week ago

Sounds good.

Mahoyomu commented 1 week ago

Currently, on 1.19.5, this issue seems had been fixed already. But I suppose I'll still be working on the red line stuff (If no member plans to take care of it)

white-haired-uncle commented 3 days ago

While trying to reproduce this (I think running at a "lower" resolution, like 1280x720 was necessary, BTW), it seems that it now always starts with the message list scrolled to the end. And by always, I mean even when you're seeing the messages for the first time.