Author Topic: Script on SC3 crashes after join 6th player  (Read 1699 times)

0 Members and 1 Guest are viewing this topic.

Offline kicikici

  • Soldier
  • **
  • Posts: 180
Script on SC3 crashes after join 6th player
« on: September 26, 2013, 08:24:05 am »
Hi,
I have a problem because my script crashes after join to game 6th player.
Script:
Code: [Select]
function MyOnCommand(Player: TActivePlayer; Command: string): Boolean;
begin
if Command = '/crash' then begin
Players[Player.ID].WriteConsole('Crash in progress...',$fefefe);
end;
end;
 
var
  i: Byte;
begin
  for i:=1 to 32 do begin
Players[i].OnCommand := @MyOnCommand;
end;
end.


Error:
Code: [Select]
(15:16:40)  [*] [scriptcore3] Unhandled exception occured:
(15:16:40)  [*] [scriptcore3] Wrong parameter
(15:16:40)  [*] Disabling scriptcore3

Any ideas?
Classic banana

Offline Falcon`

  • Flagrunner
  • ****
  • Posts: 792
  • A wanted lagger
Re: Script on SC3 crashes after join 6th player
« Reply #1 on: September 26, 2013, 09:46:36 am »
I've heard about this bug, not sure if it's on bugtracker yet. Didn't yet try to trace it.
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 Shoozza

  • Retired Soldat Developer
  • Veteran
  • ******
  • Posts: 1632
  • Soldat's Babysitter
    • Website
Re: Script on SC3 crashes after join 6th player
« Reply #2 on: September 26, 2013, 10:19:34 am »
There was a bug which crashed the server on map download, it didn't have anything to do with scripting.
Please try the 1.6.6rc1 version to see if my fix also solved your issues.

But from the looks it seems like an unrelated issue.
Rules
Tools: ARSSE - SARS - SRB - chatMod

Offline kicikici

  • Soldier
  • **
  • Posts: 180
Re: Script on SC3 crashes after join 6th player
« Reply #3 on: September 26, 2013, 11:25:16 am »
Crashes still occur on 1.6.6rc1.
Quote
There was a bug which crashed the server on map download
I am sure this bug isn't related with download a map. This issue is very well known for me because I am owner of climb server (10-15 crashes per day is really embarrased).

Btw, I am very surpised that no one from staff of SNI Pro Climb server didn't report this case. They knew about this because they limited slots for players for 2? months to 5.
Classic banana

Offline Falcon`

  • Flagrunner
  • ****
  • Posts: 792
  • A wanted lagger
Re: Script on SC3 crashes after join 6th player
« Reply #4 on: September 26, 2013, 11:56:34 am »
I'm sorry, i didn't do a single commit since 1.6.5. This issue just can't be fixed yet.
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 Bistoufly

  • Soldat Beta Team
  • Flagrunner
  • ******
  • Posts: 782
Re: Script on SC3 crashes after join 6th player
« Reply #5 on: September 26, 2013, 11:57:33 am »
Btw, I am very surpised that no one from staff of SNI Pro Climb server didn't report this case. They knew about this because they limited slots for players for 2? months to 5.
Hello kicikici,

You're right, we have the same issue. Therefore we limited maxplayers to 5 on SNI Pro Climb EU and ! Epic.Climb.

I didn't report the issue myself. I'm not a scripter and I wouldn't want to make an inexact description of the bug.

Could someone please report it to the tracker?
 

Offline Mighty

  • Camper
  • ***
  • Posts: 276
Re: Script on SC3 crashes after join 6th player
« Reply #6 on: September 27, 2013, 04:22:49 pm »
I was also told that this code's behavior is dependant on number of players on the server (even though it's not supposed to be) . and as long as there were 3-4 people it worked fine and stopped working when more people joined. Not sure if it crashes etc, that's really all I know.
xFire: macmil        e-mail: macekmil@gmail.com
My scripts: Accuracy Script       Flashbang       Punishments GUID
            CatchMe Gamemod       AntiFake
            CW System             AntiFakeGUID

Offline kicikici

  • Soldier
  • **
  • Posts: 180
Re: Script on SC3 crashes after join 6th player
« Reply #7 on: October 27, 2013, 01:35:36 pm »
Still not fixed in 1.6.6. I hope so that devs realize that SC3 is almost completely useless now.
Classic banana

Offline Falcon`

  • Flagrunner
  • ****
  • Posts: 792
  • A wanted lagger
Re: Script on SC3 crashes after join 6th player
« Reply #8 on: October 27, 2013, 04:09:10 pm »
I know. I've mentioned somewhere that i didn't touch a code since 1.6.5 was released so there's no chance that's fixed since i'm the only one working on scriptcore. I'll try to find some time to do it before next version.
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 rOy

  • Soldier
  • **
  • Posts: 120
Re: Script on SC3 crashes after join 6th player
« Reply #9 on: October 27, 2013, 04:24:12 pm »
Code: [Select]
function MyOnCommand(Player: TActivePlayer; Command: string): Boolean;
var
i: byte;

begin
if Command = '/crash' then begin
end Players[Player.ID].WriteConsole('Crash in progress...',$fefefe);
end else
for i:=1 to 32 do begin
Players[i].OnCommand := @MyOnCommand;
end
    end
end;

Write,without looking :D

Offline kicikici

  • Soldier
  • **
  • Posts: 180
Re: Script on SC3 crashes after join 6th player
« Reply #10 on: December 04, 2013, 08:02:16 am »
I made some tests because I noticed that console log provides more information after crash:

- when we enable script first time, we got compile log like this:

Code: [Select]
[*] [scriptcore3] Compilation started
[*] [scriptcore3] [Hint] main.pas(2:10): Variable 'Result' never used
[*] [scriptcore3] Compilation complete
[*] [scriptcore3] Loading bytecode
[*] [scriptcore3] Bytecode loaded

and when crash occurs, we get these information:

Code: [Select]
Server Encountered an error:
Privileged instruction

- when we enable script second/third/.. times, we got compile log like this:

Code: [Select]
[*] [scriptcore3] Loading bytecode
[*] [scriptcore3] Bytecode loaded

(I suppose that compilation isn't needed because compiled code is remebered).

and now we have another crash log:

Code: [Select]
Server Encountered an error:
Access violation

I don't know it will be helpful but I want to share this.
Classic banana

Offline Bistoufly

  • Soldat Beta Team
  • Flagrunner
  • ******
  • Posts: 782
Re: Script on SC3 crashes after join 6th player
« Reply #11 on: December 04, 2013, 09:51:34 am »
Reported in mantis by kicikici:  http://bugs.soldat.pl/view.php?id=470