Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - adaz

#31
Quote from: dreamerman on 2018-Feb-11
In short, there is no bug, that text is just encoded with chunks.

The strange thing is that it's a 4 year old script, and I did not touch it at all since then. It worked that time...

But thank you very much dreamerman, I'll check that!
#32
Hi,

My simple code works on Win32:
Code (glbasic) Select
SETCURRENTDIR("Media") // go to media files

SETSHOEBOX "1.sbx",""

LOADANIM "kockak.png",1,45,45

DRAWANIM 1,1,50,50

SHOWSCREEN
MOUSEWAIT



But LOADANIM command crashes on Android:

QuoteI/glbasic ( 9200): Extracting asset file:
F/libc    ( 9200): Fatal signal 11 (SIGSEGV) at 0x7fffffff (code=1), thread 9222 (SDLThread)
I/DEBUG   ( 1522): pid: 9200, tid: 9222, pkg name: com.company.title
I/DEBUG   ( 1522): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG   ( 1522): Build fingerprint: 'motorola/ghost_retasia/ghost:4.4.2/KOT49H/G900FXXU1ANCE:user/release-keys'
I/DEBUG   ( 1522): Revision: '0'
I/DEBUG   ( 1522): pid: 9200, tid: 9222, name: SDLThread  >>> com.company.title <<<
I/DEBUG   ( 1522): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 7fffffff
W/NativeCrashListener( 1698): Couldn't find ProcessRecord for pid 1885955130
I/DEBUG   ( 1522):     eax 7fffffff  ebx 18083260  ecx 00000001  edx 8956bd4f
I/DEBUG   ( 1522): AM write failure (32 / Broken pipe)
I/DEBUG   ( 1522):     esi 1a215030  edi 00000000
I/DEBUG   ( 1522):     xcs 00000073  xds 0000007b  xes 0000007b  xfs 00000043  xss 0000007b
I/DEBUG   ( 1522):     eip 8a47ab72  ebp 1a215000  esp 8966c744  flags 00210287
I/DEBUG   ( 1522):
I/DEBUG   ( 1522): backtrace:
I/DEBUG   ( 1522):     #00  pc 00076b72  /system/lib/lib3btrans.so (memcpy+3730)
I/DEBUG   ( 1522):
I/DEBUG   ( 1522): stack:
I/DEBUG   ( 1522):          8966c704  8a791a58
I/DEBUG   ( 1522):          8966c708  0000001c
I/DEBUG   ( 1522):          8966c70c  8966c71c  [stack:9222]
I/DEBUG   ( 1522):          8966c710  8a4b2fdd  /system/lib/lib3btrans.so
I/DEBUG   ( 1522):          8966c714  00000000
I/DEBUG   ( 1522):          8966c718  b76aa370  /system/lib/libc.so (free+32)
I/DEBUG   ( 1522):          8966c71c  8966c74c  [stack:9222]
I/DEBUG   ( 1522):          8966c720  8a58860c  /system/lib/lib3btrans.so
I/DEBUG   ( 1522):          8966c724  1453f924  /system/lib/arm/libc.so (strtol+544)
I/DEBUG   ( 1522):          8966c728  00000000
I/DEBUG   ( 1522):          8966c72c  1a215030  [stack:9212]
I/DEBUG   ( 1522):          8966c730  b76aa356  /system/lib/libc.so (free+6)
I/DEBUG   ( 1522):          8966c734  00000000
I/DEBUG   ( 1522):          8966c738  180163c6
I/DEBUG   ( 1522):          8966c73c  8a592706  /system/lib/lib3btrans.so
I/DEBUG   ( 1522):          8966c740  8a585227  /system/lib/lib3btrans.so
I/DEBUG   ( 1522):     #00  8966c744  1a215030  [stack:9212]
I/DEBUG   ( 1522):          8966c748  00000000
I/DEBUG   ( 1522):          8966c74c  18083260
I/DEBUG   ( 1522):          8966c750  18083291
I/DEBUG   ( 1522):          8966c754  8956bd4f
I/DEBUG   ( 1522):          8966c758  7fffffff
I/DEBUG   ( 1522):          8966c75c  00000001
I/DEBUG   ( 1522):          8966c760  8966c770  [stack:9222]
I/DEBUG   ( 1522):          8966c764  00000000
I/DEBUG   ( 1522):          8966c768  00000000
I/DEBUG   ( 1522):          8966c76c  00000000
I/DEBUG   ( 1522):          8966c770  8966c798  [stack:9222]
I/DEBUG   ( 1522):          8966c774  8966c760  [stack:9222]
I/DEBUG   ( 1522):          8966c778  8a5926dd  /system/lib/lib3btrans.so
I/DEBUG   ( 1522):          8966c77c  8966c988  [stack:9222]
I/DEBUG   ( 1522):          8966c780  00000000
I/DEBUG   ( 1522):
I/DEBUG   ( 1522): memory map around fault addr 7fffffff:
I/DEBUG   ( 1522):     1c260000-1c263000 rwx
I/DEBUG   ( 1522):     (no map for address)
I/DEBUG   ( 1522):     88a67000-88a89000 rwx
D

