Fixed some AdHoc bugs and implement a few more functions

i decided to return 0 as it prevent some games from stucking when it's unable to connect to adhoc server, and on exit it will always return 0