Open deviljin112 opened 4 years ago
The problem here is that this system differs between TFS 0.2, TFS 0.3/4 and TFS 1.x. If we correct it for one version, it easily breaks for another.
You can read more about it in #70
We might need to setup the config differently based on TFS version.
Temporary Solution
config.php
line 726 add:
$config['TFS10_ingame_positions'] = array(
1 => 'Player',
2 => 'Gamemaster',
3 => 'God',
);
general.php
line 346 add:
function group_id_to_name_TFS10($id) {
$positions = config('TFS10_ingame_positions');
return ($positions[$id] >= 0) ? $positions[$id] : false;
}
characterprofile.php
replace line 84 to line 90:
<!-- Player Position -->
<?php if ($profile_data['group_id'] > 1): ?>
<?php if ($config['ServerEngine'] == 'TFS_10'): ?>
<tr>
<td>Position</td>
<td><?php echo group_id_to_name_TFS10($profile_data['group_id']); ?></td>
</tr>
<?php else: ?>
<tr>
<td>Position</td>
<td><?php echo group_id_to_name($profile_data['group_id']); ?></td>
</tr>
<?php endif; ?>
<?php endif; ?>
This may not be an ideal solution but it solves the above issue perfectly without affecting non TFS 1.x
EDIT: Only works with 1 character. I've read the post you sent above, and realised this would not be viable for multiple characters on one account with different ranks.
Characterprofile.php
Prints out the character's position based on characters
group_id
in DB. Character is "GOD" in-game but profile states "Senior Tutor" because of comparison toconfig.php
Because TFS only has 3 rankings for in-game position (
groups.xml
) at least mine does, I cant actually set it to6
to have it match theconfig.php
.TLDR; Account position's (
account
db =>type
) matches exactly to config.php butcharacter
db =>group_id
does not.