I attached the shoebox file, please rename it to .sbx!

I've already tried it with other images, png's, bmp's, jpg's, etc... Tried on real phones and on Bluestacks as well.
It is very important to me, because I'm now porting my iOS game to Android, and it uses a lot of shoeboxed data. It worked on iOS.

Thank you,
Adaz

GLBasic 15.089, latest AE, api-22
#33
Hi All!

Version:  15.089

NETWEBGET returns a strange prefix before the real string when I call my php from GLBasic.

You can test the php with a browser, and see the correct texts:
http://www.antirockgame.com/halloffame/score_script.php?gameid=1
or
http://www.antirockgame.com/halloffame/score_script.php?gameid=2

It's a highscore script that returns the players' names, scores and date based on gameid.

When I call it from GLBasic, there are an additional number and CR+LF before the string.
Please try it:

Code (glbasic) Select

GLOBAL halloffametemp$

halloffametemp$=NETWEBGET$("www.antirockgame.com","/halloffame/score_script.php?gameid=1",80,512)
PRINT halloffametemp$,0,120
halloffametemp$=NETWEBGET$("www.antirockgame.com","/halloffame/score_script.php?gameid=2",80,512)
PRINT halloffametemp$,0,140

SHOWSCREEN
MOUSEWAIT


I checked the db table with phpMyAdmin, and there are no "105" or "82" strings at all.

Testing with a web browser proves that the script WORKS as expected, only GLBasic returns this extra string. Why?

If you're interested, the query in the php is this:
Code (glbasic) Select

$query = "select * from scores where gameid='$gameid' order by score desc limit 10";



Thank you,
Adaz
#34
That's OK, but under Windows 10 the MOUSESTATE of the buttons are still wrong sometimes. There IS a bug, so these commands has to be tested on Windows 10 a lot more times.
#35
More information:
My app does not work even on Android, the command returns false positive reply on that platform as well.
Strange, but if I start the IDE with Win7 compatibility mode, the compiled executables work on both platform. But this is obviously not a resolution.
#36
Hi,


GETMOUSECOUNT  returns 32 on Win8 and Win10. When I run my exe with Win7 compatibility mode, it returns 1.
It slows down my program a lot when I check if all mouse buttons are released.

In some circumstances MOUSESTATE returns that mouse button 2 is always TRUE. It happens in a very big code, but in a small FUNCTION:

Code (glbasic) Select

FUNCTION No_Click:
LOCAL mx,my,mb1,mb2
FOR i=0 TO GETMOUSECOUNT()-1
SETACTIVEMOUSE i
REPEAT
MOUSESTATE mx,my,mb1,mb2
UNTIL mb1=FALSE AND mb2=FALSE
NEXT
SETACTIVEMOUSE 0
ENDFUNCTION


