forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

WiFi, Infared, threads, and a bug?

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Lua Player Development
View previous topic :: View next topic  
Author Message
Gary13579



Joined: 15 Aug 2005
Posts: 93

PostPosted: Mon Sep 12, 2005 6:13 am    Post subject: WiFi, Infared, threads, and a bug? Reply with quote

First, a few suggestions.
WiFi.. This is pretty much a must, and is the only reason I am skeptical about using Lua over C++.
If it were possible to easily make multiplayer games using Lua, imagine how many there would be?
Even if you can't get WiFi working, infared would be great. Maybe I could finnally make a learning remote for people's tv's ;) ?

And last, threads. There may already be thread functions in Lua that I don't know about, and if so, please link me to someplace where I can learn about them. Just basic things, like load, start, stop, pauce, delete, and a few other things..

I'm sure you already know about this bug, but it has been annoying me.
You start a game, and exit it, but all of the varibles are still there. This also includes all music/sound that is playing..
This may be a problem if I were to make a HUGE RPG game that used about 24MB of RAM.
If you try playing my game after someone elses, there may not be enough RAM to store everything..

Also, when you launch a game (Music Test for example), the music continues when you stop. You have to go to a game which has an option of disabling sound (Snake) and disable it..

Edit:
Just thought of something else. Encrypted .lua files. If you do ever get WiFI/infared, this is an absolute MUST! Someone would be playing fair, but the other person has a hacked .lua file, and can cheat be pressing R trigger three times or whatever.
I am not sure how you encrypt something with this project being open source and all, but I am sure someone can think of something.

Just a few things I would like :)
Back to top
View user's profile Send private message
cgruber



Joined: 06 Sep 2005
Posts: 36

PostPosted: Mon Sep 12, 2005 7:29 am    Post subject: Reply with quote

It takes time to learn how the hardware works so that an abstraction layer can be created to take advantage of it. I think Lua Player is excellent and will continue to improve.
Back to top
View user's profile Send private message
nevyn



Joined: 31 Jul 2005
Posts: 136
Location: Sweden

PostPosted: Mon Sep 12, 2005 9:09 am    Post subject: Reply with quote

Wifi comes when the wifi interface is stable.

Lua is garbage collected. Thus, when that huge RPG quits, its variables are marked for collection. The music continues playing because the quitting application didn't stop the music after itself. It's a trivial patch to Lowser to have it explicitly stop music when games end, I'll add it...

Lua has coroutines. I'm thinking about implementing cooperative multitasking in a library sometime.

You don't need encrypted luas, you only need a clever network protocol. (like checksumming the script file and refusing to start a multiplayer game if the checksum for the two games don't match)
Back to top
View user's profile Send private message Send e-mail Visit poster's website
chaos



Joined: 10 Apr 2005
Posts: 135

PostPosted: Mon Sep 12, 2005 1:09 pm    Post subject: Reply with quote

nevyn wrote:
You don't need encrypted luas, you only need a clever network protocol. (like checksumming the script file and refusing to start a multiplayer game if the checksum for the two games don't match)


a clever hacker would just modify the game to send a fake checksum ;)

ps: yes, i can not wait for internet-enabled lua.. i have a lot of projects in mind that have been just waiting for a platform like the psp to run them..
_________________
Chaosmachine Studios: High Quality Homebrew.
Back to top
View user's profile Send private message
Shine



Joined: 03 Dec 2004
Posts: 731
Location: Germany

PostPosted: Mon Sep 12, 2005 5:06 pm    Post subject: Reply with quote

chaos wrote:
a clever hacker would just modify the game to send a fake checksum ;)


The checksum could be calculated by Lua Player and if it is MD5, the clever hacker has no chance to fake it.

And another idea: game sharing from Lua Player to Lua Player over wifi would be nice, but this can be implemented within Lowser very easily, once we have wifi.
Back to top
View user's profile Send private message
chaos



Joined: 10 Apr 2005
Posts: 135

PostPosted: Mon Sep 12, 2005 5:17 pm    Post subject: Reply with quote

Shine wrote:
chaos wrote:
a clever hacker would just modify the game to send a fake checksum ;)


The checksum could be calculated by Lua Player and if it is MD5, the clever hacker has no chance to fake it.


all you need to know is the correct checksum to send, no matter what hashing algorithm you use. capture the correct checksum, overwrite the checksum function with your own version that always sends the 'correct' result.

all the other client can do is trust that it's getting the checksum from a legitimate source, and isn't been fed the answers it wants.

there is no easy answer here, trust me ;)
_________________
Chaosmachine Studios: High Quality Homebrew.
Back to top
View user's profile Send private message
Shine



Joined: 03 Dec 2004
Posts: 731
Location: Germany

PostPosted: Mon Sep 12, 2005 5:44 pm    Post subject: Reply with quote

chaos wrote:
all you need to know is the correct checksum to send, no matter what hashing algorithm you use. capture the correct checksum, overwrite the checksum function with your own version that always sends the 'correct' result.


I don't know the low-level interface of the wifi functions, but if Lua Player provides some high-level protocol for easier usage from Lua Player, it can be encoded in the low-level protocol and then you have to recompile Lua Player, but you are right, then faking is possible. A 100% protection is possible only, if the Lua Player program is trusted (which means released by Sony) and all wifi connected PSPs are firmware >1.5.
Back to top
View user's profile Send private message
Shine



Joined: 03 Dec 2004
Posts: 731
Location: Germany

PostPosted: Mon Sep 12, 2005 10:56 pm    Post subject: Reply with quote

nevyn wrote:
Lua is garbage collected. Thus, when that huge RPG quits, its variables are marked for collection.


What about global variables when returning from a dofile? The best solution would be to create a new Lua environment for every game and destroy it on exit.
Back to top
View user's profile Send private message
nevyn



Joined: 31 Jul 2005
Posts: 136
Location: Sweden

PostPosted: Mon Sep 12, 2005 11:17 pm    Post subject: Reply with quote

Shine wrote:
nevyn wrote:
Lua is garbage collected. Thus, when that huge RPG quits, its variables are marked for collection.


What about global variables when returning from a dofile? The best solution would be to create a new Lua environment for every game and destroy it on exit.


If the applications are sandboxed, stuff like cooperative multitasking is no longer possible. Perhaps the dofile'd chunk can be scoped instead, so that its global scope is only a local scope. Thus, when the chunk ends, its private global scope is garbage collected.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Lua Player Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group