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

BLT 2 Update for BLT4Linux #79

Open
dribbleondo opened this issue Sep 5, 2017 · 97 comments
Open

BLT 2 Update for BLT4Linux #79

dribbleondo opened this issue Sep 5, 2017 · 97 comments
Labels
base-mod Having to do with the actual BLT lua base mod lua-api Relating to the lua API exposed by BLT
Milestone

Comments

@dribbleondo
Copy link
Contributor

dribbleondo commented Sep 5, 2017

May as well post it here, But I managed to port over the Base files from regular BLT to make it work on BLT4Linux. It admittedly wasn't that hard to do. I just had to delete calls relating to finding image files for mods.

Grab BLT4L 2.1 fix here
Grab BLT4L 2.2.1 fix (this is more up to date!)

The only downsides are that because I've deleted the portion of the code that tells BLT to load images from mods, images don't load in the new swanky download manager. Also no controller support in the download manager...

The update isn't really necessary, but for those who want BLT 2 functionality in BLT4L, go nuts!

@RomanHargrave
Copy link
Member

RomanHargrave commented Sep 5, 2017 via email

@dribbleondo
Copy link
Contributor Author

So far, the only thing the loader appears to be missing is the ability to load icons from mods, but i'm sure you'll be able to find other things =)

@Kazenin
Copy link

Kazenin commented Sep 6, 2017

May I download and test this newer version? Many mods does not work with current version of BLT4L

@dribbleondo
Copy link
Contributor Author

dribbleondo commented Sep 6, 2017 via email

@dribbleondo
Copy link
Contributor Author

dribbleondo commented Sep 6, 2017

Okay, new version is up HERE ,not tested it as i'm not on my Linux partition at the moment. Gotta play Paladins somehow =)

@Kazenin
Copy link

Kazenin commented Sep 6, 2017

I will test here. By the way, I use Fedora 26 and I will feedback you later. Thanks, mate

@dribbleondo
Copy link
Contributor Author

Okay, got onto my linux mint partition, and i made a boo boo: Here is the fixed version

@Kazenin
Copy link

Kazenin commented Sep 6, 2017

Well, I tested.. and the game does not open. Verifying with ldd:

