12 Oct, 2009, Confuto wrote in the 1st comment:
Votes: 0
I've been tinkering with RocketMUD a bit and am wondering what line 157 in rocket.rb does:
rFd, dummy, dummy = select(rFd, nil, nil, tv)
12 Oct, 2009, Runter wrote in the 2nd comment:
Votes: 0
The same thing select() does in the C version. It's likely a wrapper in Ruby. To be honest, though, I always use the higher level libraries in Ruby.
12 Oct, 2009, Chris Bailey wrote in the 3rd comment:
Votes: 0
It's Runter! Anyways, Runt has that one pegged…and those "higher" level libraries he mentioned are very nice indeed. Eventmachine especially, it's blazing fast.
12 Oct, 2009, Runter wrote in the 4th comment:
Votes: 0
Chris Bailey said:
It's Runter! Anyways, Runt has that one pegged…and those "higher" level libraries he mentioned are very nice indeed. Eventmachine especially, it's blazing fast.


Yeah. I'll probably be around more now. I find the place more hospitable.
14 Oct, 2009, Confuto wrote in the 5th comment:
Votes: 0
Thanks, think I have it figured out now. Bit of a Ruby novice.
14 Oct, 2009, JohnnyStarr wrote in the 6th comment:
Votes: 0
Chris Bailey said:
It's Runter! Anyways, Runt has that one pegged…and those "higher" level libraries he mentioned are very nice indeed. Eventmachine especially, it's blazing fast.


Is "Eventmachine" multi threaded? Is there a way to use non-blocking sockets with it?
14 Oct, 2009, David Haley wrote in the 7th comment:
Votes: 0
I can't answer your specific Eventmachine questions, but note that non-blocking sockets can be used without a multithreaded application.
14 Oct, 2009, JohnnyStarr wrote in the 8th comment:
Votes: 0
David Haley said:
I can't answer your specific Eventmachine questions, but note that non-blocking sockets can be used without a multithreaded application.


I asked this question because most multi-threaded I/O engines use blocking sockets,
not the other way around. So, because I only saw mulit-threaded examples on Eventmachine's Wiki, I assumed that if it was multi-threaded, it used blocking sockets.
15 Oct, 2009, Runter wrote in the 9th comment:
Votes: 0
EventMachine uses a reactor model. Not a threaded one. I'm not sure if the C implementation matters since you can't access resources out of the prescribed way. According to the documentation this prescribed way is guaranteed to be non-blocking.

EventMachine is written in C and it's much more scalable and more sensitive to the needs of many projects than some pure Ruby solutions will be. My tests with it have proven it to be more than efficient enough for my needs. (But to be honest, more than likely hte other less efficient libraries would have been as well.) One of my biggest problems with EventMachine was the lack of Ruby examples however there is pretty solid documentation for the classes. It's a library available for Java, C++, and Ruby.

There's other alternatives in Ruby like gserver or just the native socket library. There's wrappers for the low level C function calls as well.
15 Oct, 2009, Tyche wrote in the 10th comment:
Votes: 0
Eventmachine uses non-blocking sockets.
15 Oct, 2009, Chris Bailey wrote in the 11th comment:
Votes: 0
If you are interesting in Ruby solutions you can also check out the networking side of Tyches Teensymud, it's pretty sweet actually.


EDIT: The actually kind of implied that I was surprised that it was good or something. It just came out that way, I'm tired. It's good, plain and simple.
15 Oct, 2009, Runter wrote in the 12th comment:
Votes: 0
Chris Bailey said:
If you are interesting in Ruby solutions you can also check out the networking side of Tyches Teensymud, it's pretty sweet actually.


Whatever happened to that being released in a gem? *pokes tyche*
15 Oct, 2009, Tyche wrote in the 13th comment:
Votes: 0
Runter said:
Chris Bailey said:
If you are interesting in Ruby solutions you can also check out the networking side of Tyches Teensymud, it's pretty sweet actually.


Whatever happened to that being released in a gem? *pokes tyche*


Sorry. I need to get cracking on releasing more code. ;-)
16 Oct, 2009, Chris Bailey wrote in the 14th comment:
Votes: 0
Tyche said:
Sorry. I need to get cracking on releasing more code. ;-)


I agree.
18 Oct, 2009, JohnnyStarr wrote in the 15th comment:
Votes: 0
Hey, I came up with a nifty color code system of my own, just wanted to throw this out there on a RocketMud
post.

I ran with the RocketMud idea of the color table, but everything else is new.
The cool thing about it is by using '#' as background and '{' as foreground, it allows you to easily use both without having
to add color codes.

# first create the color class
class Color
attr_accessor :char, :code, :bold
def initialize (char, code, bold)
@char = char
@code = code
@bold = bold
end
end

# add a global color list
$colors = [
Color.new(?d, "0m", false),
Color.new(?D, "0m", true),
Color.new(?r, "1m", false),
Color.new(?R, "1m", true),
Color.new(?g, "2m", false),
Color.new(?G, "2m", true),
Color.new(?y, "3m", false),
Color.new(?Y, "3m", true),
Color.new(?b, "4m", false),
Color.new(?B, "4m", true),
Color.new(?p, "5m", false),
Color.new(?P, "5m", true),
Color.new(?c, "6m", false),
Color.new(?C, "6m", true),
Color.new(?w, "7m", false),
Color.new(?W, "7m", true),
Color.new(?x, "7m", false)] # default

# then add this to your (to_buffer) or what have you

def to_buffer(buf)
i = 0
while i < buf.size
fb = 0
fb = 3 if buf[i] == ?{
fb = 4 if buf[i] == ?#
i += 1

unless fb == 0
valid = false

$colors.each { |c|
b = c.bold ? 1 : 0
if buf[i] == c.char
buf[i-1..i] = "\e = "\e[#{b};#{fb}#{c.code}"
valid = true
break
end
}

unless valid
log.debug("Bad color character: #{buf[i..i]}")
buf[i-1] = '' # set char to null if invalid
end

end

end

send_data(buf)

end
[/code]
18 Oct, 2009, Chris Bailey wrote in the 16th comment:
Votes: 0
Neat stuff. I looked around briefly but couldnt find what I was looking for…awhile back we had a discussion going about color parsing and some neat things cropped up, you might want to have a look for it. =)
18 Oct, 2009, Runter wrote in the 17th comment:
Votes: 0
18 Oct, 2009, JohnnyStarr wrote in the 18th comment:
Votes: 0
I like the table, cool ideas. I still don't see a way to use background colors in the example though. :)
18 Oct, 2009, Chris Bailey wrote in the 19th comment:
Votes: 0
Star - I just thought maybe you could integrate ideas from all of them into an even better one! =) Add your background color system to that and send it up the hill to tyche for inclusion in Rocketmud. He is pretty good about putting things in if you submit a patch.
18 Oct, 2009, JohnnyStarr wrote in the 20th comment:
Votes: 0
Chris - okie dokie, sounds like a good idea :)
0.0/20