Keep disconnecting while playing games

Hello, I am new here, I have been facing this problem for weeks from now, When I play dota 1 for example, I keep disconnecting before I do anything, or playing COD or anything else, I am connected to my wifi, but when I disconnect, I am still connected to my wifi, I can browse in the internet without any problems, but I only have that problem while gaming, please help.