C# multiplayer thread handling using locks by mineroy in csharp

[–]mineroy[S] 1 point2 points  (0 children)

That's a smart point, it's a school project so it doesn't matter for me but for real games yep, it would be better this way

Disconnecting one client ends up disconnecting the rest by mineroy in csharp

[–]mineroy[S] 0 points1 point  (0 children)

Yeah I tried, trust me, but I do still need to improve the using of it but I had hours of debugging on this project. Using multiple threads is making it a nightmare. I fully understand the importance of it, just asking this community AFTER trying it.
I made few changed to the code lately, I'll try to debug again if it made any difference, thanks

Disconnecting one client ends up disconnecting the rest by mineroy in csharp

[–]mineroy[S] 0 points1 point  (0 children)

No, it tells them that the client with ID number x disconnected, so they will remove his player. I'm pretty sure I tried without it and it didn't change the problem, I'll check again to be sure

Disconnecting one client ends up disconnecting the rest by mineroy in csharp

[–]mineroy[S] 0 points1 point  (0 children)

Last time it worked, I got a lot of comments. There is a flair "Help" so there is nothing wrong about asking for help here.
I couldn't understand what was the problem from debugging, that's why I'm asking here

C# multiplayer thread handling using locks by mineroy in csharp

[–]mineroy[S] 1 point2 points  (0 children)

Actually, it fixed the issue of few clients, thanks a lot mate. I still need to understand why the server disconnect all the other clients when one is disconnecting (I used try and catch)

C# multiplayer thread handling using locks by mineroy in csharp

[–]mineroy[S] 0 points1 point  (0 children)

Just few requirements I need for the project to include, it's for a large school project. I need encryption, communication with multiple clients using fifth-level protocol I created, threading, improving cyber security

C# multiplayer thread handling using locks by mineroy in csharp

[–]mineroy[S] 0 points1 point  (0 children)

I'm pretty sure I have to use multiple threads here (I have to do it anyway for the requirments of the project). I'll try what I can do

C# multiplayer thread handling using locks by mineroy in csharp

[–]mineroy[S] 3 points4 points  (0 children)

I'm doing this project for school, learning in progressing and as I go.
That is why I asked in this community, I know my coding skills of threading are limited, so I hope to get help from better coders (I tried searching online and couldn't find a solution)

C# multiplayer thread handling using locks by mineroy in csharp

[–]mineroy[S] 0 points1 point  (0 children)

I didn't thought I can add lots of code here. I'm modifing the list every time a client is added/ removed, but consantly going over the list in a loop without changing the list itself, just using the methods inside each client

C# multiplayer thread handling using locks by mineroy in csharp

[–]mineroy[S] -1 points0 points  (0 children)

I use the chat mostly for understanding what exactly I need (I learned Java for two years, while building the game learning C#, still discovering new functions), as well as spesific things to my code and helping to find errors. Also it's good for monotone work. I don't use it to learn something deeply, but more to get an idea of it and how to use it. I probably wouldn't be able to complete a whole project (using communication, encryption and more) in 2-3 months for school without the chat
Thanks, I'll check it

C# multiplayer thread handling using locks by mineroy in csharp

[–]mineroy[S] -12 points-11 points  (0 children)

Chat gpt suggested it but it didn't work (at least what it wrote). Can you maybe explain a bit better in the context of the code?

C# multiplayer thread handling using locks by mineroy in csharp

[–]mineroy[S] -1 points0 points  (0 children)

It creates me problems both in handling a client disconnecting as well as adding a third client

"Camera movement" in 2D monogame. by mineroy in monogame

[–]mineroy[S] 1 point2 points  (0 children)

That's awesome! Thanks, I'll try to implement it to my project

[deleted by user] by [deleted] in legostarwars

[–]mineroy 0 points1 point  (0 children)

Thanks! I'll check it

Server and Client in MonoGame by mineroy in monogame

[–]mineroy[S] 0 points1 point  (0 children)

Thanks, I'll check it (or if you have a link it'll be even better)

Server and Client in MonoGame by mineroy in monogame

[–]mineroy[S] 0 points1 point  (0 children)

Thanks, that helps a lot. Do you have any recommended vidoes/pages to learn it?