./libblt_loader.so: /lib64/libcurl.so.4: no version information available (required by ./libblt_loader.so)
	linux-vdso.so.1 (0x00007ffe49bfe000)
	libdl.so.2 => /lib64/libdl.so.2 (0x00007f1bf4019000)
	libcrypto.so.1.0.0 => not found
	libcurl.so.4 => /lib64/libcurl.so.4 (0x00007f1bf3d99000)
	libz.so.1 => /lib64/libz.so.1 (0x00007f1bf3b82000)
	libc++.so.1 => /lib64/libc++.so.1 (0x00007f1bf38c4000)
	libm.so.6 => /lib64/libm.so.6 (0x00007f1bf35ae000)
	libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f1bf3397000)
	libc.so.6 => /lib64/libc.so.6 (0x00007f1bf2fc6000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f1bf443a000)
	libnghttp2.so.14 => /lib64/libnghttp2.so.14 (0x00007f1bf2da1000)
	libidn2.so.0 => /lib64/libidn2.so.0 (0x00007f1bf2b84000)
	libssh2.so.1 => /lib64/libssh2.so.1 (0x00007f1bf2957000)
	libpsl.so.5 => /lib64/libpsl.so.5 (0x00007f1bf2749000)
	libssl3.so => /lib64/libssl3.so (0x00007f1bf24fc000)
	libsmime3.so => /lib64/libsmime3.so (0x00007f1bf22d5000)
	libnss3.so => /lib64/libnss3.so (0x00007f1bf1fac000)
	libnssutil3.so => /lib64/libnssutil3.so (0x00007f1bf1d7c000)
	libplds4.so => /lib64/libplds4.so (0x00007f1bf1b78000)
	libplc4.so => /lib64/libplc4.so (0x00007f1bf1973000)
	libnspr4.so => /lib64/libnspr4.so (0x00007f1bf1734000)
	libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f1bf1515000)
	libgssapi_krb5.so.2 => /lib64/libgssapi_krb5.so.2 (0x00007f1bf12c8000)
	libkrb5.so.3 => /lib64/libkrb5.so.3 (0x00007f1bf0fe1000)
	libk5crypto.so.3 => /lib64/libk5crypto.so.3 (0x00007f1bf0dae000)
	libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00007f1bf0baa000)
	liblber-2.4.so.2 => /lib64/liblber-2.4.so.2 (0x00007f1bf099b000)
	libldap-2.4.so.2 => /lib64/libldap-2.4.so.2 (0x00007f1bf0749000)
	libc++abi.so.1 => /lib64/libc++abi.so.1 (0x00007f1bf0501000)
	librt.so.1 => /lib64/librt.so.1 (0x00007f1bf02f9000)
	libunistring.so.2 => /lib64/libunistring.so.2 (0x00007f1beff87000)
	libssl.so.1.1 => /lib64/libssl.so.1.1 (0x00007f1befd1b000)
	libcrypto.so.1.1 => /lib64/libcrypto.so.1.1 (0x00007f1bef890000)
	libkrb5support.so.0 => /lib64/libkrb5support.so.0 (0x00007f1bef681000)
	libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x00007f1bef47d000)
	libresolv.so.2 => /lib64/libresolv.so.2 (0x00007f1bef264000)
	libsasl2.so.3 => /lib64/libsasl2.so.3 (0x00007f1bef047000)
	libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f1beee1f000)
	libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007f1beebe9000)
	libpcre.so.1 => /lib64/libpcre.so.1 (0x00007f1bee976000)
	libfreebl3.so => /lib64/libfreebl3.so (0x00007f1bee773000)

libcrypto.so.1.0.0 => not found. This package is already installed. Do you have any idea?

@RomanHargrave
Copy link
Member

RomanHargrave commented Sep 6, 2017

@Kazenin

This package is already installed. Do you have any idea?

Make sure you have the 64-bit version installed, and then make sure that that package actually provides that file. Run ldconfig (as root) and check that the file shows up.

You either have a newer or older version, and thus an incompatible libcrypto, or your ld and library path is mismanaged/misconfigured.

@Kazenin
Copy link

Kazenin commented Sep 7, 2017

@dribbleondo Do you have the source code and compile instructions? the pre built did not work for me. Thank you so much

@dribbleondo
Copy link
Contributor Author

I should've clarified @Kazenin ,the loader is completely unchanged from BLT4L P1. the only thing that has changed is the files and folders within the "mods" folder. If you already have a working loader that you have compiled, then give that a go.

@hellow554
Copy link

hellow554 commented Sep 7, 2017

How does this differ from the original lua scripts?
Okay, it only differs by the GetModImage function. My solution should be "the better one", because it makes it possible for me to show up the BLT Mod Menu.

Also: i do occur a strange error, because you commented out the GetModImage function completly. I managed to get it working by just returning nil

base/req/BLTMod.lua

function BLTMod:GetModImage()
    return nil
end

@dribbleondo
Copy link
Contributor Author

I didn't think of that. I'll update my version to 2.2.2 later. @RomanHargrave I'd make a new prebuilt download (or nick the one I've made here) as some mods, once updated to be BLT 2 compatible, don't work at all on BLT 2 p1 or below.

@RomanHargrave
Copy link
Member

@dribbleondo I'll run off a new set of prebuilts

@punkkeks BLT lua should be able to detect if its running with BLT4L because we have a version API. I need to let James know that so that we can at least get some compatibility

@hellow554
Copy link

hellow554 commented Sep 7, 2017

awesome, thank you ❤️

@dribbleondo
Copy link
Contributor Author

Cheers @RomanHargrave . You da best.

@RomanHargrave
Copy link
Member

@dribbleondo @punkkeks @Kazenin

Just to satisfy my curiosity, what distros do you guys use?

