Jump to content
RAGE Multiplayer Community

[GAMEMODE] WiredPlayers Roleplay Server


Xabi

Recommended Posts

7 minutes ago, KINGVDK said:
WiredPlayers: loaded 51 remote event(s)
-> Error starting 'WiredPlayers'
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> MySql.Data.MySqlClient.MySqlException: The host 127.0.0.1 does not support SSL connections.
   at void MySql.Data.MySqlClient.NativeDriver.Open()
   at void MySql.Data.MySqlClient.Driver.Open()
   at Driver MySql.Data.MySqlClient.Driver.Create(MySqlConnectionStringBuilder settings)
   at Driver MySql.Data.MySqlClient.MySqlPool.CreateNewPooledConnection()
   at Driver MySql.Data.MySqlClient.MySqlPool.GetPooledConnection()
   at Driver MySql.Data.MySqlClient.MySqlPool.TryToGetDriver()
   at Driver MySql.Data.MySqlClient.MySqlPool.GetConnection()
   at void MySql.Data.MySqlClient.MySqlConnection.Open()
   at List<BusinessModel> WiredPlayers.database.Database.LoadAllBusiness() in D:\RAGEMP\server-files\bridge\resources\WiredPlayers\database\Database.cs:line 1204
   at void WiredPlayers.business.Business.LoadDatabaseBusiness() in D:\RAGEMP\server-files\bridge\resources\WiredPlayers\business\Business.cs:line 18
   at void WiredPlayers.database.Database.OnResourceStart() in D:\RAGEMP\server-files\bridge\resources\WiredPlayers\database\Database.cs:line 40
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at GTANetworkInternals.ScriptingEngine.InvokeVoidMethod(String method, Object[] args)
   at System.Collections.Generic.List`1.ForEach(Action`1 action)
   at GTANetworkInternals.EventHandler.ParseEx(Event _event, ScriptingEngine engine, Object[] arguments)
   at System.Collections.Generic.List`1.ForEach(Action`1 action)
   at GTANetworkInternals.GameServer.StartResource(String resourceName, String parent)

Tell me what's wrong?

Set SSLMode=none on the database connection string, located on Database.cs file or upgrade MySQL server to 8.0 version.

Link to comment
Share on other sites

17 hours ago, KINGVDK said:

I use the Denwer database

As I see, it uses MySQL 5.1 so just edit that connectionString variable into Database.cs file, and change SSLMODE=required to SSLMODE=none.

After that make sure you compile the solution in order to apply the new changes.

Link to comment
Share on other sites

Hello dears! And how do you use the registration system for players? After all, there is a check on the name in the social club. Do all players have to be registered in the social club?

Why enter a name in the rage client in the settings then?

Link to comment
Share on other sites

15 minutes ago, Roven said:

Hello dears! And how do you use the registration system for players? After all, there is a check on the name in the social club. Do all players have to be registered in the social club?

Why enter a name in the rage client in the settings then?

Obviously you need to have a Social Club account, piracy is not supported.

Link to comment
Share on other sites

15 минут назад, Xabi сказал:

Obviously you need to have a Social Club account, piracy is not supported.

It's in this registration system, right? What if we create another system? After all, you can enter any name in the Rage client.

Link to comment
Share on other sites

1 minute ago, Roven said:

It's in this registration system, right? What if we create another system? After all, you can enter any name in the Rage client.

You're free to make your own register system, if you want so.

Link to comment
Share on other sites

mp.events.add('requestPlayerLogin', (userName, userPassword, status) => {
	setTimeout(function()
	{
		// Check for the credentials
		mp.events.callRemote('loginAccount', userName, userPassword, status);
	}, 100);
});

Server: Login
 

[RemoteEvent("loginAccount")]
        public void LoginAccountEvent(Client player, String password)
        {
            Task.Factory.StartNew(() =>
            {
                bool login = Database.LoginAccount(player.SocialClubName, password);
                NAPI.ClientEvent.TriggerClientEvent(player, login ? "clearLoginWindow" : "showLoginError");
            });
            
        }


Server: database

 

public static bool LoginAccount(String socialName, String password)
        {
            bool login = false;

            using (MySqlConnection connection = new MySqlConnection(connectionString))
            {
                connection.Open();
                MySqlCommand command = connection.CreateCommand();
                command.CommandText = "SELECT status FROM accounts WHERE socialName = @socialName AND password = md5(@password) LIMIT 1";
                command.Parameters.AddWithValue("@socialName", socialName);
                command.Parameters.AddWithValue("@password", password);

                using (MySqlDataReader reader = command.ExecuteReader())
                {
                    login = reader.HasRows;
                }
            }

            return login;
        }


You can find out what makes this function?
 

mp.events.add('executeFunction', (arguments) => {
	// Check for the parameters
	let input = '';
	
	for(let i = 1; i < arguments.length; i++) {
		if(input.length > 0) {
			input += ', \'' + arguments[i] + '\'';
		} else {
			input = '\'' + arguments[i] + '\'';
		}
	}
	
	// Call the function with the parameters
	customBrowser.execute(`${arguments[0]}(${input});`);
});

 

Link to comment
Share on other sites

20 hours ago, Roven said:
mp.events.add('requestPlayerLogin', (userName, userPassword, status) => {
	setTimeout(function()
	{
		// Check for the credentials
		mp.events.callRemote('loginAccount', userName, userPassword, status);
	}, 100);
});

Server: Login
 

[RemoteEvent("loginAccount")]
        public void LoginAccountEvent(Client player, String password)
        {
            Task.Factory.StartNew(() =>
            {
                bool login = Database.LoginAccount(player.SocialClubName, password);
                NAPI.ClientEvent.TriggerClientEvent(player, login ? "clearLoginWindow" : "showLoginError");
            });
            
        }


Server: database

 

public static bool LoginAccount(String socialName, String password)
        {
            bool login = false;

            using (MySqlConnection connection = new MySqlConnection(connectionString))
            {
                connection.Open();
                MySqlCommand command = connection.CreateCommand();
                command.CommandText = "SELECT status FROM accounts WHERE socialName = @socialName AND password = md5(@password) LIMIT 1";
                command.Parameters.AddWithValue("@socialName", socialName);
                command.Parameters.AddWithValue("@password", password);

                using (MySqlDataReader reader = command.ExecuteReader())
                {
                    login = reader.HasRows;
                }
            }

            return login;
        }


You can find out what makes this function?
 

mp.events.add('executeFunction', (arguments) => {
	// Check for the parameters
	let input = '';
	
	for(let i = 1; i < arguments.length; i++) {
		if(input.length > 0) {
			input += ', \'' + arguments[i] + '\'';
		} else {
			input = '\'' + arguments[i] + '\'';
		}
	}
	
	// Call the function with the parameters
	customBrowser.execute(`${arguments[0]}(${input});`);
});

 

That event is used to call functions when CEF is loaded.

Link to comment
Share on other sites

3 часа назад, Xabi сказал:

That event is used to call functions when CEF is loaded.

Should the function send something to the browser? Why is the name of the called function passed as a parameter?
Sorry, I just don't understand.

I just don't have anything going on when show Login Error is called 
And when clear Log In Window is called, the browser is closed as specified

it seems to work with a certain html page, and I've replaced Your page with another one. So maybe I have the error information is not displayed

Edited by Roven
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...