iconfun - demo using new monkey tcp module

Monkey Archive Forums/Monkey Discussion/iconfun - demo using new monkey tcp module

Skn3(Posted 2012) [#1]
Hey I said I would have a look at the new async tcp module this week and I did!

I made a little app where you can draw an icon and submit it to my server. It will periodically check for new icons created by everyone and add them to your window.

It is just a bit of fun! All source code is included in the zip.



http://www.skn3.com/junk/iconfun/iconfun.zip


OvineByDesign(Posted 2012) [#2]
Nice one....

/StuC


Neuro(Posted 2012) [#3]
This is cool, thanks for this :)!


marksibly(Posted 2012) [#4]
Hi,

Wheee...fun! look out for 'mak'...

I couldn't get it to work on Android though, there seems to be a problem with the GUI or fontmachine or something.


Soap(Posted 2012) [#5]
Cool toy, but needs more colors!


therevills(Posted 2012) [#6]
but needs more colors!

And a fill tool!

And layers and ... and... ;D


Skn3(Posted 2012) [#7]
Yay lots of icons :D

I'll try and make it pure monkey code with no additional modules today.

Just need to get done coding the Content Aware Fill...


marksibly(Posted 2012) [#8]
Hi,

You can drop challenger and fontmachine into the src dir if you just want to keep it self contained.

Or is there some native code in there?


Skn3(Posted 2012) [#9]
I updated so it is native monkey now, and removed fontmachine or challenger gui. I thought it would be nicer to do this way so it is doesn't have 3rd part dependencies. It was originally using those modules out of pure lazyness, haha.

http://www.skn3.com/junk/iconfun/iconfun.zip

I also improved the php side of things so that it only fetches new icons using file modification timestamp and passing a timestamp param to the httpget.


slenkar(Posted 2012) [#10]
very good,


Soap(Posted 2012) [#11]
The slimes are multiplying.


Skn3(Posted 2012) [#12]
hahah I see you found a way to spam the slimes! I left 3 in there ;)


Tri|Ga|De(Posted 2012) [#13]
Your exe is a windows and I'm on Mac.
so I tried to compile your program but got an error.
<233> : Error : Type 'Thread' not found


Can you help me please?


Skn3(Posted 2012) [#14]
Need to put it in a target that uses java or cpp. Html5 and flash not included at the moment with the tcp module.


Tri|Ga|De(Posted 2012) [#15]
Okay. I'l do that.

That did help.


marksibly(Posted 2012) [#16]
Hi,

Getting a weird bug on Android.

It usually works, but sometimes there's an 'invalid int' error when it's processing iconsPending.

I narrowed it down to the loop that goes through the icon data - sometimes, this data has an "<ICON>" string at the end which is throwing Java's string->int converotor. The rest of the string is fine, just palette index digits in the range 0-7.

It's like it's dropping a newline somewhere, or the server isn't sending one...

[edit]
Found it - my fault!
[/edit]


Skn3(Posted 2012) [#17]
Hurrah! Thought I was going to have to scratch my head again. I encountered a weird bug like that but it went away after some poking and prodding so I *shock horror* released it without fixing.

What was the bug?


marksibly(Posted 2012) [#18]
Hi,

> What was the bug?

The java tcpstream code was always reading into offset 0 of the databuffer.

This was messing up ReadAll when it couldn't read all bytes the first time.


bosh77(Posted 2015) [#19]
Hello Skn3! Hello Mark! Great code Iconfun! But I have a problem with the latest versions (I use 83C) on glfw with error: Type 'IOnReadComplete' not found. Did I miss something?
While version 66B works!
One question, can I use your code to create a card game online? It is suitable to that purpose? (data exchange) or do you recommend another instead of TCP?
Thank you very much!


Skn3(Posted 2015) [#20]
Hey Bosh,

Please update the source code to:



bosh77(Posted 2015) [#21]
OK! It's WORK! Thank you very much Skn3!!