New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dodgy behaviour when two people of same nickname #144

Open
ScalaWilliam opened this Issue Feb 6, 2017 · 11 comments

Comments

Projects
None yet
5 participants
@ScalaWilliam
Collaborator

ScalaWilliam commented Feb 6, 2017

Reproduction (best done on Linux):

  1. Follow https://github.com/ActionFPS/ActionFPS-Game#linux (except the step 4)
  2. Launch server with ./bin_unix/native_server -mlocalhost --disableauthentication
  3. Launch a floating window game client with ./actionfps.sh -t
  4. Type /connect localhost
  5. When connected, type /ctf ac_depot. This selects a team mode.
  6. Press <Tab>, notice that the current player is in a team (as per screenshot).
  7. Launch another floating window game client and type /connect localhost. Wait 5 seconds and click with mouse to join the game.
  8. Press <Tab>, in the new client window and you will notice that the current player is shown as a spectator. This behaviour is incorrect, and should be like the first client's instead. Typing /spectate here does not work because the client thinks it's in spectate mode on the scoreboard, but then is spawned (alive).

First client window (correct):
image

Second client window (incorrect):
image

The problem has something to do with saving and restoring state - especially when users have the same nicknames. I can't tell if it's in the client or the server side. Multiple players of same nickname are supposed to be Ok.

This problem even persists when you change map, eg /ctf ac_mines (and F1 on the other client to make the vote count).

Normally when you join the game you're put into spectator mode, then you join, then you play. You should not be able to play when you're in spectator mode.

I myself don't really understand the logic that's going on so would appreciate as much help as possible. Lucas says that the bug was most likely introduced by his commit here - fcf28cf

I posted this on BountySource: https://www.bountysource.com/issues/41713635-put-into-spec-team-but-can-kill-and-spawn-in-enemy-s-team

I'll pay $20 for this, and extra $10 if completed by 2017-11-07T00:00:00Z. If you'd like to do this, post "I am taking on this task per ScalaWilliam Work Rules". This task is posted on ScalaWilliam work.

@gyunderscorebe

This comment has been minimized.

Show comment
Hide comment
@gyunderscorebe

gyunderscorebe Feb 6, 2017

Collaborator

What's server/client commit?

Collaborator

gyunderscorebe commented Feb 6, 2017

What's server/client commit?

@lucasgautheron

This comment has been minimized.

Show comment
Hide comment
@lucasgautheron

lucasgautheron Feb 6, 2017

Collaborator

@gyunderscorebe master.
This is probably after my update to set recover teams of reconnecting clients. I was curious to see how it would work. Turns out the game doesn't send initial team to the reconnecting client but only to others. So it's all about letting the reconnecting client know which team he is on.

Collaborator

lucasgautheron commented Feb 6, 2017

@gyunderscorebe master.
This is probably after my update to set recover teams of reconnecting clients. I was curious to see how it would work. Turns out the game doesn't send initial team to the reconnecting client but only to others. So it's all about letting the reconnecting client know which team he is on.

@ScalaWilliam

This comment has been minimized.

Show comment
Hide comment
@ScalaWilliam

ScalaWilliam Feb 6, 2017

Collaborator

I was on #125 when it was happening though

Collaborator

ScalaWilliam commented Feb 6, 2017

I was on #125 when it was happening though

@lucasgautheron

This comment has been minimized.

Show comment
Hide comment
@lucasgautheron

lucasgautheron Feb 6, 2017

Collaborator

What matters is that the server was compiled from master

Collaborator

lucasgautheron commented Feb 6, 2017

What matters is that the server was compiled from master

@ScalaWilliam

This comment has been minimized.

Show comment
Hide comment
@ScalaWilliam

ScalaWilliam Feb 6, 2017

Collaborator

ah server side prob

Collaborator

ScalaWilliam commented Feb 6, 2017

ah server side prob

@tejlibre

This comment has been minimized.

Show comment
Hide comment
@tejlibre

tejlibre May 17, 2017

Contributor

@lucasgautheron do we know what commits introduced the bug? If we have no idea when the bug was introduced, we could test a bunch of releases say, between december and february and get a starting point that way

Contributor

tejlibre commented May 17, 2017

@lucasgautheron do we know what commits introduced the bug? If we have no idea when the bug was introduced, we could test a bunch of releases say, between december and february and get a starting point that way

@lucasgautheron

This comment has been minimized.

Show comment
Hide comment
@lucasgautheron

lucasgautheron May 18, 2017

Collaborator

@tejlibre I'd say this one : fcf28cf

Collaborator

lucasgautheron commented May 18, 2017

@tejlibre I'd say this one : fcf28cf

@ScalaWilliam

This comment has been minimized.

Show comment
Hide comment
@ScalaWilliam

ScalaWilliam Jul 27, 2017

Collaborator

I know it's fairly vague for somebody not familiar with this game, but the help would be very appreciated.

You can get test users from our Discord. You'll probably want to have some C/C++ experience for doing this.

I can't support helping fix this problem, but can help in testing the final changes. Sorry, not enough time for me.

Collaborator

ScalaWilliam commented Jul 27, 2017

I know it's fairly vague for somebody not familiar with this game, but the help would be very appreciated.

You can get test users from our Discord. You'll probably want to have some C/C++ experience for doing this.

I can't support helping fix this problem, but can help in testing the final changes. Sorry, not enough time for me.

@ScalaWilliam

This comment has been minimized.

Show comment
Hide comment

@ScalaWilliam ScalaWilliam changed the title from put into spec team, but can kill, and spawn in enemy's team to Dodgy behaviour with two people of same nickname Nov 4, 2017

@ScalaWilliam ScalaWilliam changed the title from Dodgy behaviour with two people of same nickname to Dodgy behaviour when two people of same nickname Nov 4, 2017

@spelcaster

This comment has been minimized.

Show comment
Hide comment
@spelcaster

spelcaster Mar 13, 2018

Hi there, so I've started to study this issue and I think I'm very close to find the culprit.

First, I thought that this could be happening on the server side, I was suspecting that it was doing a weak comparison between clients in the same host, but the clients have some kind of unique id that is called clientnum. The sender argument, here is the same as the clientnum here and here. So this problem was less likely to be on server side.

My second assumption was that it could be something wrong with the functions that render the scoreboards, I did some tweaks and discovered that the second client does not update the playerent, but the first client is doing everything fine (apparently).

So, basically, there's a condition somewhere that is preventing the client to update the playerent.

scoreboard-player-dump.txt

spelcaster commented Mar 13, 2018

Hi there, so I've started to study this issue and I think I'm very close to find the culprit.

First, I thought that this could be happening on the server side, I was suspecting that it was doing a weak comparison between clients in the same host, but the clients have some kind of unique id that is called clientnum. The sender argument, here is the same as the clientnum here and here. So this problem was less likely to be on server side.

My second assumption was that it could be something wrong with the functions that render the scoreboards, I did some tweaks and discovered that the second client does not update the playerent, but the first client is doing everything fine (apparently).

So, basically, there's a condition somewhere that is preventing the client to update the playerent.

scoreboard-player-dump.txt

@spelcaster

This comment has been minimized.

Show comment
Hide comment
@spelcaster

spelcaster Mar 13, 2018

@ScalaWilliam, I've found the bug and fixed it, I'll send the commit later.

spelcaster commented Mar 13, 2018

@ScalaWilliam, I've found the bug and fixed it, I'll send the commit later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment