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 - spacefractal

#3316
Dropbox is of course option, not required for the user. Dropbox support in game would simple been auto disabled, If not installed on desktop or not autorized by user for mobile. So it's just a extra service for the game.

Dropbox is still best cloud service (as I known) and I don't want to hold server my self and doing all the security work (a account system is required anyway).

I trying to integrate for savegames use, not hiscore. With hiscore, it's different story.

Ps. iCloud would been nice too, also I love Dropbox.
#3317
Water is still currectly wip, but allready now its much better than the previous water was:

#3318
The console is really interesing and its got a success in the Kickstarter as well various places on net (more than example GameGadget which got a horriable release). howover the release is first about half year and the most concern is the app model, which is not directly supported by GlBasic.

Howover as soon Gernot add Java<->C++ support (either directly or via wrapper) then I thinks its should been pretty easy to support that console, since its a Android and use standard componets, except the controller itself.  Howover I thinks its really only the inApp system as well supporting the controller that is required to support it.
#3319
Because if the game got succes and plans to release to many platforms, then I would not been afford the traffic there would been incomming. So I prefer using a Cloud service like Dropbox (but could been different, example iCloud, but its only for Apple machines) or other Sync services.

The dropbox path is extracted on Windows, but missing on Mac, because I not very sure why ~/.dropbox/host.db cannot been detected correctly. The files elsewise exsits on my Mac.

The major problems is really on mobile platforms, not on deskops (where I awsume Dropbox is installed). Howover on WebOS and other unsupported OS, here server mightbeen required, but there is a Dropbox for PHP as well, which is possible to use.

The very best is of course possible to use the Dropbox's REST API directly in C++ and adapt it using inline. Howover its use HTTPS as well both GET and POST and those are unsupported by GLBASIC.
#3320
on Mac, the app start automatic when clicking on the .app extension, but its really just a folder, which can been freely open and show its content without any problems. Also there is no protection on iOS and Android either since they can been renamed back to zip and then unpack.

The best is using checksums as well scramble your images.
#3321
You need both ogg and mp3 depend on system. Put them in each own folder and use the exclude feature, so you don't have both versions.

Wav mono was for soundfx meant.

As long there is no user java communication, ps3 controller would not been possible.

#3322
also make sure its a 64bit Intel2duo as minimum, not a Intel Core Duo or Intel Core Solo, which is minimum required to use the newest OSX (Lion and soon Mountian Lion). Those cpu is also quite old today.

Yes a MacMini is a excellent little machine that works well as dev machine.
#3323
on MacOSX (And property Linux), host.db is also exists, and its seen its allways should been in ~/.dropbox, so the full path+file should been ~/.dropbox/host.db.

But if I trying to check if the file exists with DOESFILEEXIST, its allways return 0 for some reason? I guess its something different with ~ char my guess? The file also exists on my mac and I'm not using Mountian Lion. Just Lion.
#3324
Its a Android issue, not glbasic issue. mp3 is well known issue which not play on Android. You cant use mp3, so use ogg instead. For Wav make sure to use PCM, since ADPCM or other format is not supported. Here I use mono 22kz which works fine.
#3325
its easier to extract it from host.db, much easier.

Since I think DROPBOX would been excellent to been include in GLBASIC, this thread should rename as a Dropbox integration project (Im not sure I should rename, so I leave it as its are). Here is what I came with to detect the folder of it, and eventuelly create the subfolder:

Code (glbasic) Select

GLOBAL DROPBOXDIR$=""
GLOBAL DROPBOXLOCALFOLDER$="GreedyMouse_SaveData"
GLOBAL DROPBOXAPPKEY$=""
GLOBAL DROPBOXSECRETKEY$=""

FUNCTION Dropbox_Init:
IF PLATFORMINFO$("")="WIN32"
LOCAL file$=GETENV$("APPDATA")+"/dropbox/host.db"
file$=REPLACE$(file$, CHR$(134), "/")
IF DOESFILEEXIST(file$)
LOCAL ok=OPENFILE(1, file$, 1)
IF ok
LOCAL line$
WHILE ENDOFFILE(1)=0
READLINE 1, line$
line$=BASE64Decode$(line$)
IF LEN(line$)>10
IF DOESDIREXIST(line$)
DROPBOXDIR$=line$
DROPBOXDIR$=REPLACE$(DROPBOXDIR$, "\\", "/")
BREAK
ENDIF
ENDIF
WEND
ENDIF
ENDIF
file$=REPLACE$(file$, "\\", "/")
ENDIF
IF DROPBOXLOCALFOLDER$<>""
IF DOESDIREXIST(DROPBOXDIR$+"/"+DROPBOXLOCALFOLDER$)=0
CREATEDIR(DROPBOXDIR$+"/"+DROPBOXLOCALFOLDER$)
ENDIF
ENDIF

DEBUG "Dropbox Folder: "+DROPBOXDIR$
ENDFUNCTION

