Jump to content

ARK: Survival Evolved (Supports Clusters)


Dennis

Recommended Posts

welp, i figured out the problem, i didnt set the username and pass in the actual script, i was trying to use the variables for that instead, my mistake...

however now i get this error:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IDENTIFIED BY 'YtpiFNv51K'' at line 1

and i dont know anything about the SQL Language.

my server is: Server version: 8.0.19 - MySQL Community Server (Windows) on localhost

the error it shows im assuming is this line:

#mysql.ExecuteNonQuery(String.Format("CREATE USER '{0}'@'localhost' IDENTIFIED BY '{1}';", escapeduser, escapedpass));

but, im not sure what to modify on that to fix it...

 

Link to comment
Share on other sites

current scripts are the ones from the tcadmin wiki:

generate user/pass (before created) from wiki:

import clr;
import System;

clr.AddReference("TCAdmin.SDK");
from TCAdmin.SDK.Misc import Random;
from System import String;

ThisService.Variables["MySQLUser"] = String.Format("db{0}", ThisService.ServiceId);
ThisService.Variables["MySQLPassword"] = Random.RandomString(10,True,True);
ThisService.Save();

create database (after created) from wiki:

import clr;
import System;

clr.AddReference("TCAdmin.DatabaseProviders.MySql");
clr.AddReference("TCAdmin.SDK");
from TCAdmin.DatabaseProviders.MySql import MySqlManager;
from System import String;

mysql_server="localhost";
mysql_root="xxxx";
mysql_password="xxxx";

with MySqlManager() as mysql:
 escapeduser=mysql.PrepareSqlValue(ThisService.Variables["MySQLUser"]);
 escapedpass=mysql.PrepareSqlValue(ThisService.Variables["MySQLPassword"]);
 mysql.DisableReplication=True;
 mysql.Connect(String.Format("Data Source={0};User Id={1};Password={2};Pooling=False;", mysql_server, mysql_root, mysql_password));

 mysql.ExecuteNonQuery(String.Format("DROP DATABASE IF EXISTS {0};", escapeduser));
 if mysql.Execute(String.Format("SELECT * FROM mysql.user WHERE user='{0}' AND host='localhost';", escapeduser)).Rows.Count == 1 :
  mysql.ExecuteNonQuery(String.Format("DROP USER {0}@localhost;", escapeduser));

 mysql.ExecuteNonQuery(String.Format("CREATE DATABASE {0};", escapeduser));
 ## MYSQL 5 SYNTAX
 mysql.ExecuteNonQuery(String.Format("GRANT ALL PRIVILEGES ON {0}.* TO '{0}'@'localhost' IDENTIFIED BY '{1}';", escapeduser, escapedpass));
 ## MYSQL 8 SYNTAX
 #mysql.ExecuteNonQuery(String.Format("CREATE USER '{0}'@'localhost' IDENTIFIED BY '{1}';", escapeduser, escapedpass));
 #mysql.ExecuteNonQuery(String.Format("GRANT ALL PRIVILEGES ON {0}.* TO '{0}'@'localhost';", escapeduser));

and the before deleted script from wiki:

import clr;
import System;

clr.AddReference("TCAdmin.DatabaseProviders.MySql");
clr.AddReference("TCAdmin.SDK");
from TCAdmin.DatabaseProviders.MySql import MySqlManager;
from System import String;

mysql_server="localhost";
mysql_root="xxxx";
mysql_password="xxxx";

if not ThisService.Variables.HasValue("MySQLUser") :
 Script.Exit();

if ThisService.Variables["MySQLUser"] == String.Empty:
 Script.Exit();

with MySqlManager() as mysql:
 escapeduser=mysql.PrepareSqlValue(ThisService.Variables["MySQLUser"]);
 mysql.DisableReplication=True;
 mysql.Connect(String.Format("Data Source={0};User Id={1};Password={2};Pooling=False;", mysql_server, mysql_root, mysql_password));

 mysql.ExecuteNonQuery(String.Format("DROP DATABASE IF EXISTS {0};", escapeduser));
 if mysql.Execute(String.Format("SELECT * FROM mysql.user WHERE user='{0}' AND host='localhost';", escapeduser)).Rows.Count == 1 :
  mysql.ExecuteNonQuery(String.Format("DROP USER {0}@localhost;", escapeduser));

 

