Skip to content

New HitBox PoC by Solomenka #130

@Rosenstein

Description

@Rosenstein

As can be seen @ https://github.com/Solomenka/Psychostats-HitBox/
I'm opening issue in this repo because code embed only works here.

Great work done with this PoC, @Solomenka.
One issue I see right now is separate querying of SQL DB to fetch player & weapon data, when PsychoStats does all that work for us in player.php.
That is fine while developing, but on live site might add additional stress on top of already SQL heavy PS.

Let's look at the current code we have right now:
Url for swf hitbox is rendered with Smarty:

<param name="movie" value="{theme->parent_url}/hitbox/hitbox.swf?{$hitbox_url}">

it is generated here:
'hitbox_url' => 'weaponxml=' . ps_escape_html($php_scnm) . "&amp;id=$id&amp;imgpath=" . ps_escape_html(rtrim(dirname($php_scnm), '/\\') . '/img/weapons/' . $ps->conf['main']['gametype'] . $moddir) . '&amp;confxml=' . $cms->theme->parent_url() . '/hitbox/config.xml',

Output is >
/ps_tfc/themes/default/hitbox/hitbox.swf?weaponxml=/ps_tfc/player.php&id=11&imgpath=/ps_tfc/img/weapons/halflife/tfc&confxml=/ps_tfc/themes/default/hitbox/config.xml

Swf parses this and loads:
https://displaced.zone/ps_tfc/player.php?xml=w&id=11 (id is dynamic for every player)
https://displaced.zone/ps_tfc/img/weapons/halflife/tfc/ac.gif ( image is dynamic for every weapon displayed on hitbox)
https://displaced.zone/ps_tfc/themes/default/hitbox/config.xml ( this is always static )

As we can see, xml output of player.php fetches all required information.

<data>
<sniperrifle>
<dataid>109</dataid>
<plrid>11</plrid>
<weaponid>1</weaponid>
<firstdate>2021-04-05</firstdate>
<lastdate>2021-04-05</lastdate>
<accuracy>36.36</accuracy>
<damage>777</damage>
<deaths>0</deaths>
<ffdeaths>0</ffdeaths>
<ffkills>0</ffkills>
<headshotkills>0</headshotkills>
<headshotkillspct>0.00</headshotkillspct>
<hits>32</hits>
<kills>8</kills>
<shot_chest>2</shot_chest>
<shot_head>2</shot_head>
<shot_leftarm>15</shot_leftarm>
<shot_leftleg>0</shot_leftleg>
<shot_rightarm>8</shot_rightarm>
<shot_rightleg>0</shot_rightleg>
<shot_stomach>5</shot_stomach>
<shots>88</shots>
<shotsperkill>11.00</shotsperkill>
<uniqueid>sniperrifle</uniqueid>
<name>Sniper Rifle</name>
<skillweight>1</skillweight>
<class>Sniper Rifle</class>
<label>Sniper Rifle</label>
</sniperrifle>
....
</data>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions