Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some weekend fixes #692

Closed
wants to merge 7 commits into from
Closed

some weekend fixes #692

wants to merge 7 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Jun 1, 2020

Changes proposed in this pull request:

Container bugfix #653
Fixes (escort & cleanup) #674
fix selling vehicles #677
fixes for master branch #688

call hudUpdate on health change (updates hud when healed)
fixed cop getting bounty when player is send to jail
converted textures to PAA as required by headless client
fixed missing ammo for AK12
fixed sofia garage
fixed quite a lot headless stuff to make it run on its own without life_server loaded
fixed some BattlEye filters

  • I have tested my changes and corrected any errors found (yes, actually tested this time over the weekend with just a 2nd account)

feel free to ignore or deny like my other fixes - it's just to show of that a lot of issues can be fixed on a single day by a single dev

muuhschaaf added 3 commits June 1, 2020 01:31
fixed quite a lot of stuff and made the headless client running correctly on its own
delete non-paa textures from within mission
update sql base file for extended rights and noop procedure
Copy link
Contributor

@klmunday klmunday left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, thanks for the PR

Please see my comments regarding the changes. Please note I have not checked whether the references to the HC_ functions is correct, but considering you've stated you've tested them I am going to assume they're correct.

You also seem to have duplicated the old texture files into the root of the repo, I don't beleive you intended to do this.

Also could you please explain the intention of changing the cleanup script to such an extent. The small sleep duration on the file is intended and I'm not sure why you've placed the procedures in there currently.

In future please try to keep to one issue fix per PR. This helps simplify merging, Thanks! :)

Comment on lines +168 to +169
F(BIS_fnc_execVM,ANYONE)
F(BIS_fnc_debugConsoleExec,ANYONE)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the error in the rpt log regarding execVM not having permissions to be remoteExec'd can be ignored from what I remember. Also debugConsoleExec has been left out of this file intentionally

Comment on lines -69 to +61
This section is meant for people doing their own edits to the mission, DO NOT REMOVE THE ABOVE.<br/><br/>
Container bugfix #653<br/>
Fixes (escort &amp; cleanup) #674<br/>
fix selling vehicles #677<br/>
fixes for master branch #688<br/>
<br/>
server patches<br/>
call hudUpdate on health change (updates hud when healed)<br/>
fix cop getting bounty when player is send to jail<br/>
converted textures to PAA as required by headless client<br/>
fix missing ammo for AK12<br/>
fix sofia garage
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part of the file is intended to be changed by people taking the framework and using it for their servers

@@ -10,7 +10,7 @@ unsafeCVL = 1; // Allows createVehicleLocal to be executed in Multiplayer
class CfgServer {
DatabaseName = "altislife"; //Config name that'll be grep in the extdb-conf.ini. Default: [altislife]
DebugMode = 0; //Enable many server/hc debugging logs. Default: 0 (1 = Enabled / 0 = Disabled)
HeadlessSupport = 0; //Enable/Disable Headless client support. Default: 1 (1 = Enabled / 0 = Disabled)
HeadlessSupport = 1; //Enable/Disable Headless client support. Default: 1 (1 = Enabled / 0 = Disabled)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be disabled by default

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in fact using HC should be more encouraged as it significantly reduce system stress
on my root (2x some 4-core xeons) it reduced from single-thread 85% to server about 35% and the HC to about 20% over at least two cores (which a dual-cpu system can really benefit from when both process split not just between cores of the same physical chip but between both chips) - hence I left this in intentional

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whilst what you're saying is true. Most server owners do not enable HC due to the extended setup it takes. Which is why it has been disabled by default

Comment on lines -37 to +65
CREATE DEFINER=CURRENT_USER PROCEDURE `resetLifeVehicles`()
CREATE DEFINER=`arma3`@`localhost` PROCEDURE `resetLifeVehicles`()
BEGIN
UPDATE `vehicles` SET `active`= 0;
END$$

CREATE DEFINER=CURRENT_USER PROCEDURE `deleteDeadVehicles`()
CREATE DEFINER=`arma3`@`localhost` PROCEDURE `deleteDeadVehicles`()
BEGIN
DELETE FROM `vehicles` WHERE `alive` = 0;
END$$

CREATE DEFINER=CURRENT_USER PROCEDURE `deleteOldHouses`()
CREATE DEFINER=`arma3`@`localhost` PROCEDURE `deleteOldHouses`()
BEGIN
DELETE FROM `houses` WHERE `owned` = 0;
END$$

CREATE DEFINER=CURRENT_USER PROCEDURE `deleteOldGangs`()
CREATE DEFINER=`arma3`@`localhost` PROCEDURE `deleteOldGangs`()
BEGIN
DELETE FROM `gangs` WHERE `active` = 0;
END$$

CREATE DEFINER=CURRENT_USER PROCEDURE `deleteOldContainers`()
CREATE DEFINER=`arma3`@`localhost` PROCEDURE `deleteOldContainers`()
BEGIN
DELETE FROM `containers` WHERE `owned` = 0;
END$$

CREATE DEFINER=CURRENT_USER PROCEDURE `deleteOldWanted`()
CREATE DEFINER=`arma3`@`localhost` PROCEDURE `deleteOldWanted`()
Copy link
Contributor

@klmunday klmunday Jun 1, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please keep this as CURRENT_USER. IT is intended as to not require DELETE permission on the arma3 user

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don'T know much about current-user - but when replacing them via phpMyAdmin it defaults them to the logged in user - hence my manual move of creating the user to the very top

about user not have delete permissions: makes it unnecessary harder to correctly administrate it for cleaning out junk to switch to another user with more privileges (root)
also a database wipe using TRUNCATE is impossible with the limited rights as most implementations (at least MySQL and MariaDB) just completely drop the table and create a new one instead of clearing it out

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The point of the CURRENT_USER is exactly as stated above. The procedure would be ran as the user who runs the SQL script (one with elevated permissions) and not the Arma3 user. This gives an additional layer of security as the "elevated" user is never used at the application to login to the database, and instead a user with less permissions is used instead.

Would be great if you could change this back as previously stated, thanks!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be great if you could change this back as previously stated, thanks!

just deny the PR
as said: it's just a show of to show what can be fixed by ONE dev and two accounts (picked up a 2nd copy as it was on sale) within a couple of hours on a sunday afternoon what this whole repo isn'T able to get done within months ...
it's also a bit uncool that someone thought to re-open the closed issues just cause s/he couldn't take a "NO, that's it, I'm pulling out" - it's still MY stuff on which I have the copyright - if I decide to close it as I don't see it anymore relevant as it's either denied by someone with at least in my eyes lacks a lot of common knowledge or noone even gives a damn to at least look at it - than that's my decision. Only stupid rights management of GitHub allows you as maintainers to fiddle with other users content ... which I see as a major flaw of githubs rights management ...

anyway - theese changes are just provided to get v6 movin a bit - do withit what you want - use it - shred it - IDK - but at least keep the rolling train movin instead of let get it stuck again im limbo for the next months ...
I already started a re-write from scratch - and instead of just supporting a HC my mission will rely on it - as it really decreases system resource consumption and should be used by anyone - even on a windows host (ok, anyone using windows as server os seem to have other issues to solve) with 64bit support - it'S at least somewhat useful unless BI provides a 64bit linux binary

so long suxxers - feel free to block as this account is most likely already deleted when you reply
just thought most admins were morrons - but seeing how this whole project is managed - well, I can see where at least SOME got their attitude from ..

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

within a couple of hours on a sunday afternoon what this whole repo isn'T able to get done within months

You should bare in mind that people don't have to commit all of their free time (some of who have less than others) to this project. Considering the current worldwide situation I wouldn't be surprised if people have other priorities.

it's also a bit uncool that someone thought to re-open the closed issues

The issues are still valid, you've reported a problem with the code base. The code you submitted to be merged is tied to your pull request. Whether or not your PR is merged has nothing to do with the state of the issue.

I already started a re-write from scratch

That's great! I look forward to seeing it :) best of luck

Comment on lines -236 to +245
-- --------------------------------------------------------
--
-- Creates default user `arma3` with password `changeme` unless it already exists
-- Granting permissions to user `arma3`, created below
-- Reloads the privileges from the grant tables in the MySQL system database.
--

CREATE USER IF NOT EXISTS `arma3`@`localhost` IDENTIFIED BY 'changeme';
GRANT SELECT, UPDATE, INSERT, EXECUTE ON `altislife`.* TO 'arma3'@'localhost';
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EXECUTE ON `altislife`.* TO 'arma3'@'localhost';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert these changes. It is intended for the arma user to not have DELETE permissions

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in addition to other reply: WHY?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For security purposes

Comment on lines +10 to +15
private _routines = [
[[], _fnc_doNoop, 3600]
];
{
_x pushBack (diag_tickTime + (_x # 2));
} forEach _routines;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit confused as to why you're storing one element in an array and looping over it as opposed to just setting a variable for the one element instead of using an array? What's the intention of this file?

@@ -46,7 +47,7 @@ if (_queryResult isEqualType "" || _queryResult isEqualTo []) exitWith {
[] remoteExecCall ["SOCK_fnc_insertPlayerInfo",_ownerID];
};

private _licenses = _queryResult select 6;
private _licenses = (_queryResult select 6);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

brackets are unnecessary

if (isNull _civ || {isNull _cop}) exitWith {};
if (isNull _civ || isNull _cop) exitWith {};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +4 to +15
private _fnc_doNoop = {
for "_i" from 0 to 10 step 1 do
{
["noop", 1] call DB_fnc_asyncCall;
}
};
private _routines = [
[[], _fnc_doNoop, 3600]
];
{
_x pushBack (diag_tickTime + (_x # 2));
} forEach _routines;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as life_hc's version comment

Comment on lines -15 to +33
player setObjectTextureGlobal [0, "textures\civilian_uniform_1.jpg"];
player setObjectTextureGlobal [0, "textures\civilian_uniform_1.paa"];
};
if (uniform player isEqualTo "U_C_Poloshirt_burgundy") then {
player setObjectTextureGlobal [0, "textures\civilian_uniform_2.jpg"];
player setObjectTextureGlobal [0, "textures\civilian_uniform_2.paa"];
};
if (uniform player isEqualTo "U_C_Poloshirt_stripped") then {
player setObjectTextureGlobal [0, "textures\civilian_uniform_3.jpg"];
player setObjectTextureGlobal [0, "textures\civilian_uniform_3.paa"];
};
if (uniform player isEqualTo "U_C_Poloshirt_tricolour") then {
player setObjectTextureGlobal [0, "textures\civilian_uniform_4.jpg"];
player setObjectTextureGlobal [0, "textures\civilian_uniform_4.paa"];
};
if (uniform player isEqualTo "U_C_Poloshirt_salmon") then {
player setObjectTextureGlobal [0, "textures\civilian_uniform_5.jpg"];
player setObjectTextureGlobal [0, "textures\civilian_uniform_5.paa"];
};
if (uniform player isEqualTo "U_C_Poloshirt_redwhite") then {
player setObjectTextureGlobal [0, "textures\civilian_uniform_6.jpg"];
player setObjectTextureGlobal [0, "textures\civilian_uniform_6.paa"];
};
if (uniform player isEqualTo "U_C_Commoner1_1") then {
player setObjectTextureGlobal [0, "textures\civilian_uniform_7.jpg"];
player setObjectTextureGlobal [0, "textures\civilian_uniform_7.paa"];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These files don't exist. Seems they didn't exist before either.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please see further down - I have moved the original non-paa textures out of Altis_Life.Altis into a new folder and replaced them by PAA versions
conversion was done by TexView2 as the batch processing with ImageToPAA failed for some unknown reason

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's because ImageToPAA only allows PNG > PAA, and not JPG > PAA

@klmunday klmunday requested a review from DomT602 June 1, 2020 02:25
@ghost ghost requested a review from klmunday June 1, 2020 21:07
@Jason2605 Jason2605 closed this Jun 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants