Modify your Atavism Server
Prerequisites
- Basic understanding of Python programming.
- Access to the Atavism server files.
- A website with an authentication system.
Objective
To modify the auth_server.py
script in the Atavism server to authenticate users via your website.
Step-by-Step Guide
- Locate the
auth_server.py
Script- Navigate to the
bin
folder in your Atavism server directory (usually located at\atavism_server\bin
). - Find the file named
auth_server.py
.
- Navigate to the
- Backup the Original Script
- Before making any changes, it’s crucial to back up the original script. Copy
auth_server.py
and save it in a different folder or rename it.
- Before making any changes, it’s crucial to back up the original script. Copy
- Open the Script for Editing
- Open
auth_server.py
in a text editor of your choice (e.g., Notepad++, Sublime Text, or Visual Studio Code, vi, vim, nano, etc.).
- Open
- Modify the Connection Settings
- Locate the following lines in the script:
connector = RemotePhpAccountConnector()
#connector.setUrl(“http://localhost/verifyAccount.php”)
# True =1 ; False = 0
connector.setPost(1)
- Modify the
setUrl
method to point to your website’s authentication URL. For example:connector.setUrl(“http://yourwebsiteurl.com/verify”)
Replace
http://yourwebsiteurl.com/verify
with the actual URL where your website handles authentication requests.
- Locate the following lines in the script:
Note: Do not end your URL with a / as this will break the system as it will attempt to load the default page which does not exist.
- Configure the Post Method
- The
setPost
method determines how data is sent to your website.1
indicates using the POST method, which is more secure for transmitting user credentials. - If your website authentication is set up to receive data via POST, leave this setting as is (
connector.setPost(1)
). If not, consult your web developer or documentation to adjust accordingly.
- The
- Comment Out Unnecessary Lines
- If there are any other
setUrl
lines, comment them out to prevent conflicts. For example:#connector.setUrl(“http://localhost/verifyAccount.php”)
This ensures that only your specified URL is used for authentication.
- If there are any other
- Save the Changes
- After making the changes, save the file.
- Restart the Atavism Server
- To apply the changes, restart your Atavism server. This usually involves stopping and starting the server processes.
- Test the Integration
- Test the integration by attempting to log in through the game client.
- Ensure that the authentication process works correctly, and the server communicates with your website as expected.
Tips
- Always keep a backup of the original files before making changes.
- Ensure your website’s authentication endpoint is secure and can handle requests from the game server.
- Regularly update both your Atavism server and website to maintain compatibility and security.
Conclusion
By following these steps, you have successfully integrated your website with the Atavism Game Server for user authentication. This allows you to manage game accounts through your website, providing a seamless experience for your players.
For further assistance or more advanced configurations, consult the Atavism documentation or seek help from the Atavism community forums.