Author Topic: Can't run script from another script [Linux]  (Read 1546 times)

0 Members and 1 Guest are viewing this topic.

Offline mrhx

  • Major(1)
  • Posts: 3
Can't run script from another script [Linux]
« on: March 20, 2016, 11:14:33 am »
I'm trying to run script fake.pas that uses procedure from TestScript.pas and TestScript.pas uses procedure from BaseScript.pas, all files in the same folder.
Windows starts it without problems but on Linux (Debian) server doesn't see TestScript unit.
Did I miss something? For example some 'SearchPath' that I need to set additionally on Linux.

config.ini
Code: [Select]
[Config]
Name = TestScript
MainFile = fake.pas
Sandboxed = 1
Debug = 1

[SearchPaths]

[Defines]

fake.pas
Code: [Select]
uses TestScript;
begin
Run();
end.

TestScript.pas
Code: [Select]
unit TestScript;
interface
uses BaseScript; {BaseScript.pas}
procedure Run();
implementation

procedure TestProcedure();
begin
WriteLn(Script.Name+' - procedure TestProcedure');
end;

procedure Run();
begin
TestProcedure(); {TestScript.pas}
BaseProcedure(); {BaseScript.pas}
end;

finalization
end.

BaseScript.pas
Code: [Select]
unit BaseScript;
interface
implementation

procedure BaseProcedure();
begin
WriteLn(Script.Name+' - procedure BaseProcedure');
end;

finalization
end.


Linux log
Code: [Select]
Welcome to Soldat 1.7.0
 Server name: Test
 Server PID: 23163
 [*] Preparing scripts to be launched
 [*] [TestScript] Compilation started
 [*] [TestScript] [Error] (1:6): Unit 'TestScript' not found or contains errors
 [*] [TestScript] Compilation failed
 [*] Disabling TestScript
 [*] Done
----------------------------------------------------------------
New Soldat Map
Loaded weapons mod "Mod v0.0.0"
Survival Mode ON
 Server IP: 0.0.0.0 Port: 23083
 Connection for file server started. Port: 23093

Windows log
Code: [Select]
Welcome to Soldat 1.7.0
 Server name: Test
 Server PID: 4852
 [*] Preparing scripts to be launched
 [*] [TestScript] Compilation started
 [*] [TestScript] Compilation complete
 [*] [TestScript] Loading bytecode
 [*] [TestScript] Bytecode loaded
 [*] Done
----------------------------------------------------------------
TestScript - procedure TestProcedure
TestScript - procedure BaseProcedure
New Soldat Map
Loaded weapons mod "Mod v0.0.0"
Survival Mode ON
 Server IP: 0.0.0.0 Port: 23083
 Connection for file server started. Port: 23093

Offline Falcon`

  • Flagrunner
  • ****
  • Posts: 792
  • A wanted lagger
Re: Can't run script from another script [Linux]
« Reply #1 on: March 20, 2016, 01:40:56 pm »
Unit files should be all lower case. Works on windows as NTFS is case insensiive. Rename TestScript.pas to testscript.pas and BaseScript.pas to basescript.pas and you're good to go.
« Last Edit: March 20, 2016, 01:42:43 pm by FalconPL »
If you're not paying for something, you're not the customer; you're the product being sold.
- Andrew Lewis

Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.

Offline mrhx

  • Major(1)
  • Posts: 3
Re: Can't run script from another script [Linux]
« Reply #2 on: March 20, 2016, 04:35:42 pm »
Thanks for fast answer. I knew it that had to be something simple.
« Last Edit: March 20, 2016, 04:41:51 pm by mrhx »