@hellow554
Copy link

Arch Linux

@dribbleondo
Copy link
Contributor Author

Linux Mint 18.2.

@RomanHargrave
Copy link
Member

RomanHargrave commented Sep 7, 2017

@dribbleondo @punkkeks @Kazenin @BangL @ZNixian @Ozymandias117 @leonardkoenig @blt4linux/website @blt4linux/developers

I created a distro (mainly) survey: https://goo.gl/forms/7lxv8PBWpbiEyQUg1

It's also linked in the repo description.

@Kazenin
Copy link

Kazenin commented Sep 8, 2017

@RomanHargrave thanks for newer version. I compiled here and works great. But, some mods does not work yet. See the list:

1 - Assault survived
2 - Assault states
3 - Nepgearsy HUD

and other BLT 2.x version mods.

@RomanHargrave
Copy link
Member

Do you know why they don't work?

@RomanHargrave
Copy link
Member

@Kazenin
Copy link

Kazenin commented Sep 8, 2017

I don`t know but, all mods are detected by BLT and in game these mods does not work. the developer told me that it gave compatibility to version 2 of the BLT. So I believe this is the problem.

@RomanHargrave
Copy link
Member

Are you using version 2 of the BLT base?

@Kazenin
Copy link

Kazenin commented Sep 9, 2017

the base folder ?

@Kazenin
Copy link

Kazenin commented Sep 9, 2017

If I use the base folder from the newer version the "mod options" not appears

@BangL
Copy link
Collaborator

BangL commented Sep 9, 2017

using the old base folder is not an option at all, the new blt needs the new one.

for more info about the mod options, see this: JamesWilko/Payday-2-BLT#140

@Kazenin
Copy link

Kazenin commented Sep 9, 2017

Nice. I created new save files and all works correctly, except mods with xml config files. Thank you

@ZNixian
Copy link
Member

ZNixian commented Sep 15, 2017

I've fixed it - it was a case of 1 vs -1.

However, Lua crashes if I return false for seemingly unrealated reasons. Looking into it.

About a built-in SystemFS:
I'll disable BLT4L's SystemFS, and see if a default one exists.

@ZNixian
Copy link
Member

ZNixian commented Sep 15, 2017

Okay, conclusion about systemfs:

lua_call: error in lua_pcall: mods/Testing/main.lua:1: attempt to index global 'SystemFS' (a nil value)

@BangL
Copy link
Collaborator

BangL commented Sep 15, 2017

alright. good to be sure though

@BangL
Copy link
Collaborator

BangL commented Sep 15, 2017

oh and here is a screen of my previous logs, which lead me to the conclusion that its reversed:
https://i.imgur.com/8vUg0Rq.png

"Maps" and the both config.xml files existed, while the version.txt did not.
exists() reported the opposite in all 4 cases though. not always the same.

so my latest tests on my root path have been blocked to to fs permissions, i guess.

@ZNixian
Copy link
Member

ZNixian commented Sep 15, 2017

Huh, that's... odd.

Are you sure you said SystemFS:exists not SystemFS.exists in your patch-thing?

@BangL
Copy link
Collaborator

BangL commented Sep 15, 2017

in the log i called :exists which returned false when it was true and true when it was false.
in my patch-mod i store the function in a local, using .exists though, cause thats how you do it in lua.
dont let lua's weird way of function calls confuse you.

when you define a function like this: class:func(param1, param2) , it actually expects 3 params, while the first one is the instance of the class.
you can then call it either instance:func(param1, param2) OR class.func(instance, param1, param2) while .func is an independent function.

@BangL
Copy link
Collaborator

BangL commented Sep 15, 2017

but now as you say it, ..my 'fix' actually contains a bug indeed, i need to pass 'self' to 'real_exists()'
however, the tests i posted have all been done without my fix-mod

@ZNixian
Copy link
Member

ZNixian commented Sep 15, 2017

In regards to arguments, Lua puts them on a stack like this:

(self, ) arg1, arg2, arg3, arg4, etc
 1       2     3     4     5    < possible positive indexes
-5      -4    -3    -2    -1    < possible negative indexes

When you want to get one of your arguments, you can either use a positive number, to count forwards from the first argument (or self - obviously no difference) or a negative number to count backwards.

BLT was using 1 - which is the first argument. This only works if you call it as SystemFS.exists - what it should have been using is -1, as that works both ways - the filename is always the last argument.

@BangL
Copy link
Collaborator

BangL commented Sep 15, 2017

right. i would rather take 2 though. you can be pretty sure everybody whos using SystemFS will call it using : cause thats how we have to do on windows as well. -1 would just lead into weird acting when someone puts too much params.
also take in account that there will follow implementations with more than one param, like rename_file, copy_file and so on

@BangL
Copy link
Collaborator

BangL commented Sep 15, 2017

ah but now i understand.. exists was handling the args as if it was called by . like on the file class. i see.

@ZNixian
Copy link
Member

ZNixian commented Sep 15, 2017

Also, I found the solution to one of my other problems. Whenever I was returning the correct value, my game continued loading and crashed to desktop. Now I know it was Steam's fault, not BLT, it simplified stuff quite a bit.

@ZNixian
Copy link
Member

ZNixian commented Sep 15, 2017

I can probably use some assert system to error out if someone passes the wrong number of args.

@BangL
Copy link
Collaborator

BangL commented Sep 15, 2017

as of my understanding of lua, the cleanest way would be to take arg 2 and ignore any other. if those functions would be defined in lua, it would not care about too much args as well.

@ZNixian
Copy link
Member

ZNixian commented Sep 15, 2017

Most of the C functions I've seen from Lua itself tend to error when they get the wrong params.

@ZNixian
Copy link
Member

ZNixian commented Sep 15, 2017

Also blindly taking 2 args will probably crash to desktop if the user misses it or uses . - and it wouldn't show up in the logs, so it could be very hard to debug.

@BangL
Copy link
Collaborator

BangL commented Sep 15, 2017

you can see it like this: the functions defined on 'io' and 'file' are completely static, while overkills SystemFS implementation is not having any static function, and always expects the own instance as first arg. since you implement it static, you just have to ignore the first argument.

@BangL
Copy link
Collaborator

BangL commented Sep 15, 2017

you can be pretty sure no one will ever call a SystemFS function using ., since the windows binary doesnt allow us to. all existing codes ive seen use :,

@ZNixian
Copy link
Member

ZNixian commented Sep 15, 2017

Just ignoring the first arg while checking the number/type of arguments seems reasonable.

@ZNixian
Copy link
Member

ZNixian commented Sep 15, 2017

Come to think of it, this should probably have been a seperate issue. Almost about to make a PR.

@BangL
Copy link
Collaborator

BangL commented Sep 15, 2017

indeed, but one thing lead to another.
btw: updated my 'linux io compat' mod, link is the same. now it just passes the path arg as the first one, instead of negating the return value. that way we have a proper fix until your PR gets official.

@BangL
Copy link
Collaborator

BangL commented Sep 15, 2017

great, so the io stuff is kinda solved as well. now were just missing file.DirectoryHash, file.FileHash and DB:create_entry :)

@ZNixian
Copy link
Member

ZNixian commented Sep 15, 2017

What do file.DirectoryHash and file.FileHash do (hashing, if so what type)? It's getting kinda late local time, but if you could open an issue with the details in I'll probably be able to implement them tomorrow.

@BangL
Copy link
Collaborator

BangL commented Sep 15, 2017

will do..

@RomanHargrave RomanHargrave added lua-api Relating to the lua API exposed by BLT base-mod Having to do with the actual BLT lua base mod labels Sep 15, 2017
@RomanHargrave
Copy link
Member

See Also: #85 #87

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
base-mod Having to do with the actual BLT lua base mod lua-api Relating to the lua API exposed by BLT
Projects
None yet
Development

No branches or pull requests

7 participants