The REPEAT loop never ends.

Are these bugs, or deliberate changes in OS?

GLBasic Precompiler V.14.721
GLBasic IDE, Version: 15.089

Thank you,
Adaz

#37
Let me notify you about some good news: Apple has approved my first game, and it's on the AppStore now! :)
https://itunes.apple.com/us/app/antirock/id843356076?mt=8

The current version is 1.0, but 1.1 in under the approvement process. There weill be a Credits window, and I have replaced some graphics. I hope 1.1 will be available in a week.
The game is free by the way, and there are additional level packs by in-app purchase (currently only one).

Can I ask you to please download and try it, and spread it on Facebook and other forums? :)

Facebook page:
https://www.facebook.com/antirockofficial

Thank you!

Adaz

#38
The text field does not appear on iOS 7, and the keyboard doesn't come up. I don't know what to change in the code:(
#39
Thanks Guys, but I really needed an md5 function.

In the meantime I have developed a solution for iOS / Xcode, so I will answer my own question now - for others.
It works for me flawlessly!


Open your Xcode project, and insert this line in the beginning of inapp.mm:

Code (glbasic) Select

#import <CommonCrypto/CommonDigest.h>



Insert these lines after #pragma mark GLB:

Code (glbasic) Select

- (NSString *) _glb_md5:(NSString *) input {
    const char *cStr = [input UTF8String];
    unsigned char digest[CC_MD5_DIGEST_LENGTH];
    CC_MD5( cStr, strlen(cStr), digest ); // This is the md5 call
   
    NSMutableString *output = [NSMutableString stringWithCapacity:CC_MD5_DIGEST_LENGTH * 2];
   
    for(int i = 0; i < CC_MD5_DIGEST_LENGTH; i++)
        [output appendFormat:@"%02x", digest[i]];
   
    return  output;
}



Insert these lines after extern "C" {

Code (glbasic) Select

    char g_data[2048];
    char* glb_md5(char* text) {
    temp_string = [my_inapp _glb_md5: [NSString stringWithUTF8String:text]];
g_data[0]='\0';
strcpy(g_data, [temp_string UTF8String]);
return g_data;
    }



After that you can call this glb_md5 function from GLBasic - if you declare it in your GLBasic project:

Code (glbasic) Select

?IFDEF IPHONE
        IMPORT "C" char* glb_md5(const char* text)
?ELSE
        FUNCTION glb_md5: text                  //glb_md5 won't work on Windows!! That's an XCode function! So you need this dummy function to be able to run your app on Windows without md5.
        ENDFUNCTION
?ENDIF
#40
Thanks, but a 3rd-hosted php script uses MD5, and I have to provide md5 for them.
#41
Hi All,

Is there a way to generate md5 hash from a string within GLBasic? I need a cross-platform solution (it has to work on iPhone too), so an inline code would be great!

Thank you ALL,

Adaz
#42
Quote from: Schranz0r on 2014-Jun-24
Write youre own method to pack all files and leveldata in one file then crypt it...
Its easy!
I's not so easy for me... I has to work on iPhone as well.
Do you have an idea or plan for implementation?
Thanks
#43
Confirmed
#44
I just tried to store a simple JPG in shoebox, but it cannot be read back! Error:3 (not found)
PNG and BMP work, but I cannot read jpg's from it...
Very annoying, now I have to rethink my idea and rewrite my whole file handling/compressing algorithm because of an old, unhandled bug:(( http://www.glbasic.com/forum/index.php?topic=6858.msg55507#msg55507
Moreover, if this is an old bug (or known deficiency), why the shoebox creator doesn't display an error message like "JPG's currently not supported!"?
#45
Thanks, I already use encrypt, but I wanted to protect my level map data with the necessary image files in one big file. So this is impossible because of some bugs.

If there was some kind of multiplatform (un)zip/rar etc. packer (with password support) we could use in GLB, that'd be marvelous!

Adaz