Link to comment
Share on other sites

well it successfully created the database for the server, but im still getting this error on start

Access denied for user 'omitted'@'xxxxx' (using password: YES)

which again, its displaying my webhost MySQL connection information, and not the info in the localhost database i set up specifically for the independent game server...

image.png.6f04ccfa40aaf9ca0953fd0bb23e84e0.png <-- the server did create the database upon initial create for the game, so that part worked...

 

so what is the "Access denied" for when trying to "start" the server? (first start)

Link to comment
Share on other sites

i have it working now, i opened a support ticket and they corrected a couple mistakes:

1) when i changed the MySQL password, i didnt restart the Service manager (didnt know i was suppose to)

2) they fixed a syntax error in the mysql scripts. % needs to be in quotes '%' and i pulled all the scripts from the wiki, and what came with the config

3) Before started script from config named "Set permissions on cluster folder" they had to fix as well to this

import clr
clr.AddReference("TCAdmin.SDK")
clr.AddReference("TCAdmin.GameHosting.SDK")
from TCAdmin.GameHosting.SDK.Objects import Server, Service, Game
from TCAdmin.SDK.Objects import User
from System.IO import Directory, Path
from System import Environment, PlatformID, Exception

#Load objects from database.
serviceid=ThisService_ServiceId
ThisService=Service(serviceid)
if ThisService.Variables['clusterid']:
  if ThisService.Variables['ClusterPath'] == None and ThisService.Variables['clusterid'] !='':
    raise Exception('Your service has no ClusterPath set. Go to \"More\" (next to Start) and click \"Set ClusterPath value\"')
  
  elif ThisService.Variables['ClusterPath'] != None and ThisService.Variables['clusterid']:
    ThisUser=User(ThisService.UserId)
    ThisServer=Server(ThisService.ServerId)
    ThisGame=Game(ThisService.GameId)
    
    services=Service.GetServices(ThisUser, ThisService.ServerId)
    if Environment.OSVersion.Platform == PlatformID.Win32NT:
      if not Directory.Exists(ThisService.Variables["ClusterPath"] + "/clusters"):
        Directory.CreateDirectory(ThisService.Variables["ClusterPath"] + "/clusters")
    else:
      from subprocess import Popen
      clusterfolder = ThisService.Variables["ClusterPath"] + "/clusters"
      if not Directory.Exists(clusterfolder):
        Directory.CreateDirectory(clusterfolder)
        Popen(["chown", "-R", ThisService.RunAsUserName+':'+ThisService.RunAsUserName, clusterfolder])

i dont know what they changed but, there is the working version (i didnt touch this script from the original config so, i pasted it for your reference Dennis)

Link to comment
Share on other sites

On 4/10/2021 at 5:21 PM, DevilzEye1 said:

3) Before started script from config named "Set permissions on cluster folder" they had to fix as well to this

That seems identical to what's already in the config. Are you using the latest version?

Link to comment
Share on other sites

yes sir i am 🤷‍♂️ thats just what the rep said, i dunno, unless somehow i screwed it up, but i never opened that script so

but now i cant get ARK to publish to the public ingame server list so, here's yet another problem ive been tackling... it's not related to TCadmin tho because it does it outside of TCA as well... yay

Link to comment
Share on other sites

I noticed that ARK had the same issue as your other Config RUST since once the server is full, the query keeps calculating more than the MAX number of users in server which is in queue and it reaches Max limit in tcadmin max players detection.

Solving this with same script of Rust or so would be great (Maybe)

Thx

Link to comment
Share on other sites

15 hours ago, Dennis said:

@conceptr980 is that not only with CrossPlay enabled? There's no fix for that, unfortunately. That's just how the number of active players are reported.

Thanks for your reply. No crossplay used, just normal server. Disabling players detection query would be the only solution available i presume 😑

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Terms of Use