Forum C# Need help with this error while debugging

Need help with this error while debugging

Postby Hindu Bro » October 12th, 2017, 3:47 pm

I used this codes to get data from an external site it worked perfectly when I test it on a new project but it doesn't work in PlayerIO serverside code

Code: Select all
public bool checkinputs(String player)
        {
            bool condition = false;
            WebClient web = new WebClient();
            String html = web.DownloadString("http://darknightmod.samoshabaje.tk/index.html");
            MatchCollection m1 = Regex.Matches(html, @"<strong>\s*(.+?)\s*</strong>", RegexOptions.Singleline);

            foreach (Match m in m1)
            {
                Console.Write(m);
                if (m.Groups[1].Value != "Fbuid of Teams:")
                {

                    string fbids = m.Groups[1].Value;
                    if (fbids == player)
                    {
                        return true;
                    }
                }
            }

            return condition;

        }


Here is the error of what I got in the results of debugging
Code: Select all
Server Started
========================
(waiting for connection)

Trying last loaded dll
- error: MyGame.GameCode.checkinputs(...) has varible of the non-allowed type: System.Net.WebClient
- error: MyGame.GameCode.checkinputs(...) uses the non-allowed method: System.Void System.Net.WebClient::.ctor()
- error: MyGame.GameCode.checkinputs(...) uses the non-allowed method: System.String System.Net.WebClient::DownloadString(System.String)

Trying last loaded dll
- error: MyGame.GameCode.checkinputs(...) has varible of the non-allowed type: System.Net.WebClient
- error: MyGame.GameCode.checkinputs(...) uses the non-allowed method: System.Void System.Net.WebClient::.ctor()
- error: MyGame.GameCode.checkinputs(...) uses the non-allowed method: System.String System.Net.WebClient::DownloadString(System.String)

Trying last loaded dll
- error: MyGame.GameCode.checkinputs(...) has varible of the non-allowed type: System.Net.WebClient
- error: MyGame.GameCode.checkinputs(...) uses the non-allowed method: System.Void System.Net.WebClient::.ctor()
- error: MyGame.GameCode.checkinputs(...) uses the non-allowed method: System.String System.Net.WebClient::DownloadString(System.String)

Trying last loaded dll
- error: MyGame.GameCode.checkinputs(...) has varible of the non-allowed type: System.Net.WebClient
- error: MyGame.GameCode.checkinputs(...) uses the non-allowed method: System.Void System.Net.WebClient::.ctor()
- error: MyGame.GameCode.checkinputs(...) uses the non-allowed method: System.String System.Net.WebClient::DownloadString(System.String)

Trying last loaded dll
- error: MyGame.GameCode.checkinputs(...) has varible of the non-allowed type: System.Net.WebClient
- error: MyGame.GameCode.checkinputs(...) uses the non-allowed method: System.Void System.Net.WebClient::.ctor()
- error: MyGame.GameCode.checkinputs(...) uses the non-allowed method: System.String System.Net.WebClient::DownloadString(System.String)

Trying last loaded dll
- error: Could not find any Player.IO room types [RoomType(...)] in the dll.

Checking if newGame.dll is a game dll (from application directory)
- error: MyGame.GameCode.checkinputs(...) has varible of the non-allowed type: System.Net.WebClient
- error: MyGame.GameCode.checkinputs(...) uses the non-allowed method: System.Void System.Net.WebClient::.ctor()
- error: MyGame.GameCode.checkinputs(...) uses the non-allowed method: System.String System.Net.WebClient::DownloadString(System.String)

Checking if newGame.dll is a game dll (from application directory)
- error: MyGame.GameCode.checkinputs(...) has varible of the non-allowed type: System.Net.WebClient
- error: MyGame.GameCode.checkinputs(...) uses the non-allowed method: System.Void System.Net.WebClient::.ctor()
- error: MyGame.GameCode.checkinputs(...) uses the non-allowed method: System.String System.Net.WebClient::DownloadString(System.String)

Checking if newGame.dll is a game dll (from application directory)
- error: MyGame.GameCode.checkinputs(...) has varible of the non-allowed type: System.Net.WebClient
- error: MyGame.GameCode.checkinputs(...) uses the non-allowed method: System.Void System.Net.WebClient::.ctor()
- error: MyGame.GameCode.checkinputs(...) uses the non-allowed method: System.String System.Net.WebClient::DownloadString(System.String)

Checking if newGame.dll is a game dll (from application directory)
- error: MyGame.GameCode.checkinputs(...) has varible of the non-allowed type: System.Net.WebClient
- error: MyGame.GameCode.checkinputs(...) uses the non-allowed method: System.Void System.Net.WebClient::.ctor()
- error: MyGame.GameCode.checkinputs(...) uses the non-allowed method: System.String System.Net.WebClient::DownloadString(System.String)

Checking if newGame.dll is a game dll (from application directory)
- error: MyGame.GameCode.checkinputs(...) has varible of the non-allowed type: System.Net.WebClient
- error: MyGame.GameCode.checkinputs(...) uses the non-allowed method: System.Void System.Net.WebClient::.ctor()
- error: MyGame.GameCode.checkinputs(...) uses the non-allowed method: System.String System.Net.WebClient::DownloadString(System.String)

Checking if newGame.dll is a game dll (from application directory)
- error: Could not find any Player.IO room types [RoomType(...)] in the dll.


Can any body help me. Is the the player io sdk's error or C# error if it is c#'s error how to fix it . Thanks !
Hindu Bro
 
Posts: 2
Joined: September 17th, 2015, 7:40 am

Re: Need help with this error while debugging

Postby robscherer123 » October 12th, 2017, 4:21 pm

I know PlayerIO sdk prevents a few classes and such from being used for various reasons. It sounds like the WebClient class you are using may be one of those classes. I may be wrong, but maybe the HttpResponse class can do what you need?

Check here: https://playerio.com/documentation/refe ... tpresponse
robscherer123
Paid Member
 
Posts: 313
Joined: December 12th, 2012, 8:46 pm


Return to C#