MattJeanes / PewPew

Divran's old GCombat remake now up to date for Garry's Mod 13.
7 stars 9 forks source link

Issue with PewPew on Linux #39

Closed ApertureDevelopment closed 7 years ago

ApertureDevelopment commented 7 years ago

Hello,

I wanted to tell you that PewPew has some issues on Linux beacuse it is case sensitive on file and folder names.

You need need to rename all folder names to lower case, because otherwise file.Find("pewpewplugins/server/*.lua", "LUA") would not find the folder "PewPewPlugins" with mixed casing.

MattJeanes commented 7 years ago

Yeah, that's very true - I've already made this fix for the rest of my addons but apparently missed this one, I'll see if I can get that fix done for you.

MattJeanes commented 7 years ago

Okay, there are some things still mixed case but it hopefully should work now, can you give it a go? I've only updated the GitHub version currently, workshop has not been updated yet.

ApertureDevelopment commented 7 years ago

We have still some problems .. strangely when you reload the autorun file after the server loaded it works

ApertureDevelopment commented 7 years ago

We found the mistake. spacecombat addon overrides the whole gcombat table, but does not define each function....

MattJeanes commented 7 years ago

Ah okay, so is it all ok and good to push to workshop you reckon?

ApertureDevelopment commented 7 years ago

Yes, thank you for the fix :D

MattJeanes commented 7 years ago

Cool, no problem, I'll close this when I deploy to workshop

X-Coder commented 7 years ago

Can you please wait a day or so before you push it to workshop? I need to check something together with captain1242 first, it could be broken or just a server side restriction.

MattJeanes commented 7 years ago

Sure no problem

On 28 Mar 2017 01:36, "X-Coder" notifications@github.com wrote:

Can you please wait a day or so before you push it to workshop? I need to check something together with captain242 first, it could be broken or just a server side restriction.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/MattJeanes/PewPew/issues/39#issuecomment-289627209, or mute the thread https://github.com/notifications/unsubscribe-auth/ACQQ-p7DQYOIGqGf7xwnJGEVCwibLv9gks5rqFYpgaJpZM4Mpjq4 .

tidusjar commented 7 years ago

still broken. Please fix now

MattJeanes commented 7 years ago

@tidusjar please refrain from bullying me on GitHub 😢

X-Coder commented 7 years ago

It wasn't a restriction issue. I currently can't test it, but I think the commits did break something because the list of weapons is empty now in the tool menu.

MattJeanes commented 7 years ago

What platform is it broken on?

X-Coder commented 7 years ago

Linux, didn't tested it on Windows yet. Maybe I have today some time to test why its not working.

X-Coder commented 7 years ago

Ok, got some time for testing. Tested it now on my own dedicated server, same problem.

Windows: works Linux-git on case sensitive filesystem: After git clone, it does completely not load addon because garrysmod won't detect the folder. It is because main folder name contains uppercase letters (addons/)"PewPew" after cloning -> so I renamed it to "pewpew" after cloning and it shows up. For workshop version I have no idea if this matters.

But the list of weapons is empty on my dedicated linux server here too. I guess the latest commits did break this.

Now I'm digging through lua code, maybe I can find whats causing it.

MattJeanes commented 7 years ago

Okay thanks, appreciate it. Don't have a linux box at the moment so difficult to test. The addon folder name shouldn't be affected from workshop

X-Coder commented 7 years ago

Garry's file.Find behaves strange in linux. I tested it below with different combinations. As long the parent folder name contains upper case letters, it won't return any lua files inside the folder, but it lists folder names containing upper case. The Nebelwerfer.lua works, even if it contains upper case.

For testing I renamed Official_Weapons, Artilleries, Rockets to lower case:

