Code Monkey home page Code Monkey logo

Comments (17)

Zeex avatar Zeex commented on August 29, 2024

I suppose this has something to do either with [multi-dimensional] arrays or this. Do you have an example?

from compiler.

PT-Player avatar PT-Player commented on August 29, 2024

Well take an look ( i traslated the text for you understand )

http://pastebin.com/rDUxeJN3

Only happens with Dialog_ShowCallback not with Dialog_Show that's why i think is something with y_inline.

from compiler.

Zeex avatar Zeex commented on August 29, 2024

Sorry, by example I meant something that would reprodce this, not a piece of your code. I tried this the code that you posted but it didn't give any y_inline errors at runtime.

Also I think we should summon @Y-Less here, he knows better about YSI / y_inline.

from compiler.

PT-Player avatar PT-Player commented on August 29, 2024

I hope Y_Less say something here...

Well loking on include the problem looks something with script init see:

https://github.com/Y-Less/YSI-Includes/blob/master/y_inline.inc#L475

from compiler.

Y-Less avatar Y-Less commented on August 29, 2024

I think we should summon @Y-Less

So summoned!

Short answer: I don't know sorry - I need to get some time to look in to this (probably tomorrow since I'm working and teaching today) (OK, that answer wasn't so short - I think I have a physical aversion to brevity...)

Long answer: YSI 3's y_inline works by searching through the AMX for certain patterns, aided by a load of unique parameters VASTLY reducing the chance of a random match. This pattern is quite compiler and settings dependent (it isn't a good way to do it really, hence 4.0's method), so subtle compiler changes can result in subtly different assembly being generated and so break the scanner.

from compiler.

oscar-broman avatar oscar-broman commented on August 29, 2024

Try compiling with the following flags, one of them might work:

-d0 -O0
-d1 -O0
-d2 -O0
-d0 -O1
-d1 -O1
-d2 -O1

So you'll have to compile and try it 6 times.

The following works for me with the latest version and YSI 3: -d2 -O0

from compiler.

Y-Less avatar Y-Less commented on August 29, 2024

I've used this script in the past:

@echo off

set FNAME=%~p1%~n1
set FLAGS=-a -;+ -(+

call :compile ""
call :compile "-O0"
call :compile "-O1"
REM call :compile "-O2"
call :compile "-d0"
call :compile "-d0 -O0"
call :compile "-d0 -O1"
REM call :compile "-d0 -O2"
call :compile "-d1"
call :compile "-d1 -O0"
call :compile "-d1 -O1"
REM call :compile "-d1 -O2"
call :compile "-d2"
call :compile "-d2 -O0"
call :compile "-d2 -O1"
REM call :compile "-d2 -O2"
call :compile "-d3"
call :compile "-d3 -O0"
call :compile "-d3 -O1"
REM call :compile "-d3 -O2"

goto :EOF

:compile
set VFLAGS=%~1
echo pawncc "%FNAME%.pwn" %FLAGS% %VFLAGS% -o"%FNAME% %VFLAGS%"
pawncc "%FNAME%.pwn" %FLAGS% %VFLAGS% -o"%FNAME% %VFLAGS%"
goto :EOF

Usage:

build "..\gamemodes\myscript.pwn"

(maybe without the ".pwn").

The YSI 4.0 test script (that I should maybe use on 3.1 at some point) is:

@echo off

set MODE=YSI_TEST

set BLANK=

call :main
goto :eof

:main
    rem Move the original somewhere safe
    move /Y server.cfg server_real.cfg > nul
    move /Y server_log.txt server_real.txt > nul

    rem Old compiler
    echo.
    echo ********************
    echo ********************
    echo ********************
    echo ***              ***
    echo *** OLD COMPILER ***
    echo ***              ***
    echo ********************
    echo ********************
    echo ********************
    echo.
    call :switch_old
    call :all_builds

    rem New compiler
    echo.
    echo ********************
    echo ********************
    echo ********************
    echo ***              ***
    echo *** NEW COMPILER ***
    echo ***              ***
    echo ********************
    echo ********************
    echo ********************
    echo.
    call :switch_new
    call :all_builds

    rem Store our new server_log.txt file.
    if exist "server_log.txt" (
        move /Y server_log.txt ysi_log.txt > nul
    )

    rem Get the original settings back
    move /Y server_real.cfg server.cfg > nul
    move /Y server_real.txt server_log.txt > nul

    REM del compile_flags.txt

    goto :eof

:all_builds
    rem All the build modes we want to test under for the current compiler
    call :mode "_0000" "GTYPE=0 MTYPE=0 -d0 -O0"
    call :mode "_0010" "GTYPE=0 MTYPE=0 -d1 -O0"
    call :mode "_0020" "GTYPE=0 MTYPE=0 -d2 -O0"
    call :mode "_0100" "GTYPE=0 MTYPE=1 -d0 -O0"
    call :mode "_0110" "GTYPE=0 MTYPE=1 -d1 -O0"
    call :mode "_0120" "GTYPE=0 MTYPE=1 -d2 -O0"
    call :mode "_0200" "GTYPE=0 MTYPE=2 -d0 -O0"
    call :mode "_0210" "GTYPE=0 MTYPE=2 -d1 -O0"
    call :mode "_0220" "GTYPE=0 MTYPE=2 -d2 -O0"
    call :mode "_1000" "GTYPE=1 MTYPE=0 -d0 -O0"
    call :mode "_1010" "GTYPE=1 MTYPE=0 -d1 -O0"
    call :mode "_1020" "GTYPE=1 MTYPE=0 -d2 -O0"
    call :mode "_1100" "GTYPE=1 MTYPE=1 -d0 -O0"
    call :mode "_1110" "GTYPE=1 MTYPE=1 -d1 -O0"
    call :mode "_1120" "GTYPE=1 MTYPE=1 -d2 -O0"
    call :mode "_1200" "GTYPE=1 MTYPE=2 -d0 -O0"
    call :mode "_1210" "GTYPE=1 MTYPE=2 -d1 -O0"
    call :mode "_1220" "GTYPE=1 MTYPE=2 -d2 -O0"
    call :mode "_2000" "GTYPE=2 MTYPE=0 -d0 -O0"
    call :mode "_2010" "GTYPE=2 MTYPE=0 -d1 -O0"
    call :mode "_2020" "GTYPE=2 MTYPE=0 -d2 -O0"
    call :mode "_2100" "GTYPE=2 MTYPE=1 -d0 -O0"
    call :mode "_2110" "GTYPE=2 MTYPE=1 -d1 -O0"
    call :mode "_2120" "GTYPE=2 MTYPE=1 -d2 -O0"
    call :mode "_2200" "GTYPE=2 MTYPE=2 -d0 -O0"
    call :mode "_2210" "GTYPE=2 MTYPE=2 -d1 -O0"
    call :mode "_2220" "GTYPE=2 MTYPE=2 -d2 -O0"
    call :mode "_0001" "GTYPE=0 MTYPE=0 -d0 -O1"
    call :mode "_0011" "GTYPE=0 MTYPE=0 -d1 -O1"
    call :mode "_0021" "GTYPE=0 MTYPE=0 -d2 -O1"
    call :mode "_0101" "GTYPE=0 MTYPE=1 -d0 -O1"
    call :mode "_0111" "GTYPE=0 MTYPE=1 -d1 -O1"
    call :mode "_0121" "GTYPE=0 MTYPE=1 -d2 -O1"
    call :mode "_0201" "GTYPE=0 MTYPE=2 -d0 -O1"
    call :mode "_0211" "GTYPE=0 MTYPE=2 -d1 -O1"
    call :mode "_0221" "GTYPE=0 MTYPE=2 -d2 -O1"
    call :mode "_1001" "GTYPE=1 MTYPE=0 -d0 -O1"
    call :mode "_1011" "GTYPE=1 MTYPE=0 -d1 -O1"
    call :mode "_1021" "GTYPE=1 MTYPE=0 -d2 -O1"
    call :mode "_1101" "GTYPE=1 MTYPE=1 -d0 -O1"
    call :mode "_1111" "GTYPE=1 MTYPE=1 -d1 -O1"
    call :mode "_1121" "GTYPE=1 MTYPE=1 -d2 -O1"
    call :mode "_1201" "GTYPE=1 MTYPE=2 -d0 -O1"
    call :mode "_1211" "GTYPE=1 MTYPE=2 -d1 -O1"
    call :mode "_1221" "GTYPE=1 MTYPE=2 -d2 -O1"
    call :mode "_2001" "GTYPE=2 MTYPE=0 -d0 -O1"
    call :mode "_2011" "GTYPE=2 MTYPE=0 -d1 -O1"
    call :mode "_2021" "GTYPE=2 MTYPE=0 -d2 -O1"
    call :mode "_2101" "GTYPE=2 MTYPE=1 -d0 -O1"
    call :mode "_2111" "GTYPE=2 MTYPE=1 -d1 -O1"
    call :mode "_2121" "GTYPE=2 MTYPE=1 -d2 -O1"
    call :mode "_2201" "GTYPE=2 MTYPE=2 -d0 -O1"
    call :mode "_2211" "GTYPE=2 MTYPE=2 -d1 -O1"
    call :mode "_2221" "GTYPE=2 MTYPE=2 -d2 -O1"

    goto :eof

:mode
    call :build %1 %2
    call :setup %1
    call :run
    goto :eof

:build
    echo Testing flags: %2
    echo #define COMPILE_FLAGS %2 > compile_flags.txt
    pawno\pawncc.exe "gamemodes\%MODE%.pwn" -v0 -i"pawno\include" -;+ -(+ %~2 LIGHT_TEST_REPORT=true _DEBUG=0 TEST_AUTO_EXIT=true COMPILE_FLAGS=%2 -o"gamemodes\%MODE%%~1.amx"
    goto :eof

:setup
    rem Write the current test to the config file
    copy /A /Y server_test.cfg server.cfg > nul
    echo gamemode0 %MODE%%~1 1 >> server.cfg
    goto :eof

:run
    rem Run the server with the custom server.cfg - it closes itself after
    samp-server.exe
    goto :eof

:switch_new
    if exist "pawno\newpawncc.exe" (
        ren pawno\pawncc.exe oldpawncc.exe
        ren pawno\newpawncc.exe pawncc.exe
    )
    if exist "pawno\newpawnc.dll" (
        ren pawno\pawnc.dll oldpawnc.dll
        ren pawno\newpawnc.dll pawnc.dll
    )
    goto :eof

:switch_old
    if exist "pawno\oldpawncc.exe" (
        ren pawno\pawncc.exe newpawncc.exe
        ren pawno\oldpawncc.exe pawncc.exe
    )
    if exist "pawno\oldpawnc.dll" (
        ren pawno\pawnc.dll newpawnc.dll
        ren pawno\oldpawnc.dll pawnc.dll
    )
    goto :eof

from compiler.

Y-Less avatar Y-Less commented on August 29, 2024

Yes, the script can be simplified. And if you aren't testing YSI you can VASTLY reduce the number of compiler flags because many of them are for script specific settings such as MASTER type and y_groups inclusion order.

from compiler.

Y-Less avatar Y-Less commented on August 29, 2024

Also, I should have mentioned that you will need something like:

SendRconCommand("exit");

In your mode for this script to fully work and continue testing after starting the server (maybe I should look in to spawning each build/test in a separate parallel process).

from compiler.

PT-Player avatar PT-Player commented on August 29, 2024

Well @Y-Less i'm using -d3 because the crashdetect.

But with YSI 4.0 i have an big issue i think is an bug from y_inline on YSI 4.0.

I connect on server the server shows the dialog and works well, but connect an friend the server show the dialog but when he press 'OK' for connect the server dont gives any response on dialog....

from compiler.

Y-Less avatar Y-Less commented on August 29, 2024

Hmm, interesting. As I said, I can look in to these things tomorrow. Could you make an issue please for that?

from compiler.

PT-Player avatar PT-Player commented on August 29, 2024

Yes no problem done.

@ Edit

Sorry for close my bad wrong button.

from compiler.

Zeex avatar Zeex commented on August 29, 2024

@PT-Player Please see if this compiler works for you.

from compiler.

PT-Player avatar PT-Player commented on August 29, 2024

@Zeex well i tested and for now i dont have any problems it's all normal.

from compiler.

Y-Less avatar Y-Less commented on August 29, 2024

I have just found a bug in y_inline in YSI 4.0 with -O1 -d0 and certain function parameter combinations, which is slightly annoying.

from compiler.

Zeex avatar Zeex commented on August 29, 2024

@Y-Less Did you delete/hide/move YSI or something? Can't find it in your repos :O

from compiler.

PT-Player avatar PT-Player commented on August 29, 2024

@Zeex he deleted everything on sa-mp foruns and github.

from compiler.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.