@MOAL: If your machine has not been configured to accept incoming connections, then it won't work regardless of firewall, port forwarding and anything else. You first have to set up your PC to accept incoming connections. Sadly I don't remember anymore how exactly it is done. Try googling that error and see what comes up.
Also, you should upgrade to RMX-OS 1.18. There have been some improvements. Among other things, it may actually help you a bit with your problems.
@RyukLikesApples: You said that you tried using custom Ruby versions and
mysql.so files, right? I suggest that you use the versions that I have specified in the manual and that you use the files already contained in RMX-OS. This will have the highest chance of everything working properly.
I have taken a look at the error you are getting and this is the whole method:
def try_register(username, password)
# try to find user
check = RMXOS.server.sql.query("SELECT COUNT(*) AS count FROM users WHERE username = '#{RMXOS.fix_string(username)}'")
hash = check.fetch_hash
# user already exists
return RMXOS::RESULT_FAIL if hash['count'].to_i > 0
# get user count
check = RMXOS.server.sql.query("SELECT COUNT(*) AS count FROM users")
hash = check.fetch_hash
RMXOS.server.sql.query("START TRANSACTION")
# first registered user becomes admin
group = (hash['count'].to_i == 0 ? RMXOS::GROUP_ADMIN : RMXOS::GROUP_PLAYER)
# register new user
RMXOS.server.sql.query("INSERT INTO users (username, password, usergroup) VALUES ('#{RMXOS.fix_string(username)}', '#{password}', #{group})")
# get new user ID
check = RMXOS.server.sql.query("SELECT user_id FROM users WHERE username = '#{RMXOS.fix_string(username)}'")
hash = check.fetch_hash
user_id = hash['user_id'].to_i
RMXOS.server.sql.query("INSERT INTO user_data (user_id, lastlogin) VALUES (#{user_id}, '#{RMXOS.get_sqltime(Time.now.getutc)}')")
# get client's IP address
ip = @client.socket.peeraddr[3]
# record IP
RMXOS.server.sql.query("REPLACE INTO ips(user_id, ip) VALUES (#{user_id}, '#{ip}')")
RMXOS.server.sql.query("COMMIT")
return RMXOS::RESULT_SUCCESS
end
Notice these lines:
RMXOS.server.sql.query("INSERT INTO user_data (user_id, lastlogin) VALUES (#{user_id}, '#{RMXOS.get_sqltime(Time.now.getutc)}')")
# get client's IP address
ip = @client.socket.peeraddr[3]
# record IP
RMXOS.server.sql.query("REPLACE INTO ips(user_id, ip) VALUES (#{user_id}, '#{ip}')")
RMXOS.server.sql.query("COMMIT")
This means that there is definitely a user entry in the database before the IP is logged. But I can't remember how well things work when you use transactions and if foreign constraints are disabled during them so everything can work out. The only thing that I can suggest is that you move the COMMIT line further up so the user is definitely already registered in the database when his IP is supposed to be added:
RMXOS.server.sql.query("COMMIT")
# get client's IP address
ip = @client.socket.peeraddr[3]
# record IP
RMXOS.server.sql.query("REPLACE INTO ips(user_id, ip) VALUES (#{user_id}, '#{ip}')")
If the problem really is the transaction in progress, this change should prevent the foreign key error.
If this doesn't work, then just remove the lines. Technically it's an optional feature so you don't really need it. But you won't be able to IP ban users properly.
Also, if you are still having errors with this one, you should keep in mind that there is a similar line in the try_login method in same file (line 86) so you might wanna remove that one as well.