DannyTom Posted October 6, 2022 Share Posted October 6, 2022 Is there a way to query the server or have some kind of connection that will say when someone joins the game? I am working on a discord bot for such a thing for official public servers and wanted to see if that is even possible... I am able to currently poll the server for the players that are currently on using A2S under python - I'd like for my tribe to see who joins the server when we are in discord Link to comment Share on other sites More sharing options...
Larkfields Posted October 6, 2022 Share Posted October 6, 2022 Windows or Linux? You could put a watch on the files in save directory changing - character files are stored individually. You could send a listplayers over RCON. You can't get away with the Steam API that looks at the number of players connected because that doesn't list any EPIC players. Link to comment Share on other sites More sharing options...
DannyTom Posted October 7, 2022 Author Share Posted October 7, 2022 ya linux or windows doesnt really matter but linux would be less worriesome and this is for getting info from the offical public servers and not a private server, so RCON is what i should look into then? Link to comment Share on other sites More sharing options...
Larkfields Posted October 7, 2022 Share Posted October 7, 2022 You've got no chance with public servers, RCON needs a password. I assumed you were talking about your own server. A2S doesn't entirely work because EPIC accounts don't get listed by the Steam API, and it can't distinguish between two players with the same name. www.battlemetrics.comhttps://developer.valvesoftware.com/wiki/Server_queries Link to comment Share on other sites More sharing options...
DannyTom Posted October 12, 2022 Author Share Posted October 12, 2022 On 10/7/2022 at 12:33 AM, Larkfields said: You've got no chance with public servers, RCON needs a password. I assumed you were talking about your own server. A2S doesn't entirely work because EPIC accounts don't get listed by the Steam API, and it can't distinguish between two players with the same name. www.battlemetrics.comhttps://developer.valvesoftware.com/wiki/Server_queries Thanks. Ya i do know about epic and battlemetrics i was speaking of public so as how battlemetrics shows when someone logs in, surely that is replicatable and ive heard of some big tribes having a way for a bot to post in discord , when someone logs into the server.. Link to comment Share on other sites More sharing options...
IanHighlander Posted November 6, 2022 Share Posted November 6, 2022 You definitely don't need the rcon password for some information like player lists. I've not looked into what exactly it's doing but I use php source query on our clusters website ( http://www.arkultrapc.com ) to get player lists and no where are the rcon passwords set in it. I'm not at home so can't check the code but if you find it on github you'll be able to check the php function to see what he's doing to get it. Edit: sorry, re-reading the thread, I may have told you something you already knew. I'm not sure about actual join/leave triggers. I just query the servers every 5 minutes for our website. Link to comment Share on other sites More sharing options...
Larkfields Posted November 6, 2022 Share Posted November 6, 2022 @IanHighlander Are you able to get name of players that use the EPIC version of the game? Link to comment Share on other sites More sharing options...
DannyTom Posted November 7, 2022 Author Share Posted November 7, 2022 15 hours ago, IanHighlander said: You definitely don't need the rcon password for some information like player lists. I've not looked into what exactly it's doing but I use php source query on our clusters website ( http://www.arkultrapc.com ) to get player lists and no where are the rcon passwords set in it. I'm not at home so can't check the code but if you find it on github you'll be able to check the php function to see what he's doing to get it. Edit: sorry, re-reading the thread, I may have told you something you already knew. I'm not sure about actual join/leave triggers. I just query the servers every 5 minutes for our website. so you query every 5 mins and compare it to the last query to see what changed as far as join/leave? Link to comment Share on other sites More sharing options...
IanHighlander Posted November 12, 2022 Share Posted November 12, 2022 On 11/7/2022 at 1:43 AM, DannyTom said: so you query every 5 mins and compare it to the last query to see what changed as far as join/leave? Nothing quite so clever I'm afraid. Every five minutes the json files on the webserver get updated with current stats. To see the change on the website you'd have to refresh. I couldn't be bothered to code in an Ajax refresh if I'm honest given how few people will use the site. Link to comment Share on other sites More sharing options...
DannyTom Posted November 25, 2022 Author Share Posted November 25, 2022 On 11/12/2022 at 8:33 AM, IanHighlander said: Nothing quite so clever I'm afraid. Every five minutes the json files on the webserver get updated with current stats. To see the change on the website you'd have to refresh. I couldn't be bothered to code in an Ajax refresh if I'm honest given how few people will use the site. Well dang.. i was hoping to be able to add a live join/leave for my discord bot but since the A2S doesnt work like that, i may have to rethink doing much more work beyond what I already have for the bot Link to comment Share on other sites More sharing options...
Larkfields Posted November 25, 2022 Share Posted November 25, 2022 Monitor the save directory and watch for the arkprofile files to change their date stamp. If you can suss out the file contents, you should be able to get the character's name. Link to comment Share on other sites More sharing options...
DannyTom Posted November 26, 2022 Author Share Posted November 26, 2022 18 hours ago, Larkfields said: Monitor the save directory and watch for the arkprofile files to change their date stamp. If you can suss out the file contents, you should be able to get the character's name. Dang that seems like a lot of work Link to comment Share on other sites More sharing options...
DannyTom Posted November 26, 2022 Author Share Posted November 26, 2022 On 11/12/2022 at 8:33 AM, IanHighlander said: Nothing quite so clever I'm afraid. Every five minutes the json files on the webserver get updated with current stats. To see the change on the website you'd have to refresh. I couldn't be bothered to code in an Ajax refresh if I'm honest given how few people will use the site. Checking out your site to steal any ideas ... Link to comment Share on other sites More sharing options...
IanHighlander Posted November 26, 2022 Share Posted November 26, 2022 On 11/6/2022 at 5:04 PM, Larkfields said: @IanHighlander Are you able to get name of players that use the EPIC version of the game? I don't know for certain as ours is a modded cluster so no epic players, but it's just querying the server on RCON for the details so I don't see why not. Link to comment Share on other sites More sharing options...
Volunteer Moderator Joebl0w13 Posted November 26, 2022 Volunteer Moderator Share Posted November 26, 2022 7 hours ago, DannyTom said: Dang that seems like a lot of work It's not hard really. Python has a couple packages you can use to do it. Watchdog for monitoring changes in a directory: https://pypi.org/project/watchdog/ Then you can parse the file that changed: https://www.pythontutorial.net/python-basics/python-read-text-file/ Link to comment Share on other sites More sharing options...
Larkfields Posted November 26, 2022 Share Posted November 26, 2022 Mirage's utility can produce a text version of the important stuff in the character's data file. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.