Persistent scoring for Llama players (revisited)

Started by =JpS=SgtRock, September 11, 2021, 07:54:58 PM

Previous topic - Next topic

=JpS=SgtRock

I brought this topic up in an email chain quite a while ago. I see it as a way to help build up the Llama community again. I haven't forgotten about it. Quite the contrary, in fact.

I've been noodling about it off and on for about a year. I still think it's doable within the scope of the tools that we have available. I'm thinking that most of the heavy lifting can be done primarily through the Arma editor tools. Although, the HostHavoc gameserver tools and the really broad array of options that we get with our webserver also provide some interesting possibilities for solving at least some of the problems that I foresee.

In the meantime I've put development of my own Liberation type mission on hold.  I'm hoping that Drongo will be able to get his mission creation tools to the point that they solve a lot of the persistence issues. If you haven't run across his stuff yet, he's a really talented contributor to the Steam Workshop. It will make things MUCH easier on guys like me if he gets that worked out. Besides, with the continuing improvement of Antistasi, KP Liberation available for a bunch of maps, and (hopefully) the continued maturing of Vindicta it's not like we don't have an interesting selection of missions to play as it is!   :o ;)

This weekend I started noodling around with what needed to be done to pull off player score tracking. If you're interested in the topic, I've been documenting my thinking in the GitLab JpS mpmissions wiki.

So far, what I've put together can only be described as half formed at best. Lots of assumptions that I haven't documented and a LOT of questions that need to be resolved. I would love to get some feedback even though what I've got so far can only be described as a very rough sketch.  Take a look and add some comments!

Raptor-Man

I'm on right now doing some VueJS work.

As I stated before - all of the hard work to get stat tracking with some basics is already done.

I already wrote a more advanced 2 way communication with the DLL's.

Just change the calls to the DLL to write to log file (which was actually how I was testing the in game functions).

All of the hard work is done. 

Last steps in process to be done:

1) Any person who can turn on a computer, open a text file & use find+replace can adapt the function calls I did to write to log file
2) Need an FTP script to download the file each day & truncate the server file so you don't have repeats
3) Find any standard log parser already written - which should do an import which checks for no repeating timestamps incase same file gets imported to MySQL db
4) run any modern ruby/js frame work & it will auto generate the tables for you based on sql (i'll help with this part if you want to eventually make stuff private etc

Really - besides #4 - which in its basic for these are all trival steps next to the 2 months put in to learning how the arma3 engine works


=JpS=SgtRock

Thanks for pulling that together Raptor. I'll take a look at it when I can. Right now I'm still focused on building that mission using the Drongo tools, although I ended up going down a detour that I had been thinking about tackling for years. See the thread for details.

Raptor-Man

I was looking for our cpanel credentials & saw you've got the 1 yr old ticket open still on gitlabs:

https://gitlab.com/jpssgtrock/jackpine-savages-website/-/issues/1

I updated the a3_killlog demo i did as mod there.

Raptor-Man

I totally forgot - I actually already made the logfile generator ...

So I'm going to admit I'm a tiny bit fuzzy on how to powershell sql commands since it's a skill that really shouldn't be used - this should be done by solving the permissions/implementation issue with hosthavoc of why the DLL doesn't work for us, but same DLL works for antistasi life on their servers.

I tossed in at least 30 hours (conservatively if not triple that with research) on making a modern solution & you're insisting on going back to the 90s so it's a problem for someone else to solve.

All you have to figure out is

1) uncomment the log writing line
2) insert the db credentials into sql or user get-credential so the person running stats has to hand type it
3) how to write an insert query in powershell & record it into a *.ps1 file - then you have your text based logging.

1) you have to do is change fn_getKillInfo.sqf to uncomment line number 49 in the mod I wrote you last year & the stats will log to the *.rpt

2 & 3)  From there something based on this guys powershell like:

Powershell to setup db connection

[string]$sMySQLUserName = 'dbusername'
[string]$sMySQLPW = 'DatabasePa$$word'
[string]$sMySQLDB = 'db_test'
[string]$sMySQLHost = 'localhost'
[string]$sConnectionString = "server="+$sMySQLHost+";port=3306;uid=" + $sMySQLUserName + ";pwd=" + $sMySQLPW + ";database="+$sMySQLDB


Test db connection:

$oConnection = New-Object MySql.Data.MySqlClient.MySqlConnection($sConnectionString)
$Error.Clear()
try
{
    $oConnection.Open()
}
catch
{
    write-warning ("Could not open a connection to Database $sMySQLDB on Host $sMySQLHost. Error: "+$Error[0].ToString())
}



Assemble the insert query with insert string from FN_formatInsert.sqf line #25 & the text from log file suppied by fn_getKillInfo.sqf line #49

# I defined a PSCustom Object for a User
$oNewUser=New-Object psobject -Property @{"username"="NewUser";"login"="login126";}
$oMYSQLCommand = New-Object MySql.Data.MySqlClient.MySqlCommand
$oMYSQLCommand.CommandText='
INSERT into `db_test`.`users` ($StringFrom) VALUES("$StringFromLog)'
$iRowsAffected=$oMYSQLCommand.ExecuteNonQuery()



Bit of my research I recorded:  https://mirviriam.wordpress.com/2021/12/12/arma-logging-to-mysql-db-to-webpage/?preview_id=6930&preview_nonce=f05ea98106&preview=true

Raptor-Man

As I offered last spring - you or anyone else interested can link up on zoom etc & we'll pair program this out - just no one has taking 20minutes to do so yet.

=JpS=SgtRock


Raptor-Man


Raptor-Man

I saw there's a discord chat for hosthavoc - I'm in there now trying to pickup what I can to get the extdb3 going.

=JpS=SgtRock

Quote from: Raptor-Man on December 16, 2021, 12:12:10 AM
I saw there's a discord chat for hosthavoc - I'm in there now trying to pickup what I can to get the extdb3 going.

Cool! Let us know what you find out.

Raptor-Man