FUNCTION Dropbox_Upload: LocalFile$, CloudFile$
ENDFUNCTION

FUNCTION Dropbox_Download: CloudFile$, LocalFile$
ENDFUNCTION

FUNCTION BASE64Decode$: String$
LOCAL keyStr$ = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
LOCAL result$=""
LOCAL a$, b$, c$, d$

FOR i=0 TO LEN(String$)
a$=MID$(String$, i, 1)
IF INSTR(keyStr$, a$, 0)>-1 THEN result$=result$+a$
NEXT

String$=result$
LOCAL strresult$=""
FOR i=0 TO LEN(String$) STEP 4
a$=MID$(String$, i, 1);
IF a$<>"="
LOCAL a=INSTR(keyStr$, a$, 0); a$=Bin$(a, 1); a$=RIGHT$(a$, 6)
b$=MID$(String$, i+1, 1);
IF b$<>"="
LOCAL b=INSTR(keyStr$, b$, 0); b$=Bin$(b, 1); b$=RIGHT$(b$, 6)
c$=MID$(String$, i+2, 1);
IF c$<>"="
LOCAL c=INSTR(keyStr$, c$, 0); c$=Bin$(c, 1); c$=RIGHT$(c$, 6)
d$=MID$(String$, i+3, 1);

IF d$<>"="
LOCAL d=INSTR(keyStr$, d$, 0); d$=Bin$(d, 1); d$=RIGHT$(d$, 6)
ENDIF
ENDIF
ENDIF
ENDIF
result$=a$+b$+c$+d$
LOCAL ch1$=MID$(result$, 0, 8); ch1$=Bin2Dec(ch1$); IF INTEGER(ch1$)<255 AND INTEGER(ch1$)>32 THEN strresult$=strresult$+CHR$(INTEGER(ch1$))
LOCAL ch2$=MID$(result$, 8, 8); ch2$=Bin2Dec(ch2$); IF INTEGER(ch2$)<255 AND INTEGER(ch2$)>32 THEN strresult$=strresult$+CHR$(INTEGER(ch2$))
LOCAL ch3$=MID$(result$, 16, 8); ch3$=Bin2Dec(ch3$); IF INTEGER(ch3$)<255 AND INTEGER(ch3$)>32 THEN strresult$=strresult$+CHR$(INTEGER(ch3$))

a$=""; b$=""; c$=""; d$=""
NEXT
RETURN strresult$
ENDFUNCTION

FUNCTION Bin$: p_num, p_bytes = 4
   LOCAL l_length = p_bytes * 8, l_counter, l_result$
   FOR l_counter = l_length - 1 TO 0 STEP -1
      IF bAND(p_num,POW(2, l_counter))
         l_result$ = l_result$ + "1"
      ELSE
         l_result$ = l_result$ + "0"
      ENDIF
   NEXT
   RETURN l_result$
ENDFUNCTION

FUNCTION Bin2Dec: binnum$
LOCAL l_result, l_counter, l_length
l_length = LEN(binnum$) - 1
FOR l_counter = l_length TO 0 STEP -1
IF MID$(binnum$, l_counter, 1) = 1
INC l_result, POW(2, l_length - l_counter)
ENDIF
NEXT
RETURN l_result
ENDFUNCTION


The goal is of course is get it to work on so many platforms as possible. I think savegame integration across platforms would been very cool to have (later its could go for iCloud for mac as well).

PS. Thread is renamed as i see, that pretty nice. I hope to see and do more code. Today I did some work on the waterpart in the game (also nothing dropbox today). The part works now.
#3326
But I do can't take account others would do the same, so it's better to find and decode host.db
#3327
I allready created base64 decoder and its was plain simple to do.

i would and try use dropbox for gamesave sync for greedy mouse, so you could play the game and resume on any device.

The hard part me guess is andriod version, due no call from c++ to java yet.

When I a day got it to work with comply of platform I add to code snippet.
#3328
Its me that is stupid  =D.

Of course #DROPBOX# just launch Dropbox.exe and all its does is of course launch explorer with its path. Nothing special. Here I just got confuction its was setup a variable. But howover sadly there is no system variable, which I find is dumb.

Howover I do could find a way to find and open host.db and I just need to base64 decode it (no expert, but the download link I found is down) and find its default url (if its exists of course).

Howover list of system variable using set did help where I could locate AppData/Roaming folder.

PS. I did created my own base64 decoder. its was pretty much very easy, dispite missing num2bin$ as well bin2dec (but there is allready functions doing it). I Post it later when I have got it to work in the code snippes. Its might take a week or two or sometime. But I will open DROPBOX integration when done (more than just Windows).
#3329
That version gernot use is large in HTML file and might not been used for we pages. Howovere there is working a 123basic which could so that, both look cool.
#3330
But not for example dropbox user variable. Here its would been nice if SETCURRENTDIR could check for that. You can allways use string variable to set the path back again eventuelly.

Temp was also a example to (even its can been checked, but I do not use that). Property it's a inline thing.