Skip to content
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

Fix Team Select Problem #270

Closed
wants to merge 3 commits into from
Closed

Fix Team Select Problem #270

wants to merge 3 commits into from

Conversation

crashzk
Copy link
Contributor

@crashzk crashzk commented Jun 19, 2020

  • Fix Team Select Problem;

Credits for @Ilusion9: #245 (comment)

- Fix Team Select Problem;

Credits for @Ilusion9: #245 (comment)
@borzaka
Copy link
Contributor

borzaka commented Jun 19, 2020

Nobody-x has almost the same PR:
#262

He said:

// Since I removed SetEventBroadcast call into player_team event we need this workaround
// I don't know exactly why but it seem to be how the engine works.
DataPack pack;
CreateDataTimer(0.1, Timer_UpdateClientArenaTag, pack);

pack.WriteCell(GetClientSerial(client));
pack.WriteString(buffer);

I don't know it's related, but it seems. Have you tested fully your code?

@crashzk
Copy link
Contributor Author

crashzk commented Jun 19, 2020

Yes, I realized that too. In this case, I only made the changes that passed the issues I commented on.

I will be testing in depth, anything includes these modifications that you also mentioned.

@Nobody-x
Copy link

Nobody-x commented Jun 20, 2020

Nobody-x has almost the same PR:
#262

He said:

// Since I removed SetEventBroadcast call into player_team event we need this workaround
// I don't know exactly why but it seem to be how the engine works.
DataPack pack;
CreateDataTimer(0.1, Timer_UpdateClientArenaTag, pack);

pack.WriteCell(GetClientSerial(client));
pack.WriteString(buffer);

I don't know it's related, but it seems. Have you tested fully your code?

Unfortunately this has not fixed 100% the problem. I've accomplished more testing but never managed to fix the clan tag issue related to my PR.

But.

In my Event_OnPlayerTeam function I used return Plugin_Changed; instead of return Plugin_Continue;. You still use the second one.
Are you sure that event.SetBool("silent", true); fixed the team selection menu ? If yes, then you have the correct fix to this.

Its seems to me that return Plugin_Changed; is the cause of the others errors. If I remember correctly, this is required to fix the team selection menu but I can be wrong.

@crashzk
Copy link
Contributor Author

crashzk commented Jun 20, 2020

To block tag changes you can try this:

public void OnClientPutInServer(int client)
{
	CS_SetClientClanTag(client, "");
}

public Action OnClientCommandKeyValues(int client, KeyValues kv)
{
	char command[PLATFORM_MAX_PATH];
	if (kv.GetSectionName(command, sizeof(command)) && StrEqual(command, "ClanTagChanged", false))
	{
		return Plugin_Handled;
	}
	
	return Plugin_Continue;
}

Compile and see if it solves the problem.

On the event.SetBool("silent", true); I will thoroughly check if you have fixed the team selection menu problem.

@borzaka
Copy link
Contributor

borzaka commented Jun 21, 2020

I'am and many of us are using this plugin:
[CS:GO] Multi 1v1 - Country Tag
https://forums.alliedmods.net/showthread.php?p=2547876

It would be great, if this needs a fix as well, that you guys open would open a PR. Thx!

@crashzk
Copy link
Contributor Author

crashzk commented Jun 24, 2020

It seems that only the modifications event.SetBool("silent", true); is not enough, the problem still occurs, as can be seen here.

https://forums.alliedmods.net/showpost.php?p=2707116&postcount=1607
https://forums.alliedmods.net/showpost.php?p=2707119&postcount=1608

@borzaka
Copy link
Contributor

borzaka commented Jun 24, 2020

I wouldn't trust them only, because you didn't have to wait until the round end, you can press ESC after a team selection.

@crashzk
Copy link
Contributor Author

crashzk commented Jun 24, 2020

I wouldn't trust them only, because you didn't have to wait until the round end, you can press ESC after a team selection.

I understand, I will test it myself ... If the problem continues I see the other changes from @Nobody-x to see if it solves the problem.

@crashzk
Copy link
Contributor Author

crashzk commented Jun 25, 2020

I did the test myself on my server, problem continues.

I connect to the server, choose a team, I still have to wait for the round to end or press ESC to close. I will try to implement the @Nobody-x fix to see how it solves the problem.

@crashzk
Copy link
Contributor Author

crashzk commented Jun 25, 2020

Now, I did the test and everything is working fine, no errors so far.

I believe it can be merged into the main branch of the project.

@crashzk
Copy link
Contributor Author

crashzk commented Jun 30, 2020

Fix is ​​not effective.... When you send the change to the server for the first time it works, however when changing the map the BUG continues.

@Ilusion9
Copy link

Fix is ​​not effective.... When you send the change to the server for the first time it works, however when changing the map the BUG continues.

Try to replace cs_switchteam with changeclientteam in SwitchPlayerTeam function.

@crashzk
Copy link
Contributor Author

crashzk commented Jun 30, 2020

Try to replace cs_switchteam with changeclientteam in SwitchPlayerTeam function.

I tried, nothing yet, bug continues.

@borzaka
Copy link
Contributor

borzaka commented Jul 1, 2020

@RavageCS made a possible fix for csgo-retakes: splewis/csgo-retakes#270

Related issue: splewis/csgo-retakes#269

This was working except as soon as someone clicked on join spectator you need to click twice again.
I went and changed the rest of the event function calls to use this syntax, and from my testing it looks to be fixed.

@crashzk
Copy link
Contributor Author

crashzk commented Jul 1, 2020

@RavageCS made a possible fix for csgo-retakes: splewis/csgo-retakes#270

Related issue: splewis/csgo-retakes#269

This was working except as soon as someone clicked on join spectator you need to click twice again.
I went and changed the rest of the event function calls to use this syntax, and from my testing it looks to be fixed.

Interesting, I'll check it out and test it.

@Ilusion9
Copy link

Ilusion9 commented Jul 2, 2020

Maybe putting clients as Spectators when they join doesn't close the menu. I put players automatically to CT on my dr server and the menu is auto closing. You can try to put them on T or CT side, and in the next frame to SPEC. Or you can put them on T or CT and leave them there, would that be a problem?

@crashzk crashzk closed this Jul 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants