BloonPHP [PHP] [RSA, DH, RC4] [R63B]

Status
Not open for further replies.
Junior Spellweaver
Joined
Jan 7, 2014
Messages
191
Reaction score
2
Re: BloonPHP [PHP] [RSA, DH, RC4] [R64B]

Good luck with this!
 
☮TAKU????
Joined
Nov 16, 2009
Messages
866
Reaction score
580
Re: BloonPHP [PHP] [RSA, DH, RC4] [R64B]

Ah man, this would have been awesome! but in the end it will never be "stable". PHP is just a horrible language to write a server applications in. Use PHP for whats it is meant for, web applications.
 
Skilled Illusionist
Joined
Mar 26, 2013
Messages
371
Reaction score
280
Re: BloonPHP [PHP] [RSA, DH, RC4] [R64B]

Isn't this like the 4th thread of BloonPHP?

Just 1 old thread is for my old project (I recoded it from scratch)
all : Thanks, I will upload SWF pack



In-game :

QCksqq - BloonPHP [PHP] [RSA, DH, RC4] [R63B] - RaGEZONE Forums
 

Attachments

You must be registered for see attachments list
I don't even know
Loyal Member
Joined
Apr 7, 2010
Messages
1,699
Reaction score
420
socket_select($changed,$write,$except,NULL);
foreach($changed as $socket){
if($socket==$master){
}else{

Since it's only going to be the first in the array, I think it would be better to do

socket_select($changed,$write,$except,NULL);

if($changed[0] == $master){
master code
unset($changed[0]);
}

foreach($changed as $socket){
normal code

Otherwise you'd have a if/else 500 times (if you have 500 online users) that's not necessary
 
Skilled Illusionist
Joined
Mar 26, 2013
Messages
371
Reaction score
280
socket_select($changed,$write,$except,NULL);
foreach($changed as $socket){
if($socket==$master){
}else{

Since it's only going to be the first in the array, I think it would be better to do

socket_select($changed,$write,$except,NULL);

if($changed[0] == $master){
master code
unset($changed[0]);
}

foreach($changed as $socket){
normal code

Otherwise you'd have a if/else 500 times (if you have 500 online users) that's not necessary

No, $changed array count is not always 1 :ehh:
 
I don't even know
Loyal Member
Joined
Apr 7, 2010
Messages
1,699
Reaction score
420
I never said that, I said only the first item in the array has the potential to be the master, so checking on all of them (can be 500 if you have that many connections) would waste a lot of if/else checks

Another tip: If you're aiming for a high speed you should squeeze out every bit of performance you can and use as less overhead as possible. Use static so the pointer to the values doesn't have to be passed, pass strings and arrays as a pointer so they're not copied in memory, send buffers ASAP so you can reuse the memory and not get 1000 of buffers laying around. Also, you should find the best way to emulate "async" in PHP so you can send tasked packets to sockets that are still waiting for a potential send/receive. That was the part where I gave up because my implementation (async with suppressed socket async -> bool (false) means no data -> check for tasks). By that I mean for example a working pathfinder.

I hope your project goes well, if it does we might finally get a good working emulator across all OSes

PS: For is slightly faster than foreach :) NVM THIS
 
Last edited:
Developer
Joined
Jul 28, 2009
Messages
983
Reaction score
133
I never understood why people would make an emulator in PHP. Isn't something like C#/Java/C++/whatever much better?
Well, good luck with it.

Just for fun, it could improve your programming skilss.
 
Custom Title Activated
Loyal Member
Joined
May 23, 2011
Messages
1,603
Reaction score
588
I never said that, I said only the first item in the array has the potential to be the master, so checking on all of them (can be 500 if you have that many connections) would waste a lot of if/else checks

Another tip: If you're aiming for a high speed you should squeeze out every bit of performance you can and use as less overhead as possible. Use static so the pointer to the values doesn't have to be passed, pass strings and arrays as a pointer so they're not copied in memory, send buffers ASAP so you can reuse the memory and not get 1000 of buffers laying around. Also, you should find the best way to emulate "async" in PHP so you can send tasked packets to sockets that are still waiting for a potential send/receive. That was the part where I gave up because my implementation (async with suppressed socket async -> bool (false) means no data -> check for tasks). By that I mean for example a working pathfinder.

I hope your project goes well, if it does we might finally get a good working emulator across all OSes

PS: For is slightly faster than foreach :) NVM THIS

Crowley.
Sierra.
Grizzly.

--
Also, you could look into HipHop if you want near-native performance from PHP.
 
Skilled Illusionist
Joined
Mar 26, 2013
Messages
371
Reaction score
280
I use PHP pthreads for multi-threading (just pathfinder for now) and I will use PHP APC for shared memory between all threads.
azaidi : I don't need emulate "async", I use real posix multithreading with pthreads :thumbup:
 
☮TAKU????
Joined
Nov 16, 2009
Messages
866
Reaction score
580
I use PHP pthreads for multi-threading (just pathfinder for now) and I will use PHP APC for shared memory between all threads.
azaidi : I don't need emulate "async", I use real posix multithreading with pthreads :thumbup:

The APC module is deprecated...
 
Status
Not open for further replies.
Back
Top