Ariane Soft PPL2 Pocket Programming DataMite
  #1  
Old 05-03-2010, 05:07 PM
Nicknack's Avatar
Nicknack Nicknack is offline
Senior Member
 
Join Date: Nov 2006
Location: Germany
Posts: 527
Talking Want to play with me???

here finally I finished this fat project somehow:
- a remake of my old minisock: TCP.ppl which lets you write multiplayer games fast and with little trouble. wether bluetooth pan or internet, as long you have an ip addresss this code will work. if used correctly no blocking programs and the server can constantly add clients thanks to threading (see attached screenshot of my chat example). it is that simple, try it out! I have included a nearly complete 2 player tron game with online support.
- for the online support I have added a extra code file: net.ppl. It features several function to connect to my webserver and make information availabe to any on the internet. just register your game and if your port is open, everybody can see and connect to your game (if you are behind a router, you must forward your used port to be able to host games). if you interested, you can use your own webserver, you need only php and mysql. ask me for the needed php code.
- gui.ppl is a remake of ui.ppl and let you create a sprite based graphical user interface. it features buttons, checkboxes, editboxes, listboxes and captions. every graphical item is menu sorted, you can switch between menus with a single command. see my gui system in action in the tron game.

all and everything is open source, three examples are included, every command is shortly documented and it should work for every PPL version and on every device. just download it and play around with the examples.
if this doesn't motivate you to start coding I don't know what else


edit:
there is a bug with threads, so sometimes it just chrash. hopefullly kornalius will sort this out with next release
Attached Thumbnails
Click image for larger version

Name:	chat.PNG
Views:	342
Size:	133.2 KB
ID:	333   Click image for larger version

Name:	tron.PNG
Views:	335
Size:	19.6 KB
ID:	334   Click image for larger version

Name:	gui.PNG
Views:	325
Size:	45.3 KB
ID:	335  
Attached Files
File Type: zip Multiplayer_Pack.zip (270.1 KB, 396 views)
__________________
Software bugs are impossible to detect by anybody except the end user.
A Computer program is doing what you write, not what you want.

Last edited by Nicknack; 05-03-2010 at 07:36 PM.
Reply With Quote
  #2  
Old 05-04-2010, 03:53 PM
c4esar c4esar is offline
Member
 
Join Date: Mar 2009
Location: Germany
Posts: 41
Thumbs up

Cooool Stuff!
Reply With Quote
  #3  
Old 05-04-2010, 08:08 PM
zehlein's Avatar
zehlein zehlein is offline
Senior Member
 
Join Date: Sep 2006
Location: Leipzig, Germany
Posts: 596
Default

One simpel thing to add: WOW!
__________________
There is a crack, a crack in everything. That's how the light gets in. (L. Cohen)
Reply With Quote
  #4  
Old 05-13-2010, 08:03 AM
Mike Halliday's Avatar
Mike Halliday Mike Halliday is offline
Senior Member
 
Join Date: Sep 2007
Location: Warrington, United Kingdom
Posts: 821
Send a message via Skype™ to Mike Halliday
Default

Amazing.

PPL instant messaging! - Now if we can get some 256bit encryption from PPL we could have a really secure IM session! Kornalius should incorporate this into the next release of the IDE so we can see who is developing and chat to them???
__________________
Past editor of 'Voice of the PPL' the BI-Monthly Disk Magazine for the PPL by the PeoPLe!

Still developing products using PPL! - Although not as many as I used to!


If you enjoy my PPL applications and want to see many more, or I have helped you in any way; click here to buy me a beer;
Reply With Quote
  #5  
Old 05-15-2010, 05:53 PM
Nicknack's Avatar
Nicknack Nicknack is offline
Senior Member
 
Join Date: Nov 2006
Location: Germany
Posts: 527
Default

thanks for the nice comments gals ;D
@Mike: great idea, but it would be better implemented in UDP. with UDP you would have simple NAT punching and you wouldn't have to forward a port.
the downside: UDP is really unreliable and I was too lazy to make it more reliable for sensible use. if you make it correctly you would have sth. similar reliable as TCP, but in comparison worse in speed and cleverness. why reinventing the wheel? and with Ipv6 we don't need NATs anymore. maybe its already possible to use Ipv6, I'll look into this.
__________________
Software bugs are impossible to detect by anybody except the end user.
A Computer program is doing what you write, not what you want.

Last edited by Nicknack; 05-15-2010 at 06:00 PM.
Reply With Quote
  #6  
Old 08-08-2010, 02:36 PM
juppmaifeld juppmaifeld is offline
Member
 
Join Date: Aug 2009
Posts: 43
Default

Hi Nicknack,

I just tried to get the chat example running with ppl 1.53 pro. It failed because ppl 1.53 dosen't know the expresion "var(buffer$, sz$)" in

func tcp_recv(s$, sz$)

local(buffer$, read$);

//var(buffer$, sz$);

// PPL 1.53 dosen't know "var(buffer$, sz$);" therfore I used ->
SDIM(buffer$, TBYTE, sz$);


if (s$ == 0)
s$ = tcp_socket$;
end;

read$ = recv(s$, &buffer$, sz$, 0);

if (read$ < 0)
return ( - 1);
else
setbyte(&buffer$ + read$, 0);
return (char(buffer$));
end;
end;

To get it running I used "SDIM(buffer$, TBYTE, sz$);" instead of "var(buffer$, sz$);" . It worked but I am not sure whether I will run into a memory problem because I do not explicitly free buffer$ at the end of the function. I hope ppl's garbage collector will take care of it. Am I wrong? Is there an other workaround for var(buffer$, sz$);?

Realy good stuff what you have done.

Jupp
Reply With Quote
  #7  
Old 08-08-2010, 09:18 PM
Nicknack's Avatar
Nicknack Nicknack is offline
Senior Member
 
Join Date: Nov 2006
Location: Germany
Posts: 527
Default

as far I remember is type() the best complement to var() and objects should be the only variables which have to be freed.
__________________
Software bugs are impossible to detect by anybody except the end user.
A Computer program is doing what you write, not what you want.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:59 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright (c) ArianeSoft Inc.
Copyright © 2009 www.ppl-lang.com - All rights reserved
Web Design by BR Web Consulting Ltd