News for hackers. Stuff that matters.
Re:Show HN: Open-source Counter-Strike-like game by bilekas on Tuesday October 22, 2024 @02:32PM (#41917247)
This is wild... PHP server with electron client.. I'm genuinely impressed. It's been many years since I worked with PHP. Back in the days before proper namespaces etc. This just blows my mind. What an incredible effort, I will definitely be helping with this project in my free time. We need more crazy projects like this!
Re:Show HN: Open-source Counter-Strike-like game by solcloud on Tuesday October 22, 2024 @03:26PM (#41917775)
thank you for kind words :)
Re:Show HN: Open-source Counter-Strike-like game by doctorpangloss on Tuesday October 22, 2024 @03:12PM (#41917616)
“Make games that are fun to make.”
Re:Show HN: Open-source Counter-Strike-like game by calvinmorrison on Tuesday October 22, 2024 @08:28PM (#41920240)
Php is basically runtime Java these days. It's so much better than ye olden days
Re:Show HN: Open-source Counter-Strike-like game by ARandomerDude on Tuesday October 22, 2024 @09:27PM (#41920707)
> Php is basically runtime Java these days

I don't know enough about PHP to understand this comment. Can you elaborate?

Re:Show HN: Open-source Counter-Strike-like game by mikeweiss on Tuesday October 22, 2024 @10:35PM (#41921194)
I think they're just saying its a lot like Java if Java was a interpreted language and not a compiled language.
Re:Show HN: Open-source Counter-Strike-like game by bilekas on Wednesday October 23, 2024 @02:40AM (#41922436)
Might you call it JavaScript? /s
Re:Show HN: Open-source Counter-Strike-like game by meiraleal on Wednesday October 23, 2024 @07:09AM (#41923795)
Thanks God, no. PHP has the clumsiness of Java but JavaScript is cool.
Re:Show HN: Open-source Counter-Strike-like game by divan on Wednesday October 23, 2024 @07:52AM (#41924021)
Re:Show HN: Open-source Counter-Strike-like game by calvinmorrison on Wednesday October 23, 2024 @08:54AM (#41924587)
wow this is hilarious.

we have a linter that bitches anytime anyone uses php's empty. In fact, php has tons of these weird behaviours mostly masaradng as trying to be helpful

Re:Show HN: Open-source Counter-Strike-like game by treflop on Wednesday October 23, 2024 @01:43AM (#41922154)
You could have actually made this 15 years ago! As a kid I pretty much only knew PHP and Visual Basic so I made CLI servers in PHP (…lol)

You could make asynchronous servers using socket_select(), which was added in PHP 4.1.

https://www.php.net/manual/en/function.socket-select.php

There was also a third party extension that added threads to PHP 15 years ago, although it was buggy.

Re:Show HN: Open-source Counter-Strike-like game by diggan on Wednesday October 23, 2024 @08:16AM (#41924204)
> There was also a third party extension that added threads to PHP 15 years ago, although it was buggy.

Reminds me of ReactPHP (no, not that React) that allowed you to do non-blocking I/O in PHP back in like 2012-2013 sometime. Maybe that's the library you're referring to actually?

https://github.com/reactphp/reactphp

Re:Show HN: Open-source Counter-Strike-like game by treflop on Wednesday October 23, 2024 @10:36AM (#41925456)
I mean actual threads.

Seems they still have the docs up: https://www.php.net/manual/en/book.pthreads.php

Re:Show HN: Open-source Counter-Strike-like game by fefferkorn on Wednesday October 23, 2024 @11:57AM (#41926353)
Yeah, same,.. Real time game server written in PHP is really interessting. I also know PHP from the old days and now only from certain CMS systems, but not realtime projects. Im amazed! Nice! :)))
Re:Show HN: Open-source Counter-Strike-like game by Sincere6066 on Friday October 25, 2024 @10:25PM (#41952012)
electron eh? pass.