roflmuffin / CounterStrikeSharp

CounterStrikeSharp allows you to write server plugins in C# for Counter-Strike 2/Source2/CS2
https://docs.cssharp.dev
Other
760 stars 116 forks source link

[BUG] Chat is not responding to commands, but server console does #93

Closed K4ryuu closed 10 months ago

K4ryuu commented 10 months ago

So basically, I've encountered a weird bug, which is appeared only on one server of the several, which I was checking on. First I was thinking about that possibly some leftover from meta plugins or so, which is incompatible with CSS, so I installed freshly the server, added Metamod dev2 and css latest (v53). When I installed a test plugin to check the problem again it does the following:

I tried to check this on multiple dev servers from multiple hosts, but so far I see this bug only on one and first server so far.

roflmuffin commented 10 months ago

Could be an encoding issue, do you know if this server is in a different locale? Might need more repro information

K4ryuu commented 10 months ago

This server is hosted in Romania as I know, so my guess is that. However I'm going to contact the owner when he's available again. If you have any exact questions about the host where they rent the server I forward them and they contact their support with those questions.

roflmuffin commented 10 months ago

They could try running with invariant culture on .net side and see if this makes any difference? Otherwise it might be on the C++ side.

DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=true

K4ryuu commented 10 months ago

I've added "System.Globalization.Invariant": true to the runtimeconfig's configProperties, but that didn't make any difference sadly.

sphaxa commented 10 months ago

also seeing this issue on my end, went from v50 to v54 and latest metamod. No other changes. Now (!) commands do not work at all. (/) commands and console command work perfectly fine.

K4ryuu commented 10 months ago

I fixed the problem on my end, though I forgot to update you here. I had been testing it for two days and eventually, I exported the .cs and .csproj files. Then, I created a new project using the dotnet command. Strangely, the new solution file ended up having the same IDs as the old ones, which was quite puzzling. It seemed like the new project somehow "restored" the old project's IDs and solutions, including their files, into different folders on my Mac.

After several attempts, I managed to generate a project with different values, and the old project files were not included in it. After making these changes, everything started working again. I'm not entirely sure if this was the solution, but the issue resolved itself somehow over the course of two days, and now the server can execute those commands just like all the other projects.

I hope this clarifies the situation. If you have any further questions or need additional assistance, please feel free to ask.

miguno commented 10 months ago

Same problem here with CSS 1.0.54 and latest Metamod (v1266).

miguno commented 10 months ago

Strangely, the new solution file ended up having the same IDs as the old ones, which was quite puzzling.

Which IDs are you referring to?

sphaxa commented 10 months ago

Additional context, server is on linux. Tried setting invariant and it didn't fix anything. coreconfig is loading correctly and is using the correct version.

I swapped the triggers, ! for silent and / for public. And it appears that whatever is set to a silent trigger is working fine. But whatever character I set to be public do not work.

ALSO, if I add additional characters to the public trigger, ex [ "!", "."] then the server will segfault when either of them are used, instead of just nothing happening.

Im busy with work atm but can try and repro and get dumps later if needed.

roflmuffin commented 10 months ago

Would you be able to run CS2 with SPDLOG_LEVEL env set to "trace", i.e. "SPDLOG_LEVEL=trace ./CS2". This should provide more logging to debug

chenbuyi2019 commented 10 months ago

I am having this problem too . I updated to v55 last hour. and i found all chat commands are not working in chats, the console part is still working. For example: css and !css . when i type !css in client chat, it didnt tell me "[CSS] You do not have..."
but if i type css in client console,it works and prints "[CSS] You do not have..." in my chatbox.

I downgrade to v53, the chat part works again.
my server version: 1.39.7.2/13972
my os: Windows 10,11

audiomaster99 commented 10 months ago

In downgraded from v54 to v53, and had core.json from v54 which was like this "PublicChatTrigger": [ "!" ], after I deleted [] chat commands started working, but if I do that in v54 or v55 i get this error: CSSharp: Could not read '/home/container/game/csgo/addons/counterstrikesharp/configs/core.json'. Error: Failed to parse CoreConfig file: [json.exception.type_error.302] type must be array, but is string

roflmuffin commented 10 months ago

This should be fixed now as part of v56 release. Please try this build and confirm and I will close this issue.

audiomaster99 commented 10 months ago

This should be fixed now as part of v56 release. Please try this build and confirm and I will close this issue.

Chat commands do work in v56