player.send("[ZoneName]\r\n");
player.socket.write("This is a very cool room description\r\n");
player.socket.write("also here is a squirrel.");
//you'd want something like this to format your output.
player.report.room(roomStruct);
$foo = "Silly Room\n";
$foo .= " This is a " . $room.light_level > 50 ? "bright " : $room.light_level < 10 ? "dark " : "" . " room.\n";
$foo .= "You wish this room looked more interesting.\n";
send($ch, $foo);
So, I'd basicly like to hear some insight or clarification on the matter, as well as any other thoughts or ideas for ways that the socket code could be improved; along with some sort of confirmation as to whether I'm on the right track or not.
Also as a quick side note, I do have another question. I notice that at current the code uses write() to spit out text in chunks that are at most 4k in size. Is there any particular reason for it being done at that rate that anyone is aware of? Should it be decreased or increased at all; maybe even set to just send everything there is to send for that socket all at once? I'd expect it to be fine to just have it send everything all at once anyways (since it will do that regardless?), but I'm guessing there may be reasons otherwise that I am not aware of (protocol limit(s), maybe?).
:thinking: