ArianeSoft Forums

ArianeSoft Forums (http://forums.arianesoft.ca//index.php)
-   Code Sharing (http://forums.arianesoft.ca//forumdisplay.php?f=20)
-   -   Want to play with me??? (http://forums.arianesoft.ca//showthread.php?t=1972)

Nicknack 05-03-2010 05:07 PM

Want to play with me???
 
4 Attachment(s)
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 :)

c4esar 05-04-2010 03:53 PM

Cooool Stuff!

zehlein 05-04-2010 08:08 PM

One simpel thing to add: WOW! :)

Mike Halliday 05-13-2010 08:03 AM

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

Nicknack 05-15-2010 05:53 PM

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.

juppmaifeld 08-08-2010 02:36 PM

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. :cool:

Jupp

Nicknack 08-08-2010 09:18 PM

as far I remember is type() the best complement to var() and objects should be the only variables which have to be freed.


All times are GMT. The time now is 10:43 PM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
Copyright (c) ArianeSoft Inc.