Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUDs ➜ General ➜ Another tinymudserver question.

Another tinymudserver question.

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Metsuro   USA  (389 posts)  Bio
Date Sun 17 Sep 2006 09:03 AM (UTC)
Message
Alright, in tinymudserver look goes through all players connect to see if they are in same room then displays them, to me I kinda think this is a waste? I'd rather something more like smaug I guess, where rooms have a list of players in it or something and then goes through them? I'd rather have a form kinda like instead of going through all players connect, anyone interested in explaining how I could do this and maybe help start me off with it?

Everything turns around in the end
Top

Posted by Conner   USA  (381 posts)  Bio
Date Reply #1 on Sun 17 Sep 2006 10:17 PM (UTC)
Message
Well, you could create a double linked list of the characters in the room, like smaug uses by copying what smaug has for that into your souc=rce code for tinymudserver, no?

-=Conner=-
--
Come test your mettle in the Land of Legends at telnet://tcdbbs.zapto.org:4000
or, for a little family oriented medieval fun, come join us at The Castle's Dungeon BBS at telnet://tcdbbs.zapto.org
or, if you just want information about either, check our web page at http://tcdbbs.zapto.org
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #2 on Sun 17 Sep 2006 10:24 PM (UTC)
Message
A waste? I don't think it would be that inefficient until you have 2000+ players you're looping through, I guess.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Nick Gammon   Australia  (23,140 posts)  Bio   Forum Administrator
Date Reply #3 on Mon 18 Sep 2006 12:41 AM (UTC)
Message
That was really a simple example of writing a MUD server. Even now I would do things differently, like, rewrite it in Lua. ;)

I agree that it is slightly wasteful to scan all characters to see if they are in a particular room, but searching a list for a match on an integer is really quite a fast operation. Certainly with 2000 players you might want to do it more efficiently.

Remember that the code to do it efficiently, like a linked list per room has an overhead of its own. For example, leaving one room and going to another means removing from one list and adding to another. There would be a breakeven point where the separate lists are more efficient, however it might be 10+ players on the MUD. And even then the savings on a fast PC might be microseconds.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Metsuro   USA  (389 posts)  Bio
Date Reply #4 on Mon 18 Sep 2006 01:03 AM (UTC)
Message
Well I guess my biggest problem with it, is I want to add attacks and things that can be used room wide, some that work from the first person in the room down. And if It has to search the entire mud for whos in the room, it doesn't work so well right? Only problem is I'm not really sure what a linked list is or how to use a linked list.

Everything turns around in the end
Top

Posted by Nick Gammon   Australia  (23,140 posts)  Bio   Forum Administrator
Date Reply #5 on Mon 18 Sep 2006 01:12 AM (UTC)
Message
Searching "the entire MUD" isn't too bad, as you are only searching logged-in players. How many would that be? 50? 20? 10?

Linked lists and other things are easy to do in STL, which is used extensively in the tinymudserver anyway. Read my posts about STL for clues on how to use that. You won't get far modifying the server without understanding STL anyway.

See:

http://www.gammon.com.au/forum/?id=2899

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


21,171 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.