// Linux folder tree
addons/pewpew/lua/pewpewbullets$ tree official_weapons
official_weapons
├── Admin_Only
│   ├── bombnuke.lua
│   ├── cannonnuke.lua
│   ├── lasernuke.lua
│   ├── missilenuke.lua
│   └── wtfboom.lua
├── artilleries
│   ├── basicartillery.lua
│   ├── lowvelocityartillery.lua
│   ├── modifiable_arty.lua
│   ├── Nebelwerfer.lua
│   └── rocketbarrage.lua
├── Bombs_and_Explosives
│   ├── bomb_rack.lua
│   ├── c4.lua
│   ├── carpet_bomber.lua
│   ├── empbomb.lua
│   ├── Helicopter_Bomb.lua
│   └── Warhead.lua
├── Cannons
│   ├── 105mm.lua
│   ├── 230mm.lua
│   ├── 37mm.lua
│   ├── 40mm.lua
│   ├── basiccannon.lua
│   ├── empcannon.lua
│   ├── Flak_cannon.lua
│   ├── lowvelocitycannon.lua
│   ├── plasma_bomb.lua
│   └── railgun.lua
├── Close_Combat
│   ├── fist.lua
│   ├── flamethrower.lua
│   └── Laser_sword.lua
├── Defense
│   ├── areaheal.lua
│   ├── autodefense.lua
│   └── manualdefense.lua
├── Fun
│   ├── firework.lua
│   └── waterballoon.lua
├── Lasers
│   ├── basiclaser.lua
│   ├── beamlaser.lua
│   ├── Deathray.lua
│   ├── LaserMachinegun.lua
│   ├── MediumLaser.lua
│   ├── ParticleBeam.lua
│   ├── rapidfire_laser.lua
│   ├── starwars_biglaser.lua
│   ├── starwars_greenlaser.lua
│   └── starwars_redlaser.lua
├── Launchers_and_Spawners
│   ├── c4spawner.lua
│   ├── grenadelauncher.lua
│   └── smokegrenadelauncher.lua
├── Machineguns
│   ├── 100cal_explosive_round.lua
│   ├── 50cal.lua
│   ├── basicmachinegun.lua
│   ├── burstmachinegun.lua
│   ├── gaussgun.lua
│   └── minigun.lua
├── Naval
│   ├── depth_charge.lua
│   ├── naval_mine.lua
│   ├── naval_mine_spawner.lua
│   └── torpedo.lua
├── Other
│   ├── DelayedStickyBombLauncher.lua
│   ├── flameshell.lua
│   ├── smokeemitter.lua
│   ├── thud.lua
│   └── unrealrailgun.lua
├── Realistic_Weapons
│   ├── 120mm_armor_piercing.lua
│   ├── 120mm_high_explosive.lua
│   ├── 2A42.lua
│   ├── M134D.lua
│   └── M60C.lua
└── rockets
    ├── airtoground.lua
    ├── basicmissile.lua
    ├── homingmissile.lua
    ├── qaammissile.lua
    ├── rocketbattery.lua
    └── surfacetoair.lua
--WORKS list directory names:
lua_run local entries,directories = file.Find( "pewpewbullets/official_weapons/*", "LUA") PrintTable(directories)
> local entries,directories = file.Find( "pewpewbullets/official_weapons/*", "LUA") PrintTable(directories)...
1       =       Admin_Only
2       =       Bombs_and_Explosives
3       =       Cannons
4       =       Close_Combat
5       =       Defense
6       =       Fun
7       =       Lasers
8       =       Launchers_and_Spawners
9       =       Machineguns
10      =       Naval
11      =       Other
12      =       Realistic_Weapons
13      =       artilleries
14      =       rockets

--WORKS on lower case folder 'artilleries':
lua_run local entries,directories = file.Find( "pewpewbullets/official_weapons/artilleries/*", "LUA") PrintTable(entries)
> local entries,directories = file.Find( "pewpewbullets/official_weapons/artilleries/*", "LUA") PrintTable(entries)...
1       =       Nebelwerfer.lua
2       =       basicartillery.lua
3       =       lowvelocityartillery.lua
4       =       modifiable_arty.lua
5       =       rocketbarrage.lua

--DOESN'T WORK lists no lua files when folder name contains upper case letters
lua_run local entries,directories = file.Find( "pewpewbullets/official_weapons/Admin_Only/*", "LUA") PrintTable(entries)
> local entries,directories = file.Find( "pewpewbullets/official_weapons/Admin_Only/*", "LUA") PrintTable(entries)...
MattJeanes commented 7 years ago

Okay, so I just need to make everything lowercase. That's fine, but it just means folder names will be lowercase in the UI as well which I think is fine anyway. Appreciate your investigation, I'll get these changes done soon unless you have any extra thoughts?

X-Coder commented 7 years ago

I just don't know if renaming the models/materials would have side effects, like not working textures on models, because models contain hard-coded material paths, or what happens with already stored advanced duplicator 2 files. The later might be only a problem if the client is not using windows.

X-Coder commented 7 years ago

Question: does every official_model use the same model? -Or did I mess something up?

MattJeanes commented 7 years ago

Sorry I just meant in the lua folder, do the models and materials work on linux with the mixed case?

X-Coder commented 7 years ago

I think just the lua folder is ok, the starwars laser model is being used even if the folder names contains upper case.

I can make a pull request shortly.

X-Coder commented 7 years ago

I failed on the first commit, and replaced it with fixed one. So 4b0b868 is ready in the pull request. Also I didn't a temporary rename like you had to do in windows.

MattJeanes commented 7 years ago

Just checked it on Windows, looks good so I've pushed it to Steam Workshop now, again thanks for contributing, appreciate it.