<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.openuru.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=A%27moaca%27</id>
	<title>OpenUru - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.openuru.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=A%27moaca%27"/>
	<link rel="alternate" type="text/html" href="https://wiki.openuru.org/index.php/Special:Contributions/A%27moaca%27"/>
	<updated>2026-10-23T03:41:52Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.1</generator>
	<entry>
		<id>https://wiki.openuru.org/index.php?title=MOSS/Project_Ideas&amp;diff=1679</id>
		<title>MOSS/Project Ideas</title>
		<link rel="alternate" type="text/html" href="https://wiki.openuru.org/index.php?title=MOSS/Project_Ideas&amp;diff=1679"/>
		<updated>2012-01-07T19:54:35Z</updated>

		<summary type="html">&lt;p&gt;A'moaca': /* Fairly contained changes */ remove item fixed for bug MOSS-18&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The initial list was generated over the lengthy period of MOSS's initial&lt;br /&gt;
development. These project ideas mostly cover missing functionality. None of&lt;br /&gt;
the missing functionality is known to cause gameplay issues so these did not&lt;br /&gt;
really seem like bugs. These ideas are grouped by general type of change&lt;br /&gt;
required, and sort of by increasing approximate difficulty level and sort of by&lt;br /&gt;
decreasing value.&lt;br /&gt;
&lt;br /&gt;
Bigger ideas, such as entirely new functionality now made possible by the&lt;br /&gt;
release of the client, could go here too. Be realistic, though. Remember that&lt;br /&gt;
protocol changes are not to be made lightly, because it causes an&lt;br /&gt;
incompatibility problem. It is probably better to propose large changes in&lt;br /&gt;
discussion format on the forums. Do not ''expect'' someone else to take up and&lt;br /&gt;
implement your proposal.&lt;br /&gt;
&lt;br /&gt;
The whole idea of this list is to provide some ideas for anyone wishing to dive&lt;br /&gt;
into MOSS. Sometimes a little direction helps.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Terminology ==&lt;br /&gt;
The terms &amp;quot;frontend&amp;quot; and &amp;quot;backend&amp;quot; are used throughout this document. If the meaning is not clear from context, the terminology is explained in the [[MOSS-Developer_Notes#terminology | Developer Notes]].&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;vault&amp;quot; is basically the database, though it could be abstractly thought of as a collection of trees of vault nodes. Generally when referring to it as a set of node trees, &amp;quot;vault&amp;quot; is written and when referring to it as something with tables and rows, &amp;quot;DB&amp;quot; is written. The &amp;quot;vault server&amp;quot; is that portion of the backend concerned with handling the Vault* messages and working with the database.&lt;br /&gt;
&lt;br /&gt;
== Fix bugs ==&lt;br /&gt;
&lt;br /&gt;
The bug tracker is here: https://foundry.openuru.org/jira/browse/MOSS&lt;br /&gt;
&lt;br /&gt;
== Detail work (little Uru-specific knowledge required) ==&lt;br /&gt;
&lt;br /&gt;
* Try disabling the Nagle algorithm on sockets. This should result in less latency to the client when small messages are involved. Make sure to test the whole game thoroughly.&lt;br /&gt;
&lt;br /&gt;
* Figure out and implement a good way to use autoconf to compile in default pathnames. This would apply to the default config file, key file, moss_serv binary, and log/auth/game/file directory locations. The idea is if I say --prefix=/foo the defaults become /foo/etc/moss.cfg and so forth instead of ./etc/moss.cfg. Don't forget autoconf lets you override the etcdir, bindir, etc. separately.&lt;br /&gt;
&lt;br /&gt;
* Treat SDL filenames case-insensitively. This is very annoying in Unix, since it requires using readdir() and strcasecmp() instead of just open().&lt;br /&gt;
&lt;br /&gt;
* Make it so the game/state directory location can be separately configured. This is so the whole MOSS install can be read-only and just the log directory and game/state moved somewhere read-write. (The easy workaround is to symlink a writable directory to game/state.)&lt;br /&gt;
&lt;br /&gt;
* Log the PID of all forked servers in moss.log.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span id=&amp;quot;libevent&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;See if we can switch to libevent for inter-thread communication instead of raw signals. This should be fairly portable and take advantage of the different per-OS lightweight signalling mechanisms.&lt;br /&gt;
&lt;br /&gt;
* Allow ''skipping'' overlong messages (messages MOSS thinks are too big). This requires, upon catching the exception, tossing out the message, and if it has not all been read in yet, keeping track of how much more to toss in the future. The RC4 state must be updated too for the tossed message length.&lt;br /&gt;
&lt;br /&gt;
* It would be nice to use atomic operations for refcounts instead of having to use (bigger, slower) mutexes for them. This does make MOSS not architecture-independent, which is part of why I have been resisting it. (See also signal handling next.)&lt;br /&gt;
&lt;br /&gt;
* Signal handlers and the operations to read and reset the values in the main loops should be using atomic operations.&lt;br /&gt;
&lt;br /&gt;
* Catch and handle std::bad_alloc whenever possible.&lt;br /&gt;
&lt;br /&gt;
== Fairly contained changes ==&lt;br /&gt;
&lt;br /&gt;
* Make it so game servers can be forked as separate processes. This helps a lot for debugging and also would help for age development, making it easier to change SDL and retest. Otherwise you have to shut down the whole frontend server or wait out the age's linger time. This work was started but not completed, and that code can be found inside &amp;lt;tt&amp;gt;FORK_GAME_TOO&amp;lt;/tt&amp;gt; #ifdefs. If you do this, I suggest you consider separating &amp;lt;tt&amp;gt;FORK_GAME_TOO&amp;lt;/tt&amp;gt; from &amp;lt;tt&amp;gt;FORK_ENABLE&amp;lt;/tt&amp;gt; so that one could have forked game servers and *not* forked auth/file servers.&lt;br /&gt;
&lt;br /&gt;
* Age population limits are unimplemented. The value is in the vault, but the server does not look at it.&lt;br /&gt;
&lt;br /&gt;
* Figure out how to throw out clones and SDL when a player leaves the age. Please see the &amp;quot;clean up clone, SDL&amp;quot; section in GameServer::conn_shutdown(). Right now this is full of special cases: it handles the Kemo bugs and and Quabs specially (a different thing for each). It may be that this is required for best behavior, but I still feel like I've missed something despite heavy scrutiny of the data. This is more of a research project and not much of a code project.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span id=&amp;quot;SDL_timestamps&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;MOUL parsed SDL nodes on the way into the vault. It probably only updated the node with fields having the Dirty bit set. In addition it added timestamps to the fields because the client does not put in the timestamps (reasonably so, as its time may be wrong). MOSS currently saves the SDL wholesale. This basically works, but with the timestamps properly added, the game server can merge the vault, age, and global SDL in any order and without strange rules. Note: if you do this, you also need to write a script or some other way to update all the SDL nodes in existing MOSS DBs.&lt;br /&gt;
&lt;br /&gt;
* The kickable SDL filtering algorithm is the same one I put in Alcugs ages ago. It is better than nothing but not as good as Plasma's. You will see more warping of kickables than with Cyan's server. This project is to come up with a better way of deciding what physical SDL to send to all the clients, based on those messages all the clients are sending to the server.&lt;br /&gt;
&lt;br /&gt;
* The server is probably supposed to use RelevanceRegion information to avoid sending SDL updates to clients who don't share a relevance region with the originating client. (The idea being to reduce network traffic, since hopefully the client already avoids rendering/physics on things in irrelevant regions.) Things work if the server doesn't filter, so MOSS doesn't. Also, I do not have strong evidence to believe this supposition is actually correct. Which is the other reason MOSS doesn't do it. Finding out, and implementing it if so, would be a nice project.&lt;br /&gt;
&lt;br /&gt;
* Figure out what the server is supposed to do with plSetNetGroupIDMsg and do it. Right now MOSS just drops it to no apparent ill effect. I am deeply suspicious of this message due to seeing it at aurally unpleasant times in UU. (Old, old notes: &amp;quot;may have to do with infinitely looping scraping noises&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;kCli2Auth_SendFriendInviteRequest&amp;lt;/tt&amp;gt; is not fully supported (it is dropped on the floor).&lt;br /&gt;
&lt;br /&gt;
== Bigger changes ==&lt;br /&gt;
&lt;br /&gt;
* The following messages are unimplemented.&lt;br /&gt;
** &amp;lt;tt&amp;gt;kCli2Auth_VaultSetSeen&amp;lt;/tt&amp;gt;  --  unimplemented in client&lt;br /&gt;
** &amp;lt;tt&amp;gt;kCli2Auth_ScoreDelete&amp;lt;/tt&amp;gt;  --  never saw one, so couldn't implement it&lt;br /&gt;
** &amp;lt;tt&amp;gt;kCli2Auth_ScoreSetPoints&amp;lt;/tt&amp;gt;  --  never saw one, so couldn't implement it&lt;br /&gt;
** &amp;lt;tt&amp;gt;kCli2Auth_ScoreGetRanks&amp;lt;/tt&amp;gt;  --  never saw one, so couldn't implement it&lt;br /&gt;
** &amp;lt;tt&amp;gt;kCli2Csr_PingRequest&amp;lt;/tt&amp;gt;  --  no recorded Csr messages&lt;br /&gt;
** &amp;lt;tt&amp;gt;kCli2Csr_RegisterRequest&amp;lt;/tt&amp;gt;&lt;br /&gt;
** &amp;lt;tt&amp;gt;kCli2Csr_LoginRequest&amp;lt;/tt&amp;gt;&lt;br /&gt;
** &amp;lt;tt&amp;gt;kCsr2Cli_PingReply&amp;lt;/tt&amp;gt;&lt;br /&gt;
** &amp;lt;tt&amp;gt;kCsr2Cli_RegisterReply&amp;lt;/tt&amp;gt;&lt;br /&gt;
** &amp;lt;tt&amp;gt;kCsr2Cli_LoginReply&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Add hood randomization to DRC hoods. Player-created hoods are randomized by the Python in the Nexus when the hood is created. DRC hoods, however, are created by the server. In MOSS's case, they are created entirely by SQL code. So adding DRC hood randomization means noticing when the DB has created a new DRC hood, creating and modifying SDL in the backend, and then finding and modifying the age SDL node for that new hood. All before responding to the client creating the new avatar and thus the new DRC hood.&lt;br /&gt;
&lt;br /&gt;
* The MessageQueue class has a concept of priorities. The idea was to enable dropping of lower-priority messages if a queue to a given client starts to back up. (The lowest priority being voice chat, then avatar movements, with world state changes being highest.) The measurement of queue length or throughput necessary for that is not implemented. So, neither is the dropping. (There is the very beginnings of some if &amp;lt;tt&amp;gt;DO_PRIORITIES&amp;lt;/tt&amp;gt; is #defined.) As such, queue users don't do a good job of priority-setting, although VOICE and FRONT are properly used. The idea wasn't to order the queue (except for FRONT), but to skip sending, say, a VOICE message when we encounter one, if the queue congestion measure says to.&lt;br /&gt;
&lt;br /&gt;
* '''Vault security'''&lt;br /&gt;
: The MOSS vault is as insecure as the MOUL vault. Need I say more? Here are some starter thoughts.&lt;br /&gt;
:* MOSS should parse incoming SDL messages and sanity-check them. See also [[#SDL_timestamps | adding timestamps]].&lt;br /&gt;
:* MOSS could probably verify other blob contents too.&lt;br /&gt;
:* Anyone can save anything to any node, and can fetch any node if they know its type and ID. We can deny these requests if the user shouldn't have access. Possibly [[MOSS-Developer_Notes#notifier | the notifier field]] can help.&lt;br /&gt;
:* Much more, I'm sure. Better vault security ''is'' possible.&lt;br /&gt;
&lt;br /&gt;
* Eliminate excessive byteswapping of opaque server IDs in BackendMessages. This is to say, in the backend server, when reading in the messages, it byte-swaps the IDs to store them, only ever uses them in equality tests with other IDs, and then byte-swaps them back when sending new messages. (On a little-endian box there's no swapping so it does not cost much, but it's the principle of the matter.) Unfortunately this really needs to be tested on a big-endian machine.&lt;br /&gt;
&lt;br /&gt;
* Try changing the File server to do [[MOSS-Setup#ackless | ackless downloads]], too. Maybe only if there is only one download at a time, though.&lt;br /&gt;
&lt;br /&gt;
== Scalability issues ==&lt;br /&gt;
&lt;br /&gt;
Performance and scalability are always interesting questions. And frequently ignored, because they only matter for larger installations.&lt;br /&gt;
&lt;br /&gt;
These are ideas unimplemented because they only really matter for large&lt;br /&gt;
shards. Large as in having, let's say, 50+ concurrent '''busy''' users. (50&lt;br /&gt;
people standing in the city chatting doesn't actually do much.) Maybe MOSS is&lt;br /&gt;
okay with that number now, in which case &amp;quot;large&amp;quot; is more. It is entirely&lt;br /&gt;
unknown.&lt;br /&gt;
&lt;br /&gt;
* Performance testing. Instrumentation. There should be a load generator to do this. This was not high on the list during development, with a user base of 3.&lt;br /&gt;
&lt;br /&gt;
* See the last paragraph in the comments at the top of FileTransaction.h about how multiple file transactions of the same file should share a single opened file.&lt;br /&gt;
&lt;br /&gt;
* Allow speculative pre-caching of AgeInfoNodes and PlayerInfoNodes when node changed notifications come from the vault server and are forwarded to any connected client. Cache in the auth server, vault server, or both. The goal is to reduce latency on those requests the client freezes for.&lt;br /&gt;
&lt;br /&gt;
* The backend protocol supports game servers requesting batches of GameMgr IDs. However, there is no code on either side to actually do so. The idea for this was that more populated ages, like the city, would benefit from doing batch requests. Every person who links in with a marker game needs a new global game ID, and it would be nice to cut out any extra backend round trips for links, even though this particular round trip does not block the link process (aside from being something the backend is doing when it could be doing something else).&lt;br /&gt;
&lt;br /&gt;
* Database performance could be measured and the SQL or even tables optimized.&lt;br /&gt;
&lt;br /&gt;
* MOSS currently uses a single blocking connection to the DB. Implement and investigate performance of multiple DB connections, or asynchronous ones. Maybe the backend server has to become threaded to gain the best advantage.&lt;br /&gt;
&lt;br /&gt;
* In a big shard, we may need to split the backend server work up. The [[MOSS-Developer_Notes#backend_typecodes | backend protocol]] is designed to support separating backend work between threads. The &amp;quot;classes&amp;quot; of backend messages in a bitfield are meant as a way to quickly route a backend message to an appropriate backend thread or process.&lt;br /&gt;
&lt;br /&gt;
== Frontend/backend interactions ==&lt;br /&gt;
&lt;br /&gt;
* Add encryption to the backend protocol. This itself is not a big deal (though you have to pick a good key negotiation, and do not forget to consider authentication mechanisms), but it does mean all the BackendMessage fill_buffer() code paths would be newly exercised, so a lot of regression testing would be in order.&lt;br /&gt;
&lt;br /&gt;
* It would be much easier on the DB if updates to markers are batched by the game server. This especially applies to capturing markers. See the comments in the setmarkerto() and startmarkergame() SQL functions.&lt;br /&gt;
&lt;br /&gt;
* The backend protocol allows for frontends hosting ages to specify only a subset of ages that can be hosted there. This is unused right now; the message has a field saying, &amp;quot;this is the length of the following age restriction list&amp;quot; and it is always zero. When there are no restrictions the backend can request any frontend to host any age.&lt;br /&gt;
** The need for splitting hostable ages is unclear, but in a very large shard you might, for example, put all city instances, or even only the public one, on a separate server. It would also allow someone to join a shard and host just their own age, or whatever.&lt;br /&gt;
** Since the frontend never sends restrictions, the backend currently has no way to store and use them. So there is work on both sides.&lt;br /&gt;
** Presumably which ages a frontend server can host would be a configuration option but it could be done instead by restricting the contents of the game/age directory. That would not allow even finer-grained restrictions, but this whole project kind of needs a real use case to flesh out what is needed.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span id=&amp;quot;connection_merging&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;Having one backend TCP connection per frontend server is probably not a good thing, in terms of efficiency, or of scalability with a cluster of machines. We could change it to have one backend connection per frontend ''process'' and funnel everything through it. The mostly-implemented but unused and untested MultiWriterMessageQueue was meant, in part, to support this (there are multiple threads writing, but only one thread reading, which writes to the socket).&lt;br /&gt;
&lt;br /&gt;
: Then when messages are received in the frontend there needs to be some way of passing the message to the right thread and signaling them something is present to be handled. This is all unimplemented but the format of the backend messages is meant to take care of this case (in particular, the two &amp;quot;server IDs&amp;quot; in the header are for dispatching messages to the correct thread).&lt;br /&gt;
&lt;br /&gt;
: However, essentially the same changes would be necessary if the backend server is folded into the main server so there is only one process; then &amp;quot;sending&amp;quot; messages to the backend server is just putting them on the (shared) queue that would have been used to funnel everything through one connection, and &amp;quot;receiving&amp;quot; them is just taking them off that queue since there's no TCP connection to deal with.&lt;br /&gt;
&lt;br /&gt;
== New functionality ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span id=&amp;quot;scripting&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;I am guessing Cyan's server handles the GameMgr stuff with server-side scripting. At the time MOSS was implemented there was no expectation that new game types may be added so adding in a scripting language was not worth the problems incumbent with doing so. Also the overall value of scripting is not clear (especially for the cost in server complication). However, it could be done. The project would have to include embedding the scripting and then rewriting stuff using scripts.&lt;br /&gt;
: Please note, a lot of effort went into getting the Heek right, handling ties, allowing people to accidentally stand up and sit back down in the game, and probably other details I forgot. If you want to script Heek, it really ought to still work as well.&lt;br /&gt;
&lt;br /&gt;
* Really adventurous hardcore project: destroy KI hacks. The server would have to be able to analyze all game traffic to decide whether it looks okay. To do it right the server would have to have and understand PRP files and do physics. Also &amp;quot;console&amp;quot; commands have to be wisely filtered. If you're daunted, join the club.&lt;br /&gt;
&lt;br /&gt;
* Add a data export API; see Blizzard's Armory as an example.  This could enable players to have web-visible &amp;quot;Achievements&amp;quot; and even allow for automation of integration with social media.  This can add value to the game without requiring any client changes.  A well-designed website taking advantage of this API might:&lt;br /&gt;
** Permit players to control privacy settings on whether their profiles should be public or private (default should be private!)&lt;br /&gt;
** View/Display their current game accomplishments (relto pages, sparks, ages completed)&lt;br /&gt;
** Enable automated posting to social media when the player accomplishes a new goal&lt;br /&gt;
&lt;br /&gt;
== Redesigns ==&lt;br /&gt;
{{tba}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:MOSS]]&lt;/div&gt;</summary>
		<author><name>A'moaca'</name></author>
	</entry>
	<entry>
		<id>https://wiki.openuru.org/index.php?title=MOSS/Setup&amp;diff=1041</id>
		<title>MOSS/Setup</title>
		<link rel="alternate" type="text/html" href="https://wiki.openuru.org/index.php?title=MOSS/Setup&amp;diff=1041"/>
		<updated>2011-04-11T06:32:13Z</updated>

		<summary type="html">&lt;p&gt;A'moaca': /* Key Files */ MOSS-3 is fixed, and make_cyan_dh has -C now&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MOSS currently only runs on Unix. Not Windows. It ought to work on Mac OS/X&lt;br /&gt;
(even PowerPC) but nobody has tried yet.&lt;br /&gt;
&lt;br /&gt;
Please also see the&lt;br /&gt;
[http://foundry.openuru.org/fisheye/browse/MOSS/doc/setup main setup instructions].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Compile ==&lt;br /&gt;
&lt;br /&gt;
=== Prerequisites ===&lt;br /&gt;
&lt;br /&gt;
Before you start, you need to ensure you have the following:&lt;br /&gt;
* pthreads (almost certainly installed already)&lt;br /&gt;
* libiconv (almost certainly installed already)&lt;br /&gt;
* OpenSSL (also almost certainly installed) -- you need both the libraries and the development headers if that's separate (I'm looking at you, Debian)&lt;br /&gt;
* Zlib (also probably installed) -- both the library and the development stuff if separate&lt;br /&gt;
* PostgreSQL -- both the sever and client, plus any development packages&lt;br /&gt;
* libpqxx -- both the library and the development package&lt;br /&gt;
* gcc, g++, whatever all you need for compiling C++&lt;br /&gt;
&lt;br /&gt;
If you are compiling from a clone of an Hg respository and there is no &lt;br /&gt;
&amp;quot;configure&amp;quot; script, you also need the autotools:&lt;br /&gt;
* autoconf&lt;br /&gt;
* automake&lt;br /&gt;
* libtool&lt;br /&gt;
&lt;br /&gt;
'''If you are reading this, please go over to'''&lt;br /&gt;
[[MOSS-Distribution_Specific_Instructions]] '''and fill in how to install all that on YOUR distribution/OS. Thank you!'''&lt;br /&gt;
&lt;br /&gt;
=== configure ===&lt;br /&gt;
&lt;br /&gt;
If you don't have a &amp;quot;configure&amp;quot; file, it must be generated. Run the&lt;br /&gt;
&amp;quot;bootstrap.sh&amp;quot; script to create it.&lt;br /&gt;
&lt;br /&gt;
Run &amp;quot;./configure&amp;quot;. The configure script takes many options. For a full listing&lt;br /&gt;
run &amp;quot;./configure --help&amp;quot;. The default options set up the server to match the&lt;br /&gt;
way Cyan's works. Here are the options you are probably interested in:&lt;br /&gt;
; --prefix&lt;br /&gt;
: Specify where &amp;quot;make install&amp;quot; places the files. If you are using a non-typical location you may need to add ''prefix''/lib to your LDFLAGS or something.&lt;br /&gt;
; &amp;lt;span id=&amp;quot;ackless&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;--enable-fast-download&lt;br /&gt;
: During auth file downloads, Cyan's server waits for the client to acknowledge every 32k of data sent. I believe this was to fix the &amp;quot;zero seconds remaining&amp;quot; bug. MOSS does not have that bug. Use --enable-fast-download to configure the server to send data as fast as it can, thereby using all the bandwidth available.&lt;br /&gt;
; --disable-single-login&lt;br /&gt;
: If you use this, multiple different avatars on the same account can be logged in at once. Logging into the same avatar will boot the other. Without disabling &amp;quot;single login&amp;quot;, logging into the same account will boot whatever avatar is logged in from that account.&lt;br /&gt;
Other options:&lt;br /&gt;
; --enable-require-secure-download&lt;br /&gt;
: Boot users who don't download python.pak.&lt;br /&gt;
; --enable-encryption=type&lt;br /&gt;
: The default is &amp;quot;cyan_dh&amp;quot;. MOSS allows you to disable encryption, or (legacy) use [[MOSS-Notes#RSA | RSA]].&lt;br /&gt;
; --enable-fork&lt;br /&gt;
: The primary use for this is if you need to debug auth or file servers. It is much easier to debug single-threaded programs.&lt;br /&gt;
; --enable-debug&lt;br /&gt;
: Anyone developing MOSS or willing to run some extra bug-hunting code should use this. If the bug-hunting code finds a bad thing it will make the server dump core so you can debug it.&lt;br /&gt;
; --enable-old-protocol&lt;br /&gt;
: This makes MOSS use older protocol versions. You probably don't need this.&lt;br /&gt;
If you have any trouble with configure finding the locations of various&lt;br /&gt;
libraries, you can use these:&lt;br /&gt;
; --with-postgres=PREFIX&lt;br /&gt;
; --with-libpqxx=PREFIX&lt;br /&gt;
; --with-openssl=PREFIX&lt;br /&gt;
; --with-zlib=PREFIX&lt;br /&gt;
; --with-iconv=PREFIX&lt;br /&gt;
&lt;br /&gt;
=== Compile ===&lt;br /&gt;
&lt;br /&gt;
Run &amp;quot;make&amp;quot;. Assuming that succeeds, you probably should use &amp;quot;make install&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Now cd into the postgresql directory. Here you need to compile a custom&lt;br /&gt;
PostgreSQL module that creates UUIDs. Follow the instructions in the README&lt;br /&gt;
file there, but for most people this should just be running &amp;quot;make&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Install the postgres module in your postgres install. Do this by copying the&lt;br /&gt;
moss_uuidgen.so file you just compiled. You'll need to log in as root to do&lt;br /&gt;
this (&amp;quot;sudo cp moss_uuidgen.so /path/to/postgres/modules&amp;quot; on most&lt;br /&gt;
systems). Please check [[MOSS-Distribution_Specific_Instructions]] and fill in&lt;br /&gt;
where to copy it for your system if it's not there already. Consult PostgreSQL&lt;br /&gt;
documentation if you're not sure. After the library is installed, restart the&lt;br /&gt;
DB server.&lt;br /&gt;
&lt;br /&gt;
== Set Up the Database ==&lt;br /&gt;
&lt;br /&gt;
The easiest way to set up the database is to create a &amp;quot;moss&amp;quot; user to be&lt;br /&gt;
associated with the MOSS database. If you want to use a different username, you&lt;br /&gt;
will have to edit the moss.sql file to match. The moss user needs to be able to&lt;br /&gt;
modify tables in the MOSS DB.&lt;br /&gt;
&lt;br /&gt;
Most distributions create some user that has root access to the DB&lt;br /&gt;
when connecting from the local machine. In my example this user is &amp;quot;pgsql&amp;quot; but&lt;br /&gt;
yours may be different. Please check&lt;br /&gt;
[[MOSS-Distribution_Specific_Instructions]] for hints or to fill in the user&lt;br /&gt;
for your distribution.&lt;br /&gt;
&lt;br /&gt;
Start by creating the database. The default database name is &amp;quot;moss&amp;quot;; if you use&lt;br /&gt;
any other you'll have to set it in the MOSS&lt;br /&gt;
[[#Configuration_Files | configuration file]]. Make sure to use the 'UTF8'&lt;br /&gt;
encoding. Then create the &amp;quot;moss&amp;quot; user in the new database. Then load&lt;br /&gt;
postgresql/moss.sql into the new database.&lt;br /&gt;
&lt;br /&gt;
I did the following:&lt;br /&gt;
 su pgsql -c &amp;quot;psql postgres&amp;quot;&lt;br /&gt;
 create database moss with encoding='UTF8';&lt;br /&gt;
 \c moss&lt;br /&gt;
 create role moss with login;&lt;br /&gt;
 \q&lt;br /&gt;
 su pgsql -c &amp;quot;psql moss -f moss.sql&amp;quot;&lt;br /&gt;
After this, you can connect to the database as the &amp;quot;moss&amp;quot; user:&lt;br /&gt;
 psql -U moss&lt;br /&gt;
&lt;br /&gt;
If all that works, you are done setting up the database!&lt;br /&gt;
&lt;br /&gt;
To set up AllAgeGlobalSDLNodes, use global_sdl_manager (we have no VaultManager&lt;br /&gt;
to do it). This program is installed in ''prefix''/bin. To aid setup, the&lt;br /&gt;
support/set_to_moul.txt file can be used to set the global SDL state to a&lt;br /&gt;
reasonable default (with no sparks) by running something like:&lt;br /&gt;
 global_sdl_manager game/SDL &amp;lt; set_to_moul.txt&lt;br /&gt;
If you want sparks, you can turn them on yourself using this program, but the&lt;br /&gt;
Minkata one is still broken.&lt;br /&gt;
&lt;br /&gt;
== Set Up Files ==&lt;br /&gt;
&lt;br /&gt;
There are quite a few files that the server needs to use. All these files are&lt;br /&gt;
located by default in locations relative to where you will *start* the&lt;br /&gt;
server. The location of all the files can be configured in the&lt;br /&gt;
[[#Configuration_Files | configuration files]]; you may find it easiest to&lt;br /&gt;
specify absolute paths (starting with &amp;quot;/&amp;quot;) there.&lt;br /&gt;
&lt;br /&gt;
=== File Server Data ===&lt;br /&gt;
&lt;br /&gt;
You need to start with your current Uru install (MOULagain, presumably). This&lt;br /&gt;
procedure assumes you can run a Windows application to create the file server&lt;br /&gt;
manifets MOSS needs. This seems a reasonable assumption when the client itself&lt;br /&gt;
is a Windows app.&lt;br /&gt;
&lt;br /&gt;
Copy support/ManifestCreator.exe and support/Mainfests.zip to your Windows&lt;br /&gt;
box. Unzip Manifests.zip. This will make a &amp;quot;CyanStructure&amp;quot; folder. The .txt&lt;br /&gt;
files in this folder are input. They describe the files which need to be in the&lt;br /&gt;
final manifests. It is important to use \ as the directory separator.&lt;br /&gt;
&lt;br /&gt;
Start up ManifestCreator. To generate a manifest, click &amp;quot;Make Manifest&amp;quot; and it&lt;br /&gt;
brings up a dialog. Navigate to the CyanStructure folder, and select all the&lt;br /&gt;
.txt files there. Then click OK and when it pops up a dialog asking for the&lt;br /&gt;
location of your Uru install, navigate to that directory, click OK and wait for&lt;br /&gt;
a bit.&lt;br /&gt;
&lt;br /&gt;
When it is done stop and consider which files you need the file server to&lt;br /&gt;
actually give to clients. If you are making this shard for yourself it could be&lt;br /&gt;
basically nothing, or everything. Note that we do not have a license to&lt;br /&gt;
redistribute Cyan's data files. So it is recommended not to copy any files you&lt;br /&gt;
should not distribute to your file server.&lt;br /&gt;
&lt;br /&gt;
Back on the machine which will run MOSS, create a file server directory. The&lt;br /&gt;
default is &amp;quot;./file&amp;quot; (relative to where you start it up). I recommend you make&lt;br /&gt;
it ''prefix''/file, where ''prefix'' is the installed location. Copy all the&lt;br /&gt;
.mbm files created in the CyanStructure folder to this directory. If you are&lt;br /&gt;
serving up a CWE client (built from open source) you will want to copy the&lt;br /&gt;
gzipped executable and libraries. They are located in&lt;br /&gt;
CyanStructure\Client\External and need to be in ''file dir''/Client/External on&lt;br /&gt;
your server to match. Anything you can distribute and that clients will need to&lt;br /&gt;
download, like a new age, also should be copied. Make sure to match the&lt;br /&gt;
directory structures when copying them over.&lt;br /&gt;
&lt;br /&gt;
Finally, Mac clients request the &amp;quot;macExternal&amp;quot; manifest instead of&lt;br /&gt;
&amp;quot;External&amp;quot;. There are added files in the Mac manifest, but if you don't have&lt;br /&gt;
them to generate a proper manifest from, just copy or symlink External.mbm to&lt;br /&gt;
macExternal.mbm. If you do have the files, you can generate the proper manifest&lt;br /&gt;
using ManifestCreator and the support/macExternal.txt file.&lt;br /&gt;
&lt;br /&gt;
=== Auth Server Data ===&lt;br /&gt;
&lt;br /&gt;
Like for the file server data, the default auth directory is &amp;quot;./auth&amp;quot; (relative&lt;br /&gt;
to where you start it up). I recommend using ''prefix''/auth.&lt;br /&gt;
&lt;br /&gt;
A script automating all the following steps in this section (except for any&lt;br /&gt;
user-created ages) is in the works.&lt;br /&gt;
&lt;br /&gt;
This directory is required to have another subdirectory named &amp;quot;default&amp;quot;. You&lt;br /&gt;
must keep a copy here of the encrypted Python and SDL files for clients to&lt;br /&gt;
download. The easiest way to get a set of these files is from the Cyan-provided&lt;br /&gt;
[http://assets.openuru.org/cyan/AuthFiles.zip AuthFiles.zip]. Download this&lt;br /&gt;
file, and unzip it. Copy the entire contents of the resulting AuthFiles/893&lt;br /&gt;
directory to ''auth dir''/default/. The resulting directory structure is:&lt;br /&gt;
 auth&lt;br /&gt;
   default&lt;br /&gt;
     Python&lt;br /&gt;
       python.pak&lt;br /&gt;
     SDL&lt;br /&gt;
       various .sdl files&lt;br /&gt;
     encryption.key&lt;br /&gt;
&lt;br /&gt;
Now you have to make manifest files here as well. Make a Python.txt file which&lt;br /&gt;
contains one line: &amp;quot;Python\python.pak&amp;quot;. Make an SDL.txt file with contains one&lt;br /&gt;
line per file in the SDL directory. The lines look like&lt;br /&gt;
&amp;quot;SDL\BaronCityOffice.sdl&amp;quot;. I just toss these in the auth/default directory but&lt;br /&gt;
you don't have to. The server does not look at them.&lt;br /&gt;
&lt;br /&gt;
If you have user-created ages with SDL files, be sure to add them to the SDL&lt;br /&gt;
directory here. Encrypt them with the encryption.key. (A tool to do this does&lt;br /&gt;
exist in the CWE source.) Similarly, if you want to add Python, you can rebuild&lt;br /&gt;
the python.pak file, but if you are adding a new age, you may find it easier to&lt;br /&gt;
add a new .pak file. If you do that, encrypt it and then add a new line to the&lt;br /&gt;
Python.txt file for your new .pak. The client will download them all.&lt;br /&gt;
&lt;br /&gt;
Once you have listed each SDL and Python file, you can use the Perl script&lt;br /&gt;
support/make-mbam.pl to create the .mbam files. If you don't have Perl,&lt;br /&gt;
ManifestCreator.exe will also create the files. Select &amp;quot;Auth Server&amp;quot; in the&lt;br /&gt;
&amp;quot;Manifest type&amp;quot; dropdown. If you use ManifestCreator, make sure it has the&lt;br /&gt;
Python and SDL directories and their contents. Make sure to copy the resulting&lt;br /&gt;
two .mbam files to your ''auth-dir''/default directory.&lt;br /&gt;
&lt;br /&gt;
=== Game Server Data ===&lt;br /&gt;
&lt;br /&gt;
Just like for the file and auth server data, the default game directory is&lt;br /&gt;
&amp;quot;./game&amp;quot; (relative to where you start it up). I recommend using&lt;br /&gt;
''prefix''/game.&lt;br /&gt;
&lt;br /&gt;
A script automating all the following steps in this section (except for&lt;br /&gt;
any user-created ages) is in the works.&lt;br /&gt;
&lt;br /&gt;
The game servers need unencrypted .sdl and .age files. The easiest way to get a&lt;br /&gt;
set of these files is from the Cyan-provided&lt;br /&gt;
[http://assets.openuru.org/cyan/Scripts.zip Scripts.zip]. Download this file&lt;br /&gt;
and unzip it. Copy/move the Scripts/SDL directory to ''game-dir''. Then create&lt;br /&gt;
''game-dir''/age and copy Scripts/dat/*.age to it. (MOSS does not use the .fni&lt;br /&gt;
files.)&lt;br /&gt;
&lt;br /&gt;
Do not forget to copy any user-created ages' SDL and .age files here. This copy&lt;br /&gt;
needs to be unencrypted.&lt;br /&gt;
&lt;br /&gt;
Now there is one more step. The SDL files the game server uses need to be moved&lt;br /&gt;
around, some into subdirectories, and some renamed because Unix treats file&lt;br /&gt;
names case-sensitively. Please read the details in the doc/setup file (linked&lt;br /&gt;
at the top of this page). You should have three subdirectories when you're&lt;br /&gt;
done. User-created ages may need subdirectories too, if they have multiple .sdl&lt;br /&gt;
files. If you find this way too complex, just move all the .sdl files into&lt;br /&gt;
the common subdirectory. You lose some small optimizations this way and you will&lt;br /&gt;
need to restart the server if any SDL files change.&lt;br /&gt;
&lt;br /&gt;
At the end the directory structure should be:&lt;br /&gt;
 game&lt;br /&gt;
   age&lt;br /&gt;
     various .age files&lt;br /&gt;
   SDL&lt;br /&gt;
     common&lt;br /&gt;
       some .sdl files&lt;br /&gt;
     Garrison&lt;br /&gt;
       a couple of .sdl files&lt;br /&gt;
     Teledahn&lt;br /&gt;
       other .sdl files&lt;br /&gt;
     more .sdl files&lt;br /&gt;
&lt;br /&gt;
== Key Files ==&lt;br /&gt;
&lt;br /&gt;
The modified Diffie-Hellman algorithm used in the client and MOSS by default&lt;br /&gt;
requires the server to have private keys. '''Do not share them with anyone.'''&lt;br /&gt;
They should not be world-readable.&lt;br /&gt;
&lt;br /&gt;
You can generate keys using the &amp;quot;make_cyan_dh&amp;quot; program which will be installed&lt;br /&gt;
in ''prefix''/bin. Or, there might be a program to generate keys in the CWE&lt;br /&gt;
source, but the chance of it outputting the private keys in the format MOSS&lt;br /&gt;
wants is basically zero. Generate a key for each of auth, game, and&lt;br /&gt;
gatekeeper. Run &amp;quot;make_cyan_dh -h&amp;quot; to see what generators to use if you want to&lt;br /&gt;
match those MOULagain is using. If you're building your own client you can use&lt;br /&gt;
whatever generator you want. Note: I see no reason not to use OpenSSL default&lt;br /&gt;
generators such as 2, 3, or 5. In fact, unless you are a cryptographer, I do not&lt;br /&gt;
recommend departing from these. If you are a cryptographer, you probably did&lt;br /&gt;
not need to hear that from me!&lt;br /&gt;
&lt;br /&gt;
The -s and -c/-C options direct the program to write the data for the server and&lt;br /&gt;
client to files, respectively, e.g.:&lt;br /&gt;
 make_cyan_dh -g 2 -s auth_key.der -C pnNbAuthKey.hpp&lt;br /&gt;
or &lt;br /&gt;
 make_cyan_dh -g 2 -s auth_key.der -c auth_key.bin&lt;br /&gt;
If you're compiling a CWE client, you can use the -C option to output a C++ file that should be a drop-in replacement for the current key files. Make sure you have at least revision 2 of the MOSS source to use -C. (You may need to do a clean and a rebuild if you have previously compiled CWE with a different key; the dependencies in the projects are not set up perfectly.) If you're not compiling a client, you probably want the -c option, and it's up to you what to do with the .bin file.&lt;br /&gt;
&lt;br /&gt;
Take the .der file (contains the PRIVATE key) and move it to ''prefix''. I&lt;br /&gt;
suggest using ''prefix''/etc/auth_key.der. Make it readable only by the user&lt;br /&gt;
which will be running the server: &amp;quot;chmod 400 ''prefix''/etc/auth_key.der; chown&lt;br /&gt;
mossuser ''prefix''/etc/auth_key.der&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Do the same for the game and gatekeeper keys. ''prefix''/etc/game_key.der and&lt;br /&gt;
''prefix''/etc/gatekeeper_key.der.&lt;br /&gt;
&lt;br /&gt;
== Configuration Files ==&lt;br /&gt;
&lt;br /&gt;
Now that you have all the other files set up, it's time to configure MOSS&lt;br /&gt;
itself. There is a configuration file for each server process. The default&lt;br /&gt;
location for moss_backend is ./etc/moss_backend.cfg and the default&lt;br /&gt;
location for moss is ./etc/moss.cfg. I recommend copying main.cfg to&lt;br /&gt;
''prefix''/etc/moss.cfg and backend.cfg to ''prefix''/etc/moss_backend.cfg.&lt;br /&gt;
&lt;br /&gt;
Now open each up in your text editor. The files contain instructions for how to&lt;br /&gt;
set the various options.&lt;br /&gt;
&lt;br /&gt;
I recommend you set the following in moss.cfg to the absolute paths&lt;br /&gt;
corresponding to where you installed these files in earlier steps:&lt;br /&gt;
&amp;lt;tt&amp;gt;auth_download_dir&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;auth_key_file&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;file_download_dir&amp;lt;/tt&amp;gt;,&lt;br /&gt;
&amp;lt;tt&amp;gt;game_data_dir&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;game_key_file&amp;lt;/tt&amp;gt;,&lt;br /&gt;
&amp;lt;tt&amp;gt;gatekeeper_key_file&amp;lt;/tt&amp;gt;. In addition I recommend you set &amp;lt;tt&amp;gt;log_dir&amp;lt;/tt&amp;gt;&lt;br /&gt;
to somewhere you want log files to go. Remember the log directory has to be&lt;br /&gt;
writable by the user that will run the server. You may also need to set&lt;br /&gt;
&amp;lt;tt&amp;gt;pid_file&amp;lt;/tt&amp;gt; to a location writable by that user. If you want the .pid&lt;br /&gt;
file to be created. Read through all the options to make sure your setup is as&lt;br /&gt;
you want. The only mandatory configuration directive is&lt;br /&gt;
&amp;lt;tt&amp;gt;external_address&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For moss_backend.cfg look especially into &amp;lt;tt&amp;gt;log_dir&amp;lt;/tt&amp;gt; and&lt;br /&gt;
&amp;lt;tt&amp;gt;pid_file&amp;lt;/tt&amp;gt;. In addition, depending on how your DB is&lt;br /&gt;
[[#Set_Up_the_Database | set up]] you likely need to specify &amp;lt;tt&amp;gt;db_user&amp;lt;/tt&amp;gt;,&lt;br /&gt;
and maybe other DB parameters.&lt;br /&gt;
&lt;br /&gt;
== Security Considerations ==&lt;br /&gt;
&lt;br /&gt;
'''Please''' read about them at the end of&lt;br /&gt;
[http://foundry.openuru.org/fisheye/browse/MOSS/doc/setup doc/setup].&lt;br /&gt;
&lt;br /&gt;
Do not run MOSS as root.&lt;br /&gt;
&lt;br /&gt;
== Before You Open Your Server ==&lt;br /&gt;
&lt;br /&gt;
If you plan to let anyone other than you connect to your server, you have&lt;br /&gt;
certain obligations under the licenses of the software/data you will be&lt;br /&gt;
distributing from the file and auth servers.&lt;br /&gt;
&lt;br /&gt;
* The MOULagain EULA still does not provide for you to modify and redistribute the files. So do not put original or modified Cyan files on your file server. You can still have them listed in the .mbm (manifest) files. If someone has an incomplete install they will be forced to get the files from Cyan's file server. That is as yet still the only place from which you're supposed to get those files.&lt;br /&gt;
&lt;br /&gt;
* You are supplying GPL'd Python code. You must provide a way to acquire that code. If you are using unmodified Python you can link to the [http://assets.openuru.org/cyan/Scripts.zip original source]. If you modify it for any reason, you must make your changes available and tell your users where to get it.&lt;br /&gt;
&lt;br /&gt;
* If you are providing client executables from a CWE build:&lt;br /&gt;
** You probably need to add the GPL license file to the client install. The license is supposed to be conveyed with the executable, and the only sure way to do that is to install it from the file server same as the executable. This means you'll have to add it to ThinExternal.txt and External.txt and generate the new .mbm files, copying the .mbm files and LICENSE.txt.gz over to the appropriate locations. You probably should also arrange for the license to be available along with UruLauncher.&lt;br /&gt;
** You must provide a way to acquire the source for your client. The means is supposed to be &amp;quot;equivalent&amp;quot; to the way the executable is acquired. Links are probably sufficient. If you use an unmodified version you should be able to link to the repository (make sure you point to the actual changeset you used). If you modify files for your shard's public keys, status hostname, and/or gatekeeper/auth addresses, you have to additionally provide that source. Note: these are ''public'' keys, so don't worry, you're not giving anything away.&lt;br /&gt;
** Unless someone changes the jpeg library again, you need to credit IJG for jpeglib. The easiest may be to add another file doing so to the install. Or, if you are modifying Python for some reason, you could add it to the in-game credits along with all the other licenses:&lt;br /&gt;
 xUruCreditsJournalEnglish.py&lt;br /&gt;
 xUruCreditsJournalFrench.py&lt;br /&gt;
 xUruCreditsJournalGerman.py&lt;br /&gt;
 xUruCreditsJournalItalian.py&lt;br /&gt;
 xUruCreditsJournalSpanish.py&lt;br /&gt;
&lt;br /&gt;
The links or whatever means you use to provide access to the source of the&lt;br /&gt;
binaries and Python don't have to go into the client install, but they must be&lt;br /&gt;
somewhere reasonable for your users to find, &amp;quot;equivalent&amp;quot; to installing the software for your shard. I would put links to a copy of the&lt;br /&gt;
files on your shard's home page or something.&lt;br /&gt;
&lt;br /&gt;
See also [[CyanWorlds.com_Engine/FAQ#What_are_my_open_source_license_.28GPLv3.29_responsibilities_as_a_user.2C_developer_or_server_operator_.28e.g._shard_owner.29.3F | the CWE FAQ]].&lt;br /&gt;
&lt;br /&gt;
Please do not consider this advice the final or complete word on the&lt;br /&gt;
matter. All the licenses of all the data you use expect you to follow them. So&lt;br /&gt;
you have to do your due diligence. If you find something obviously missing from&lt;br /&gt;
this section, please add it!&lt;br /&gt;
&lt;br /&gt;
== Start It Up ==&lt;br /&gt;
&lt;br /&gt;
Now you should be set to run your server. Hopefully someone will contribute a&lt;br /&gt;
nice startup script. For now, cd to the directory you planned from the start to&lt;br /&gt;
start the server from (that's ''prefix'' in the earlier recommendations). Make&lt;br /&gt;
sure you are su'd to the user you want to run as. '''NOT root!''' Start&lt;br /&gt;
moss_backend first, then moss. E.g., if you have put the config files in&lt;br /&gt;
''prefix''/etc, you can just do:&lt;br /&gt;
 bin/moss_backend&lt;br /&gt;
 bin/moss&lt;br /&gt;
You can instead specify the location of the config file with the -c option.&lt;br /&gt;
If you've used absolute paths in the config files, you can thus easily run&lt;br /&gt;
the server from any directory.&lt;br /&gt;
&lt;br /&gt;
== Create Accounts ==&lt;br /&gt;
&lt;br /&gt;
Don't forget to create accounts for your users, or it will be difficult to log&lt;br /&gt;
in... Please just refer directly to &lt;br /&gt;
[http://foundry.openuru.org/fisheye/browse/MOSS/doc/user-management doc/user-management].&lt;br /&gt;
&lt;br /&gt;
Really short version:&lt;br /&gt;
 INSERT INTO accounts (name, hash, id, class, visitor)&lt;br /&gt;
 VALUES ('foo@example.com', '11223344...', uuid(), 'default', false);&lt;br /&gt;
&lt;br /&gt;
Hopefully someone will contribute a script to add users. A CGI script to&lt;br /&gt;
automatically add users would be neat too.&lt;br /&gt;
&lt;br /&gt;
== More Hints ==&lt;br /&gt;
&lt;br /&gt;
Please see the following for more information of interest to running a server.&lt;br /&gt;
&lt;br /&gt;
* [[MOSS-Notes]]&lt;br /&gt;
* [http://foundry.openuru.org/fisheye/browse/MOSS/doc/running doc/running]&lt;br /&gt;
&lt;br /&gt;
[[Category:MOSS]]&lt;/div&gt;</summary>
		<author><name>A'moaca'</name></author>
	</entry>
	<entry>
		<id>https://wiki.openuru.org/index.php?title=Wireshark_Plugin&amp;diff=1040</id>
		<title>Wireshark Plugin</title>
		<link rel="alternate" type="text/html" href="https://wiki.openuru.org/index.php?title=Wireshark_Plugin&amp;diff=1040"/>
		<updated>2011-04-11T05:57:45Z</updated>

		<summary type="html">&lt;p&gt;A'moaca': /* How to compile it */ note guest svn access is not working&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{UruDocProj}}&lt;br /&gt;
Welcome to the main page for the Uru Wireshark plugin!&lt;br /&gt;
&lt;br /&gt;
= Do I care about this? =&lt;br /&gt;
&lt;br /&gt;
Wireshark is a GUI-based network protocol analysis tool. (There is a command-line version too.) In short, it lets you look at network traffic to see what is going on, even in real-time. a'moaca' has figured out Uru bugs based on real-time behavior related to what is seen on the network, in addition to more subtle bugs discovered with detailed later analysis.&lt;br /&gt;
&lt;br /&gt;
Generally this tool will only be of interest to those working on the protocol or client/server code. It is also interesting for a more hobbyist &amp;quot;figure out how it works&amp;quot; perspective.&lt;br /&gt;
&lt;br /&gt;
But there is a caveat. The MOUL protocol (which the plugin calls &amp;quot;UruLive&amp;quot;) is protected by a form of public-key encryption. This means that the Uru plugin cannot read the contents of any but the very first packets of each connection, unless you have the private key or some means of determining the negotiated session key.&lt;br /&gt;
&lt;br /&gt;
Only Cyan should have the private key. Anyone writing new clients can choose to expose the session key for use with the Wireshark plugin. When people can run their own servers, they will in turn have their own private keys and they can use the plugin too. If you wish to use the plugin otherwise, I leave you to your creativity.&lt;br /&gt;
&lt;br /&gt;
The plugin will work on old UU/Alcugs traffic, though, should you happen to have any to look at.&lt;br /&gt;
&lt;br /&gt;
= History (why are things this weird way?) =&lt;br /&gt;
&lt;br /&gt;
a'moaca' first started the plugin while debugging a linking hang with old Alcugs (unet2) code. The resulting bare-bones transport-layer only version of the plugin was checked into the Alcugs repository (where some Alcugs-specific code was later added that is not present in this version as of now). Later, in support of other projects, a'moaca' began adding dissection of the rest of the protocol, based almost entirely on the Alcugs server code itself. This is the reason many of the names in the plugin are what they are.&lt;br /&gt;
&lt;br /&gt;
The hobbyist perspective led to gradually more dissection, proceeding on to the MOUL protocol. Over time, cjkelly1 has contributed a lot to the plugin as well, including some code contributions, effort spent figuring things out, testing, a lot of Windows-specific testing (usually unintentional but sometimes planned), and providing some of the correct names for things.&lt;br /&gt;
&lt;br /&gt;
Very little of the knowledge added by a'moaca' and cjkelly1 after what originated from the Alcugs source came from disassembly, the &amp;quot;usual&amp;quot; method of Uru reverse-engineering. It was done by looking at real traffic and educated guessing. This is the reason many other names are what they are, and this is why there are still some gaps in the dissection.&lt;br /&gt;
&lt;br /&gt;
If you want to fix any of this, submit a patch!&lt;br /&gt;
&lt;br /&gt;
= How to use it =&lt;br /&gt;
&lt;br /&gt;
(At the moment there isn't a compiled executable to distribute. This could change in the future. Until/unless a precompiled version is available, you will have to compile your own. For that, see the next section.)&lt;br /&gt;
&lt;br /&gt;
Using the Uru plugin is not much different than using Wireshark for any other protocol. Here are some extra notes:&lt;br /&gt;
* There are two configuration sections, &amp;quot;Uru&amp;quot; and &amp;quot;UruLive&amp;quot;. The &amp;quot;Uru&amp;quot; section covers configuration specific to the Prologue/UU/PotS protocol. The &amp;quot;UruLive&amp;quot; section covers configuration specific to the MOUL/MOULa protocol. Anything common to both is also in the &amp;quot;Uru&amp;quot; section (this is the toggle for hiding fields, and all SDL-related configuration).&lt;br /&gt;
* Be careful with your SDL files. Unfortunately, the MOUL SDL files are not a strict superset of PotS files (I believe there is at least one mismatch with the same version number, for example). Genrally one copy will suffice, though. If you do not provide SDL files, the plugin will use a crummy but serviceable algorithm that guesses the field types.&lt;br /&gt;
* The UruLive configuration contains several choices for protocol versioning. These apply to MOUL versions. You can basically ignore them unless you have ''old'' uncrypted traces. The default (Live 9, autodetect) should be good.&lt;br /&gt;
* Two ways to decrypt MOUL connections are provided: giving Wireshark each session key, or giving it the private key data for each type of connection.&lt;br /&gt;
** The first way requires configuring the 7-byte session key, if you have a way to determine it. This key is negotiated each connection. The input box accepts a comma-separated list of port=key pairs. Use the client port number (the one that is not 14617); this is how the plugin associates each key with a connection. The 7 bytes of the key should be in hexadecimal. An example value might be:&lt;br /&gt;
 1050=1A2B3C4D5E6F70,1053=1234ABCD5678EF&lt;br /&gt;
:* The second way requires knowledge of the server private key. Provide a key file for each connection type (auth, game, gatekeeper). The format of the key file is 128 bytes of binary data. The first 64 bytes are the modulus in '''big-endian''' order (note it is little-endian in the exectuables), and the second 64-bytes are the private key, again '''big-endian'''. (This key file choice is based on the baseless assumption that the actual key files are stored in a common format such as DER, which is big-endian.)&lt;br /&gt;
&lt;br /&gt;
= How to compile it =&lt;br /&gt;
&lt;br /&gt;
The code is present in OpenUru.org's Subversion repository at [http://foundry.openuru.org/svn/wireshark_plugin http://foundry.openuru.org/svn/wireshark_plugin].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;NOTE (2011-04-10): Currently &amp;quot;guest&amp;quot; Subversion access is not working. You will need to register for a [https://foundry.openuru.org/jira JIRA account] and use that username and password as described below. Hopefully guest access will be restored soon.&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To check it out, use your favorite Subversion GUI with username &amp;quot;guest&amp;quot; and password &amp;quot;guest&amp;quot;, or on the command line:&lt;br /&gt;
 svn co --username guest --password guest http://foundry.openuru.org/svn/wireshark_plugin&lt;br /&gt;
This will check out the latest version of the source in the current directory. You will also need a copy of the Wireshark source. It may be downloaded from [http://www.wireshark.org/download.html the Wireshark site]. Using 1.4.x or the &amp;quot;Development Release&amp;quot; is recommended, as the patch provided will work with that tree. Version 1.2.8 or newer will also work, but you will need to patch plugins\Makefile.nmake yourself, as the structure of the file differs between 1.2.x and newer releases.&lt;br /&gt;
&lt;br /&gt;
In the plugin directory, the INSTALL file provides build directions. The basic idea is that you patch the plugin into the Wireshark build and then build Wireshark normally. So you should be able to follow Wireshark's build documentation.&lt;br /&gt;
&lt;br /&gt;
The [http://www.wireshark.org/docs/wsdg_html_chunked Developer's Guide] contains [http://www.wireshark.org/docs/wsdg_html_chunked/ChSrcBuildFirstTime.html build instructions], which are pretty minimal. If you are building for Windows, check [http://www.wireshark.org/docs/wsdg_html_chunked/ChSetupWin32.html the additional instructions] and a'moaca' uses [http://wiki.wireshark.org/Development/MSVC7 this wiki page].&lt;br /&gt;
&lt;br /&gt;
= Contributing =&lt;br /&gt;
&lt;br /&gt;
OpenUru.org has a JIRA installation. You may use it for [http://foundry.openuru.org:7080/browse/WIREPLUG bugs and patch contributions]. JIRA account registration is public.  Please register there to submit bugs.&lt;br /&gt;
&lt;br /&gt;
Code contributions will be code-reviewed for safety and correctness. Please keep code to 79 columns or fewer. There are currently no plans to reject anything based on content unless it is actually incorrect. If you want commit access, contribute a couple working patches and then ask for access. This protocol may change in the future if it does not work.&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>A'moaca'</name></author>
	</entry>
	<entry>
		<id>https://wiki.openuru.org/index.php?title=MOSS/Setup&amp;diff=1037</id>
		<title>MOSS/Setup</title>
		<link rel="alternate" type="text/html" href="https://wiki.openuru.org/index.php?title=MOSS/Setup&amp;diff=1037"/>
		<updated>2011-04-10T06:01:09Z</updated>

		<summary type="html">&lt;p&gt;A'moaca': /* Key Files */ openssl also likes 3 for D-H generators&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MOSS currently only runs on Unix. Not Windows. It ought to work on Mac OS/X&lt;br /&gt;
(even PowerPC) but nobody has tried yet.&lt;br /&gt;
&lt;br /&gt;
Please also see the&lt;br /&gt;
[http://foundry.openuru.org/fisheye/browse/MOSS/doc/setup main setup instructions].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Compile ==&lt;br /&gt;
&lt;br /&gt;
=== Prerequisites ===&lt;br /&gt;
&lt;br /&gt;
Before you start, you need to ensure you have the following:&lt;br /&gt;
* pthreads (almost certainly installed already)&lt;br /&gt;
* libiconv (almost certainly installed already)&lt;br /&gt;
* OpenSSL (also almost certainly installed) -- you need both the libraries and the development headers if that's separate (I'm looking at you, Debian)&lt;br /&gt;
* Zlib (also probably installed) -- both the library and the development stuff if separate&lt;br /&gt;
* PostgreSQL -- both the sever and client, plus any development packages&lt;br /&gt;
* libpqxx -- both the library and the development package&lt;br /&gt;
* gcc, g++, whatever all you need for compiling C++&lt;br /&gt;
&lt;br /&gt;
If you are compiling from a clone of an Hg respository and there is no &lt;br /&gt;
&amp;quot;configure&amp;quot; script, you also need the autotools:&lt;br /&gt;
* autoconf&lt;br /&gt;
* automake&lt;br /&gt;
* libtool&lt;br /&gt;
&lt;br /&gt;
'''If you are reading this, please go over to'''&lt;br /&gt;
[[MOSS-Distribution_Specific_Instructions]] '''and fill in how to install all that on YOUR distribution/OS. Thank you!'''&lt;br /&gt;
&lt;br /&gt;
=== configure ===&lt;br /&gt;
&lt;br /&gt;
If you don't have a &amp;quot;configure&amp;quot; file, it must be generated. Run the&lt;br /&gt;
&amp;quot;bootstrap.sh&amp;quot; script to create it.&lt;br /&gt;
&lt;br /&gt;
Run &amp;quot;./configure&amp;quot;. The configure script takes many options. For a full listing&lt;br /&gt;
run &amp;quot;./configure --help&amp;quot;. The default options set up the server to match the&lt;br /&gt;
way Cyan's works. Here are the options you are probably interested in:&lt;br /&gt;
; --prefix&lt;br /&gt;
: Specify where &amp;quot;make install&amp;quot; places the files. If you are using a non-typical location you may need to add ''prefix''/lib to your LDFLAGS or something.&lt;br /&gt;
; &amp;lt;span id=&amp;quot;ackless&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;--enable-fast-download&lt;br /&gt;
: During auth file downloads, Cyan's server waits for the client to acknowledge every 32k of data sent. I believe this was to fix the &amp;quot;zero seconds remaining&amp;quot; bug. MOSS does not have that bug. Use --enable-fast-download to configure the server to send data as fast as it can, thereby using all the bandwidth available.&lt;br /&gt;
; --disable-single-login&lt;br /&gt;
: If you use this, multiple different avatars on the same account can be logged in at once. Logging into the same avatar will boot the other. Without disabling &amp;quot;single login&amp;quot;, logging into the same account will boot whatever avatar is logged in from that account.&lt;br /&gt;
Other options:&lt;br /&gt;
; --enable-require-secure-download&lt;br /&gt;
: Boot users who don't download python.pak.&lt;br /&gt;
; --enable-encryption=type&lt;br /&gt;
: The default is &amp;quot;cyan_dh&amp;quot;. MOSS allows you to disable encryption, or (legacy) use [[MOSS-Notes#RSA | RSA]].&lt;br /&gt;
; --enable-fork&lt;br /&gt;
: The primary use for this is if you need to debug auth or file servers. It is much easier to debug single-threaded programs.&lt;br /&gt;
; --enable-debug&lt;br /&gt;
: Anyone developing MOSS or willing to run some extra bug-hunting code should use this. If the bug-hunting code finds a bad thing it will make the server dump core so you can debug it.&lt;br /&gt;
; --enable-old-protocol&lt;br /&gt;
: This makes MOSS use older protocol versions. You probably don't need this.&lt;br /&gt;
If you have any trouble with configure finding the locations of various&lt;br /&gt;
libraries, you can use these:&lt;br /&gt;
; --with-postgres=PREFIX&lt;br /&gt;
; --with-libpqxx=PREFIX&lt;br /&gt;
; --with-openssl=PREFIX&lt;br /&gt;
; --with-zlib=PREFIX&lt;br /&gt;
; --with-iconv=PREFIX&lt;br /&gt;
&lt;br /&gt;
=== Compile ===&lt;br /&gt;
&lt;br /&gt;
Run &amp;quot;make&amp;quot;. Assuming that succeeds, you probably should use &amp;quot;make install&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Now cd into the postgresql directory. Here you need to compile a custom&lt;br /&gt;
PostgreSQL module that creates UUIDs. Follow the instructions in the README&lt;br /&gt;
file there, but for most people this should just be running &amp;quot;make&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Install the postgres module in your postgres install. Do this by copying the&lt;br /&gt;
moss_uuidgen.so file you just compiled. You'll need to log in as root to do&lt;br /&gt;
this (&amp;quot;sudo cp moss_uuidgen.so /path/to/postgres/modules&amp;quot; on most&lt;br /&gt;
systems). Please check [[MOSS-Distribution_Specific_Instructions]] and fill in&lt;br /&gt;
where to copy it for your system if it's not there already. Consult PostgreSQL&lt;br /&gt;
documentation if you're not sure. After the library is installed, restart the&lt;br /&gt;
DB server.&lt;br /&gt;
&lt;br /&gt;
== Set Up the Database ==&lt;br /&gt;
&lt;br /&gt;
The easiest way to set up the database is to create a &amp;quot;moss&amp;quot; user to be&lt;br /&gt;
associated with the MOSS database. If you want to use a different username, you&lt;br /&gt;
will have to edit the moss.sql file to match. The moss user needs to be able to&lt;br /&gt;
modify tables in the MOSS DB.&lt;br /&gt;
&lt;br /&gt;
Most distributions create some user that has root access to the DB&lt;br /&gt;
when connecting from the local machine. In my example this user is &amp;quot;pgsql&amp;quot; but&lt;br /&gt;
yours may be different. Please check&lt;br /&gt;
[[MOSS-Distribution_Specific_Instructions]] for hints or to fill in the user&lt;br /&gt;
for your distribution.&lt;br /&gt;
&lt;br /&gt;
Start by creating the database. The default database name is &amp;quot;moss&amp;quot;; if you use&lt;br /&gt;
any other you'll have to set it in the MOSS&lt;br /&gt;
[[#Configuration_Files | configuration file]]. Make sure to use the 'UTF8'&lt;br /&gt;
encoding. Then create the &amp;quot;moss&amp;quot; user in the new database. Then load&lt;br /&gt;
postgresql/moss.sql into the new database.&lt;br /&gt;
&lt;br /&gt;
I did the following:&lt;br /&gt;
 su pgsql -c &amp;quot;psql postgres&amp;quot;&lt;br /&gt;
 create database moss with encoding='UTF8';&lt;br /&gt;
 \c moss&lt;br /&gt;
 create role moss with login;&lt;br /&gt;
 \q&lt;br /&gt;
 su pgsql -c &amp;quot;psql moss -f moss.sql&amp;quot;&lt;br /&gt;
After this, you can connect to the database as the &amp;quot;moss&amp;quot; user:&lt;br /&gt;
 psql -U moss&lt;br /&gt;
&lt;br /&gt;
If all that works, you are done setting up the database!&lt;br /&gt;
&lt;br /&gt;
To set up AllAgeGlobalSDLNodes, use global_sdl_manager (we have no VaultManager&lt;br /&gt;
to do it). This program is installed in ''prefix''/bin. To aid setup, the&lt;br /&gt;
support/set_to_moul.txt file can be used to set the global SDL state to a&lt;br /&gt;
reasonable default (with no sparks) by running something like:&lt;br /&gt;
 global_sdl_manager game/SDL &amp;lt; set_to_moul.txt&lt;br /&gt;
If you want sparks, you can turn them on yourself using this program, but the&lt;br /&gt;
Minkata one is still broken.&lt;br /&gt;
&lt;br /&gt;
== Set Up Files ==&lt;br /&gt;
&lt;br /&gt;
There are quite a few files that the server needs to use. All these files are&lt;br /&gt;
located by default in locations relative to where you will *start* the&lt;br /&gt;
server. The location of all the files can be configured in the&lt;br /&gt;
[[#Configuration_Files | configuration files]]; you may find it easiest to&lt;br /&gt;
specify absolute paths (starting with &amp;quot;/&amp;quot;) there.&lt;br /&gt;
&lt;br /&gt;
=== File Server Data ===&lt;br /&gt;
&lt;br /&gt;
You need to start with your current Uru install (MOULagain, presumably). This&lt;br /&gt;
procedure assumes you can run a Windows application to create the file server&lt;br /&gt;
manifets MOSS needs. This seems a reasonable assumption when the client itself&lt;br /&gt;
is a Windows app.&lt;br /&gt;
&lt;br /&gt;
Copy support/ManifestCreator.exe and support/Mainfests.zip to your Windows&lt;br /&gt;
box. Unzip Manifests.zip. This will make a &amp;quot;CyanStructure&amp;quot; folder. The .txt&lt;br /&gt;
files in this folder are input. They describe the files which need to be in the&lt;br /&gt;
final manifests. It is important to use \ as the directory separator.&lt;br /&gt;
&lt;br /&gt;
Start up ManifestCreator. To generate a manifest, click &amp;quot;Make Manifest&amp;quot; and it&lt;br /&gt;
brings up a dialog. Navigate to the CyanStructure folder, and select all the&lt;br /&gt;
.txt files there. Then click OK and when it pops up a dialog asking for the&lt;br /&gt;
location of your Uru install, navigate to that directory, click OK and wait for&lt;br /&gt;
a bit.&lt;br /&gt;
&lt;br /&gt;
When it is done stop and consider which files you need the file server to&lt;br /&gt;
actually give to clients. If you are making this shard for yourself it could be&lt;br /&gt;
basically nothing, or everything. Note that we do not have a license to&lt;br /&gt;
redistribute Cyan's data files. So it is recommended not to copy any files you&lt;br /&gt;
should not distribute to your file server.&lt;br /&gt;
&lt;br /&gt;
Back on the machine which will run MOSS, create a file server directory. The&lt;br /&gt;
default is &amp;quot;./file&amp;quot; (relative to where you start it up). I recommend you make&lt;br /&gt;
it ''prefix''/file, where ''prefix'' is the installed location. Copy all the&lt;br /&gt;
.mbm files created in the CyanStructure folder to this directory. If you are&lt;br /&gt;
serving up a CWE client (built from open source) you will want to copy the&lt;br /&gt;
gzipped executable and libraries. They are located in&lt;br /&gt;
CyanStructure\Client\External and need to be in ''file dir''/Client/External on&lt;br /&gt;
your server to match. Anything you can distribute and that clients will need to&lt;br /&gt;
download, like a new age, also should be copied. Make sure to match the&lt;br /&gt;
directory structures when copying them over.&lt;br /&gt;
&lt;br /&gt;
Finally, Mac clients request the &amp;quot;macExternal&amp;quot; manifest instead of&lt;br /&gt;
&amp;quot;External&amp;quot;. There are added files in the Mac manifest, but if you don't have&lt;br /&gt;
them to generate a proper manifest from, just copy or symlink External.mbm to&lt;br /&gt;
macExternal.mbm. If you do have the files, you can generate the proper manifest&lt;br /&gt;
using ManifestCreator and the support/macExternal.txt file.&lt;br /&gt;
&lt;br /&gt;
=== Auth Server Data ===&lt;br /&gt;
&lt;br /&gt;
Like for the file server data, the default auth directory is &amp;quot;./auth&amp;quot; (relative&lt;br /&gt;
to where you start it up). I recommend using ''prefix''/auth.&lt;br /&gt;
&lt;br /&gt;
A script automating all the following steps in this section (except for any&lt;br /&gt;
user-created ages) is in the works.&lt;br /&gt;
&lt;br /&gt;
This directory is required to have another subdirectory named &amp;quot;default&amp;quot;. You&lt;br /&gt;
must keep a copy here of the encrypted Python and SDL files for clients to&lt;br /&gt;
download. The easiest way to get a set of these files is from the Cyan-provided&lt;br /&gt;
[http://assets.openuru.org/cyan/AuthFiles.zip AuthFiles.zip]. Download this&lt;br /&gt;
file, and unzip it. Copy the entire contents of the resulting AuthFiles/893&lt;br /&gt;
directory to ''auth dir''/default/. The resulting directory structure is:&lt;br /&gt;
 auth&lt;br /&gt;
   default&lt;br /&gt;
     Python&lt;br /&gt;
       python.pak&lt;br /&gt;
     SDL&lt;br /&gt;
       various .sdl files&lt;br /&gt;
     encryption.key&lt;br /&gt;
&lt;br /&gt;
Now you have to make manifest files here as well. Make a Python.txt file which&lt;br /&gt;
contains one line: &amp;quot;Python\python.pak&amp;quot;. Make an SDL.txt file with contains one&lt;br /&gt;
line per file in the SDL directory. The lines look like&lt;br /&gt;
&amp;quot;SDL\BaronCityOffice.sdl&amp;quot;. I just toss these in the auth/default directory but&lt;br /&gt;
you don't have to. The server does not look at them.&lt;br /&gt;
&lt;br /&gt;
If you have user-created ages with SDL files, be sure to add them to the SDL&lt;br /&gt;
directory here. Encrypt them with the encryption.key. (A tool to do this does&lt;br /&gt;
exist in the CWE source.) Similarly, if you want to add Python, you can rebuild&lt;br /&gt;
the python.pak file, but if you are adding a new age, you may find it easier to&lt;br /&gt;
add a new .pak file. If you do that, encrypt it and then add a new line to the&lt;br /&gt;
Python.txt file for your new .pak. The client will download them all.&lt;br /&gt;
&lt;br /&gt;
Once you have listed each SDL and Python file, you can use the Perl script&lt;br /&gt;
support/make-mbam.pl to create the .mbam files. If you don't have Perl,&lt;br /&gt;
ManifestCreator.exe will also create the files. Select &amp;quot;Auth Server&amp;quot; in the&lt;br /&gt;
&amp;quot;Manifest type&amp;quot; dropdown. If you use ManifestCreator, make sure it has the&lt;br /&gt;
Python and SDL directories and their contents. Make sure to copy the resulting&lt;br /&gt;
two .mbam files to your ''auth-dir''/default directory.&lt;br /&gt;
&lt;br /&gt;
=== Game Server Data ===&lt;br /&gt;
&lt;br /&gt;
Just like for the file and auth server data, the default game directory is&lt;br /&gt;
&amp;quot;./game&amp;quot; (relative to where you start it up). I recommend using&lt;br /&gt;
''prefix''/game.&lt;br /&gt;
&lt;br /&gt;
A script automating all the following steps in this section (except for&lt;br /&gt;
any user-created ages) is in the works.&lt;br /&gt;
&lt;br /&gt;
The game servers need unencrypted .sdl and .age files. The easiest way to get a&lt;br /&gt;
set of these files is from the Cyan-provided&lt;br /&gt;
[http://assets.openuru.org/cyan/Scripts.zip Scripts.zip]. Download this file&lt;br /&gt;
and unzip it. Copy/move the Scripts/SDL directory to ''game-dir''. Then create&lt;br /&gt;
''game-dir''/age and copy Scripts/dat/*.age to it. (MOSS does not use the .fni&lt;br /&gt;
files.)&lt;br /&gt;
&lt;br /&gt;
Do not forget to copy any user-created ages' SDL and .age files here. This copy&lt;br /&gt;
needs to be unencrypted.&lt;br /&gt;
&lt;br /&gt;
Now there is one more step. The SDL files the game server uses need to be moved&lt;br /&gt;
around, some into subdirectories, and some renamed because Unix treats file&lt;br /&gt;
names case-sensitively. Please read the details in the doc/setup file (linked&lt;br /&gt;
at the top of this page). You should have three subdirectories when you're&lt;br /&gt;
done. User-created ages may need subdirectories too, if they have multiple .sdl&lt;br /&gt;
files. If you find this way too complex, just move all the .sdl files into&lt;br /&gt;
the common subdirectory. You lose some small optimizations this way and you will&lt;br /&gt;
need to restart the server if any SDL files change.&lt;br /&gt;
&lt;br /&gt;
At the end the directory structure should be:&lt;br /&gt;
 game&lt;br /&gt;
   age&lt;br /&gt;
     various .age files&lt;br /&gt;
   SDL&lt;br /&gt;
     common&lt;br /&gt;
       some .sdl files&lt;br /&gt;
     Garrison&lt;br /&gt;
       a couple of .sdl files&lt;br /&gt;
     Teledahn&lt;br /&gt;
       other .sdl files&lt;br /&gt;
     more .sdl files&lt;br /&gt;
&lt;br /&gt;
== Key Files ==&lt;br /&gt;
&lt;br /&gt;
The modified Diffie-Hellman algorithm used in the client and MOSS by default&lt;br /&gt;
requires the server to have private keys. '''Do not share them with anyone.'''&lt;br /&gt;
They should not be world-readable.&lt;br /&gt;
&lt;br /&gt;
You can generate keys using the &amp;quot;make_cyan_dh&amp;quot; program which will be installed&lt;br /&gt;
in ''prefix''/bin. Or, there might be a program to generate keys in the CWE&lt;br /&gt;
source, but the chance of it outputting the private keys in the format MOSS&lt;br /&gt;
wants is basically zero. Generate a key for each of auth, game, and&lt;br /&gt;
gatekeeper. Run &amp;quot;make_cyan_dh -h&amp;quot; to see what generators to use if you want to&lt;br /&gt;
match those MOULagain is using. If you're building your own client you can use&lt;br /&gt;
whatever generator you want. Note: I see no reason not to use OpenSSL default&lt;br /&gt;
generators such as 2, 3, or 5. In fact, unless you are a cryptographer, I do not&lt;br /&gt;
recommend departing from these. If you are a cryptographer, you probably did&lt;br /&gt;
not need to hear that from me!&lt;br /&gt;
&lt;br /&gt;
The -s and -c options direct the program to write the data for the server and&lt;br /&gt;
client to files, respectively, e.g.:&lt;br /&gt;
 make_cyan_dh -g 2 -s auth_key.der -c auth_key.bin&lt;br /&gt;
&lt;br /&gt;
If you're compiling a CWE client, make_cyan_dh does not currently output data&lt;br /&gt;
in that format. See [https://foundry.openuru.org/jira/browse/MOSS-3 the bug]&lt;br /&gt;
for the workaround. If you're not compiling a client, it's up to you what to do&lt;br /&gt;
with the .bin file.&lt;br /&gt;
&lt;br /&gt;
Take the .der file (contains the PRIVATE key) and move it to ''prefix''. I&lt;br /&gt;
suggest using ''prefix''/etc/auth_key.der. Make it readable only by the user&lt;br /&gt;
which will be running the server: &amp;quot;chmod 400 ''prefix''/etc/auth_key.der; chown&lt;br /&gt;
mossuser ''prefix''/etc/auth_key.der&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Do the same for the game and gatekeeper keys. ''prefix''/etc/game_key.der and&lt;br /&gt;
''prefix''/etc/gatekeeper_key.der.&lt;br /&gt;
&lt;br /&gt;
== Configuration Files ==&lt;br /&gt;
&lt;br /&gt;
Now that you have all the other files set up, it's time to configure MOSS&lt;br /&gt;
itself. There is a configuration file for each server process. The default&lt;br /&gt;
location for moss_backend is ./etc/moss_backend.cfg and the default&lt;br /&gt;
location for moss is ./etc/moss.cfg. I recommend copying main.cfg to&lt;br /&gt;
''prefix''/etc/moss.cfg and backend.cfg to ''prefix''/etc/moss_backend.cfg.&lt;br /&gt;
&lt;br /&gt;
Now open each up in your text editor. The files contain instructions for how to&lt;br /&gt;
set the various options.&lt;br /&gt;
&lt;br /&gt;
I recommend you set the following in moss.cfg to the absolute paths&lt;br /&gt;
corresponding to where you installed these files in earlier steps:&lt;br /&gt;
&amp;lt;tt&amp;gt;auth_download_dir&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;auth_key_file&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;file_download_dir&amp;lt;/tt&amp;gt;,&lt;br /&gt;
&amp;lt;tt&amp;gt;game_data_dir&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;game_key_file&amp;lt;/tt&amp;gt;,&lt;br /&gt;
&amp;lt;tt&amp;gt;gatekeeper_key_file&amp;lt;/tt&amp;gt;. In addition I recommend you set &amp;lt;tt&amp;gt;log_dir&amp;lt;/tt&amp;gt;&lt;br /&gt;
to somewhere you want log files to go. Remember the log directory has to be&lt;br /&gt;
writable by the user that will run the server. You may also need to set&lt;br /&gt;
&amp;lt;tt&amp;gt;pid_file&amp;lt;/tt&amp;gt; to a location writable by that user. If you want the .pid&lt;br /&gt;
file to be created. Read through all the options to make sure your setup is as&lt;br /&gt;
you want. The only mandatory configuration directive is&lt;br /&gt;
&amp;lt;tt&amp;gt;external_address&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For moss_backend.cfg look especially into &amp;lt;tt&amp;gt;log_dir&amp;lt;/tt&amp;gt; and&lt;br /&gt;
&amp;lt;tt&amp;gt;pid_file&amp;lt;/tt&amp;gt;. In addition, depending on how your DB is&lt;br /&gt;
[[#Set_Up_the_Database | set up]] you likely need to specify &amp;lt;tt&amp;gt;db_user&amp;lt;/tt&amp;gt;,&lt;br /&gt;
and maybe other DB parameters.&lt;br /&gt;
&lt;br /&gt;
== Security Considerations ==&lt;br /&gt;
&lt;br /&gt;
'''Please''' read about them at the end of&lt;br /&gt;
[http://foundry.openuru.org/fisheye/browse/MOSS/doc/setup doc/setup].&lt;br /&gt;
&lt;br /&gt;
Do not run MOSS as root.&lt;br /&gt;
&lt;br /&gt;
== Before You Open Your Server ==&lt;br /&gt;
&lt;br /&gt;
If you plan to let anyone other than you connect to your server, you have&lt;br /&gt;
certain obligations under the licenses of the software/data you will be&lt;br /&gt;
distributing from the file and auth servers.&lt;br /&gt;
&lt;br /&gt;
* The MOULagain EULA still does not provide for you to modify and redistribute the files. So do not put original or modified Cyan files on your file server. You can still have them listed in the .mbm (manifest) files. If someone has an incomplete install they will be forced to get the files from Cyan's file server. That is as yet still the only place from which you're supposed to get those files.&lt;br /&gt;
&lt;br /&gt;
* You are supplying GPL'd Python code. You must provide a way to acquire that code. If you are using unmodified Python you can link to the [http://assets.openuru.org/cyan/Scripts.zip original source]. If you modify it for any reason, you must make your changes available and tell your users where to get it.&lt;br /&gt;
&lt;br /&gt;
* If you are providing client executables from a CWE build:&lt;br /&gt;
** You probably need to add the GPL license file to the client install. The license is supposed to be conveyed with the executable, and the only sure way to do that is to install it from the file server same as the executable. This means you'll have to add it to ThinExternal.txt and External.txt and generate the new .mbm files, copying the .mbm files and LICENSE.txt.gz over to the appropriate locations. You probably should also arrange for the license to be available along with UruLauncher.&lt;br /&gt;
** You must provide a way to acquire the source for your client. The means is supposed to be &amp;quot;equivalent&amp;quot; to the way the executable is acquired. Links are probably sufficient. If you use an unmodified version you should be able to link to the repository (make sure you point to the actual changeset you used). If you modify files for your shard's public keys, status hostname, and/or gatekeeper/auth addresses, you have to additionally provide that source. Note: these are ''public'' keys, so don't worry, you're not giving anything away.&lt;br /&gt;
** Unless someone changes the jpeg library again, you need to credit IJG for jpeglib. The easiest may be to add another file doing so to the install. Or, if you are modifying Python for some reason, you could add it to the in-game credits along with all the other licenses:&lt;br /&gt;
 xUruCreditsJournalEnglish.py&lt;br /&gt;
 xUruCreditsJournalFrench.py&lt;br /&gt;
 xUruCreditsJournalGerman.py&lt;br /&gt;
 xUruCreditsJournalItalian.py&lt;br /&gt;
 xUruCreditsJournalSpanish.py&lt;br /&gt;
&lt;br /&gt;
The links or whatever means you use to provide access to the source of the&lt;br /&gt;
binaries and Python don't have to go into the client install, but they must be&lt;br /&gt;
somewhere reasonable for your users to find, &amp;quot;equivalent&amp;quot; to installing the software for your shard. I would put links to a copy of the&lt;br /&gt;
files on your shard's home page or something.&lt;br /&gt;
&lt;br /&gt;
See also [[CyanWorlds.com_Engine/FAQ#What_are_my_open_source_license_.28GPLv3.29_responsibilities_as_a_user.2C_developer_or_server_operator_.28e.g._shard_owner.29.3F | the CWE FAQ]].&lt;br /&gt;
&lt;br /&gt;
Please do not consider this advice the final or complete word on the&lt;br /&gt;
matter. All the licenses of all the data you use expect you to follow them. So&lt;br /&gt;
you have to do your due diligence. If you find something obviously missing from&lt;br /&gt;
this section, please add it!&lt;br /&gt;
&lt;br /&gt;
== Start It Up ==&lt;br /&gt;
&lt;br /&gt;
Now you should be set to run your server. Hopefully someone will contribute a&lt;br /&gt;
nice startup script. For now, cd to the directory you planned from the start to&lt;br /&gt;
start the server from (that's ''prefix'' in the earlier recommendations). Make&lt;br /&gt;
sure you are su'd to the user you want to run as. '''NOT root!''' Start&lt;br /&gt;
moss_backend first, then moss. E.g., if you have put the config files in&lt;br /&gt;
''prefix''/etc, you can just do:&lt;br /&gt;
 bin/moss_backend&lt;br /&gt;
 bin/moss&lt;br /&gt;
You can instead specify the location of the config file with the -c option.&lt;br /&gt;
If you've used absolute paths in the config files, you can thus easily run&lt;br /&gt;
the server from any directory.&lt;br /&gt;
&lt;br /&gt;
== Create Accounts ==&lt;br /&gt;
&lt;br /&gt;
Don't forget to create accounts for your users, or it will be difficult to log&lt;br /&gt;
in... Please just refer directly to &lt;br /&gt;
[http://foundry.openuru.org/fisheye/browse/MOSS/doc/user-management doc/user-management].&lt;br /&gt;
&lt;br /&gt;
Really short version:&lt;br /&gt;
 INSERT INTO accounts (name, hash, id, class, visitor)&lt;br /&gt;
 VALUES ('foo@example.com', '11223344...', uuid(), 'default', false);&lt;br /&gt;
&lt;br /&gt;
Hopefully someone will contribute a script to add users. A CGI script to&lt;br /&gt;
automatically add users would be neat too.&lt;br /&gt;
&lt;br /&gt;
== More Hints ==&lt;br /&gt;
&lt;br /&gt;
Please see the following for more information of interest to running a server.&lt;br /&gt;
&lt;br /&gt;
* [[MOSS-Notes]]&lt;br /&gt;
* [http://foundry.openuru.org/fisheye/browse/MOSS/doc/running doc/running]&lt;br /&gt;
&lt;br /&gt;
[[Category:MOSS]]&lt;/div&gt;</summary>
		<author><name>A'moaca'</name></author>
	</entry>
	<entry>
		<id>https://wiki.openuru.org/index.php?title=MOSS/Notes&amp;diff=1006</id>
		<title>MOSS/Notes</title>
		<link rel="alternate" type="text/html" href="https://wiki.openuru.org/index.php?title=MOSS/Notes&amp;diff=1006"/>
		<updated>2011-04-06T05:34:04Z</updated>

		<summary type="html">&lt;p&gt;A'moaca': /* Questions */ typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page just holds various notes about running a MOSS server.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Questions ==&lt;br /&gt;
&lt;br /&gt;
I can't really call this a FAQ until the questions have been asked frequently.&lt;br /&gt;
&lt;br /&gt;
; How do I add a user?&lt;br /&gt;
: [[MOSS-Setup#Create_Accounts]]&lt;br /&gt;
; How do I change the Python?&lt;br /&gt;
: Start with the source Cyan has generously provided us under the GPL. To compile that source you'll have to add in the glue. Maybe there is a tool to do that in the CWE source. Make your changes. After compiling and creating the .pak (another tool?), copy the .pak to the [[MOSS-Setup#Auth_Server_Data | correct server directory]] and encrypt it. Make a new .mbam file.&lt;br /&gt;
; How do I add a new age?&lt;br /&gt;
: Copy the encrypted .pak to the [[MOSS-Setup#Auth_Server_Data | correct server directory]], add the file to the Python.txt, and make a new .mbam file. Copy any SDL files to the auth SDL directory and encrypt them. Add them to SDL.txt and make a new .mbam file. Copy unencrypted SDL files to the [[MOSS-Setup#Game_Server_Data | correct server directory]]. Note if you have more than one SDL file for your age, or the file is not named the same as the age, you'll need to put the age's SDL file(s) in a directory named after the age. Copy the unencrypted .age file to the game server directory.&lt;br /&gt;
; Why would I use --enable-fork?&lt;br /&gt;
: This is primarily useful for testing. It's easier to debug a non-threaded process.&lt;br /&gt;
; What resource limitations are there (file descriptors, memory, etc.)?&lt;br /&gt;
: This is a question that's not obvious to answer. But here is what is known:&lt;br /&gt;
:* Currently MOSS uses about 5 file descriptors when idle. It uses about 10 per connected user. (4 are for the game server, so if the user links around a lot, it will be more, and if you have multiple users in one age it will be less.) If you are running a large shard, you may need to adjust per-process file descriptor limits (see the &amp;quot;ulimit&amp;quot; command) or even kernel (global) limits. If you adjust the global limit, pay attention to &amp;lt;tt&amp;gt;FD_SETSIZE&amp;lt;/tt&amp;gt;. See the select() man page.&lt;br /&gt;
:* Currently MOSS uses 7 big buffers for network data per connected user. The buffer size is set by &amp;lt;tt&amp;gt;BUFSIZE&amp;lt;/tt&amp;gt; in constants.h. The default is 64k, so a total of 448k per user. If you have enough users that your moss processes grow too large you can reduce the &amp;lt;tt&amp;gt;BUFSIZE&amp;lt;/tt&amp;gt;.&lt;br /&gt;
:* There is not a lot of disk I/O, except for whatever the database has to write. If you set the log levels very low (DEBUG or worse, MSGS) then there will be a lot of I/O for log files.&lt;br /&gt;
; Does MOSS work on my Power PC?&lt;br /&gt;
: It is supposed to! Testing of big-endian systems was done, but not a full, complete run-through of all game mechanics and multiplayer testing. If it does not work, [[MOSS#How_to_Contribute | it's a bug]].&lt;br /&gt;
; Does MOSS work on Windows? OS X?&lt;br /&gt;
: Not Windows. There is a fair bit of porting work to do. OS X theoretically works but nobody has tried yet. (If you try and it works, let us know!)&lt;br /&gt;
; What is the &amp;quot;status&amp;quot; server type?&lt;br /&gt;
: MOSS will provide the status string normally fetched from a web server. You do have to make the client send the HTTP request to port 14617 or it won't do much good. This is a feature that perhaps only the author wants.&lt;br /&gt;
&lt;br /&gt;
== Warnings ==&lt;br /&gt;
&lt;br /&gt;
* Please note: The MOSS vault is as insecure as MOUL's. (I don't know what was done to MOULagain.) The MOSS server is almost as trusting of the client as MOUL's. (Or maybe more, in other ways; for example, there is no server-side profanity filter.) This is because a MOUL server was implemented, not some other server. Doing better is definitely possible. But to do it right is a very big project, because the entire ''system'' was designed with this trust model. You can't always change just one part of it to get where you want to be.&lt;br /&gt;
&lt;br /&gt;
* Don't change the .mbm or file server files while you have clients doing File transactions. Doing so will give everything indigestion.&lt;br /&gt;
&lt;br /&gt;
* I'm sure the same applies for .mbam and auth server files.&lt;br /&gt;
&lt;br /&gt;
* The SDL mechanism depends on all servers in the shard having synchronized time. Use NTP if you have more than one server. (You'll also need to NFS mount the game/state directory on all the servers so the age SDL is available to all.)&lt;br /&gt;
&lt;br /&gt;
== Setup Choices ==&lt;br /&gt;
&lt;br /&gt;
* Disabling the client&amp;lt;-&amp;gt;server encryption is NOT recommended. However, if you subscribe to the shortsighted idea that protecting your users is not important, go ahead. But be warned, there are code paths in MOSS that are completely untested when all encryption is disabled. You'll have to fix any bugs. (The [[Wireshark Plugin]] does support decrypting connections when you have the key, so you ''can'' use encrypted connections during development/testing.)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span id=&amp;quot;RSA&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;MOSS supports using RSA for key negotiation. The client contribution to the session key is RSA-encrypted with the server public key and then sent to the server, which decrypts the message. Ironically, this actually is less crypto work, while using a non-modified standard encryption technology. And it has the same pseudo-authentication properties as the Cyan-style modified Diffie-Hellman. The assembler changes required for this are astonishingly small, but there's not much value in using RSA. Nonetheless, there's no need to remove working server support for it...&lt;br /&gt;
&lt;br /&gt;
== While Running the Server ==&lt;br /&gt;
&lt;br /&gt;
* You can change age SDL state server-side by modifying the state saved in files in the game/state directory. Keeping backups is advised. You may modify the files with the &amp;quot;sdl_reader&amp;quot; program (which you need to build separately using &amp;quot;make sdl_reader&amp;quot;). This is a very simple command-line program. Use the -l option to specify a saved file to read. When in the program, use the &amp;quot;h&amp;quot; command to see the help. Saving this file while a game server for that age is running is pointless; the new version won't be read and it will be overwritten when the server exits.&lt;br /&gt;
&lt;br /&gt;
== Client Bug Workarounds ==&lt;br /&gt;
&lt;br /&gt;
MOSS works around a few client bugs.&lt;br /&gt;
&lt;br /&gt;
* MOSS &amp;quot;fixes&amp;quot; the KI light bug. It is a bug in the PRP files. MOSS has an extra check for determining whether SDL state is avatar-related, instead of relying on the flag that says whether to keep the SDL state around. That check covers the KI light, so the light SDL is tossed along with the rest of avatar SDL when a person leaves an age.&lt;br /&gt;
&lt;br /&gt;
* MOSS may &amp;quot;fix&amp;quot; the footstep region bug. This bug is when you get the wrong footstep sound stuck, like that wooden bridge you left long ago clumping around while you're on stone. Everyone in the age hears the wrong footstep sounds. I believe that in normal play (that is, without things like /spawn) it is due to a race with the exclusive locking mechanism used to keep things like multiple button presses from being processed at the same time. Why footstep regions take a server-side exclusive lock is beyond me**, so MOSS grants '''all''' footstep region lock requests. This should make the problem occur less frequently, if at all (depending on how the client actually responds to receiving the lock after leaving the region). MOSS decides you are asking for a footstep region lock by looking for the word &amp;quot;Footstep&amp;quot; in the object name. ''Do not name buttons, door regions, or whatever with &amp;quot;Footstep&amp;quot; in your new ages.'' I suggest you do name footstep regions with &amp;quot;Footstep&amp;quot;. The special case can be removed by removing &amp;lt;tt&amp;gt;#define GRANT_ALL_FOOTSTEPS&amp;lt;/tt&amp;gt; from GameState.cc and recompiling.&lt;br /&gt;
:: **In fact, as a friend of mine pointed out, why are footstep sounds decided by the represented avatar's client and propagated to everyone else in the first place? It should be a purely local decision based on the location of each avatar as seen by that client. That would save on traffic and always be accurate, never mind the race with locking on the region since there would be no need to coordinate anything for a purely local decision.&lt;br /&gt;
&lt;br /&gt;
* Quab game Python is not really complete. The first person to link to the age becomes the &amp;quot;owner&amp;quot; of the quab game. The Python sort of attempts to handle the situation where the game owner leaves the age while there are still quabs around, but it does not actually handle it. If the server attempts to pass ownership to someone else, that client will break. And the current MOULagain client even crashes. So MOSS works around the problem by intentionally breaking the whole game when the owner leaves the age and quabs are still present. All the quabs will remain frozen in place until the age has been cleared of all players. The age does not have to restart to revive the game, just be empty.&lt;br /&gt;
&lt;br /&gt;
* The client supports two kinds of passwords, depending on the format of the username. If the username has the format x@x.x it uses algorithm 1 (a more secure one but also one with a fencepost error), and otherwise algorithm 2.  Unfortunately the /changepassword command does not know about algorithm 2 and if you logged in with algorithm 2, it will try to change your password hash to the one for algorithm 1. This would result in you being unable to log in.  So MOSS rejects requests to change the password if the username does not have the x@x.x format.&lt;br /&gt;
&lt;br /&gt;
== Server Non-Bugs ==&lt;br /&gt;
&lt;br /&gt;
These are problems with Cyan's server that MOSS does not have.&lt;br /&gt;
&lt;br /&gt;
* MOSS does not have the infamous &amp;quot;zero seconds remaining&amp;quot; bug. Thus it is possible to do the auth downloads without the server waiting for acks from the client. This speeds up the download substantially as now the bandwidth can be fully utilized. (The [[MOSS-Setup#configure | --enable-fast-download]] configure option turns this on.)&lt;br /&gt;
&lt;br /&gt;
* The MOUL server has a bug with quabs in Ahnonay. If you are the first person who linked into the age, the quabs are associated with your ID. When you link out of the age, the server is supposed to send a LoadClone message telling other clients to unload your clone (the avatar). The MOUL server sends the message, but it says to unload one of the quabs with your ID in it instead of the player avatar. Oddly, the client seems just fine with that. MOSS does not have this bug.&lt;br /&gt;
&lt;br /&gt;
* You should see less client hitching while moving around with MOSS. The MOUL server sends a ton of node update messages for the (unchanged) city AgeInfo node. Each node update causes the client to fetch your pellet scores. The client is frozen during this (and most any) vault transaction. The MOSS server does not send all those useless updates. Interesting note: One measurement during MOUL was approximately 400 pellet score fetches an hour. That is the client freezing every 9 seconds regardless of what age you are in or how many people are in it or on your buddy list. (The pellet score fetch itself can probably be fixed in the Python but you'd still be wasting time on the city node.)&lt;br /&gt;
&lt;br /&gt;
* The pellet score freeze can be further reduced by #defining &amp;lt;tt&amp;gt;PELLET_SCORE_CACHE&amp;lt;/tt&amp;gt;, which does what it sounds like: it caches the client's pellet score in the Auth server to cut out the round-trip time to the DB. However, there's little value to it without the city node update problem; when you open the KI it fetches the score but it's also fetching other vault nodes. Plus you aren't trying to move at the time so the freeze is less obvious. So &amp;lt;tt&amp;gt;PELLET_SCORE_CACHE&amp;lt;/tt&amp;gt; is undefined by default, and in fact it is ''untested''.&lt;br /&gt;
&lt;br /&gt;
[[Category:MOSS]]&lt;/div&gt;</summary>
		<author><name>A'moaca'</name></author>
	</entry>
	<entry>
		<id>https://wiki.openuru.org/index.php?title=MOSS/Project_Ideas&amp;diff=989</id>
		<title>MOSS/Project Ideas</title>
		<link rel="alternate" type="text/html" href="https://wiki.openuru.org/index.php?title=MOSS/Project_Ideas&amp;diff=989"/>
		<updated>2011-04-05T07:14:48Z</updated>

		<summary type="html">&lt;p&gt;A'moaca': add Terminology&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The initial list was generated over the lengthy period of MOSS's initial&lt;br /&gt;
development. These project ideas mostly cover missing functionality. None of&lt;br /&gt;
the missing functionality is known to cause gameplay issues so these did not&lt;br /&gt;
really seem like bugs. These ideas are grouped by general type of change&lt;br /&gt;
required, and sort of by increasing approximate difficulty level and sort of by&lt;br /&gt;
decreasing value.&lt;br /&gt;
&lt;br /&gt;
Bigger ideas, such as entirely new functionality now made possible by the&lt;br /&gt;
release of the client, could go here too. Be realistic, though. Remember that&lt;br /&gt;
protocol changes are not to be made lightly, because it causes an&lt;br /&gt;
incompatibility problem. It is probably better to propose large changes in&lt;br /&gt;
discussion format on the forums. Do not ''expect'' someone else to take up and&lt;br /&gt;
implement your proposal.&lt;br /&gt;
&lt;br /&gt;
The whole idea of this list is to provide some ideas for anyone wishing to dive&lt;br /&gt;
into MOSS. Sometimes a little direction helps.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Terminology ==&lt;br /&gt;
The terms &amp;quot;frontend&amp;quot; and &amp;quot;backend&amp;quot; are used throughout this document. If the meaning is not clear from context, the terminology is explained in the [[MOSS-Developer_Notes#terminology | Developer Notes]].&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;vault&amp;quot; is basically the database, though it could be abstractly thought of as a collection of trees of vault nodes. Generally when referring to it as a set of node trees, &amp;quot;vault&amp;quot; is written and when referring to it as something with tables and rows, &amp;quot;DB&amp;quot; is written. The &amp;quot;vault server&amp;quot; is that portion of the backend concerned with handling the Vault* messages and working with the database.&lt;br /&gt;
&lt;br /&gt;
== Fix bugs ==&lt;br /&gt;
&lt;br /&gt;
The bug tracker is here: https://foundry.openuru.org/jira/browse/MOSS&lt;br /&gt;
&lt;br /&gt;
== Detail work (little Uru-specific knowledge required) ==&lt;br /&gt;
&lt;br /&gt;
* Try disabling the Nagle algorithm on sockets. This should result in less latency to the client when small messages are involved. Make sure to test the whole game thoroughly.&lt;br /&gt;
&lt;br /&gt;
* Figure out and implement a good way to use autoconf to compile in default pathnames. This would apply to the default config file, key file, moss_serv binary, and log/auth/game/file directory locations. The idea is if I say --prefix=/foo the defaults become /foo/etc/moss.cfg and so forth instead of ./etc/moss.cfg. Don't forget autoconf lets you override the etcdir, bindir, etc. separately.&lt;br /&gt;
&lt;br /&gt;
* Treat SDL filenames case-insensitively. This is very annoying in Unix, since it requires using readdir() and strcasecmp() instead of just open().&lt;br /&gt;
&lt;br /&gt;
* Make it so the game/state directory location can be separately configured. This is so the whole MOSS install can be read-only and just the log directory and game/state moved somewhere read-write. (The easy workaround is to symlink a writable directory to game/state.)&lt;br /&gt;
&lt;br /&gt;
* Log the PID of all forked servers in moss.log.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span id=&amp;quot;libevent&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;See if we can switch to libevent for inter-thread communication instead of raw signals. This should be fairly portable and take advantage of the different per-OS lightweight signalling mechanisms.&lt;br /&gt;
&lt;br /&gt;
* Allow ''skipping'' overlong messages (messages MOSS thinks are too big). This requires, upon catching the exception, tossing out the message, and if it has not all been read in yet, keeping track of how much more to toss in the future. The RC4 state must be updated too for the tossed message length.&lt;br /&gt;
&lt;br /&gt;
* It would be nice to use atomic operations for refcounts instead of having to use (bigger, slower) mutexes for them. This does make MOSS not architecture-independent, which is part of why I have been resisting it. (See also signal handling next.)&lt;br /&gt;
&lt;br /&gt;
* Signal handlers and the operations to read and reset the values in the main loops should be using atomic operations.&lt;br /&gt;
&lt;br /&gt;
* Catch and handle std::bad_alloc whenever possible.&lt;br /&gt;
&lt;br /&gt;
== Fairly contained changes ==&lt;br /&gt;
&lt;br /&gt;
* Make it so game servers can be forked as separate processes. This helps a lot for debugging and also would help for age development, making it easier to change SDL and retest. Otherwise you have to shut down the whole frontend server or wait out the age's linger time. This work was started but not completed, and that code can be found inside &amp;lt;tt&amp;gt;FORK_GAME_TOO&amp;lt;/tt&amp;gt; #ifdefs. If you do this, I suggest you consider separating &amp;lt;tt&amp;gt;FORK_GAME_TOO&amp;lt;/tt&amp;gt; from &amp;lt;tt&amp;gt;FORK_ENABLE&amp;lt;/tt&amp;gt; so that one could have forked game servers and *not* forked auth/file servers.&lt;br /&gt;
&lt;br /&gt;
* In the getpublicagelist() SQL function, there is a comment about the 50-hood limit. The current code returns the first 50 hoods. We should return the most recently used 50 hoods. The hard part is knowing which those are. This is mostly if not wholly DB/SQL work.&lt;br /&gt;
&lt;br /&gt;
* Age population limits are unimplemented. The value is in the vault, but the server does not look at it.&lt;br /&gt;
&lt;br /&gt;
* Figure out how to throw out clones and SDL when a player leaves the age. Please see the &amp;quot;clean up clone, SDL&amp;quot; section in GameServer::conn_shutdown(). Right now this is full of special cases: it handles the Kemo bugs and and Quabs specially (a different thing for each). It may be that this is required for best behavior, but I still feel like I've missed something despite heavy scrutiny of the data. This is more of a research project and not much of a code project.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span id=&amp;quot;SDL_timestamps&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;MOUL parsed SDL nodes on the way into the vault. It probably only updated the node with fields having the Dirty bit set. In addition it added timestamps to the fields because the client does not put in the timestamps (reasonably so, as its time may be wrong). MOSS currently saves the SDL wholesale. This basically works, but with the timestamps properly added, the game server can merge the vault, age, and global SDL in any order and without strange rules. Note: if you do this, you also need to write a script or some other way to update all the SDL nodes in existing MOSS DBs.&lt;br /&gt;
&lt;br /&gt;
* The kickable SDL filtering algorithm is the same one I put in Alcugs ages ago. It is better than nothing but not as good as Plasma's. You will see more warping of kickables than with Cyan's server. This project is to come up with a better way of deciding what physical SDL to send to all the clients, based on those messages all the clients are sending to the server.&lt;br /&gt;
&lt;br /&gt;
* The server is probably supposed to use RelevanceRegion information to avoid sending SDL updates to clients who don't share a relevance region with the originating client. (The idea being to reduce network traffic, since hopefully the client already avoids rendering/physics on things in irrelevant regions.) Things work if the server doesn't filter, so MOSS doesn't. Also, I do not have strong evidence to believe this supposition is actually correct. Which is the other reason MOSS doesn't do it. Finding out, and implementing it if so, would be a nice project.&lt;br /&gt;
&lt;br /&gt;
* Figure out what the server is supposed to do with plSetNetGroupIDMsg and do it. Right now MOSS just drops it to no apparent ill effect. I am deeply suspicious of this message due to seeing it at aurally unpleasant times in UU. (Old, old notes: &amp;quot;may have to do with infinitely looping scraping noises&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;kCli2Auth_SendFriendInviteRequest&amp;lt;/tt&amp;gt; is not fully supported (it is dropped on the floor).&lt;br /&gt;
&lt;br /&gt;
== Bigger changes ==&lt;br /&gt;
&lt;br /&gt;
* The following messages are unimplemented.&lt;br /&gt;
** &amp;lt;tt&amp;gt;kCli2Auth_VaultSetSeen&amp;lt;/tt&amp;gt;  --  unimplemented in client&lt;br /&gt;
** &amp;lt;tt&amp;gt;kCli2Auth_ScoreDelete&amp;lt;/tt&amp;gt;  --  never saw one, so couldn't implement it&lt;br /&gt;
** &amp;lt;tt&amp;gt;kCli2Auth_ScoreSetPoints&amp;lt;/tt&amp;gt;  --  never saw one, so couldn't implement it&lt;br /&gt;
** &amp;lt;tt&amp;gt;kCli2Auth_ScoreGetRanks&amp;lt;/tt&amp;gt;  --  never saw one, so couldn't implement it&lt;br /&gt;
** &amp;lt;tt&amp;gt;kCli2Csr_PingRequest&amp;lt;/tt&amp;gt;  --  no recorded Csr messages&lt;br /&gt;
** &amp;lt;tt&amp;gt;kCli2Csr_RegisterRequest&amp;lt;/tt&amp;gt;&lt;br /&gt;
** &amp;lt;tt&amp;gt;kCli2Csr_LoginRequest&amp;lt;/tt&amp;gt;&lt;br /&gt;
** &amp;lt;tt&amp;gt;kCsr2Cli_PingReply&amp;lt;/tt&amp;gt;&lt;br /&gt;
** &amp;lt;tt&amp;gt;kCsr2Cli_RegisterReply&amp;lt;/tt&amp;gt;&lt;br /&gt;
** &amp;lt;tt&amp;gt;kCsr2Cli_LoginReply&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Add hood randomization to DRC hoods. Player-created hoods are randomized by the Python in the Nexus when the hood is created. DRC hoods, however, are created by the server. In MOSS's case, they are created entirely by SQL code. So adding DRC hood randomization means noticing when the DB has created a new DRC hood, creating and modifying SDL in the backend, and then finding and modifying the age SDL node for that new hood. All before responding to the client creating the new avatar and thus the new DRC hood.&lt;br /&gt;
&lt;br /&gt;
* The MessageQueue class has a concept of priorities. The idea was to enable dropping of lower-priority messages if a queue to a given client starts to back up. (The lowest priority being voice chat, then avatar movements, with world state changes being highest.) The measurement of queue length or throughput necessary for that is not implemented. So, neither is the dropping. (There is the very beginnings of some if &amp;lt;tt&amp;gt;DO_PRIORITIES&amp;lt;/tt&amp;gt; is #defined.) As such, queue users don't do a good job of priority-setting, although VOICE and FRONT are properly used. The idea wasn't to order the queue (except for FRONT), but to skip sending, say, a VOICE message when we encounter one, if the queue congestion measure says to.&lt;br /&gt;
&lt;br /&gt;
* '''Vault security'''&lt;br /&gt;
: The MOSS vault is as insecure as the MOUL vault. Need I say more? Here are some starter thoughts.&lt;br /&gt;
:* MOSS should parse incoming SDL messages and sanity-check them. See also [[#SDL_timestamps | adding timestamps]].&lt;br /&gt;
:* MOSS could probably verify other blob contents too.&lt;br /&gt;
:* Anyone can save anything to any node, and can fetch any node if they know its type and ID. We can deny these requests if the user shouldn't have access. Possibly [[MOSS-Developer_Notes#notifier | the notifier field]] can help.&lt;br /&gt;
:* Much more, I'm sure. Better vault security ''is'' possible.&lt;br /&gt;
&lt;br /&gt;
* Eliminate excessive byteswapping of opaque server IDs in BackendMessages. This is to say, in the backend server, when reading in the messages, it byte-swaps the IDs to store them, only ever uses them in equality tests with other IDs, and then byte-swaps them back when sending new messages. (On a little-endian box there's no swapping so it does not cost much, but it's the principle of the matter.) Unfortunately this really needs to be tested on a big-endian machine.&lt;br /&gt;
&lt;br /&gt;
* Try changing the File server to do [[MOSS-Setup#ackless | ackless downloads]], too. Maybe only if there is only one download at a time, though.&lt;br /&gt;
&lt;br /&gt;
== Scalability issues ==&lt;br /&gt;
&lt;br /&gt;
Performance and scalability are always interesting questions. And frequently ignored, because they only matter for larger installations.&lt;br /&gt;
&lt;br /&gt;
These are ideas unimplemented because they only really matter for large&lt;br /&gt;
shards. Large as in having, let's say, 50+ concurrent '''busy''' users. (50&lt;br /&gt;
people standing in the city chatting doesn't actually do much.) Maybe MOSS is&lt;br /&gt;
okay with that number now, in which case &amp;quot;large&amp;quot; is more. It is entirely&lt;br /&gt;
unknown.&lt;br /&gt;
&lt;br /&gt;
* Performance testing. Instrumentation. There should be a load generator to do this. This was not high on the list during development, with a user base of 3.&lt;br /&gt;
&lt;br /&gt;
* See the last paragraph in the comments at the top of FileTransaction.h about how multiple file transactions of the same file should share a single opened file.&lt;br /&gt;
&lt;br /&gt;
* Allow speculative pre-caching of AgeInfoNodes and PlayerInfoNodes when node changed notifications come from the vault server and are forwarded to any connected client. Cache in the auth server, vault server, or both. The goal is to reduce latency on those requests the client freezes for.&lt;br /&gt;
&lt;br /&gt;
* The backend protocol supports game servers requesting batches of GameMgr IDs. However, there is no code on either side to actually do so. The idea for this was that more populated ages, like the city, would benefit from doing batch requests. Every person who links in with a marker game needs a new global game ID, and it would be nice to cut out any extra backend round trips for links, even though this particular round trip does not block the link process (aside from being something the backend is doing when it could be doing something else).&lt;br /&gt;
&lt;br /&gt;
* Database performance could be measured and the SQL or even tables optimized.&lt;br /&gt;
&lt;br /&gt;
* MOSS currently uses a single blocking connection to the DB. Implement and investigate performance of multiple DB connections, or asynchronous ones. Maybe the backend server has to become threaded to gain the best advantage.&lt;br /&gt;
&lt;br /&gt;
* In a big shard, we may need to split the backend server work up. The [[MOSS-Developer_Notes#backend_typecodes | backend protocol]] is designed to support separating backend work between threads. The &amp;quot;classes&amp;quot; of backend messages in a bitfield are meant as a way to quickly route a backend message to an appropriate backend thread or process.&lt;br /&gt;
&lt;br /&gt;
== Frontend/backend interactions ==&lt;br /&gt;
&lt;br /&gt;
* Add encryption to the backend protocol. This itself is not a big deal (though you have to pick a good key negotiation, and do not forget to consider authentication mechanisms), but it does mean all the BackendMessage fill_buffer() code paths would be newly exercised, so a lot of regression testing would be in order.&lt;br /&gt;
&lt;br /&gt;
* It would be much easier on the DB if updates to markers are batched by the game server. This especially applies to capturing markers. See the comments in the setmarkerto() and startmarkergame() SQL functions.&lt;br /&gt;
&lt;br /&gt;
* The backend protocol allows for frontends hosting ages to specify only a subset of ages that can be hosted there. This is unused right now; the message has a field saying, &amp;quot;this is the length of the following age restriction list&amp;quot; and it is always zero. When there are no restrictions the backend can request any frontend to host any age.&lt;br /&gt;
** The need for splitting hostable ages is unclear, but in a very large shard you might, for example, put all city instances, or even only the public one, on a separate server. It would also allow someone to join a shard and host just their own age, or whatever.&lt;br /&gt;
** Since the frontend never sends restrictions, the backend currently has no way to store and use them. So there is work on both sides.&lt;br /&gt;
** Presumably which ages a frontend server can host would be a configuration option but it could be done instead by restricting the contents of the game/age directory. That would not allow even finer-grained restrictions, but this whole project kind of needs a real use case to flesh out what is needed.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span id=&amp;quot;connection_merging&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;Having one backend TCP connection per frontend server is probably not a good thing, in terms of efficiency, or of scalability with a cluster of machines. We could change it to have one backend connection per frontend ''process'' and funnel everything through it. The mostly-implemented but unused and untested MultiWriterMessageQueue was meant, in part, to support this (there are multiple threads writing, but only one thread reading, which writes to the socket).&lt;br /&gt;
&lt;br /&gt;
: Then when messages are received in the frontend there needs to be some way of passing the message to the right thread and signaling them something is present to be handled. This is all unimplemented but the format of the backend messages is meant to take care of this case (in particular, the two &amp;quot;server IDs&amp;quot; in the header are for dispatching messages to the correct thread).&lt;br /&gt;
&lt;br /&gt;
: However, essentially the same changes would be necessary if the backend server is folded into the main server so there is only one process; then &amp;quot;sending&amp;quot; messages to the backend server is just putting them on the (shared) queue that would have been used to funnel everything through one connection, and &amp;quot;receiving&amp;quot; them is just taking them off that queue since there's no TCP connection to deal with.&lt;br /&gt;
&lt;br /&gt;
== New functionality ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span id=&amp;quot;scripting&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;I am guessing Cyan's server handles the GameMgr stuff with server-side scripting. At the time MOSS was implemented there was no expectation that new game types may be added so adding in a scripting language was not worth the problems incumbent with doing so. Also the overall value of scripting is not clear (especially for the cost in server complication). However, it could be done. The project would have to include embedding the scripting and then rewriting stuff using scripts.&lt;br /&gt;
: Please note, a lot of effort went into getting the Heek right, handling ties, allowing people to accidentally stand up and sit back down in the game, and probably other details I forgot. If you want to script Heek, it really ought to still work as well.&lt;br /&gt;
&lt;br /&gt;
* Really adventurous hardcore project: destroy KI hacks. The server would have to be able to analyze all game traffic to decide whether it looks okay. To do it right the server would have to have and understand PRP files and do physics. Also &amp;quot;console&amp;quot; commands have to be wisely filtered. If you're daunted, join the club.&lt;br /&gt;
&lt;br /&gt;
== Redesigns ==&lt;br /&gt;
{{tba}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:MOSS]]&lt;/div&gt;</summary>
		<author><name>A'moaca'</name></author>
	</entry>
	<entry>
		<id>https://wiki.openuru.org/index.php?title=MOSS/Developer_Notes&amp;diff=988</id>
		<title>MOSS/Developer Notes</title>
		<link rel="alternate" type="text/html" href="https://wiki.openuru.org/index.php?title=MOSS/Developer_Notes&amp;diff=988"/>
		<updated>2011-04-05T07:06:21Z</updated>

		<summary type="html">&lt;p&gt;A'moaca': /* Implementation Choices */ add anchor&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Comments of interest to those working with the MOSS code should go here. If&lt;br /&gt;
you plan to just run a server and not modify it, you don't need to be here.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Working with the Code ==&lt;br /&gt;
&lt;br /&gt;
=== Requirements ===&lt;br /&gt;
&lt;br /&gt;
* Handle byte-swapping. A networking person wrote MOSS, and such people care about working with both endiannesses. Do not break it.&lt;br /&gt;
&lt;br /&gt;
* This does mean you cannot drop in someone else's code handling the MOUL protocol if it assumes you are using a little-endian machine. This is '''the''' reason for not casting incoming byte data to structs and writing out structs.&lt;br /&gt;
&lt;br /&gt;
* Including &amp;quot;config.h&amp;quot; should always look like this:&lt;br /&gt;
 #ifdef HAVE_CONFIG_H&lt;br /&gt;
 #include &amp;quot;config.h&amp;quot;&lt;br /&gt;
 #endif&lt;br /&gt;
&lt;br /&gt;
=== Code Conventions ===&lt;br /&gt;
&lt;br /&gt;
* Keep C++-style comments out of preprocessor lines.&lt;br /&gt;
&lt;br /&gt;
* Keep code to 78 columns whenever possible.&lt;br /&gt;
&lt;br /&gt;
* Include (.h) files have comments at the top listing which other include files are required before including this file. (Some may be missing but I tried.)&lt;br /&gt;
&lt;br /&gt;
* I use emacs. Please keep the &amp;lt;tt&amp;gt;/* -*- c++ -*- */&amp;lt;/tt&amp;gt; at the top of .h files if they are indeed C++. Feel free to add similar magic for your editor.&lt;br /&gt;
&lt;br /&gt;
* Please match indentation, spacing, and brace styles, etc. (It is the default &amp;quot;gnu&amp;quot; style in emacs.)&lt;br /&gt;
&lt;br /&gt;
* Limit direct including of other include files in .h files. I don't remember why, but it's the project's convention. (It does help with dependencies sometimes.)&lt;br /&gt;
&lt;br /&gt;
=== Advice ===&lt;br /&gt;
&lt;br /&gt;
* If you add a client message type, make sure to add it to check_useable(). Otherwise the server will toss the message and drop the client.&lt;br /&gt;
&lt;br /&gt;
* If you add a client message type, test compiling with the --enable-old-protocol=yes configure option set. You don't need to run it, just compile it. The purpose of the compile test is to make sure that your new message is not referred to when using the older protocols, unless it's supposed to be. If the new message did not exist at all in these older protocols, code referring to them won't compile, and that needs to be fixed.&lt;br /&gt;
&lt;br /&gt;
* When handling byte-swapping, never assign the result of readNNle() to a larger variable. This is wrong. Consider a 16-bit little-endian number with two bytes ''XY'', represented as &amp;lt;tt&amp;gt;YX&amp;lt;/tt&amp;gt;. read16le() returns &amp;lt;tt&amp;gt;YX&amp;lt;/tt&amp;gt;, and assigned to a 32-bit number on a big-endian system, the result is &amp;lt;tt&amp;gt;00YX&amp;lt;/tt&amp;gt;. A 32-bit little-endian number of value ''XY'' is '''correctly''' represented as &amp;lt;tt&amp;gt;YX00&amp;lt;/tt&amp;gt;. Assigning the result of readNN() is fine, as that value is in host order. Similarly you can't writeNNle() a number stored in a smaller type, but this is a harder mistake to make.&lt;br /&gt;
&lt;br /&gt;
* As a corollary, don't save anything explicitly kept little-endian in anything other than a sized int type. Don't use size_t, enum types, or anything along those lines. Especially not size_t.&lt;br /&gt;
&lt;br /&gt;
* Remember that protocol changes are not to be made lightly, because it causes an incompatibility problem. &lt;br /&gt;
&lt;br /&gt;
* Be very, very, careful about any changes to game server startup code in the backend. Triple-check all the logic (or more). Do not forget to take into account the client disconnecting/timing out after the request, the game server never starting, the game server shutting down as the request arrives, and everything in between.&lt;br /&gt;
&lt;br /&gt;
* Before writing new DB query code or changing how current ones work, make sure to read up on the [http://pqxx.org/devprojects/libpqxx/doc/stable/html/Tutorial/ch03s07.html pqxx transactor model].&lt;br /&gt;
&lt;br /&gt;
* There is a reftree.sql file in the test directory. If you are working with the DB and need a view into the trees of data the change notification routines are working with, you may find this file useful. Load it into the DB, and it adds a &amp;quot;reftree&amp;quot; function which, given a node, will generate a list of the whole tree below it by following the noderefs. The output includes node and folder type '''names''' and the information used to determine where change notifications have to be sent.&lt;br /&gt;
&lt;br /&gt;
== Implementation Choices ==&lt;br /&gt;
&lt;br /&gt;
Oftentimes, in a hobbyist project such as MOSS was in the beginning, there is not a lot of design documentation. MOSS had some, but most of it became obsolete as goals changed. Here are some short descriptions answering some &amp;quot;Why did you do it this way?&amp;quot; questions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;terminology&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;Terminology used here: the &amp;quot;backend&amp;quot; server is that process named moss_backend, which talks to the DB and handles anything needing centralized management, while &amp;quot;frontend&amp;quot; servers are everything else (auth/file/game/gatekeeper servers talking to the client, and the dispatcher listening for connections). The &amp;quot;backend protocol&amp;quot; is the protocol used between the frontend and backend servers.&lt;br /&gt;
&lt;br /&gt;
; Why is there all this read32/read32le stuff?&lt;br /&gt;
: [[#Requirements | A networking person wrote MOSS.]] readNN() byte-swaps a little-endian value (from the protocol on the wire) to host order. writeNN() byte-swaps from host to little-endian. If you run it on a little-endian box this is a no-op. readNNle() ''doesn't'' byte-swap, returning a number of size NN in little-endian order. If you run it on a little-endian box this is a no-op. On a big-endian box these are critical. In addition, these macros/functions handle hardware that does not allow unaligned access of memory locations. At the time of release, MOSS appeared to work correctly on big-endian machines.&lt;br /&gt;
&lt;br /&gt;
; Why are there two ways to write every message?&lt;br /&gt;
: For larger messages, the writev() syscall is considered more efficient, because less data has to be copied when crossing the user/kernel memory boundary. In other words, you save one copy of the entire contents of what you write at the price of computing and copying the set of iovecs. However, writev() won't work when you have to encrypt the data first, so for encrypted connections we have to copy the data into a buffer and then encrypt it.&lt;br /&gt;
&lt;br /&gt;
; Why do the backend message classes have &amp;quot;little-endian&amp;quot; comments all over?&lt;br /&gt;
: The backend protocol is handled somewhat differently in MOSS. For frontend servers, any data read in and used by the server is stored in host order. But for the backend messages, the data is mostly stored in ''little-endian'' order, because the protocol is (currently!) unencrypted and I can use writev() and skip copying into a buffer. For many messages, writev() may not be better than copying, because the iovec is bigger than the data it represents. On the other hand, the actual copy into the buffer is avoided. The performance of each approach is unknown. There is no MessageQueue support for mixing the iovec and buffer strategies in a single queue based on message type.&lt;br /&gt;
&lt;br /&gt;
; Why do you use a single-threaded big select loop for each game server?&lt;br /&gt;
: The other typical strategy would be to have a thread per client and pass messages between threads. The MultiWriterMessageQueue class was originally intended to cover that case (in addition to [[MOSS-Project_Ideas#connection_merging | others]]). But the fundamental problem with this plan is that I did not have a good portable way to wake up threads when a message is queued. It can be done, but signals are probably not the way to do it.&lt;br /&gt;
&lt;br /&gt;
; Speaking of signals, why do you use them between threads instead of epoll()?&lt;br /&gt;
: I don't have epoll() on my development machine. Signals are the most portable. [[MOSS-Project_Ideas#libevent | Replacing the use of signals + select() with libevent]] might be the right answer because part of its goal is to work on many OSes.&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;span id=&amp;quot;backend_typecodes&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;Explain the funky backend protocol numbering scheme?&lt;br /&gt;
: The protocol was designed to facilitate using multiple processes or servers in the backend. Thus messages have a bitmask &amp;quot;class&amp;quot; which would allow them to be quickly routed to the right location by checking the bitmask, rather than having a giant case statement to decide.&lt;br /&gt;
&lt;br /&gt;
: Then, I wanted the pairs of messages to be recognizable from the number, so a message TO the backend is numbered the same the corresponding message FROM the backend, with the addition of a bit to mark which direction the message is going. Since each server knows its own identity, this bit is basically a big favor for the Wireshark dissector. Trust me, it's really nice.&lt;br /&gt;
&lt;br /&gt;
: Finally, because once upon a time I knew many messages by their number, I assigned backend messages the same number as a corresponding frontend (client) message. When it made sense. We don't need to do this going forward, but we aren't allowed to change the current ones.&lt;br /&gt;
&lt;br /&gt;
: There are some bits in the middle &amp;quot;left over&amp;quot;. Maybe someone will need them for something creative someday!&lt;br /&gt;
&lt;br /&gt;
; Why did you choose [http://www.postgresql.org/ PostgreSQL]?&lt;br /&gt;
: There were not a lot of differentiators between it and MySQL. But, PostgreSQL provides &amp;quot;triggers&amp;quot; -- this is a way to request that when a table is changed, the DB tells anything subscribed to the triggers about the change. I was intrigued by them, and thought they could prove useful for providing the vault node update notifications to clients (VaultNodeChanged/VaultNodeAdded/VaultNodeDeleted). Unfortunately, doing this ended up requiring at least two connections to the DB, one like the current one, and another to listen for triggers. So triggers were not used in the interest of simplicity in the backend server. Nothing else is preventing their use.&lt;br /&gt;
&lt;br /&gt;
; What is up with this giant DB schema!&lt;br /&gt;
: First, it was a conscious decision to put as much SQL code as possible into stored procedures. This makes it so you can modify the DB functionality without recompiling the server, and it reduces the amount of data you have to push over the socket.&lt;br /&gt;
&lt;br /&gt;
: The single giant table as seen in PotS, UU, and to some extent (how much exactly is unknown) MOUL/MOULa is so hard to work with. And it has scalability, relations, and clarity built right out of it. We were thinking of how to split the database load up to help with the bottleneck the DB still proved to be in MOUL. While no implementation was done for that (realistic expectations of MOSS suggest it is not needed), this did lead to the decision to experiment with splitting the table up into many tables by node type.&lt;br /&gt;
&lt;br /&gt;
: There's no way to know if these design choices are more efficient, without changing the design, implementing it, and comparing the performance of the two in a like-for-like way. But it sure is a lot easier to write queries with the stored procedures and tables by node type!&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;span id=&amp;quot;notifier&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;What is this new &amp;quot;notifier&amp;quot; thing in the noderefs table?&lt;br /&gt;
: It is the answer to the question &amp;quot;How do I know which client to tell about changes to this reference or referred-to node?&amp;quot;&lt;br /&gt;
&lt;br /&gt;
: After drawing many pictures of node trees, it became clear that the &amp;quot;owner&amp;quot;, coming from the client, was mostly but not really right for this. I was left with the impression that's what the &amp;quot;owner&amp;quot; field is for... but since it wasn't what I wanted I added a new one. For player trees, the notifier is the player. For age trees, it's the age, and then the DB looks up what players are interested in that age.&lt;br /&gt;
&lt;br /&gt;
: I do not know how Cyan solved the problem, but this was the way to push the decision about who to tell into the DB where most of the data is. Otherwise, the backend (vault) server would have to cache all the active trees itself in order to find the answer.&lt;br /&gt;
&lt;br /&gt;
; Why did you make the SDL files be in a directory tree instead of a single directory?&lt;br /&gt;
: The goal was to improve the age development experience. If the server loads all the SDL at startup, and you want to change the SDL because you have a new version to test, you have to restart the server. If instead, a given age's SDL is loaded at the time the game server starts up, you only need to restart the game server. I then put the files common to all ages in a &amp;quot;common&amp;quot; directory so that it is loaded once, and the data can be shared between game servers, but that is just a small optimization. If users have serious issues with this they can put ''all'' the SDL files in the common subdirectory.&lt;br /&gt;
&lt;br /&gt;
; Why .mbm and .mbam files?&lt;br /&gt;
: I did not want the server to have to stat and checksum files all the time. File and auth files don't change much.&lt;br /&gt;
&lt;br /&gt;
; Why didn't you put Python in to script Heek?&lt;br /&gt;
: I suspect Cyan did this. I am not a fan of embedding scripting where it is not needed, and at the time I had no reason to believe there would ever be new GameMgr types requiring the kind of dynamic rapid development that embedded scripting is good for. Still, it's in the [[MOSS-Project_Ideas#scripting | project ideas]] for those who are into that sort of thing.&lt;br /&gt;
&lt;br /&gt;
== Project Ideas ==&lt;br /&gt;
&lt;br /&gt;
The whole idea of this list is to provide some ideas for anyone wishing to dive&lt;br /&gt;
into MOSS. Sometimes a little direction helps. See [[MOSS-Project_Ideas]]. Of&lt;br /&gt;
course, you are not limited to this list!&lt;br /&gt;
&lt;br /&gt;
[[Category:MOSS]]&lt;/div&gt;</summary>
		<author><name>A'moaca'</name></author>
	</entry>
	<entry>
		<id>https://wiki.openuru.org/index.php?title=MOSS/Developer_Notes&amp;diff=987</id>
		<title>MOSS/Developer Notes</title>
		<link rel="alternate" type="text/html" href="https://wiki.openuru.org/index.php?title=MOSS/Developer_Notes&amp;diff=987"/>
		<updated>2011-04-05T07:05:16Z</updated>

		<summary type="html">&lt;p&gt;A'moaca': /* Advice */ clarify --enable-old-protocol compile test&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Comments of interest to those working with the MOSS code should go here. If&lt;br /&gt;
you plan to just run a server and not modify it, you don't need to be here.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Working with the Code ==&lt;br /&gt;
&lt;br /&gt;
=== Requirements ===&lt;br /&gt;
&lt;br /&gt;
* Handle byte-swapping. A networking person wrote MOSS, and such people care about working with both endiannesses. Do not break it.&lt;br /&gt;
&lt;br /&gt;
* This does mean you cannot drop in someone else's code handling the MOUL protocol if it assumes you are using a little-endian machine. This is '''the''' reason for not casting incoming byte data to structs and writing out structs.&lt;br /&gt;
&lt;br /&gt;
* Including &amp;quot;config.h&amp;quot; should always look like this:&lt;br /&gt;
 #ifdef HAVE_CONFIG_H&lt;br /&gt;
 #include &amp;quot;config.h&amp;quot;&lt;br /&gt;
 #endif&lt;br /&gt;
&lt;br /&gt;
=== Code Conventions ===&lt;br /&gt;
&lt;br /&gt;
* Keep C++-style comments out of preprocessor lines.&lt;br /&gt;
&lt;br /&gt;
* Keep code to 78 columns whenever possible.&lt;br /&gt;
&lt;br /&gt;
* Include (.h) files have comments at the top listing which other include files are required before including this file. (Some may be missing but I tried.)&lt;br /&gt;
&lt;br /&gt;
* I use emacs. Please keep the &amp;lt;tt&amp;gt;/* -*- c++ -*- */&amp;lt;/tt&amp;gt; at the top of .h files if they are indeed C++. Feel free to add similar magic for your editor.&lt;br /&gt;
&lt;br /&gt;
* Please match indentation, spacing, and brace styles, etc. (It is the default &amp;quot;gnu&amp;quot; style in emacs.)&lt;br /&gt;
&lt;br /&gt;
* Limit direct including of other include files in .h files. I don't remember why, but it's the project's convention. (It does help with dependencies sometimes.)&lt;br /&gt;
&lt;br /&gt;
=== Advice ===&lt;br /&gt;
&lt;br /&gt;
* If you add a client message type, make sure to add it to check_useable(). Otherwise the server will toss the message and drop the client.&lt;br /&gt;
&lt;br /&gt;
* If you add a client message type, test compiling with the --enable-old-protocol=yes configure option set. You don't need to run it, just compile it. The purpose of the compile test is to make sure that your new message is not referred to when using the older protocols, unless it's supposed to be. If the new message did not exist at all in these older protocols, code referring to them won't compile, and that needs to be fixed.&lt;br /&gt;
&lt;br /&gt;
* When handling byte-swapping, never assign the result of readNNle() to a larger variable. This is wrong. Consider a 16-bit little-endian number with two bytes ''XY'', represented as &amp;lt;tt&amp;gt;YX&amp;lt;/tt&amp;gt;. read16le() returns &amp;lt;tt&amp;gt;YX&amp;lt;/tt&amp;gt;, and assigned to a 32-bit number on a big-endian system, the result is &amp;lt;tt&amp;gt;00YX&amp;lt;/tt&amp;gt;. A 32-bit little-endian number of value ''XY'' is '''correctly''' represented as &amp;lt;tt&amp;gt;YX00&amp;lt;/tt&amp;gt;. Assigning the result of readNN() is fine, as that value is in host order. Similarly you can't writeNNle() a number stored in a smaller type, but this is a harder mistake to make.&lt;br /&gt;
&lt;br /&gt;
* As a corollary, don't save anything explicitly kept little-endian in anything other than a sized int type. Don't use size_t, enum types, or anything along those lines. Especially not size_t.&lt;br /&gt;
&lt;br /&gt;
* Remember that protocol changes are not to be made lightly, because it causes an incompatibility problem. &lt;br /&gt;
&lt;br /&gt;
* Be very, very, careful about any changes to game server startup code in the backend. Triple-check all the logic (or more). Do not forget to take into account the client disconnecting/timing out after the request, the game server never starting, the game server shutting down as the request arrives, and everything in between.&lt;br /&gt;
&lt;br /&gt;
* Before writing new DB query code or changing how current ones work, make sure to read up on the [http://pqxx.org/devprojects/libpqxx/doc/stable/html/Tutorial/ch03s07.html pqxx transactor model].&lt;br /&gt;
&lt;br /&gt;
* There is a reftree.sql file in the test directory. If you are working with the DB and need a view into the trees of data the change notification routines are working with, you may find this file useful. Load it into the DB, and it adds a &amp;quot;reftree&amp;quot; function which, given a node, will generate a list of the whole tree below it by following the noderefs. The output includes node and folder type '''names''' and the information used to determine where change notifications have to be sent.&lt;br /&gt;
&lt;br /&gt;
== Implementation Choices ==&lt;br /&gt;
&lt;br /&gt;
Oftentimes, in a hobbyist project such as MOSS was in the beginning, there is not a lot of design documentation. MOSS had some, but most of it became obsolete as goals changed. Here are some short descriptions answering some &amp;quot;Why did you do it this way?&amp;quot; questions.&lt;br /&gt;
&lt;br /&gt;
Terminology used here: the &amp;quot;backend&amp;quot; server is that process named moss_backend, which talks to the DB and handles anything needing centralized management, while &amp;quot;frontend&amp;quot; servers are everything else (auth/file/game/gatekeeper servers talking to the client, and the dispatcher listening for connections). The &amp;quot;backend protocol&amp;quot; is the protocol used between the frontend and backend servers.&lt;br /&gt;
&lt;br /&gt;
; Why is there all this read32/read32le stuff?&lt;br /&gt;
: [[#Requirements | A networking person wrote MOSS.]] readNN() byte-swaps a little-endian value (from the protocol on the wire) to host order. writeNN() byte-swaps from host to little-endian. If you run it on a little-endian box this is a no-op. readNNle() ''doesn't'' byte-swap, returning a number of size NN in little-endian order. If you run it on a little-endian box this is a no-op. On a big-endian box these are critical. In addition, these macros/functions handle hardware that does not allow unaligned access of memory locations. At the time of release, MOSS appeared to work correctly on big-endian machines.&lt;br /&gt;
&lt;br /&gt;
; Why are there two ways to write every message?&lt;br /&gt;
: For larger messages, the writev() syscall is considered more efficient, because less data has to be copied when crossing the user/kernel memory boundary. In other words, you save one copy of the entire contents of what you write at the price of computing and copying the set of iovecs. However, writev() won't work when you have to encrypt the data first, so for encrypted connections we have to copy the data into a buffer and then encrypt it.&lt;br /&gt;
&lt;br /&gt;
; Why do the backend message classes have &amp;quot;little-endian&amp;quot; comments all over?&lt;br /&gt;
: The backend protocol is handled somewhat differently in MOSS. For frontend servers, any data read in and used by the server is stored in host order. But for the backend messages, the data is mostly stored in ''little-endian'' order, because the protocol is (currently!) unencrypted and I can use writev() and skip copying into a buffer. For many messages, writev() may not be better than copying, because the iovec is bigger than the data it represents. On the other hand, the actual copy into the buffer is avoided. The performance of each approach is unknown. There is no MessageQueue support for mixing the iovec and buffer strategies in a single queue based on message type.&lt;br /&gt;
&lt;br /&gt;
; Why do you use a single-threaded big select loop for each game server?&lt;br /&gt;
: The other typical strategy would be to have a thread per client and pass messages between threads. The MultiWriterMessageQueue class was originally intended to cover that case (in addition to [[MOSS-Project_Ideas#connection_merging | others]]). But the fundamental problem with this plan is that I did not have a good portable way to wake up threads when a message is queued. It can be done, but signals are probably not the way to do it.&lt;br /&gt;
&lt;br /&gt;
; Speaking of signals, why do you use them between threads instead of epoll()?&lt;br /&gt;
: I don't have epoll() on my development machine. Signals are the most portable. [[MOSS-Project_Ideas#libevent | Replacing the use of signals + select() with libevent]] might be the right answer because part of its goal is to work on many OSes.&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;span id=&amp;quot;backend_typecodes&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;Explain the funky backend protocol numbering scheme?&lt;br /&gt;
: The protocol was designed to facilitate using multiple processes or servers in the backend. Thus messages have a bitmask &amp;quot;class&amp;quot; which would allow them to be quickly routed to the right location by checking the bitmask, rather than having a giant case statement to decide.&lt;br /&gt;
&lt;br /&gt;
: Then, I wanted the pairs of messages to be recognizable from the number, so a message TO the backend is numbered the same the corresponding message FROM the backend, with the addition of a bit to mark which direction the message is going. Since each server knows its own identity, this bit is basically a big favor for the Wireshark dissector. Trust me, it's really nice.&lt;br /&gt;
&lt;br /&gt;
: Finally, because once upon a time I knew many messages by their number, I assigned backend messages the same number as a corresponding frontend (client) message. When it made sense. We don't need to do this going forward, but we aren't allowed to change the current ones.&lt;br /&gt;
&lt;br /&gt;
: There are some bits in the middle &amp;quot;left over&amp;quot;. Maybe someone will need them for something creative someday!&lt;br /&gt;
&lt;br /&gt;
; Why did you choose [http://www.postgresql.org/ PostgreSQL]?&lt;br /&gt;
: There were not a lot of differentiators between it and MySQL. But, PostgreSQL provides &amp;quot;triggers&amp;quot; -- this is a way to request that when a table is changed, the DB tells anything subscribed to the triggers about the change. I was intrigued by them, and thought they could prove useful for providing the vault node update notifications to clients (VaultNodeChanged/VaultNodeAdded/VaultNodeDeleted). Unfortunately, doing this ended up requiring at least two connections to the DB, one like the current one, and another to listen for triggers. So triggers were not used in the interest of simplicity in the backend server. Nothing else is preventing their use.&lt;br /&gt;
&lt;br /&gt;
; What is up with this giant DB schema!&lt;br /&gt;
: First, it was a conscious decision to put as much SQL code as possible into stored procedures. This makes it so you can modify the DB functionality without recompiling the server, and it reduces the amount of data you have to push over the socket.&lt;br /&gt;
&lt;br /&gt;
: The single giant table as seen in PotS, UU, and to some extent (how much exactly is unknown) MOUL/MOULa is so hard to work with. And it has scalability, relations, and clarity built right out of it. We were thinking of how to split the database load up to help with the bottleneck the DB still proved to be in MOUL. While no implementation was done for that (realistic expectations of MOSS suggest it is not needed), this did lead to the decision to experiment with splitting the table up into many tables by node type.&lt;br /&gt;
&lt;br /&gt;
: There's no way to know if these design choices are more efficient, without changing the design, implementing it, and comparing the performance of the two in a like-for-like way. But it sure is a lot easier to write queries with the stored procedures and tables by node type!&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;span id=&amp;quot;notifier&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;What is this new &amp;quot;notifier&amp;quot; thing in the noderefs table?&lt;br /&gt;
: It is the answer to the question &amp;quot;How do I know which client to tell about changes to this reference or referred-to node?&amp;quot;&lt;br /&gt;
&lt;br /&gt;
: After drawing many pictures of node trees, it became clear that the &amp;quot;owner&amp;quot;, coming from the client, was mostly but not really right for this. I was left with the impression that's what the &amp;quot;owner&amp;quot; field is for... but since it wasn't what I wanted I added a new one. For player trees, the notifier is the player. For age trees, it's the age, and then the DB looks up what players are interested in that age.&lt;br /&gt;
&lt;br /&gt;
: I do not know how Cyan solved the problem, but this was the way to push the decision about who to tell into the DB where most of the data is. Otherwise, the backend (vault) server would have to cache all the active trees itself in order to find the answer.&lt;br /&gt;
&lt;br /&gt;
; Why did you make the SDL files be in a directory tree instead of a single directory?&lt;br /&gt;
: The goal was to improve the age development experience. If the server loads all the SDL at startup, and you want to change the SDL because you have a new version to test, you have to restart the server. If instead, a given age's SDL is loaded at the time the game server starts up, you only need to restart the game server. I then put the files common to all ages in a &amp;quot;common&amp;quot; directory so that it is loaded once, and the data can be shared between game servers, but that is just a small optimization. If users have serious issues with this they can put ''all'' the SDL files in the common subdirectory.&lt;br /&gt;
&lt;br /&gt;
; Why .mbm and .mbam files?&lt;br /&gt;
: I did not want the server to have to stat and checksum files all the time. File and auth files don't change much.&lt;br /&gt;
&lt;br /&gt;
; Why didn't you put Python in to script Heek?&lt;br /&gt;
: I suspect Cyan did this. I am not a fan of embedding scripting where it is not needed, and at the time I had no reason to believe there would ever be new GameMgr types requiring the kind of dynamic rapid development that embedded scripting is good for. Still, it's in the [[MOSS-Project_Ideas#scripting | project ideas]] for those who are into that sort of thing.&lt;br /&gt;
&lt;br /&gt;
== Project Ideas ==&lt;br /&gt;
&lt;br /&gt;
The whole idea of this list is to provide some ideas for anyone wishing to dive&lt;br /&gt;
into MOSS. Sometimes a little direction helps. See [[MOSS-Project_Ideas]]. Of&lt;br /&gt;
course, you are not limited to this list!&lt;br /&gt;
&lt;br /&gt;
[[Category:MOSS]]&lt;/div&gt;</summary>
		<author><name>A'moaca'</name></author>
	</entry>
	<entry>
		<id>https://wiki.openuru.org/index.php?title=MOSS/Notes&amp;diff=986</id>
		<title>MOSS/Notes</title>
		<link rel="alternate" type="text/html" href="https://wiki.openuru.org/index.php?title=MOSS/Notes&amp;diff=986"/>
		<updated>2011-04-05T06:57:36Z</updated>

		<summary type="html">&lt;p&gt;A'moaca': /* Questions */ add missing step&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page just holds various notes about running a MOSS server.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Questions ==&lt;br /&gt;
&lt;br /&gt;
I can't really call this a FAQ until the questions have been asked frequently.&lt;br /&gt;
&lt;br /&gt;
; How do I add a user?&lt;br /&gt;
: [[MOSS-Setup#Create_Accounts]]&lt;br /&gt;
; How do I change the Python?&lt;br /&gt;
: Start with the source Cyan has generously provided us under the GPL. To compile that source you'll have to add in the glue. Maybe there is a tool do that in the CWE source. Make your changes. After compiling and creating the .pak (another tool?), copy the .pak to the [[MOSS-Setup#Auth_Server_Data | correct server directory]] and encrypt it. Make a new .mbam file.&lt;br /&gt;
; How do I add a new age?&lt;br /&gt;
: Copy the encrypted .pak to the [[MOSS-Setup#Auth_Server_Data | correct server directory]], add the file to the Python.txt, and make a new .mbam file. Copy any SDL files to the auth SDL directory and encrypt them. Add them to SDL.txt and make a new .mbam file. Copy unencrypted SDL files to the [[MOSS-Setup#Game_Server_Data | correct server directory]]. Note if you have more than one SDL file for your age, or the file is not named the same as the age, you'll need to put the age's SDL file(s) in a directory named after the age. Copy the unencrypted .age file to the game server directory.&lt;br /&gt;
; Why would I use --enable-fork?&lt;br /&gt;
: This is primarily useful for testing. It's easier to debug a non-threaded process.&lt;br /&gt;
; What resource limitations are there (file descriptors, memory, etc.)?&lt;br /&gt;
: This is a question that's not obvious to answer. But here is what is known:&lt;br /&gt;
:* Currently MOSS uses about 5 file descriptors when idle. It uses about 10 per connected user. (4 are for the game server, so if the user links around a lot, it will be more, and if you have multiple users in one age it will be less.) If you are running a large shard, you may need to adjust per-process file descriptor limits (see the &amp;quot;ulimit&amp;quot; command) or even kernel (global) limits. If you adjust the global limit, pay attention to &amp;lt;tt&amp;gt;FD_SETSIZE&amp;lt;/tt&amp;gt;. See the select() man page.&lt;br /&gt;
:* Currently MOSS uses 7 big buffers for network data per connected user. The buffer size is set by &amp;lt;tt&amp;gt;BUFSIZE&amp;lt;/tt&amp;gt; in constants.h. The default is 64k, so a total of 448k per user. If you have enough users that your moss processes grow too large you can reduce the &amp;lt;tt&amp;gt;BUFSIZE&amp;lt;/tt&amp;gt;.&lt;br /&gt;
:* There is not a lot of disk I/O, except for whatever the database has to write. If you set the log levels very low (DEBUG or worse, MSGS) then there will be a lot of I/O for log files.&lt;br /&gt;
; Does MOSS work on my Power PC?&lt;br /&gt;
: It is supposed to! Testing of big-endian systems was done, but not a full, complete run-through of all game mechanics and multiplayer testing. If it does not work, [[MOSS#How_to_Contribute | it's a bug]].&lt;br /&gt;
; Does MOSS work on Windows? OS X?&lt;br /&gt;
: Not Windows. There is a fair bit of porting work to do. OS X theoretically works but nobody has tried yet. (If you try and it works, let us know!)&lt;br /&gt;
; What is the &amp;quot;status&amp;quot; server type?&lt;br /&gt;
: MOSS will provide the status string normally fetched from a web server. You do have to make the client send the HTTP request to port 14617 or it won't do much good. This is a feature that perhaps only the author wants.&lt;br /&gt;
&lt;br /&gt;
== Warnings ==&lt;br /&gt;
&lt;br /&gt;
* Please note: The MOSS vault is as insecure as MOUL's. (I don't know what was done to MOULagain.) The MOSS server is almost as trusting of the client as MOUL's. (Or maybe more, in other ways; for example, there is no server-side profanity filter.) This is because a MOUL server was implemented, not some other server. Doing better is definitely possible. But to do it right is a very big project, because the entire ''system'' was designed with this trust model. You can't always change just one part of it to get where you want to be.&lt;br /&gt;
&lt;br /&gt;
* Don't change the .mbm or file server files while you have clients doing File transactions. Doing so will give everything indigestion.&lt;br /&gt;
&lt;br /&gt;
* I'm sure the same applies for .mbam and auth server files.&lt;br /&gt;
&lt;br /&gt;
* The SDL mechanism depends on all servers in the shard having synchronized time. Use NTP if you have more than one server. (You'll also need to NFS mount the game/state directory on all the servers so the age SDL is available to all.)&lt;br /&gt;
&lt;br /&gt;
== Setup Choices ==&lt;br /&gt;
&lt;br /&gt;
* Disabling the client&amp;lt;-&amp;gt;server encryption is NOT recommended. However, if you subscribe to the shortsighted idea that protecting your users is not important, go ahead. But be warned, there are code paths in MOSS that are completely untested when all encryption is disabled. You'll have to fix any bugs. (The [[Wireshark Plugin]] does support decrypting connections when you have the key, so you ''can'' use encrypted connections during development/testing.)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span id=&amp;quot;RSA&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;MOSS supports using RSA for key negotiation. The client contribution to the session key is RSA-encrypted with the server public key and then sent to the server, which decrypts the message. Ironically, this actually is less crypto work, while using a non-modified standard encryption technology. And it has the same pseudo-authentication properties as the Cyan-style modified Diffie-Hellman. The assembler changes required for this are astonishingly small, but there's not much value in using RSA. Nonetheless, there's no need to remove working server support for it...&lt;br /&gt;
&lt;br /&gt;
== While Running the Server ==&lt;br /&gt;
&lt;br /&gt;
* You can change age SDL state server-side by modifying the state saved in files in the game/state directory. Keeping backups is advised. You may modify the files with the &amp;quot;sdl_reader&amp;quot; program (which you need to build separately using &amp;quot;make sdl_reader&amp;quot;). This is a very simple command-line program. Use the -l option to specify a saved file to read. When in the program, use the &amp;quot;h&amp;quot; command to see the help. Saving this file while a game server for that age is running is pointless; the new version won't be read and it will be overwritten when the server exits.&lt;br /&gt;
&lt;br /&gt;
== Client Bug Workarounds ==&lt;br /&gt;
&lt;br /&gt;
MOSS works around a few client bugs.&lt;br /&gt;
&lt;br /&gt;
* MOSS &amp;quot;fixes&amp;quot; the KI light bug. It is a bug in the PRP files. MOSS has an extra check for determining whether SDL state is avatar-related, instead of relying on the flag that says whether to keep the SDL state around. That check covers the KI light, so the light SDL is tossed along with the rest of avatar SDL when a person leaves an age.&lt;br /&gt;
&lt;br /&gt;
* MOSS may &amp;quot;fix&amp;quot; the footstep region bug. This bug is when you get the wrong footstep sound stuck, like that wooden bridge you left long ago clumping around while you're on stone. Everyone in the age hears the wrong footstep sounds. I believe that in normal play (that is, without things like /spawn) it is due to a race with the exclusive locking mechanism used to keep things like multiple button presses from being processed at the same time. Why footstep regions take a server-side exclusive lock is beyond me**, so MOSS grants '''all''' footstep region lock requests. This should make the problem occur less frequently, if at all (depending on how the client actually responds to receiving the lock after leaving the region). MOSS decides you are asking for a footstep region lock by looking for the word &amp;quot;Footstep&amp;quot; in the object name. ''Do not name buttons, door regions, or whatever with &amp;quot;Footstep&amp;quot; in your new ages.'' I suggest you do name footstep regions with &amp;quot;Footstep&amp;quot;. The special case can be removed by removing &amp;lt;tt&amp;gt;#define GRANT_ALL_FOOTSTEPS&amp;lt;/tt&amp;gt; from GameState.cc and recompiling.&lt;br /&gt;
:: **In fact, as a friend of mine pointed out, why are footstep sounds decided by the represented avatar's client and propagated to everyone else in the first place? It should be a purely local decision based on the location of each avatar as seen by that client. That would save on traffic and always be accurate, never mind the race with locking on the region since there would be no need to coordinate anything for a purely local decision.&lt;br /&gt;
&lt;br /&gt;
* Quab game Python is not really complete. The first person to link to the age becomes the &amp;quot;owner&amp;quot; of the quab game. The Python sort of attempts to handle the situation where the game owner leaves the age while there are still quabs around, but it does not actually handle it. If the server attempts to pass ownership to someone else, that client will break. And the current MOULagain client even crashes. So MOSS works around the problem by intentionally breaking the whole game when the owner leaves the age and quabs are still present. All the quabs will remain frozen in place until the age has been cleared of all players. The age does not have to restart to revive the game, just be empty.&lt;br /&gt;
&lt;br /&gt;
* The client supports two kinds of passwords, depending on the format of the username. If the username has the format x@x.x it uses algorithm 1 (a more secure one but also one with a fencepost error), and otherwise algorithm 2.  Unfortunately the /changepassword command does not know about algorithm 2 and if you logged in with algorithm 2, it will try to change your password hash to the one for algorithm 1. This would result in you being unable to log in.  So MOSS rejects requests to change the password if the username does not have the x@x.x format.&lt;br /&gt;
&lt;br /&gt;
== Server Non-Bugs ==&lt;br /&gt;
&lt;br /&gt;
These are problems with Cyan's server that MOSS does not have.&lt;br /&gt;
&lt;br /&gt;
* MOSS does not have the infamous &amp;quot;zero seconds remaining&amp;quot; bug. Thus it is possible to do the auth downloads without the server waiting for acks from the client. This speeds up the download substantially as now the bandwidth can be fully utilized. (The [[MOSS-Setup#configure | --enable-fast-download]] configure option turns this on.)&lt;br /&gt;
&lt;br /&gt;
* The MOUL server has a bug with quabs in Ahnonay. If you are the first person who linked into the age, the quabs are associated with your ID. When you link out of the age, the server is supposed to send a LoadClone message telling other clients to unload your clone (the avatar). The MOUL server sends the message, but it says to unload one of the quabs with your ID in it instead of the player avatar. Oddly, the client seems just fine with that. MOSS does not have this bug.&lt;br /&gt;
&lt;br /&gt;
* You should see less client hitching while moving around with MOSS. The MOUL server sends a ton of node update messages for the (unchanged) city AgeInfo node. Each node update causes the client to fetch your pellet scores. The client is frozen during this (and most any) vault transaction. The MOSS server does not send all those useless updates. Interesting note: One measurement during MOUL was approximately 400 pellet score fetches an hour. That is the client freezing every 9 seconds regardless of what age you are in or how many people are in it or on your buddy list. (The pellet score fetch itself can probably be fixed in the Python but you'd still be wasting time on the city node.)&lt;br /&gt;
&lt;br /&gt;
* The pellet score freeze can be further reduced by #defining &amp;lt;tt&amp;gt;PELLET_SCORE_CACHE&amp;lt;/tt&amp;gt;, which does what it sounds like: it caches the client's pellet score in the Auth server to cut out the round-trip time to the DB. However, there's little value to it without the city node update problem; when you open the KI it fetches the score but it's also fetching other vault nodes. Plus you aren't trying to move at the time so the freeze is less obvious. So &amp;lt;tt&amp;gt;PELLET_SCORE_CACHE&amp;lt;/tt&amp;gt; is undefined by default, and in fact it is ''untested''.&lt;br /&gt;
&lt;br /&gt;
[[Category:MOSS]]&lt;/div&gt;</summary>
		<author><name>A'moaca'</name></author>
	</entry>
	<entry>
		<id>https://wiki.openuru.org/index.php?title=MOSS/Project_Ideas&amp;diff=985</id>
		<title>MOSS/Project Ideas</title>
		<link rel="alternate" type="text/html" href="https://wiki.openuru.org/index.php?title=MOSS/Project_Ideas&amp;diff=985"/>
		<updated>2011-04-05T06:53:20Z</updated>

		<summary type="html">&lt;p&gt;A'moaca': /* Detail work (little Uru-specific knowledge required) */ new idea&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The initial list was generated over the lengthy period of MOSS's initial&lt;br /&gt;
development. These project ideas mostly cover missing functionality. None of&lt;br /&gt;
the missing functionality is known to cause gameplay issues so these did not&lt;br /&gt;
really seem like bugs. These ideas are grouped by general type of change&lt;br /&gt;
required, and sort of by increasing approximate difficulty level and sort of by&lt;br /&gt;
decreasing value.&lt;br /&gt;
&lt;br /&gt;
Bigger ideas, such as entirely new functionality now made possible by the&lt;br /&gt;
release of the client, could go here too. Be realistic, though. Remember that&lt;br /&gt;
protocol changes are not to be made lightly, because it causes an&lt;br /&gt;
incompatibility problem. It is probably better to propose large changes in&lt;br /&gt;
discussion format on the forums. Do not ''expect'' someone else to take up and&lt;br /&gt;
implement your proposal.&lt;br /&gt;
&lt;br /&gt;
The whole idea of this list is to provide some ideas for anyone wishing to dive&lt;br /&gt;
into MOSS. Sometimes a little direction helps.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Fix bugs ==&lt;br /&gt;
&lt;br /&gt;
The bug tracker is here: https://foundry.openuru.org/jira/browse/MOSS&lt;br /&gt;
&lt;br /&gt;
== Detail work (little Uru-specific knowledge required) ==&lt;br /&gt;
&lt;br /&gt;
* Try disabling the Nagle algorithm on sockets. This should result in less latency to the client when small messages are involved. Make sure to test the whole game thoroughly.&lt;br /&gt;
&lt;br /&gt;
* Figure out and implement a good way to use autoconf to compile in default pathnames. This would apply to the default config file, key file, moss_serv binary, and log/auth/game/file directory locations. The idea is if I say --prefix=/foo the defaults become /foo/etc/moss.cfg and so forth instead of ./etc/moss.cfg. Don't forget autoconf lets you override the etcdir, bindir, etc. separately.&lt;br /&gt;
&lt;br /&gt;
* Treat SDL filenames case-insensitively. This is very annoying in Unix, since it requires using readdir() and strcasecmp() instead of just open().&lt;br /&gt;
&lt;br /&gt;
* Make it so the game/state directory location can be separately configured. This is so the whole MOSS install can be read-only and just the log directory and game/state moved somewhere read-write. (The easy workaround is to symlink a writable directory to game/state.)&lt;br /&gt;
&lt;br /&gt;
* Log the PID of all forked servers in moss.log.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span id=&amp;quot;libevent&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;See if we can switch to libevent for inter-thread communication instead of raw signals. This should be fairly portable and take advantage of the different per-OS lightweight signalling mechanisms.&lt;br /&gt;
&lt;br /&gt;
* Allow ''skipping'' overlong messages (messages MOSS thinks are too big). This requires, upon catching the exception, tossing out the message, and if it has not all been read in yet, keeping track of how much more to toss in the future. The RC4 state must be updated too for the tossed message length.&lt;br /&gt;
&lt;br /&gt;
* It would be nice to use atomic operations for refcounts instead of having to use (bigger, slower) mutexes for them. This does make MOSS not architecture-independent, which is part of why I have been resisting it. (See also signal handling next.)&lt;br /&gt;
&lt;br /&gt;
* Signal handlers and the operations to read and reset the values in the main loops should be using atomic operations.&lt;br /&gt;
&lt;br /&gt;
* Catch and handle std::bad_alloc whenever possible.&lt;br /&gt;
&lt;br /&gt;
== Fairly contained changes ==&lt;br /&gt;
&lt;br /&gt;
* Make it so game servers can be forked as separate processes. This helps a lot for debugging and also would help for age development, making it easier to change SDL and retest. Otherwise you have to shut down the whole frontend server or wait out the age's linger time. This work was started but not completed, and that code can be found inside &amp;lt;tt&amp;gt;FORK_GAME_TOO&amp;lt;/tt&amp;gt; #ifdefs. If you do this, I suggest you consider separating &amp;lt;tt&amp;gt;FORK_GAME_TOO&amp;lt;/tt&amp;gt; from &amp;lt;tt&amp;gt;FORK_ENABLE&amp;lt;/tt&amp;gt; so that one could have forked game servers and *not* forked auth/file servers.&lt;br /&gt;
&lt;br /&gt;
* In the getpublicagelist() SQL function, there is a comment about the 50-hood limit. The current code returns the first 50 hoods. We should return the most recently used 50 hoods. The hard part is knowing which those are. This is mostly if not wholly DB/SQL work.&lt;br /&gt;
&lt;br /&gt;
* Age population limits are unimplemented. The value is in the vault, but the server does not look at it.&lt;br /&gt;
&lt;br /&gt;
* Figure out how to throw out clones and SDL when a player leaves the age. Please see the &amp;quot;clean up clone, SDL&amp;quot; section in GameServer::conn_shutdown(). Right now this is full of special cases: it handles the Kemo bugs and and Quabs specially (a different thing for each). It may be that this is required for best behavior, but I still feel like I've missed something despite heavy scrutiny of the data. This is more of a research project and not much of a code project.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span id=&amp;quot;SDL_timestamps&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;MOUL parsed SDL nodes on the way into the vault. It probably only updated the node with fields having the Dirty bit set. In addition it added timestamps to the fields because the client does not put in the timestamps (reasonably so, as its time may be wrong). MOSS currently saves the SDL wholesale. This basically works, but with the timestamps properly added, the game server can merge the vault, age, and global SDL in any order and without strange rules. Note: if you do this, you also need to write a script or some other way to update all the SDL nodes in existing MOSS DBs.&lt;br /&gt;
&lt;br /&gt;
* The kickable SDL filtering algorithm is the same one I put in Alcugs ages ago. It is better than nothing but not as good as Plasma's. You will see more warping of kickables than with Cyan's server. This project is to come up with a better way of deciding what physical SDL to send to all the clients, based on those messages all the clients are sending to the server.&lt;br /&gt;
&lt;br /&gt;
* The server is probably supposed to use RelevanceRegion information to avoid sending SDL updates to clients who don't share a relevance region with the originating client. (The idea being to reduce network traffic, since hopefully the client already avoids rendering/physics on things in irrelevant regions.) Things work if the server doesn't filter, so MOSS doesn't. Also, I do not have strong evidence to believe this supposition is actually correct. Which is the other reason MOSS doesn't do it. Finding out, and implementing it if so, would be a nice project.&lt;br /&gt;
&lt;br /&gt;
* Figure out what the server is supposed to do with plSetNetGroupIDMsg and do it. Right now MOSS just drops it to no apparent ill effect. I am deeply suspicious of this message due to seeing it at aurally unpleasant times in UU. (Old, old notes: &amp;quot;may have to do with infinitely looping scraping noises&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;kCli2Auth_SendFriendInviteRequest&amp;lt;/tt&amp;gt; is not fully supported (it is dropped on the floor).&lt;br /&gt;
&lt;br /&gt;
== Bigger changes ==&lt;br /&gt;
&lt;br /&gt;
* The following messages are unimplemented.&lt;br /&gt;
** &amp;lt;tt&amp;gt;kCli2Auth_VaultSetSeen&amp;lt;/tt&amp;gt;  --  unimplemented in client&lt;br /&gt;
** &amp;lt;tt&amp;gt;kCli2Auth_ScoreDelete&amp;lt;/tt&amp;gt;  --  never saw one, so couldn't implement it&lt;br /&gt;
** &amp;lt;tt&amp;gt;kCli2Auth_ScoreSetPoints&amp;lt;/tt&amp;gt;  --  never saw one, so couldn't implement it&lt;br /&gt;
** &amp;lt;tt&amp;gt;kCli2Auth_ScoreGetRanks&amp;lt;/tt&amp;gt;  --  never saw one, so couldn't implement it&lt;br /&gt;
** &amp;lt;tt&amp;gt;kCli2Csr_PingRequest&amp;lt;/tt&amp;gt;  --  no recorded Csr messages&lt;br /&gt;
** &amp;lt;tt&amp;gt;kCli2Csr_RegisterRequest&amp;lt;/tt&amp;gt;&lt;br /&gt;
** &amp;lt;tt&amp;gt;kCli2Csr_LoginRequest&amp;lt;/tt&amp;gt;&lt;br /&gt;
** &amp;lt;tt&amp;gt;kCsr2Cli_PingReply&amp;lt;/tt&amp;gt;&lt;br /&gt;
** &amp;lt;tt&amp;gt;kCsr2Cli_RegisterReply&amp;lt;/tt&amp;gt;&lt;br /&gt;
** &amp;lt;tt&amp;gt;kCsr2Cli_LoginReply&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Add hood randomization to DRC hoods. Player-created hoods are randomized by the Python in the Nexus when the hood is created. DRC hoods, however, are created by the server. In MOSS's case, they are created entirely by SQL code. So adding DRC hood randomization means noticing when the DB has created a new DRC hood, creating and modifying SDL in the backend, and then finding and modifying the age SDL node for that new hood. All before responding to the client creating the new avatar and thus the new DRC hood.&lt;br /&gt;
&lt;br /&gt;
* The MessageQueue class has a concept of priorities. The idea was to enable dropping of lower-priority messages if a queue to a given client starts to back up. (The lowest priority being voice chat, then avatar movements, with world state changes being highest.) The measurement of queue length or throughput necessary for that is not implemented. So, neither is the dropping. (There is the very beginnings of some if &amp;lt;tt&amp;gt;DO_PRIORITIES&amp;lt;/tt&amp;gt; is #defined.) As such, queue users don't do a good job of priority-setting, although VOICE and FRONT are properly used. The idea wasn't to order the queue (except for FRONT), but to skip sending, say, a VOICE message when we encounter one, if the queue congestion measure says to.&lt;br /&gt;
&lt;br /&gt;
* '''Vault security'''&lt;br /&gt;
: The MOSS vault is as insecure as the MOUL vault. Need I say more? Here are some starter thoughts.&lt;br /&gt;
:* MOSS should parse incoming SDL messages and sanity-check them. See also [[#SDL_timestamps | adding timestamps]].&lt;br /&gt;
:* MOSS could probably verify other blob contents too.&lt;br /&gt;
:* Anyone can save anything to any node, and can fetch any node if they know its type and ID. We can deny these requests if the user shouldn't have access. Possibly [[MOSS-Developer_Notes#notifier | the notifier field]] can help.&lt;br /&gt;
:* Much more, I'm sure. Better vault security ''is'' possible.&lt;br /&gt;
&lt;br /&gt;
* Eliminate excessive byteswapping of opaque server IDs in BackendMessages. This is to say, in the backend server, when reading in the messages, it byte-swaps the IDs to store them, only ever uses them in equality tests with other IDs, and then byte-swaps them back when sending new messages. (On a little-endian box there's no swapping so it does not cost much, but it's the principle of the matter.) Unfortunately this really needs to be tested on a big-endian machine.&lt;br /&gt;
&lt;br /&gt;
* Try changing the File server to do [[MOSS-Setup#ackless | ackless downloads]], too. Maybe only if there is only one download at a time, though.&lt;br /&gt;
&lt;br /&gt;
== Scalability issues ==&lt;br /&gt;
&lt;br /&gt;
Performance and scalability are always interesting questions. And frequently ignored, because they only matter for larger installations.&lt;br /&gt;
&lt;br /&gt;
These are ideas unimplemented because they only really matter for large&lt;br /&gt;
shards. Large as in having, let's say, 50+ concurrent '''busy''' users. (50&lt;br /&gt;
people standing in the city chatting doesn't actually do much.) Maybe MOSS is&lt;br /&gt;
okay with that number now, in which case &amp;quot;large&amp;quot; is more. It is entirely&lt;br /&gt;
unknown.&lt;br /&gt;
&lt;br /&gt;
* Performance testing. Instrumentation. There should be a load generator to do this. This was not high on the list during development, with a user base of 3.&lt;br /&gt;
&lt;br /&gt;
* See the last paragraph in the comments at the top of FileTransaction.h about how multiple file transactions of the same file should share a single opened file.&lt;br /&gt;
&lt;br /&gt;
* Allow speculative pre-caching of AgeInfoNodes and PlayerInfoNodes when node changed notifications come from the vault server and are forwarded to any connected client. Cache in the auth server, vault server, or both. The goal is to reduce latency on those requests the client freezes for.&lt;br /&gt;
&lt;br /&gt;
* The backend protocol supports game servers requesting batches of GameMgr IDs. However, there is no code on either side to actually do so. The idea for this was that more populated ages, like the city, would benefit from doing batch requests. Every person who links in with a marker game needs a new global game ID, and it would be nice to cut out any extra backend round trips for links, even though this particular round trip does not block the link process (aside from being something the backend is doing when it could be doing something else).&lt;br /&gt;
&lt;br /&gt;
* Database performance could be measured and the SQL or even tables optimized.&lt;br /&gt;
&lt;br /&gt;
* MOSS currently uses a single blocking connection to the DB. Implement and investigate performance of multiple DB connections, or asynchronous ones. Maybe the backend server has to become threaded to gain the best advantage.&lt;br /&gt;
&lt;br /&gt;
* In a big shard, we may need to split the backend server work up. The [[MOSS-Developer_Notes#backend_typecodes | backend protocol]] is designed to support separating backend work between threads. The &amp;quot;classes&amp;quot; of backend messages in a bitfield are meant as a way to quickly route a backend message to an appropriate backend thread or process.&lt;br /&gt;
&lt;br /&gt;
== Frontend/backend interactions ==&lt;br /&gt;
&lt;br /&gt;
* Add encryption to the backend protocol. This itself is not a big deal (though you have to pick a good key negotiation, and do not forget to consider authentication mechanisms), but it does mean all the BackendMessage fill_buffer() code paths would be newly exercised, so a lot of regression testing would be in order.&lt;br /&gt;
&lt;br /&gt;
* It would be much easier on the DB if updates to markers are batched by the game server. This especially applies to capturing markers. See the comments in the setmarkerto() and startmarkergame() SQL functions.&lt;br /&gt;
&lt;br /&gt;
* The backend protocol allows for frontends hosting ages to specify only a subset of ages that can be hosted there. This is unused right now; the message has a field saying, &amp;quot;this is the length of the following age restriction list&amp;quot; and it is always zero. When there are no restrictions the backend can request any frontend to host any age.&lt;br /&gt;
** The need for splitting hostable ages is unclear, but in a very large shard you might, for example, put all city instances, or even only the public one, on a separate server. It would also allow someone to join a shard and host just their own age, or whatever.&lt;br /&gt;
** Since the frontend never sends restrictions, the backend currently has no way to store and use them. So there is work on both sides.&lt;br /&gt;
** Presumably which ages a frontend server can host would be a configuration option but it could be done instead by restricting the contents of the game/age directory. That would not allow even finer-grained restrictions, but this whole project kind of needs a real use case to flesh out what is needed.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span id=&amp;quot;connection_merging&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;Having one backend TCP connection per frontend server is probably not a good thing, in terms of efficiency, or of scalability with a cluster of machines. We could change it to have one backend connection per frontend ''process'' and funnel everything through it. The mostly-implemented but unused and untested MultiWriterMessageQueue was meant, in part, to support this (there are multiple threads writing, but only one thread reading, which writes to the socket).&lt;br /&gt;
&lt;br /&gt;
: Then when messages are received in the frontend there needs to be some way of passing the message to the right thread and signaling them something is present to be handled. This is all unimplemented but the format of the backend messages is meant to take care of this case (in particular, the two &amp;quot;server IDs&amp;quot; in the header are for dispatching messages to the correct thread).&lt;br /&gt;
&lt;br /&gt;
: However, essentially the same changes would be necessary if the backend server is folded into the main server so there is only one process; then &amp;quot;sending&amp;quot; messages to the backend server is just putting them on the (shared) queue that would have been used to funnel everything through one connection, and &amp;quot;receiving&amp;quot; them is just taking them off that queue since there's no TCP connection to deal with.&lt;br /&gt;
&lt;br /&gt;
== New functionality ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span id=&amp;quot;scripting&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;I am guessing Cyan's server handles the GameMgr stuff with server-side scripting. At the time MOSS was implemented there was no expectation that new game types may be added so adding in a scripting language was not worth the problems incumbent with doing so. Also the overall value of scripting is not clear (especially for the cost in server complication). However, it could be done. The project would have to include embedding the scripting and then rewriting stuff using scripts.&lt;br /&gt;
: Please note, a lot of effort went into getting the Heek right, handling ties, allowing people to accidentally stand up and sit back down in the game, and probably other details I forgot. If you want to script Heek, it really ought to still work as well.&lt;br /&gt;
&lt;br /&gt;
* Really adventurous hardcore project: destroy KI hacks. The server would have to be able to analyze all game traffic to decide whether it looks okay. To do it right the server would have to have and understand PRP files and do physics. Also &amp;quot;console&amp;quot; commands have to be wisely filtered. If you're daunted, join the club.&lt;br /&gt;
&lt;br /&gt;
== Redesigns ==&lt;br /&gt;
{{tba}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:MOSS]]&lt;/div&gt;</summary>
		<author><name>A'moaca'</name></author>
	</entry>
	<entry>
		<id>https://wiki.openuru.org/index.php?title=MOSS/Setup&amp;diff=984</id>
		<title>MOSS/Setup</title>
		<link rel="alternate" type="text/html" href="https://wiki.openuru.org/index.php?title=MOSS/Setup&amp;diff=984"/>
		<updated>2011-04-05T06:48:49Z</updated>

		<summary type="html">&lt;p&gt;A'moaca': finishing touches&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MOSS currently only runs on Unix. Not Windows. It ought to work on Mac OS/X&lt;br /&gt;
(even PowerPC) but nobody has tried yet.&lt;br /&gt;
&lt;br /&gt;
Please also see the&lt;br /&gt;
[http://foundry.openuru.org/fisheye/browse/MOSS/doc/setup main setup instructions].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Compile ==&lt;br /&gt;
&lt;br /&gt;
=== Prerequisites ===&lt;br /&gt;
&lt;br /&gt;
Before you start, you need to ensure you have the following:&lt;br /&gt;
* pthreads (almost certainly installed already)&lt;br /&gt;
* libiconv (almost certainly installed already)&lt;br /&gt;
* OpenSSL (also almost certainly installed) -- you need both the libraries and the development headers if that's separate (I'm looking at you, Debian)&lt;br /&gt;
* Zlib (also probably installed) -- both the library and the development stuff if separate&lt;br /&gt;
* PostgreSQL -- both the sever and client, plus any development packages&lt;br /&gt;
* libpqxx -- both the library and the development package&lt;br /&gt;
* gcc, g++, whatever all you need for compiling C++&lt;br /&gt;
&lt;br /&gt;
If you are compiling from a clone of an Hg respository and there is no &lt;br /&gt;
&amp;quot;configure&amp;quot; script, you also need the autotools:&lt;br /&gt;
* autoconf&lt;br /&gt;
* automake&lt;br /&gt;
* libtool&lt;br /&gt;
&lt;br /&gt;
'''If you are reading this, please go over to'''&lt;br /&gt;
[[MOSS-Distribution_Specific_Instructions]] '''and fill in how to install all that on YOUR distribution/OS. Thank you!'''&lt;br /&gt;
&lt;br /&gt;
=== configure ===&lt;br /&gt;
&lt;br /&gt;
If you don't have a &amp;quot;configure&amp;quot; file, it must be generated. Run the&lt;br /&gt;
&amp;quot;bootstrap.sh&amp;quot; script to create it.&lt;br /&gt;
&lt;br /&gt;
Run &amp;quot;./configure&amp;quot;. The configure script takes many options. For a full listing&lt;br /&gt;
run &amp;quot;./configure --help&amp;quot;. The default options set up the server to match the&lt;br /&gt;
way Cyan's works. Here are the options you are probably interested in:&lt;br /&gt;
; --prefix&lt;br /&gt;
: Specify where &amp;quot;make install&amp;quot; places the files. If you are using a non-typical location you may need to add ''prefix''/lib to your LDFLAGS or something.&lt;br /&gt;
; &amp;lt;span id=&amp;quot;ackless&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;--enable-fast-download&lt;br /&gt;
: During auth file downloads, Cyan's server waits for the client to acknowledge every 32k of data sent. I believe this was to fix the &amp;quot;zero seconds remaining&amp;quot; bug. MOSS does not have that bug. Use --enable-fast-download to configure the server to send data as fast as it can, thereby using all the bandwidth available.&lt;br /&gt;
; --disable-single-login&lt;br /&gt;
: If you use this, multiple different avatars on the same account can be logged in at once. Logging into the same avatar will boot the other. Without disabling &amp;quot;single login&amp;quot;, logging into the same account will boot whatever avatar is logged in from that account.&lt;br /&gt;
Other options:&lt;br /&gt;
; --enable-require-secure-download&lt;br /&gt;
: Boot users who don't download python.pak.&lt;br /&gt;
; --enable-encryption=type&lt;br /&gt;
: The default is &amp;quot;cyan_dh&amp;quot;. MOSS allows you to disable encryption, or (legacy) use [[MOSS-Notes#RSA | RSA]].&lt;br /&gt;
; --enable-fork&lt;br /&gt;
: The primary use for this is if you need to debug auth or file servers. It is much easier to debug single-threaded programs.&lt;br /&gt;
; --enable-debug&lt;br /&gt;
: Anyone developing MOSS or willing to run some extra bug-hunting code should use this. If the bug-hunting code finds a bad thing it will make the server dump core so you can debug it.&lt;br /&gt;
; --enable-old-protocol&lt;br /&gt;
: This makes MOSS use older protocol versions. You probably don't need this.&lt;br /&gt;
If you have any trouble with configure finding the locations of various&lt;br /&gt;
libraries, you can use these:&lt;br /&gt;
; --with-postgres=PREFIX&lt;br /&gt;
; --with-libpqxx=PREFIX&lt;br /&gt;
; --with-openssl=PREFIX&lt;br /&gt;
; --with-zlib=PREFIX&lt;br /&gt;
; --with-iconv=PREFIX&lt;br /&gt;
&lt;br /&gt;
=== Compile ===&lt;br /&gt;
&lt;br /&gt;
Run &amp;quot;make&amp;quot;. Assuming that succeeds, you probably should use &amp;quot;make install&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Now cd into the postgresql directory. Here you need to compile a custom&lt;br /&gt;
PostgreSQL module that creates UUIDs. Follow the instructions in the README&lt;br /&gt;
file there, but for most people this should just be running &amp;quot;make&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Install the postgres module in your postgres install. Do this by copying the&lt;br /&gt;
moss_uuidgen.so file you just compiled. You'll need to log in as root to do&lt;br /&gt;
this (&amp;quot;sudo cp moss_uuidgen.so /path/to/postgres/modules&amp;quot; on most&lt;br /&gt;
systems). Please check [[MOSS-Distribution_Specific_Instructions]] and fill in&lt;br /&gt;
where to copy it for your system if it's not there already. Consult PostgreSQL&lt;br /&gt;
documentation if you're not sure. After the library is installed, restart the&lt;br /&gt;
DB server.&lt;br /&gt;
&lt;br /&gt;
== Set Up the Database ==&lt;br /&gt;
&lt;br /&gt;
The easiest way to set up the database is to create a &amp;quot;moss&amp;quot; user to be&lt;br /&gt;
associated with the MOSS database. If you want to use a different username, you&lt;br /&gt;
will have to edit the moss.sql file to match. The moss user needs to be able to&lt;br /&gt;
modify tables in the MOSS DB.&lt;br /&gt;
&lt;br /&gt;
Most distributions create some user that has root access to the DB&lt;br /&gt;
when connecting from the local machine. In my example this user is &amp;quot;pgsql&amp;quot; but&lt;br /&gt;
yours may be different. Please check&lt;br /&gt;
[[MOSS-Distribution_Specific_Instructions]] for hints or to fill in the user&lt;br /&gt;
for your distribution.&lt;br /&gt;
&lt;br /&gt;
Start by creating the database. The default database name is &amp;quot;moss&amp;quot;; if you use&lt;br /&gt;
any other you'll have to set it in the MOSS&lt;br /&gt;
[[#Configuration_Files | configuration file]]. Make sure to use the 'UTF8'&lt;br /&gt;
encoding. Then create the &amp;quot;moss&amp;quot; user in the new database. Then load&lt;br /&gt;
postgresql/moss.sql into the new database.&lt;br /&gt;
&lt;br /&gt;
I did the following:&lt;br /&gt;
 su pgsql -c &amp;quot;psql postgres&amp;quot;&lt;br /&gt;
 create database moss with encoding='UTF8';&lt;br /&gt;
 \c moss&lt;br /&gt;
 create role moss with login;&lt;br /&gt;
 \q&lt;br /&gt;
 su pgsql -c &amp;quot;psql moss -f moss.sql&amp;quot;&lt;br /&gt;
After this, you can connect to the database as the &amp;quot;moss&amp;quot; user:&lt;br /&gt;
 psql -U moss&lt;br /&gt;
&lt;br /&gt;
If all that works, you are done setting up the database!&lt;br /&gt;
&lt;br /&gt;
To set up AllAgeGlobalSDLNodes, use global_sdl_manager (we have no VaultManager&lt;br /&gt;
to do it). This program is installed in ''prefix''/bin. To aid setup, the&lt;br /&gt;
support/set_to_moul.txt file can be used to set the global SDL state to a&lt;br /&gt;
reasonable default (with no sparks) by running something like:&lt;br /&gt;
 global_sdl_manager game/SDL &amp;lt; set_to_moul.txt&lt;br /&gt;
If you want sparks, you can turn them on yourself using this program, but the&lt;br /&gt;
Minkata one is still broken.&lt;br /&gt;
&lt;br /&gt;
== Set Up Files ==&lt;br /&gt;
&lt;br /&gt;
There are quite a few files that the server needs to use. All these files are&lt;br /&gt;
located by default in locations relative to where you will *start* the&lt;br /&gt;
server. The location of all the files can be configured in the&lt;br /&gt;
[[#Configuration_Files | configuration files]]; you may find it easiest to&lt;br /&gt;
specify absolute paths (starting with &amp;quot;/&amp;quot;) there.&lt;br /&gt;
&lt;br /&gt;
=== File Server Data ===&lt;br /&gt;
&lt;br /&gt;
You need to start with your current Uru install (MOULagain, presumably). This&lt;br /&gt;
procedure assumes you can run a Windows application to create the file server&lt;br /&gt;
manifets MOSS needs. This seems a reasonable assumption when the client itself&lt;br /&gt;
is a Windows app.&lt;br /&gt;
&lt;br /&gt;
Copy support/ManifestCreator.exe and support/Mainfests.zip to your Windows&lt;br /&gt;
box. Unzip Manifests.zip. This will make a &amp;quot;CyanStructure&amp;quot; folder. The .txt&lt;br /&gt;
files in this folder are input. They describe the files which need to be in the&lt;br /&gt;
final manifests. It is important to use \ as the directory separator.&lt;br /&gt;
&lt;br /&gt;
Start up ManifestCreator. To generate a manifest, click &amp;quot;Make Manifest&amp;quot; and it&lt;br /&gt;
brings up a dialog. Navigate to the CyanStructure folder, and select all the&lt;br /&gt;
.txt files there. Then click OK and when it pops up a dialog asking for the&lt;br /&gt;
location of your Uru install, navigate to that directory, click OK and wait for&lt;br /&gt;
a bit.&lt;br /&gt;
&lt;br /&gt;
When it is done stop and consider which files you need the file server to&lt;br /&gt;
actually give to clients. If you are making this shard for yourself it could be&lt;br /&gt;
basically nothing, or everything. Note that we do not have a license to&lt;br /&gt;
redistribute Cyan's data files. So it is recommended not to copy any files you&lt;br /&gt;
should not distribute to your file server.&lt;br /&gt;
&lt;br /&gt;
Back on the machine which will run MOSS, create a file server directory. The&lt;br /&gt;
default is &amp;quot;./file&amp;quot; (relative to where you start it up). I recommend you make&lt;br /&gt;
it ''prefix''/file, where ''prefix'' is the installed location. Copy all the&lt;br /&gt;
.mbm files created in the CyanStructure folder to this directory. If you are&lt;br /&gt;
serving up a CWE client (built from open source) you will want to copy the&lt;br /&gt;
gzipped executable and libraries. They are located in&lt;br /&gt;
CyanStructure\Client\External and need to be in ''file dir''/Client/External on&lt;br /&gt;
your server to match. Anything you can distribute and that clients will need to&lt;br /&gt;
download, like a new age, also should be copied. Make sure to match the&lt;br /&gt;
directory structures when copying them over.&lt;br /&gt;
&lt;br /&gt;
Finally, Mac clients request the &amp;quot;macExternal&amp;quot; manifest instead of&lt;br /&gt;
&amp;quot;External&amp;quot;. There are added files in the Mac manifest, but if you don't have&lt;br /&gt;
them to generate a proper manifest from, just copy or symlink External.mbm to&lt;br /&gt;
macExternal.mbm. If you do have the files, you can generate the proper manifest&lt;br /&gt;
using ManifestCreator and the support/macExternal.txt file.&lt;br /&gt;
&lt;br /&gt;
=== Auth Server Data ===&lt;br /&gt;
&lt;br /&gt;
Like for the file server data, the default auth directory is &amp;quot;./auth&amp;quot; (relative&lt;br /&gt;
to where you start it up). I recommend using ''prefix''/auth.&lt;br /&gt;
&lt;br /&gt;
A script automating all the following steps in this section (except for any&lt;br /&gt;
user-created ages) is in the works.&lt;br /&gt;
&lt;br /&gt;
This directory is required to have another subdirectory named &amp;quot;default&amp;quot;. You&lt;br /&gt;
must keep a copy here of the encrypted Python and SDL files for clients to&lt;br /&gt;
download. The easiest way to get a set of these files is from the Cyan-provided&lt;br /&gt;
[http://assets.openuru.org/cyan/AuthFiles.zip AuthFiles.zip]. Download this&lt;br /&gt;
file, and unzip it. Copy the entire contents of the resulting AuthFiles/893&lt;br /&gt;
directory to ''auth dir''/default/. The resulting directory structure is:&lt;br /&gt;
 auth&lt;br /&gt;
   default&lt;br /&gt;
     Python&lt;br /&gt;
       python.pak&lt;br /&gt;
     SDL&lt;br /&gt;
       various .sdl files&lt;br /&gt;
     encryption.key&lt;br /&gt;
&lt;br /&gt;
Now you have to make manifest files here as well. Make a Python.txt file which&lt;br /&gt;
contains one line: &amp;quot;Python\python.pak&amp;quot;. Make an SDL.txt file with contains one&lt;br /&gt;
line per file in the SDL directory. The lines look like&lt;br /&gt;
&amp;quot;SDL\BaronCityOffice.sdl&amp;quot;. I just toss these in the auth/default directory but&lt;br /&gt;
you don't have to. The server does not look at them.&lt;br /&gt;
&lt;br /&gt;
If you have user-created ages with SDL files, be sure to add them to the SDL&lt;br /&gt;
directory here. Encrypt them with the encryption.key. (A tool to do this does&lt;br /&gt;
exist in the CWE source.) Similarly, if you want to add Python, you can rebuild&lt;br /&gt;
the python.pak file, but if you are adding a new age, you may find it easier to&lt;br /&gt;
add a new .pak file. If you do that, encrypt it and then add a new line to the&lt;br /&gt;
Python.txt file for your new .pak. The client will download them all.&lt;br /&gt;
&lt;br /&gt;
Once you have listed each SDL and Python file, you can use the Perl script&lt;br /&gt;
support/make-mbam.pl to create the .mbam files. If you don't have Perl,&lt;br /&gt;
ManifestCreator.exe will also create the files. Select &amp;quot;Auth Server&amp;quot; in the&lt;br /&gt;
&amp;quot;Manifest type&amp;quot; dropdown. If you use ManifestCreator, make sure it has the&lt;br /&gt;
Python and SDL directories and their contents. Make sure to copy the resulting&lt;br /&gt;
two .mbam files to your ''auth-dir''/default directory.&lt;br /&gt;
&lt;br /&gt;
=== Game Server Data ===&lt;br /&gt;
&lt;br /&gt;
Just like for the file and auth server data, the default game directory is&lt;br /&gt;
&amp;quot;./game&amp;quot; (relative to where you start it up). I recommend using&lt;br /&gt;
''prefix''/game.&lt;br /&gt;
&lt;br /&gt;
A script automating all the following steps in this section (except for&lt;br /&gt;
any user-created ages) is in the works.&lt;br /&gt;
&lt;br /&gt;
The game servers need unencrypted .sdl and .age files. The easiest way to get a&lt;br /&gt;
set of these files is from the Cyan-provided&lt;br /&gt;
[http://assets.openuru.org/cyan/Scripts.zip Scripts.zip]. Download this file&lt;br /&gt;
and unzip it. Copy/move the Scripts/SDL directory to ''game-dir''. Then create&lt;br /&gt;
''game-dir''/age and copy Scripts/dat/*.age to it. (MOSS does not use the .fni&lt;br /&gt;
files.)&lt;br /&gt;
&lt;br /&gt;
Do not forget to copy any user-created ages' SDL and .age files here. This copy&lt;br /&gt;
needs to be unencrypted.&lt;br /&gt;
&lt;br /&gt;
Now there is one more step. The SDL files the game server uses need to be moved&lt;br /&gt;
around, some into subdirectories, and some renamed because Unix treats file&lt;br /&gt;
names case-sensitively. Please read the details in the doc/setup file (linked&lt;br /&gt;
at the top of this page). You should have three subdirectories when you're&lt;br /&gt;
done. User-created ages may need subdirectories too, if they have multiple .sdl&lt;br /&gt;
files. If you find this way too complex, just move all the .sdl files into&lt;br /&gt;
the common subdirectory. You lose some small optimizations this way and you will&lt;br /&gt;
need to restart the server if any SDL files change.&lt;br /&gt;
&lt;br /&gt;
At the end the directory structure should be:&lt;br /&gt;
 game&lt;br /&gt;
   age&lt;br /&gt;
     various .age files&lt;br /&gt;
   SDL&lt;br /&gt;
     common&lt;br /&gt;
       some .sdl files&lt;br /&gt;
     Garrison&lt;br /&gt;
       a couple of .sdl files&lt;br /&gt;
     Teledahn&lt;br /&gt;
       other .sdl files&lt;br /&gt;
     more .sdl files&lt;br /&gt;
&lt;br /&gt;
== Key Files ==&lt;br /&gt;
&lt;br /&gt;
The modified Diffie-Hellman algorithm used in the client and MOSS by default&lt;br /&gt;
requires the server to have private keys. '''Do not share them with anyone.'''&lt;br /&gt;
They should not be world-readable.&lt;br /&gt;
&lt;br /&gt;
You can generate keys using the &amp;quot;make_cyan_dh&amp;quot; program which will be installed&lt;br /&gt;
in ''prefix''/bin. Or, there might be a program to generate keys in the CWE&lt;br /&gt;
source, but the chance of it outputting the private keys in the format MOSS&lt;br /&gt;
wants is basically zero. Generate a key for each of auth, game, and&lt;br /&gt;
gatekeeper. Run &amp;quot;make_cyan_dh -h&amp;quot; to see what generators to use if you want to&lt;br /&gt;
match those MOULagain is using. If you're building your own client you can use&lt;br /&gt;
whatever generator you want. Note: I see no reason not to use OpenSSL default&lt;br /&gt;
generators such as 2 or 5. In fact, unless you are a cryptographer, I do not&lt;br /&gt;
recommend departing from these. If you are a cryptographer, you probably did&lt;br /&gt;
not need to hear that from me!&lt;br /&gt;
&lt;br /&gt;
The -s and -c options direct the program to write the data for the server and&lt;br /&gt;
client to files, respectively, e.g.:&lt;br /&gt;
 make_cyan_dh -g 2 -s auth_key.der -c auth_key.bin&lt;br /&gt;
&lt;br /&gt;
If you're compiling a CWE client, make_cyan_dh does not currently output data&lt;br /&gt;
in that format. See [https://foundry.openuru.org/jira/browse/MOSS-3 the bug]&lt;br /&gt;
for the workaround. If you're not compiling a client, it's up to you what to do&lt;br /&gt;
with the .bin file.&lt;br /&gt;
&lt;br /&gt;
Take the .der file (contains the PRIVATE key) and move it to ''prefix''. I&lt;br /&gt;
suggest using ''prefix''/etc/auth_key.der. Make it readable only by the user&lt;br /&gt;
which will be running the server: &amp;quot;chmod 400 ''prefix''/etc/auth_key.der; chown&lt;br /&gt;
mossuser ''prefix''/etc/auth_key.der&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Do the same for the game and gatekeeper keys. ''prefix''/etc/game_key.der and&lt;br /&gt;
''prefix''/etc/gatekeeper_key.der.&lt;br /&gt;
&lt;br /&gt;
== Configuration Files ==&lt;br /&gt;
&lt;br /&gt;
Now that you have all the other files set up, it's time to configure MOSS&lt;br /&gt;
itself. There is a configuration file for each server process. The default&lt;br /&gt;
location for moss_backend is ./etc/moss_backend.cfg and the default&lt;br /&gt;
location for moss is ./etc/moss.cfg. I recommend copying main.cfg to&lt;br /&gt;
''prefix''/etc/moss.cfg and backend.cfg to ''prefix''/etc/moss_backend.cfg.&lt;br /&gt;
&lt;br /&gt;
Now open each up in your text editor. The files contain instructions for how to&lt;br /&gt;
set the various options.&lt;br /&gt;
&lt;br /&gt;
I recommend you set the following in moss.cfg to the absolute paths&lt;br /&gt;
corresponding to where you installed these files in earlier steps:&lt;br /&gt;
&amp;lt;tt&amp;gt;auth_download_dir&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;auth_key_file&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;file_download_dir&amp;lt;/tt&amp;gt;,&lt;br /&gt;
&amp;lt;tt&amp;gt;game_data_dir&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;game_key_file&amp;lt;/tt&amp;gt;,&lt;br /&gt;
&amp;lt;tt&amp;gt;gatekeeper_key_file&amp;lt;/tt&amp;gt;. In addition I recommend you set &amp;lt;tt&amp;gt;log_dir&amp;lt;/tt&amp;gt;&lt;br /&gt;
to somewhere you want log files to go. Remember the log directory has to be&lt;br /&gt;
writable by the user that will run the server. You may also need to set&lt;br /&gt;
&amp;lt;tt&amp;gt;pid_file&amp;lt;/tt&amp;gt; to a location writable by that user. If you want the .pid&lt;br /&gt;
file to be created. Read through all the options to make sure your setup is as&lt;br /&gt;
you want. The only mandatory configuration directive is&lt;br /&gt;
&amp;lt;tt&amp;gt;external_address&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For moss_backend.cfg look especially into &amp;lt;tt&amp;gt;log_dir&amp;lt;/tt&amp;gt; and&lt;br /&gt;
&amp;lt;tt&amp;gt;pid_file&amp;lt;/tt&amp;gt;. In addition, depending on how your DB is&lt;br /&gt;
[[#Set_Up_the_Database | set up]] you likely need to specify &amp;lt;tt&amp;gt;db_user&amp;lt;/tt&amp;gt;,&lt;br /&gt;
and maybe other DB parameters.&lt;br /&gt;
&lt;br /&gt;
== Security Considerations ==&lt;br /&gt;
&lt;br /&gt;
'''Please''' read about them at the end of&lt;br /&gt;
[http://foundry.openuru.org/fisheye/browse/MOSS/doc/setup doc/setup].&lt;br /&gt;
&lt;br /&gt;
Do not run MOSS as root.&lt;br /&gt;
&lt;br /&gt;
== Before You Open Your Server ==&lt;br /&gt;
&lt;br /&gt;
If you plan to let anyone other than you connect to your server, you have&lt;br /&gt;
certain obligations under the licenses of the software/data you will be&lt;br /&gt;
distributing from the file and auth servers.&lt;br /&gt;
&lt;br /&gt;
* The MOULagain EULA still does not provide for you to modify and redistribute the files. So do not put original or modified Cyan files on your file server. You can still have them listed in the .mbm (manifest) files. If someone has an incomplete install they will be forced to get the files from Cyan's file server. That is as yet still the only place from which you're supposed to get those files.&lt;br /&gt;
&lt;br /&gt;
* You are supplying GPL'd Python code. You must provide a way to acquire that code. If you are using unmodified Python you can link to the [http://assets.openuru.org/cyan/Scripts.zip original source]. If you modify it for any reason, you must make your changes available and tell your users where to get it.&lt;br /&gt;
&lt;br /&gt;
* If you are providing client executables from a CWE build:&lt;br /&gt;
** You probably need to add the GPL license file to the client install. The license is supposed to be conveyed with the executable, and the only sure way to do that is to install it from the file server same as the executable. This means you'll have to add it to ThinExternal.txt and External.txt and generate the new .mbm files, copying the .mbm files and LICENSE.txt.gz over to the appropriate locations. You probably should also arrange for the license to be available along with UruLauncher.&lt;br /&gt;
** You must provide a way to acquire the source for your client. The means is supposed to be &amp;quot;equivalent&amp;quot; to the way the executable is acquired. Links are probably sufficient. If you use an unmodified version you should be able to link to the repository (make sure you point to the actual changeset you used). If you modify files for your shard's public keys, status hostname, and/or gatekeeper/auth addresses, you have to additionally provide that source. Note: these are ''public'' keys, so don't worry, you're not giving anything away.&lt;br /&gt;
** Unless someone changes the jpeg library again, you need to credit IJG for jpeglib. The easiest may be to add another file doing so to the install. Or, if you are modifying Python for some reason, you could add it to the in-game credits along with all the other licenses:&lt;br /&gt;
 xUruCreditsJournalEnglish.py&lt;br /&gt;
 xUruCreditsJournalFrench.py&lt;br /&gt;
 xUruCreditsJournalGerman.py&lt;br /&gt;
 xUruCreditsJournalItalian.py&lt;br /&gt;
 xUruCreditsJournalSpanish.py&lt;br /&gt;
&lt;br /&gt;
The links or whatever means you use to provide access to the source of the&lt;br /&gt;
binaries and Python don't have to go into the client install, but they must be&lt;br /&gt;
somewhere reasonable for your users to find, &amp;quot;equivalent&amp;quot; to installing the software for your shard. I would put links to a copy of the&lt;br /&gt;
files on your shard's home page or something.&lt;br /&gt;
&lt;br /&gt;
See also [[CyanWorlds.com_Engine/FAQ#What_are_my_open_source_license_.28GPLv3.29_responsibilities_as_a_user.2C_developer_or_server_operator_.28e.g._shard_owner.29.3F | the CWE FAQ]].&lt;br /&gt;
&lt;br /&gt;
Please do not consider this advice the final or complete word on the&lt;br /&gt;
matter. All the licenses of all the data you use expect you to follow them. So&lt;br /&gt;
you have to do your due diligence. If you find something obviously missing from&lt;br /&gt;
this section, please add it!&lt;br /&gt;
&lt;br /&gt;
== Start It Up ==&lt;br /&gt;
&lt;br /&gt;
Now you should be set to run your server. Hopefully someone will contribute a&lt;br /&gt;
nice startup script. For now, cd to the directory you planned from the start to&lt;br /&gt;
start the server from (that's ''prefix'' in the earlier recommendations). Make&lt;br /&gt;
sure you are su'd to the user you want to run as. '''NOT root!''' Start&lt;br /&gt;
moss_backend first, then moss. E.g., if you have put the config files in&lt;br /&gt;
''prefix''/etc, you can just do:&lt;br /&gt;
 bin/moss_backend&lt;br /&gt;
 bin/moss&lt;br /&gt;
You can instead specify the location of the config file with the -c option.&lt;br /&gt;
If you've used absolute paths in the config files, you can thus easily run&lt;br /&gt;
the server from any directory.&lt;br /&gt;
&lt;br /&gt;
== Create Accounts ==&lt;br /&gt;
&lt;br /&gt;
Don't forget to create accounts for your users, or it will be difficult to log&lt;br /&gt;
in... Please just refer directly to &lt;br /&gt;
[http://foundry.openuru.org/fisheye/browse/MOSS/doc/user-management doc/user-management].&lt;br /&gt;
&lt;br /&gt;
Really short version:&lt;br /&gt;
 INSERT INTO accounts (name, hash, id, class, visitor)&lt;br /&gt;
 VALUES ('foo@example.com', '11223344...', uuid(), 'default', false);&lt;br /&gt;
&lt;br /&gt;
Hopefully someone will contribute a script to add users. A CGI script to&lt;br /&gt;
automatically add users would be neat too.&lt;br /&gt;
&lt;br /&gt;
== More Hints ==&lt;br /&gt;
&lt;br /&gt;
Please see the following for more information of interest to running a server.&lt;br /&gt;
&lt;br /&gt;
* [[MOSS-Notes]]&lt;br /&gt;
* [http://foundry.openuru.org/fisheye/browse/MOSS/doc/running doc/running]&lt;br /&gt;
&lt;br /&gt;
[[Category:MOSS]]&lt;/div&gt;</summary>
		<author><name>A'moaca'</name></author>
	</entry>
	<entry>
		<id>https://wiki.openuru.org/index.php?title=MOSS/Distribution_Specific_Instructions&amp;diff=983</id>
		<title>MOSS/Distribution Specific Instructions</title>
		<link rel="alternate" type="text/html" href="https://wiki.openuru.org/index.php?title=MOSS/Distribution_Specific_Instructions&amp;diff=983"/>
		<updated>2011-04-05T06:11:00Z</updated>

		<summary type="html">&lt;p&gt;A'moaca': Undo revision 982 - forgot this was in the Setup page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document is meant to collect any known distribution-specific instructions&lt;br /&gt;
for installing MOSS. There are two main parts: installing the prerequisite&lt;br /&gt;
packages, and setting up the PostgreSQL database. Feel free to add any other&lt;br /&gt;
notes you may find useful.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Prerequisite Packages ==&lt;br /&gt;
&lt;br /&gt;
=== NetBSD pkgsrc ===&lt;br /&gt;
&lt;br /&gt;
Only PostgreSQL and the autotools are needed. You can build the packages&lt;br /&gt;
or use the prebuilt packages with pkg_add.&lt;br /&gt;
&lt;br /&gt;
 pkg_add automake&lt;br /&gt;
 pkg_add libtool&lt;br /&gt;
 pkg_add libpqxx&lt;br /&gt;
I recommend starting with libpqxx because it seems to lag the postgresql-client&lt;br /&gt;
package, and installing libpqxx will get the correct client.&lt;br /&gt;
 pkg_add postgresqlNN-server&lt;br /&gt;
Get the version number to match the client installed for pqxx.&lt;br /&gt;
&lt;br /&gt;
Now follow the instructions:&lt;br /&gt;
* copy /usr/pkg/share/examples/rc.d/pgsql to /etc/rc.d/pgsql&lt;br /&gt;
* chmod 555 /etc/rc.d/pgsql&lt;br /&gt;
* append pgsql=YES to /etc/rc.conf&lt;br /&gt;
&lt;br /&gt;
== Database Setup ==&lt;br /&gt;
&lt;br /&gt;
=== NetBSD pkgsrc ===&lt;br /&gt;
&lt;br /&gt;
Copy moss_uuidgen.so to /usr/pkg/lib/postgresql/&lt;br /&gt;
&lt;br /&gt;
The database user is &amp;lt;tt&amp;gt;pgsql&amp;lt;/tt&amp;gt;. It has root access to the DB by default.&lt;br /&gt;
Connect from localhost (the default).&lt;br /&gt;
&lt;br /&gt;
Create the database:&lt;br /&gt;
 su -m pgsql -c &amp;quot;psql postgres&amp;quot;&lt;br /&gt;
 create database moss with encoding='UTF8';&lt;br /&gt;
 \c moss&lt;br /&gt;
 create role moss with login;&lt;br /&gt;
 \q&lt;br /&gt;
 su -m pgsql -c &amp;quot;psql postgres -f moss.sql&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Then set db_user=moss in moss_backend.cfg.&lt;br /&gt;
&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
&lt;br /&gt;
[[Category:MOSS]]&lt;/div&gt;</summary>
		<author><name>A'moaca'</name></author>
	</entry>
	<entry>
		<id>https://wiki.openuru.org/index.php?title=MOSS/Distribution_Specific_Instructions&amp;diff=982</id>
		<title>MOSS/Distribution Specific Instructions</title>
		<link rel="alternate" type="text/html" href="https://wiki.openuru.org/index.php?title=MOSS/Distribution_Specific_Instructions&amp;diff=982"/>
		<updated>2011-04-05T06:00:00Z</updated>

		<summary type="html">&lt;p&gt;A'moaca': /* NetBSD pkgsrc */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document is meant to collect any known distribution-specific instructions&lt;br /&gt;
for installing MOSS. There are two main parts: installing the prerequisite&lt;br /&gt;
packages, and setting up the PostgreSQL database. Feel free to add any other&lt;br /&gt;
notes you may find useful.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Prerequisite Packages ==&lt;br /&gt;
&lt;br /&gt;
=== NetBSD pkgsrc ===&lt;br /&gt;
&lt;br /&gt;
Only PostgreSQL and the autotools are needed. You can build the packages&lt;br /&gt;
or use the prebuilt packages with pkg_add.&lt;br /&gt;
&lt;br /&gt;
 pkg_add automake&lt;br /&gt;
 pkg_add libtool&lt;br /&gt;
 pkg_add libpqxx&lt;br /&gt;
I recommend starting with libpqxx because it seems to lag the postgresql-client&lt;br /&gt;
package, and installing libpqxx will get the correct client.&lt;br /&gt;
 pkg_add postgresqlNN-server&lt;br /&gt;
Get the version number to match the client installed for pqxx.&lt;br /&gt;
&lt;br /&gt;
Now follow the instructions:&lt;br /&gt;
* copy /usr/pkg/share/examples/rc.d/pgsql to /etc/rc.d/pgsql&lt;br /&gt;
* chmod 555 /etc/rc.d/pgsql&lt;br /&gt;
* append pgsql=YES to /etc/rc.conf&lt;br /&gt;
&lt;br /&gt;
== Database Setup ==&lt;br /&gt;
&lt;br /&gt;
=== NetBSD pkgsrc ===&lt;br /&gt;
&lt;br /&gt;
Copy moss_uuidgen.so to /usr/pkg/lib/postgresql/&lt;br /&gt;
&lt;br /&gt;
The database user is &amp;lt;tt&amp;gt;pgsql&amp;lt;/tt&amp;gt;. It has root access to the DB by default.&lt;br /&gt;
Connect from localhost (the default).&lt;br /&gt;
&lt;br /&gt;
Create the database:&lt;br /&gt;
 su -m pgsql -c &amp;quot;psql postgres&amp;quot;&lt;br /&gt;
 create database moss with encoding='UTF8';&lt;br /&gt;
 \c moss&lt;br /&gt;
 create role moss with login;&lt;br /&gt;
 \q&lt;br /&gt;
 su -m pgsql -c &amp;quot;psql postgres -f moss.sql&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Then set db_user=moss in moss_backend.cfg.&lt;br /&gt;
&lt;br /&gt;
If you want to connect to the moss DB you can now use &amp;quot;psql -U moss&amp;quot; instead&lt;br /&gt;
of having to su to the pgsql user.&lt;br /&gt;
&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
&lt;br /&gt;
[[Category:MOSS]]&lt;/div&gt;</summary>
		<author><name>A'moaca'</name></author>
	</entry>
	<entry>
		<id>https://wiki.openuru.org/index.php?title=MOSS&amp;diff=981</id>
		<title>MOSS</title>
		<link rel="alternate" type="text/html" href="https://wiki.openuru.org/index.php?title=MOSS&amp;diff=981"/>
		<updated>2011-04-05T05:46:11Z</updated>

		<summary type="html">&lt;p&gt;A'moaca': /* How to Contribute */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MOSS is a unix-based server for the Myst Online: Uru Live client. Development&lt;br /&gt;
began after the announcement of the shutdown of MOUL. It is complete enough to&lt;br /&gt;
play the entire game, supports multiplayer use, is licensed under GPLv3, and is&lt;br /&gt;
not ported to Windows.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
MOSS was developed by a'moaca' and cjkelly1. a'moaca' wrote all the C/C++ code,&lt;br /&gt;
and cjkelly1 wrote most of the SQL code, including doing research to determine&lt;br /&gt;
how to set up the vault. cjkelly1 wrote a tool to create the manifest files&lt;br /&gt;
required by the server, and also made the invaluable contribution of a lot of&lt;br /&gt;
testing over the years. Weldergeek helped with some of the multiplayer testing,&lt;br /&gt;
especially Heek. a'moaca' sincerely hopes there will be more contributors now&lt;br /&gt;
that MOSS is released.&lt;br /&gt;
&amp;lt;div style=&amp;quot;float: right; padding: 10px;&amp;quot;&amp;gt;http://assets.openuru.org/logos/gpl/gplv3-127x51.png&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Why Use MOSS? ==&lt;br /&gt;
&lt;br /&gt;
If you just want to host a private shard, MOSS should serve your purposes.&lt;br /&gt;
[[MOSS-Setup#Before You Open Your Server | &amp;quot;Before You Open Your Server&amp;quot;]]&lt;br /&gt;
has some help on what you need to do if you host an Uru shard.&lt;br /&gt;
&lt;br /&gt;
The server definitely works with the [[CyanWorlds.com_Engine | CWE client]]! If&lt;br /&gt;
you are thinking of doing client development you will probably find a server&lt;br /&gt;
that is not MOULagain to test with quite valuable. (MOSS was also tested with&lt;br /&gt;
PlasmaClient, but it does not fully work for PlasmaClient because it does some&lt;br /&gt;
things that a'moaca' argues are bugs from the system perspective. Let's fix&lt;br /&gt;
PlasmaClient.)&lt;br /&gt;
&lt;br /&gt;
The server has some features meant to help make it a little easier to test ages&lt;br /&gt;
you are creating. The SDL files for an age are loaded each time the age is&lt;br /&gt;
started up so you can change them without restarting MOSS. There is full&lt;br /&gt;
support for multiple .pak files. So, run your own server, test at your own&lt;br /&gt;
pace. Test in the CWE client and not the PotS one.&lt;br /&gt;
&lt;br /&gt;
== How to Get It ==&lt;br /&gt;
&lt;br /&gt;
{{tba}}&lt;br /&gt;
&lt;br /&gt;
The source code is hosted in a Mercurial repository here at OpenUru.org.&lt;br /&gt;
You can clone (download) a copy of the repository using Mercurial, or you can&lt;br /&gt;
use a snapshot. If you are considering making changes to the code, you will&lt;br /&gt;
probably prefer using the version control. If you just want to compile and run&lt;br /&gt;
a server, a snapshot should do. In addition, a compiled version is&lt;br /&gt;
available for the TBD platform.&lt;br /&gt;
&lt;br /&gt;
If you are new to Mercurial, you may want to check the&lt;br /&gt;
[http://mercurial.selenic.com/wiki/QuickStart QuickStart]. There are links to&lt;br /&gt;
more complete documentation at the bottom. The Foundry is secured via SSL&lt;br /&gt;
throughout the site. A browser security certificate is needed. Instructions are&lt;br /&gt;
available on the [[Foundry_Certificate_Installation | certificate installation&lt;br /&gt;
page]].&lt;br /&gt;
&lt;br /&gt;
'''Repository address:''' https://foundry.openuru.org/hg/MOSS&lt;br /&gt;
&lt;br /&gt;
'''Snapshot location:''' TBD&lt;br /&gt;
&lt;br /&gt;
'''Binary package:''' TBD&lt;br /&gt;
&lt;br /&gt;
== How to Set Up a Server ==&lt;br /&gt;
&lt;br /&gt;
The [http://foundry.openuru.org/fisheye/browse/MOSS/doc/setup setup] file&lt;br /&gt;
contains a complete set of installation instructions. They do assume you are&lt;br /&gt;
conversant with setting up software and basic management of a database. For&lt;br /&gt;
additional setup instructions, see [[MOSS-Setup]]. Feel free to add any hints&lt;br /&gt;
specific to your distribution [[MOSS-Distribution_Specific_Instructions | here]].&lt;br /&gt;
&lt;br /&gt;
Cyan has provided a copy of the files needed for a server hosting MOUL content.&lt;br /&gt;
The .sdl, .age, and Python source are all available at&lt;br /&gt;
http://assets.openuru.org/cyan/Scripts.zip. If you are not interested in&lt;br /&gt;
compiling your own Python from this source, you can also get a copy of the&lt;br /&gt;
compiled Python from http://assets.openuru.org/cyan/AuthFiles.zip.&lt;br /&gt;
&lt;br /&gt;
There is some Q&amp;amp;A and other notes of possible interest to someone running a&lt;br /&gt;
server at [[MOSS-Notes]].&lt;br /&gt;
&lt;br /&gt;
== How to Contribute ==&lt;br /&gt;
&lt;br /&gt;
Contributing to the wiki pages is welcome. Adding extra setup instructions, or&lt;br /&gt;
adding documentation about how MOSS works, are two good examples. It's a wiki,&lt;br /&gt;
please contribute anything you think others might want to read.&lt;br /&gt;
&lt;br /&gt;
Almost any code contribution is welcome. What is unwelcome? Protocol/behavior&lt;br /&gt;
changes without corresponding client support (obviously). Changes that remove&lt;br /&gt;
security without the option of keeping it. Changes that introduce security&lt;br /&gt;
holes, either in the server itself or the vault. Changes that break big-endian&lt;br /&gt;
support (call it a pet peeve if you like, it's still unwelcome). Changes that&lt;br /&gt;
break the build (accidents do happen, but don't break it on purpose). Hopefully&lt;br /&gt;
it is not difficult to see why these things are unwelcome.&lt;br /&gt;
&lt;br /&gt;
If you find a bug, please report it. Please, please, please search first to see&lt;br /&gt;
if it's already reported. The bug tracker is here:&lt;br /&gt;
https://foundry.openuru.org/jira/browse/MOSS&lt;br /&gt;
&lt;br /&gt;
If you find a bug and fix it, include the patch with the bug report! This&lt;br /&gt;
increases the chances of it getting fixed rather a lot.&lt;br /&gt;
&lt;br /&gt;
Bug fixes are very valuable.&lt;br /&gt;
[https://foundry.openuru.org/jira/browse/MOSS Grab a bug] and fix it! Check&lt;br /&gt;
out [[MOSS-Project_Ideas]] for more ideas.&lt;br /&gt;
&lt;br /&gt;
If you want to add a feature or change something, you can file a feature&lt;br /&gt;
request or task bug to get your change considered for the&lt;br /&gt;
[https://foundry.openuru.org/hg/MOSS central repository].&lt;br /&gt;
&lt;br /&gt;
If you want write access to the central repository, contribute. The best choice&lt;br /&gt;
for MOSS will probably be to use similar standards for determining who is given&lt;br /&gt;
write access as CWE. At this time that's undecided, so the plan for MOSS is&lt;br /&gt;
equally undecided. However, MOSS's original author is more involved than CWE's&lt;br /&gt;
so if only a couple people show up to help then it's pretty clear a couple&lt;br /&gt;
people will get write access soon enough!&lt;br /&gt;
&lt;br /&gt;
Code reviewers might be needed. If you are willing to be a reviewer, say so! It&lt;br /&gt;
is a very valuable contribution.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
[[MOSS-Notes]]&lt;br /&gt;
&lt;br /&gt;
[[MOSS-Setup]]&lt;br /&gt;
&lt;br /&gt;
[[MOSS-Developer_Notes]]&lt;br /&gt;
&lt;br /&gt;
[[CyanWorlds.com_Engine]]&lt;br /&gt;
&lt;br /&gt;
[[Category:MOSS]]&lt;/div&gt;</summary>
		<author><name>A'moaca'</name></author>
	</entry>
	<entry>
		<id>https://wiki.openuru.org/index.php?title=MOSS&amp;diff=980</id>
		<title>MOSS</title>
		<link rel="alternate" type="text/html" href="https://wiki.openuru.org/index.php?title=MOSS&amp;diff=980"/>
		<updated>2011-04-05T05:44:23Z</updated>

		<summary type="html">&lt;p&gt;A'moaca': &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MOSS is a unix-based server for the Myst Online: Uru Live client. Development&lt;br /&gt;
began after the announcement of the shutdown of MOUL. It is complete enough to&lt;br /&gt;
play the entire game, supports multiplayer use, is licensed under GPLv3, and is&lt;br /&gt;
not ported to Windows.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
MOSS was developed by a'moaca' and cjkelly1. a'moaca' wrote all the C/C++ code,&lt;br /&gt;
and cjkelly1 wrote most of the SQL code, including doing research to determine&lt;br /&gt;
how to set up the vault. cjkelly1 wrote a tool to create the manifest files&lt;br /&gt;
required by the server, and also made the invaluable contribution of a lot of&lt;br /&gt;
testing over the years. Weldergeek helped with some of the multiplayer testing,&lt;br /&gt;
especially Heek. a'moaca' sincerely hopes there will be more contributors now&lt;br /&gt;
that MOSS is released.&lt;br /&gt;
&amp;lt;div style=&amp;quot;float: right; padding: 10px;&amp;quot;&amp;gt;http://assets.openuru.org/logos/gpl/gplv3-127x51.png&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Why Use MOSS? ==&lt;br /&gt;
&lt;br /&gt;
If you just want to host a private shard, MOSS should serve your purposes.&lt;br /&gt;
[[MOSS-Setup#Before You Open Your Server | &amp;quot;Before You Open Your Server&amp;quot;]]&lt;br /&gt;
has some help on what you need to do if you host an Uru shard.&lt;br /&gt;
&lt;br /&gt;
The server definitely works with the [[CyanWorlds.com_Engine | CWE client]]! If&lt;br /&gt;
you are thinking of doing client development you will probably find a server&lt;br /&gt;
that is not MOULagain to test with quite valuable. (MOSS was also tested with&lt;br /&gt;
PlasmaClient, but it does not fully work for PlasmaClient because it does some&lt;br /&gt;
things that a'moaca' argues are bugs from the system perspective. Let's fix&lt;br /&gt;
PlasmaClient.)&lt;br /&gt;
&lt;br /&gt;
The server has some features meant to help make it a little easier to test ages&lt;br /&gt;
you are creating. The SDL files for an age are loaded each time the age is&lt;br /&gt;
started up so you can change them without restarting MOSS. There is full&lt;br /&gt;
support for multiple .pak files. So, run your own server, test at your own&lt;br /&gt;
pace. Test in the CWE client and not the PotS one.&lt;br /&gt;
&lt;br /&gt;
== How to Get It ==&lt;br /&gt;
&lt;br /&gt;
{{tba}}&lt;br /&gt;
&lt;br /&gt;
The source code is hosted in a Mercurial repository here at OpenUru.org.&lt;br /&gt;
You can clone (download) a copy of the repository using Mercurial, or you can&lt;br /&gt;
use a snapshot. If you are considering making changes to the code, you will&lt;br /&gt;
probably prefer using the version control. If you just want to compile and run&lt;br /&gt;
a server, a snapshot should do. In addition, a compiled version is&lt;br /&gt;
available for the TBD platform.&lt;br /&gt;
&lt;br /&gt;
If you are new to Mercurial, you may want to check the&lt;br /&gt;
[http://mercurial.selenic.com/wiki/QuickStart QuickStart]. There are links to&lt;br /&gt;
more complete documentation at the bottom. The Foundry is secured via SSL&lt;br /&gt;
throughout the site. A browser security certificate is needed. Instructions are&lt;br /&gt;
available on the [[Foundry_Certificate_Installation | certificate installation&lt;br /&gt;
page]].&lt;br /&gt;
&lt;br /&gt;
'''Repository address:''' https://foundry.openuru.org/hg/MOSS&lt;br /&gt;
&lt;br /&gt;
'''Snapshot location:''' TBD&lt;br /&gt;
&lt;br /&gt;
'''Binary package:''' TBD&lt;br /&gt;
&lt;br /&gt;
== How to Set Up a Server ==&lt;br /&gt;
&lt;br /&gt;
The [http://foundry.openuru.org/fisheye/browse/MOSS/doc/setup setup] file&lt;br /&gt;
contains a complete set of installation instructions. They do assume you are&lt;br /&gt;
conversant with setting up software and basic management of a database. For&lt;br /&gt;
additional setup instructions, see [[MOSS-Setup]]. Feel free to add any hints&lt;br /&gt;
specific to your distribution [[MOSS-Distribution_Specific_Instructions | here]].&lt;br /&gt;
&lt;br /&gt;
Cyan has provided a copy of the files needed for a server hosting MOUL content.&lt;br /&gt;
The .sdl, .age, and Python source are all available at&lt;br /&gt;
http://assets.openuru.org/cyan/Scripts.zip. If you are not interested in&lt;br /&gt;
compiling your own Python from this source, you can also get a copy of the&lt;br /&gt;
compiled Python from http://assets.openuru.org/cyan/AuthFiles.zip.&lt;br /&gt;
&lt;br /&gt;
There is some Q&amp;amp;A and other notes of possible interest to someone running a&lt;br /&gt;
server at [[MOSS-Notes]].&lt;br /&gt;
&lt;br /&gt;
== How to Contribute ==&lt;br /&gt;
&lt;br /&gt;
Contributing to the wiki pages is welcome. Adding extra setup instructions, or&lt;br /&gt;
adding documentation about how MOSS works, are two good examples. It's a wiki,&lt;br /&gt;
please contribute anything you think others might want to read.&lt;br /&gt;
&lt;br /&gt;
Almost any code contribution is welcome. What is unwelcome? Protocol/behavior&lt;br /&gt;
changes without corresponding client support (obviously). Changes that remove&lt;br /&gt;
security without the option of keeping it. Changes that introduce security&lt;br /&gt;
holes, either in the server itself or the vault. Changes that break big-endian&lt;br /&gt;
support (call it a pet peeve if you like, it's still unwelcome). Changes that&lt;br /&gt;
break the build (accidents do happen, but don't break it on purpose). Hopefully&lt;br /&gt;
it is not difficult to see why these things are unwelcome.&lt;br /&gt;
&lt;br /&gt;
If you find a bug, please report it. Please, please, please search first to see&lt;br /&gt;
if it's already reported. The bug tracker is here:&lt;br /&gt;
https://foundry.openuru.org/jira/browse/MOSS&lt;br /&gt;
&lt;br /&gt;
If you find a bug and fix it, include the patch with the bug report! This&lt;br /&gt;
increases the chances of it getting fixed rather a lot.&lt;br /&gt;
&lt;br /&gt;
Bug fixes are very valuable.&lt;br /&gt;
[https://foundry.openuru.org/jira/browse/MOSS Grab a bug] and fix it! Check&lt;br /&gt;
out [[MOSS-Project_Ideas]] for more ideas.&lt;br /&gt;
&lt;br /&gt;
If you want to add a feature or change something, you can file a feature&lt;br /&gt;
request or task bug to get your change considered for the&lt;br /&gt;
[https://foundry.openuru.org/hg/MOSS central repository].&lt;br /&gt;
&lt;br /&gt;
If you want write access to the central repository, contribute. I think the&lt;br /&gt;
best for MOSS will be to use similar standards for determining who is given&lt;br /&gt;
write access as CWE. At this time that's undecided, so I leave MOSS equally&lt;br /&gt;
undecided. However, MOSS's original author is more involved than CWE's so if&lt;br /&gt;
only a couple people show up to help then it's pretty clear a couple people&lt;br /&gt;
will get write access soon enough!&lt;br /&gt;
&lt;br /&gt;
Code reviewers might be needed. If you are willing to be a reviewer, say so! It&lt;br /&gt;
is a very valuable contribution.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
[[MOSS-Notes]]&lt;br /&gt;
&lt;br /&gt;
[[MOSS-Setup]]&lt;br /&gt;
&lt;br /&gt;
[[MOSS-Developer_Notes]]&lt;br /&gt;
&lt;br /&gt;
[[CyanWorlds.com_Engine]]&lt;br /&gt;
&lt;br /&gt;
[[Category:MOSS]]&lt;/div&gt;</summary>
		<author><name>A'moaca'</name></author>
	</entry>
	<entry>
		<id>https://wiki.openuru.org/index.php?title=MOSS/Notes&amp;diff=964</id>
		<title>MOSS/Notes</title>
		<link rel="alternate" type="text/html" href="https://wiki.openuru.org/index.php?title=MOSS/Notes&amp;diff=964"/>
		<updated>2011-04-04T06:41:52Z</updated>

		<summary type="html">&lt;p&gt;A'moaca': &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page just holds various notes about running a MOSS server.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Questions ==&lt;br /&gt;
&lt;br /&gt;
I can't really call this a FAQ until the questions have been asked frequently.&lt;br /&gt;
&lt;br /&gt;
; How do I add a user?&lt;br /&gt;
: [[MOSS-Setup#Create_Accounts]]&lt;br /&gt;
; How do I change the Python?&lt;br /&gt;
: Start with the source Cyan has generously provided us under the GPL. To compile that source you'll have to add in the glue. Maybe there is a tool do that in the CWE source. Make your changes. After compiling and creating the .pak (another tool?), copy the .pak to the [[MOSS-Setup#Auth_Server_Data | correct server directory]] and encrypt it. Make a new .mbam file.&lt;br /&gt;
; How do I add a new age?&lt;br /&gt;
: Copy the encrypted .pak to the [[MOSS-Setup#Auth_Server_Data | correct server directory]], add the file to the Python.txt, and make a new .mbam file. Copy any SDL files to the auth SDL directory and encrypt them. Copy unencrypted SDL files to the [[MOSS-Setup#Game_Server_Data | correct server directory]]. Note if you have more than one SDL file for your age, or the file is not named the same as the age, you'll need to put the age's SDL file(s) in a directory named after the age. Copy the unencrypted .age file to the game server directory.&lt;br /&gt;
; Why would I use --enable-fork?&lt;br /&gt;
: This is primarily useful for testing. It's easier to debug a non-threaded process.&lt;br /&gt;
; What resource limitations are there (file descriptors, memory, etc.)?&lt;br /&gt;
: This is a question that's not obvious to answer. But here is what is known:&lt;br /&gt;
:* Currently MOSS uses about 5 file descriptors when idle. It uses about 10 per connected user. (4 are for the game server, so if the user links around a lot, it will be more, and if you have multiple users in one age it will be less.) If you are running a large shard, you may need to adjust per-process file descriptor limits (see the &amp;quot;ulimit&amp;quot; command) or even kernel (global) limits. If you adjust the global limit, pay attention to &amp;lt;tt&amp;gt;FD_SETSIZE&amp;lt;/tt&amp;gt;. See the select() man page.&lt;br /&gt;
:* Currently MOSS uses 7 big buffers for network data per connected user. The buffer size is set by &amp;lt;tt&amp;gt;BUFSIZE&amp;lt;/tt&amp;gt; in constants.h. The default is 64k, so a total of 448k per user. If you have enough users that your moss processes grow too large you can reduce the &amp;lt;tt&amp;gt;BUFSIZE&amp;lt;/tt&amp;gt;.&lt;br /&gt;
:* There is not a lot of disk I/O, except for whatever the database has to write. If you set the log levels very low (DEBUG or worse, MSGS) then there will be a lot of I/O for log files.&lt;br /&gt;
; Does MOSS work on my Power PC?&lt;br /&gt;
: It is supposed to! Testing of big-endian systems was done, but not a full, complete run-through of all game mechanics and multiplayer testing. If it does not work, [[MOSS#How_to_Contribute | it's a bug]].&lt;br /&gt;
; Does MOSS work on Windows? OS X?&lt;br /&gt;
: Not Windows. There is a fair bit of porting work to do. OS/X theoretically works but nobody has tried yet. (If you try and it works, fix this!)&lt;br /&gt;
; What is the &amp;quot;status&amp;quot; server type?&lt;br /&gt;
: MOSS will provide the status string normally fetched from a web server. You do have to make the client send the HTTP request to port 14617 or it won't do much good. This is a feature that perhaps only the author wants.&lt;br /&gt;
&lt;br /&gt;
== Warnings ==&lt;br /&gt;
&lt;br /&gt;
* Please note: The MOSS vault is as insecure as MOUL's. (I don't know what was done to MOULagain.) The MOSS server is almost as trusting of the client as MOUL's. (Or maybe more, in other ways; for example, there is no server-side profanity filter.) This is because a MOUL server was implemented, not some other server. Doing better is definitely possible. But to do it right is a very big project, because the entire ''system'' was designed with this trust model. You can't always change just one part of it to get where you want to be.&lt;br /&gt;
&lt;br /&gt;
* Don't change the .mbm or file server files while you have clients doing File transactions. Doing so will give everything indigestion.&lt;br /&gt;
&lt;br /&gt;
* I'm sure the same applies for .mbam and auth server files.&lt;br /&gt;
&lt;br /&gt;
* The SDL mechanism depends on all servers in the shard having synchronized time. Use NTP if you have more than one server. (You'll also need to NFS mount the game/state directory on all the servers so the age SDL is available to all.)&lt;br /&gt;
&lt;br /&gt;
== Setup Choices ==&lt;br /&gt;
&lt;br /&gt;
* Disabling the client&amp;lt;-&amp;gt;server encryption is NOT recommended. However, if you subscribe to the shortsighted idea that protecting your users is not important, go ahead. But be warned, there are code paths in MOSS that are completely untested when all encryption is disabled. You'll have to fix any bugs. (The Wireshark plugin does support decrypting connections when you have the key, so you ''can'' use encrypted connections during development/testing.)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span id=&amp;quot;RSA&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;MOSS supports using RSA for key negotiation. The client contribution to the session key is RSA-encrypted with the server public key and then sent to the server, which decrypts the message. Ironically, this actually is less crypto work, while using a non-modified standard encryption technology. And it has the same pseudo-authentication properties as the Cyan-style modified Diffie-Hellman. The assembler changes required for this are astonishingly small, but there's not much value in using RSA. Nonetheless, there's no need to remove working server support for it...&lt;br /&gt;
&lt;br /&gt;
== While Running the Server ==&lt;br /&gt;
&lt;br /&gt;
* You can change age SDL state server-side by modifying the state saved in files in the game/state directory. Keeping backups is advised. You may modify the files with the &amp;quot;sdl_reader&amp;quot; program (which you need to build separately using &amp;quot;make sdl_reader&amp;quot;). This is a very simple command-line program. Use the -l option to specify a saved file to read. When in the program, use the &amp;quot;h&amp;quot; command to see the help. Saving this file while a game server for that age is running is pointless; the new version won't be read and it will be overwritten when the server exits.&lt;br /&gt;
&lt;br /&gt;
== Client Bug Workarounds ==&lt;br /&gt;
&lt;br /&gt;
MOSS works around a few client bugs.&lt;br /&gt;
&lt;br /&gt;
* MOSS &amp;quot;fixes&amp;quot; the KI light bug. It is a bug in the PRP files. MOSS has an extra check for determining whether SDL state is avatar-related, instead of relying on the flag that says whether to keep the SDL state around. That check covers the KI light, so the light SDL is tossed along with the rest of avatar SDL when a person leaves an age.&lt;br /&gt;
&lt;br /&gt;
* MOSS may &amp;quot;fix&amp;quot; the footstep region bug. This bug is when you get the wrong footstep sound stuck, like that wooden bridge you left long ago clumping around while you're on stone. Everyone in the age hears the wrong footstep sounds. I believe that in normal play (that is, without things like /spawn) it is due to a race with the exclusive locking mechanism used to keep things like multiple button presses from being processed at the same time. Why footstep regions take a server-side exclusive lock is beyond me**, so MOSS grants '''all''' footstep region lock requests. This should make the problem occur less frequently, if at all (depending on how the client actually responds to receiving the lock after leaving the region). MOSS decides you are asking for a footstep region lock by looking for the word &amp;quot;Footstep&amp;quot; in the object name. ''Do not name buttons, door regions, or whatever with &amp;quot;Footstep&amp;quot; in your new ages.'' I suggest you do name footstep regions with &amp;quot;Footstep&amp;quot;. The special case can be removed by removing &amp;lt;tt&amp;gt;#define GRANT_ALL_FOOTSTEPS&amp;lt;/tt&amp;gt; from GameState.cc and recompiling.&lt;br /&gt;
:: **In fact, as a friend of mine pointed out, why are footstep sounds decided by the represented avatar's client and propagated to everyone else in the first place? It should be a purely local decision based on the location of each avatar as seen by that client. That would save on traffic and always be accurate, never mind the race with locking on the region since there would be no need to coordinate anything for a purely local decision.&lt;br /&gt;
&lt;br /&gt;
* Quab game Python is not really complete. The first person to link to the age becomes the &amp;quot;owner&amp;quot; of the quab game. The Python sort of attempts to handle the situation where the game owner leaves the age while there are still quabs around, but it does not actually handle it. If the server attempts to pass ownership to someone else, that client will break. And the current MOULagain client even crashes. So MOSS works around the problem by intentionally breaking the whole game when the owner leaves the age and quabs are still present. All the quabs will remain frozen in place until the age has been cleared of all players. The age does not have to restart to revive the game, just be empty.&lt;br /&gt;
&lt;br /&gt;
* The client supports two kinds of passwords, depending on the format of the username. If the username has the format x@x.x it uses algorithm 1 (a more secure one but also one with a fencepost error), and otherwise algorithm 2.  Unfortunately the /changepassword command does not know about algorithm 2 and if you logged in with algorithm 2, it will try to change your password hash to the one for algorithm 1. This would result in you being unable to log in.  So MOSS rejects requests to change the password if the username does not have the x@x.x format.&lt;br /&gt;
&lt;br /&gt;
== Server Non-Bugs ==&lt;br /&gt;
&lt;br /&gt;
These are problems with Cyan's server that MOSS does not have.&lt;br /&gt;
&lt;br /&gt;
* MOSS does not have the infamous &amp;quot;zero seconds remaining&amp;quot; bug. Thus it is possible to do the auth downloads without the server waiting for acks from the client. This speeds up the download substantially as now the bandwidth can be fully utilized. (The [[MOSS-Setup#configure | --enable-fast-download]] configure option turns this on.)&lt;br /&gt;
&lt;br /&gt;
* The MOUL server has a bug with quabs in Ahnonay. If you are the first person who linked into the age, the quabs are associated with your ID. When you link out of the age, the server is supposed to send a LoadClone message telling other clients to unload your clone (the avatar). The MOUL server sends the message, but it says to unload one of the quabs with your ID in it instead of the player avatar. Oddly, the client seems just fine with that. MOSS does not have this bug.&lt;br /&gt;
&lt;br /&gt;
* You should see less client hitching while moving around with MOSS. The MOUL server sends a ton of node update messages for the (unchanged) city AgeInfo node. Each node update causes the client to fetch your pellet scores. The client is frozen during this (and most any) vault transaction. The MOSS server does not send all those useless updates. Interesting note: One measurement during MOUL was approximately 400 pellet score fetches an hour. That is the client freezing every 9 seconds regardless of what age you are in or how many people are in it or on your buddy list. (The pellet score fetch itself can probably be fixed in the Python but you'd still be wasting time on the city node.)&lt;br /&gt;
&lt;br /&gt;
* The pellet score freeze can be further reduced by #defining &amp;lt;tt&amp;gt;PELLET_SCORE_CACHE&amp;lt;/tt&amp;gt;, which does what it sounds like: it caches the client's pellet score in the Auth server to cut out the round-trip time to the DB. However, there's little value to it without the city node update problem; when you open the KI it fetches the score but it's also fetching other vault nodes. Plus you aren't trying to move at the time so the freeze is less obvious. So &amp;lt;tt&amp;gt;PELLET_SCORE_CACHE&amp;lt;/tt&amp;gt; is undefined by default, and in fact it is ''untested''.&lt;br /&gt;
&lt;br /&gt;
[[Category:MOSS]]&lt;/div&gt;</summary>
		<author><name>A'moaca'</name></author>
	</entry>
	<entry>
		<id>https://wiki.openuru.org/index.php?title=MOSS/Developer_Notes&amp;diff=963</id>
		<title>MOSS/Developer Notes</title>
		<link rel="alternate" type="text/html" href="https://wiki.openuru.org/index.php?title=MOSS/Developer_Notes&amp;diff=963"/>
		<updated>2011-04-04T06:40:56Z</updated>

		<summary type="html">&lt;p&gt;A'moaca': &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Comments of interest to those working with the MOSS code should go here. If&lt;br /&gt;
you plan to just run a server and not modify it, you don't need to be here.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Working with the Code ==&lt;br /&gt;
&lt;br /&gt;
=== Requirements ===&lt;br /&gt;
&lt;br /&gt;
* Handle byte-swapping. A networking person wrote MOSS, and such people care about working with both endiannesses. Do not break it.&lt;br /&gt;
&lt;br /&gt;
* This does mean you cannot drop in someone else's code handling the MOUL protocol if it assumes you are using a little-endian machine. This is '''the''' reason for not casting incoming byte data to structs and writing out structs.&lt;br /&gt;
&lt;br /&gt;
* Including &amp;quot;config.h&amp;quot; should always look like this:&lt;br /&gt;
 #ifdef HAVE_CONFIG_H&lt;br /&gt;
 #include &amp;quot;config.h&amp;quot;&lt;br /&gt;
 #endif&lt;br /&gt;
&lt;br /&gt;
=== Code Conventions ===&lt;br /&gt;
&lt;br /&gt;
* Keep C++-style comments out of preprocessor lines.&lt;br /&gt;
&lt;br /&gt;
* Keep code to 78 columns whenever possible.&lt;br /&gt;
&lt;br /&gt;
* Include (.h) files have comments at the top listing which other include files are required before including this file. (Some may be missing but I tried.)&lt;br /&gt;
&lt;br /&gt;
* I use emacs. Please keep the &amp;lt;tt&amp;gt;/* -*- c++ -*- */&amp;lt;/tt&amp;gt; at the top of .h files if they are indeed C++. Feel free to add similar magic for your editor.&lt;br /&gt;
&lt;br /&gt;
* Please match indentation, spacing, and brace styles, etc. (It is the default &amp;quot;gnu&amp;quot; style in emacs.)&lt;br /&gt;
&lt;br /&gt;
* Limit direct including of other include files in .h files. I don't remember why, but it's the project's convention. (It does help with dependencies sometimes.)&lt;br /&gt;
&lt;br /&gt;
=== Advice ===&lt;br /&gt;
&lt;br /&gt;
* If you add a client message type, make sure to add it to check_useable(). Otherwise the server will toss the message and drop the client.&lt;br /&gt;
&lt;br /&gt;
* If you add a client message type, test compiling with the --enable-old-protocol=yes configure option set.&lt;br /&gt;
&lt;br /&gt;
* When handling byte-swapping, never assign the result of readNNle() to a larger variable. This is wrong. Consider a 16-bit little-endian number with two bytes ''XY'', represented as &amp;lt;tt&amp;gt;YX&amp;lt;/tt&amp;gt;. read16le() returns &amp;lt;tt&amp;gt;YX&amp;lt;/tt&amp;gt;, and assigned to a 32-bit number on a big-endian system, the result is &amp;lt;tt&amp;gt;00YX&amp;lt;/tt&amp;gt;. A 32-bit little-endian number of value ''XY'' is '''correctly''' represented as &amp;lt;tt&amp;gt;YX00&amp;lt;/tt&amp;gt;. Assigning the result of readNN() is fine, as that value is in host order. Similarly you can't writeNNle() a number stored in a smaller type, but this is a harder mistake to make.&lt;br /&gt;
&lt;br /&gt;
* As a corollary, don't save anything explicitly kept little-endian in anything other than a sized int type. Don't use size_t, enum types, or anything along those lines. Especially not size_t.&lt;br /&gt;
&lt;br /&gt;
* Remember that protocol changes are not to be made lightly, because it causes an incompatibility problem. &lt;br /&gt;
&lt;br /&gt;
* Be very, very, careful about any changes to game server startup code in the backend. Triple-check all the logic (or more). Do not forget to take into account the client disconnecting/timing out after the request, the game server never starting, the game server shutting down as the request arrives, and everything in between.&lt;br /&gt;
&lt;br /&gt;
* Before writing new DB query code or changing how current ones work, make sure to read up on the [http://pqxx.org/devprojects/libpqxx/doc/stable/html/Tutorial/ch03s07.html pqxx transactor model].&lt;br /&gt;
&lt;br /&gt;
* There is a reftree.sql file in the test directory. If you are working with the DB and need a view into the trees of data the change notification routines are working with, you may find this file useful. Load it into the DB, and it adds a &amp;quot;reftree&amp;quot; function which, given a node, will generate a list of the whole tree below it by following the noderefs. The output includes node and folder type '''names''' and the information used to determine where change notifications have to be sent.&lt;br /&gt;
&lt;br /&gt;
== Implementation Choices ==&lt;br /&gt;
&lt;br /&gt;
Oftentimes, in a hobbyist project such as MOSS was in the beginning, there is not a lot of design documentation. MOSS had some, but most of it became obsolete as goals changed. Here are some short descriptions answering some &amp;quot;Why did you do it this way?&amp;quot; questions.&lt;br /&gt;
&lt;br /&gt;
Terminology used here: the &amp;quot;backend&amp;quot; server is that process named moss_backend, which talks to the DB and handles anything needing centralized management, while &amp;quot;frontend&amp;quot; servers are everything else (auth/file/game/gatekeeper servers talking to the client, and the dispatcher listening for connections). The &amp;quot;backend protocol&amp;quot; is the protocol used between the frontend and backend servers.&lt;br /&gt;
&lt;br /&gt;
; Why is there all this read32/read32le stuff?&lt;br /&gt;
: [[#Requirements | A networking person wrote MOSS.]] readNN() byte-swaps a little-endian value (from the protocol on the wire) to host order. writeNN() byte-swaps from host to little-endian. If you run it on a little-endian box this is a no-op. readNNle() ''doesn't'' byte-swap, returning a number of size NN in little-endian order. If you run it on a little-endian box this is a no-op. On a big-endian box these are critical. In addition, these macros/functions handle hardware that does not allow unaligned access of memory locations. At the time of release, MOSS appeared to work correctly on big-endian machines.&lt;br /&gt;
&lt;br /&gt;
; Why are there two ways to write every message?&lt;br /&gt;
: For larger messages, the writev() syscall is considered more efficient, because less data has to be copied when crossing the user/kernel memory boundary. In other words, you save one copy of the entire contents of what you write at the price of computing and copying the set of iovecs. However, writev() won't work when you have to encrypt the data first, so for encrypted connections we have to copy the data into a buffer and then encrypt it.&lt;br /&gt;
&lt;br /&gt;
; Why do the backend message classes have &amp;quot;little-endian&amp;quot; comments all over?&lt;br /&gt;
: The backend protocol is handled somewhat differently in MOSS. For frontend servers, any data read in and used by the server is stored in host order. But for the backend messages, the data is mostly stored in ''little-endian'' order, because the protocol is (currently!) unencrypted and I can use writev() and skip copying into a buffer. For many messages, writev() may not be better than copying, because the iovec is bigger than the data it represents. On the other hand, the actual copy into the buffer is avoided. The performance of each approach is unknown. There is no MessageQueue support for mixing the iovec and buffer strategies in a single queue based on message type.&lt;br /&gt;
&lt;br /&gt;
; Why do you use a single-threaded big select loop for each game server?&lt;br /&gt;
: The other typical strategy would be to have a thread per client and pass messages between threads. The MultiWriterMessageQueue class was originally intended to cover that case (in addition to [[MOSS-Project_Ideas#connection_merging | others]]). But the fundamental problem with this plan is that I did not have a good portable way to wake up threads when a message is queued. It can be done, but signals are probably not the way to do it.&lt;br /&gt;
&lt;br /&gt;
; Speaking of signals, why do you use them between threads instead of epoll()?&lt;br /&gt;
: I don't have epoll() on my development machine. Signals are the most portable. [[MOSS-Project_Ideas#libevent | Replacing the use of signals + select() with libevent]] might be the right answer because part of its goal is to work on many OSes.&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;span id=&amp;quot;backend_typecodes&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;Explain the funky backend protocol numbering scheme?&lt;br /&gt;
: The protocol was designed to facilitate using multiple processes or servers in the backend. Thus messages have a bitmask &amp;quot;class&amp;quot; which would allow them to be quickly routed to the right location by checking the bitmask, rather than having a giant case statement to decide.&lt;br /&gt;
&lt;br /&gt;
: Then, I wanted the pairs of messages to be recognizable from the number, so a message TO the backend is numbered the same the corresponding message FROM the backend, with the addition of a bit to mark which direction the message is going. Since each server knows its own identity, this bit is basically a big favor for the Wireshark dissector. Trust me, it's really nice.&lt;br /&gt;
&lt;br /&gt;
: Finally, because once upon a time I knew many messages by their number, I assigned backend messages the same number as a corresponding frontend (client) message. When it made sense. We don't need to do this going forward, but we aren't allowed to change the current ones.&lt;br /&gt;
&lt;br /&gt;
: There are some bits in the middle &amp;quot;left over&amp;quot;. Maybe someone will need them for something creative someday!&lt;br /&gt;
&lt;br /&gt;
; Why did you choose [http://www.postgresql.org/ PostgreSQL]?&lt;br /&gt;
: There were not a lot of differentiators between it and MySQL. But, PostgreSQL provides &amp;quot;triggers&amp;quot; -- this is a way to request that when a table is changed, the DB tells anything subscribed to the triggers about the change. I was intrigued by them, and thought they could prove useful for providing the vault node update notifications to clients (VaultNodeChanged/VaultNodeAdded/VaultNodeDeleted). Unfortunately, doing this ended up requiring at least two connections to the DB, one like the current one, and another to listen for triggers. So triggers were not used in the interest of simplicity in the backend server. Nothing else is preventing their use.&lt;br /&gt;
&lt;br /&gt;
; What is up with this giant DB schema!&lt;br /&gt;
: First, it was a conscious decision to put as much SQL code as possible into stored procedures. This makes it so you can modify the DB functionality without recompiling the server, and it reduces the amount of data you have to push over the socket.&lt;br /&gt;
&lt;br /&gt;
: The single giant table as seen in PotS, UU, and to some extent (how much exactly is unknown) MOUL/MOULa is so hard to work with. And it has scalability, relations, and clarity built right out of it. We were thinking of how to split the database load up to help with the bottleneck the DB still proved to be in MOUL. While no implementation was done for that (realistic expectations of MOSS suggest it is not needed), this did lead to the decision to experiment with splitting the table up into many tables by node type.&lt;br /&gt;
&lt;br /&gt;
: There's no way to know if these design choices are more efficient, without changing the design, implementing it, and comparing the performance of the two in a like-for-like way. But it sure is a lot easier to write queries with the stored procedures and tables by node type!&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;span id=&amp;quot;notifier&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;What is this new &amp;quot;notifier&amp;quot; thing in the noderefs table?&lt;br /&gt;
: It is the answer to the question &amp;quot;How do I know which client to tell about changes to this reference or referred-to node?&amp;quot;&lt;br /&gt;
&lt;br /&gt;
: After drawing many pictures of node trees, it became clear that the &amp;quot;owner&amp;quot;, coming from the client, was mostly but not really right for this. I was left with the impression that's what the &amp;quot;owner&amp;quot; field is for... but since it wasn't what I wanted I added a new one. For player trees, the notifier is the player. For age trees, it's the age, and then the DB looks up what players are interested in that age.&lt;br /&gt;
&lt;br /&gt;
: I do not know how Cyan solved the problem, but this was the way to push the decision about who to tell into the DB where most of the data is. Otherwise, the backend (vault) server would have to cache all the active trees itself in order to find the answer.&lt;br /&gt;
&lt;br /&gt;
; Why did you make the SDL files be in a directory tree instead of a single directory?&lt;br /&gt;
: The goal was to improve the age development experience. If the server loads all the SDL at startup, and you want to change the SDL because you have a new version to test, you have to restart the server. If instead, a given age's SDL is loaded at the time the game server starts up, you only need to restart the game server. I then put the files common to all ages in a &amp;quot;common&amp;quot; directory so that it is loaded once, and the data can be shared between game servers, but that is just a small optimization. If users have serious issues with this they can put ''all'' the SDL files in the common subdirectory.&lt;br /&gt;
&lt;br /&gt;
; Why .mbm and .mbam files?&lt;br /&gt;
: I did not want the server to have to stat and checksum files all the time. File and auth files don't change much.&lt;br /&gt;
&lt;br /&gt;
; Why didn't you put Python in to script Heek?&lt;br /&gt;
: I suspect Cyan did this. I am not a fan of embedding scripting where it is not needed, and at the time I had no reason to believe there would ever be new GameMgr types requiring the kind of dynamic rapid development that embedded scripting is good for. Still, it's in the [[MOSS-Project_Ideas#scripting | project ideas]] for those who are into that sort of thing.&lt;br /&gt;
&lt;br /&gt;
== Project Ideas ==&lt;br /&gt;
&lt;br /&gt;
The whole idea of this list is to provide some ideas for anyone wishing to dive&lt;br /&gt;
into MOSS. Sometimes a little direction helps. See [[MOSS-Project_Ideas]]. Of&lt;br /&gt;
course, you are not limited to this list!&lt;br /&gt;
&lt;br /&gt;
[[Category:MOSS]]&lt;/div&gt;</summary>
		<author><name>A'moaca'</name></author>
	</entry>
	<entry>
		<id>https://wiki.openuru.org/index.php?title=MOSS/Project_Ideas&amp;diff=962</id>
		<title>MOSS/Project Ideas</title>
		<link rel="alternate" type="text/html" href="https://wiki.openuru.org/index.php?title=MOSS/Project_Ideas&amp;diff=962"/>
		<updated>2011-04-04T06:40:28Z</updated>

		<summary type="html">&lt;p&gt;A'moaca': &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The initial list was generated over the lengthy period of MOSS's initial&lt;br /&gt;
development. These project ideas mostly cover missing functionality. None of&lt;br /&gt;
the missing functionality is known to cause gameplay issues so these did not&lt;br /&gt;
really seem like bugs. These ideas are grouped by general type of change&lt;br /&gt;
required, and sort of by increasing approximate difficulty level and sort of by&lt;br /&gt;
decreasing value.&lt;br /&gt;
&lt;br /&gt;
Bigger ideas, such as entirely new functionality now made possible by the&lt;br /&gt;
release of the client, could go here too. Be realistic, though. Remember that&lt;br /&gt;
protocol changes are not to be made lightly, because it causes an&lt;br /&gt;
incompatibility problem. It is probably better to propose large changes in&lt;br /&gt;
discussion format on the forums. Do not ''expect'' someone else to take up and&lt;br /&gt;
implement your proposal.&lt;br /&gt;
&lt;br /&gt;
The whole idea of this list is to provide some ideas for anyone wishing to dive&lt;br /&gt;
into MOSS. Sometimes a little direction helps.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Fix bugs ==&lt;br /&gt;
&lt;br /&gt;
The bug tracker is here: https://foundry.openuru.org/jira/browse/MOSS&lt;br /&gt;
&lt;br /&gt;
== Detail work (little Uru-specific knowledge required) ==&lt;br /&gt;
&lt;br /&gt;
* Try disabling the Nagle algorithm on sockets. This should result in less latency to the client when small messages are involved. Make sure to test the whole game thoroughly.&lt;br /&gt;
&lt;br /&gt;
* Figure out and implement a good way to use autoconf to compile in default pathnames. This would apply to the default config file, key file, moss_serv binary, and log/auth/game/file directory locations. The idea is if I say --prefix=/foo the defaults become /foo/etc/moss.cfg and so forth instead of ./etc/moss.cfg. Don't forget autoconf lets you override the etcdir, bindir, etc. separately.&lt;br /&gt;
&lt;br /&gt;
* Treat SDL filenames case-insensitively. This is very annoying in Unix, since it requires using readdir() and strcasecmp() instead of just open().&lt;br /&gt;
&lt;br /&gt;
* Log the PID of all forked servers in moss.log.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span id=&amp;quot;libevent&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;See if we can switch to libevent for inter-thread communication instead of raw signals. This should be fairly portable and take advantage of the different per-OS lightweight signalling mechanisms.&lt;br /&gt;
&lt;br /&gt;
* Allow ''skipping'' overlong messages (messages MOSS thinks are too big). This requires, upon catching the exception, tossing out the message, and if it has not all been read in yet, keeping track of how much more to toss in the future. The RC4 state must be updated too for the tossed message length.&lt;br /&gt;
&lt;br /&gt;
* It would be nice to use atomic operations for refcounts instead of having to use (bigger, slower) mutexes for them. This does make MOSS not architecture-independent, which is part of why I have been resisting it. (See also signal handling next.)&lt;br /&gt;
&lt;br /&gt;
* Signal handlers and the operations to read and reset the values in the main loops should be using atomic operations.&lt;br /&gt;
&lt;br /&gt;
* Catch and handle std::bad_alloc whenever possible.&lt;br /&gt;
&lt;br /&gt;
== Fairly contained changes ==&lt;br /&gt;
&lt;br /&gt;
* Make it so game servers can be forked as separate processes. This helps a lot for debugging and also would help for age development, making it easier to change SDL and retest. Otherwise you have to shut down the whole frontend server or wait out the age's linger time. This work was started but not completed, and that code can be found inside &amp;lt;tt&amp;gt;FORK_GAME_TOO&amp;lt;/tt&amp;gt; #ifdefs. If you do this, I suggest you consider separating &amp;lt;tt&amp;gt;FORK_GAME_TOO&amp;lt;/tt&amp;gt; from &amp;lt;tt&amp;gt;FORK_ENABLE&amp;lt;/tt&amp;gt; so that one could have forked game servers and *not* forked auth/file servers.&lt;br /&gt;
&lt;br /&gt;
* In the getpublicagelist() SQL function, there is a comment about the 50-hood limit. The current code returns the first 50 hoods. We should return the most recently used 50 hoods. The hard part is knowing which those are. This is mostly if not wholly DB/SQL work.&lt;br /&gt;
&lt;br /&gt;
* Age population limits are unimplemented. The value is in the vault, but the server does not look at it.&lt;br /&gt;
&lt;br /&gt;
* Figure out how to throw out clones and SDL when a player leaves the age. Please see the &amp;quot;clean up clone, SDL&amp;quot; section in GameServer::conn_shutdown(). Right now this is full of special cases: it handles the Kemo bugs and and Quabs specially (a different thing for each). It may be that this is required for best behavior, but I still feel like I've missed something despite heavy scrutiny of the data. This is more of a research project and not much of a code project.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span id=&amp;quot;SDL_timestamps&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;MOUL parsed SDL nodes on the way into the vault. It probably only updated the node with fields having the Dirty bit set. In addition it added timestamps to the fields because the client does not put in the timestamps (reasonably so, as its time may be wrong). MOSS currently saves the SDL wholesale. This basically works, but with the timestamps properly added, the game server can merge the vault, age, and global SDL in any order and without strange rules. Note: if you do this, you also need to write a script or some other way to update all the SDL nodes in existing MOSS DBs.&lt;br /&gt;
&lt;br /&gt;
* The kickable SDL filtering algorithm is the same one I put in Alcugs ages ago. It is better than nothing but not as good as Plasma's. You will see more warping of kickables than with Cyan's server. This project is to come up with a better way of deciding what physical SDL to send to all the clients, based on those messages all the clients are sending to the server.&lt;br /&gt;
&lt;br /&gt;
* The server is probably supposed to use RelevanceRegion information to avoid sending SDL updates to clients who don't share a relevance region with the originating client. (The idea being to reduce network traffic, since hopefully the client already avoids rendering/physics on things in irrelevant regions.) Things work if the server doesn't filter, so MOSS doesn't. Also, I do not have strong evidence to believe this supposition is actually correct. Which is the other reason MOSS doesn't do it. Finding out, and implementing it if so, would be a nice project.&lt;br /&gt;
&lt;br /&gt;
* Figure out what the server is supposed to do with plSetNetGroupIDMsg and do it. Right now MOSS just drops it to no apparent ill effect. I am deeply suspicious of this message due to seeing it at aurally unpleasant times in UU. (Old, old notes: &amp;quot;may have to do with infinitely looping scraping noises&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;kCli2Auth_SendFriendInviteRequest&amp;lt;/tt&amp;gt; is not fully supported (it is dropped on the floor).&lt;br /&gt;
&lt;br /&gt;
== Bigger changes ==&lt;br /&gt;
&lt;br /&gt;
* The following messages are unimplemented.&lt;br /&gt;
** &amp;lt;tt&amp;gt;kCli2Auth_VaultSetSeen&amp;lt;/tt&amp;gt;  --  unimplemented in client&lt;br /&gt;
** &amp;lt;tt&amp;gt;kCli2Auth_ScoreDelete&amp;lt;/tt&amp;gt;  --  never saw one, so couldn't implement it&lt;br /&gt;
** &amp;lt;tt&amp;gt;kCli2Auth_ScoreSetPoints&amp;lt;/tt&amp;gt;  --  never saw one, so couldn't implement it&lt;br /&gt;
** &amp;lt;tt&amp;gt;kCli2Auth_ScoreGetRanks&amp;lt;/tt&amp;gt;  --  never saw one, so couldn't implement it&lt;br /&gt;
** &amp;lt;tt&amp;gt;kCli2Csr_PingRequest&amp;lt;/tt&amp;gt;  --  no recorded Csr messages&lt;br /&gt;
** &amp;lt;tt&amp;gt;kCli2Csr_RegisterRequest&amp;lt;/tt&amp;gt;&lt;br /&gt;
** &amp;lt;tt&amp;gt;kCli2Csr_LoginRequest&amp;lt;/tt&amp;gt;&lt;br /&gt;
** &amp;lt;tt&amp;gt;kCsr2Cli_PingReply&amp;lt;/tt&amp;gt;&lt;br /&gt;
** &amp;lt;tt&amp;gt;kCsr2Cli_RegisterReply&amp;lt;/tt&amp;gt;&lt;br /&gt;
** &amp;lt;tt&amp;gt;kCsr2Cli_LoginReply&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Add hood randomization to DRC hoods. Player-created hoods are randomized by the Python in the Nexus when the hood is created. DRC hoods, however, are created by the server. In MOSS's case, they are created entirely by SQL code. So adding DRC hood randomization means noticing when the DB has created a new DRC hood, creating and modifying SDL in the backend, and then finding and modifying the age SDL node for that new hood. All before responding to the client creating the new avatar and thus the new DRC hood.&lt;br /&gt;
&lt;br /&gt;
* The MessageQueue class has a concept of priorities. The idea was to enable dropping of lower-priority messages if a queue to a given client starts to back up. (The lowest priority being voice chat, then avatar movements, with world state changes being highest.) The measurement of queue length or throughput necessary for that is not implemented. So, neither is the dropping. (There is the very beginnings of some if &amp;lt;tt&amp;gt;DO_PRIORITIES&amp;lt;/tt&amp;gt; is #defined.) As such, queue users don't do a good job of priority-setting, although VOICE and FRONT are properly used. The idea wasn't to order the queue (except for FRONT), but to skip sending, say, a VOICE message when we encounter one, if the queue congestion measure says to.&lt;br /&gt;
&lt;br /&gt;
* '''Vault security'''&lt;br /&gt;
: The MOSS vault is as insecure as the MOUL vault. Need I say more? Here are some starter thoughts.&lt;br /&gt;
:* MOSS should parse incoming SDL messages and sanity-check them. See also [[#SDL_timestamps | adding timestamps]].&lt;br /&gt;
:* MOSS could probably verify other blob contents too.&lt;br /&gt;
:* Anyone can save anything to any node, and can fetch any node if they know its type and ID. We can deny these requests if the user shouldn't have access. Possibly [[MOSS-Developer_Notes#notifier | the notifier field]] can help.&lt;br /&gt;
:* Much more, I'm sure. Better vault security ''is'' possible.&lt;br /&gt;
&lt;br /&gt;
* Eliminate excessive byteswapping of opaque server IDs in BackendMessages. This is to say, in the backend server, when reading in the messages, it byte-swaps the IDs to store them, only ever uses them in equality tests with other IDs, and then byte-swaps them back when sending new messages. (On a little-endian box there's no swapping so it does not cost much, but it's the principle of the matter.) Unfortunately this really needs to be tested on a big-endian machine.&lt;br /&gt;
&lt;br /&gt;
* Try changing the File server to do [[MOSS-Setup#ackless | ackless downloads]], too. Maybe only if there is only one download at a time, though.&lt;br /&gt;
&lt;br /&gt;
== Scalability issues ==&lt;br /&gt;
&lt;br /&gt;
Performance and scalability are always interesting questions. And frequently ignored, because they only matter for larger installations.&lt;br /&gt;
&lt;br /&gt;
These are ideas unimplemented because they only really matter for large&lt;br /&gt;
shards. Large as in having, let's say, 50+ concurrent '''busy''' users. (50&lt;br /&gt;
people standing in the city chatting doesn't actually do much.) Maybe MOSS is&lt;br /&gt;
okay with that number now, in which case &amp;quot;large&amp;quot; is more. It is entirely&lt;br /&gt;
unknown.&lt;br /&gt;
&lt;br /&gt;
* Performance testing. Instrumentation. There should be a load generator to do this. This was not high on the list during development, with a user base of 3.&lt;br /&gt;
&lt;br /&gt;
* See the last paragraph in the comments at the top of FileTransaction.h about how multiple file transactions of the same file should share a single opened file.&lt;br /&gt;
&lt;br /&gt;
* Allow speculative pre-caching of AgeInfoNodes and PlayerInfoNodes when node changed notifications come from the vault server and are forwarded to any connected client. Cache in the auth server, vault server, or both. The goal is to reduce latency on those requests the client freezes for.&lt;br /&gt;
&lt;br /&gt;
* The backend protocol supports game servers requesting batches of GameMgr IDs. However, there is no code on either side to actually do so. The idea for this was that more populated ages, like the city, would benefit from doing batch requests. Every person who links in with a marker game needs a new global game ID, and it would be nice to cut out any extra backend round trips for links, even though this particular round trip does not block the link process (aside from being something the backend is doing when it could be doing something else).&lt;br /&gt;
&lt;br /&gt;
* Database performance could be measured and the SQL or even tables optimized.&lt;br /&gt;
&lt;br /&gt;
* MOSS currently uses a single blocking connection to the DB. Implement and investigate performance of multiple DB connections, or asynchronous ones. Maybe the backend server has to become threaded to gain the best advantage.&lt;br /&gt;
&lt;br /&gt;
* In a big shard, we may need to split the backend server work up. The [[MOSS-Developer_Notes#backend_typecodes | backend protocol]] is designed to support separating backend work between threads. The &amp;quot;classes&amp;quot; of backend messages in a bitfield are meant as a way to quickly route a backend message to an appropriate backend thread or process.&lt;br /&gt;
&lt;br /&gt;
== Frontend/backend interactions ==&lt;br /&gt;
&lt;br /&gt;
* Add encryption to the backend protocol. This itself is not a big deal (though you have to pick a good key negotiation, and do not forget to consider authentication mechanisms), but it does mean all the BackendMessage fill_buffer() code paths would be newly exercised, so a lot of regression testing would be in order.&lt;br /&gt;
&lt;br /&gt;
* It would be much easier on the DB if updates to markers are batched by the game server. This especially applies to capturing markers. See the comments in the setmarkerto() and startmarkergame() SQL functions.&lt;br /&gt;
&lt;br /&gt;
* The backend protocol allows for frontends hosting ages to specify only a subset of ages that can be hosted there. This is unused right now; the message has a field saying, &amp;quot;this is the length of the following age restriction list&amp;quot; and it is always zero. When there are no restrictions the backend can request any frontend to host any age.&lt;br /&gt;
** The need for splitting hostable ages is unclear, but in a very large shard you might, for example, put all city instances, or even only the public one, on a separate server. It would also allow someone to join a shard and host just their own age, or whatever.&lt;br /&gt;
** Since the frontend never sends restrictions, the backend currently has no way to store and use them. So there is work on both sides.&lt;br /&gt;
** Presumably which ages a frontend server can host would be a configuration option but it could be done instead by restricting the contents of the game/age directory. That would not allow even finer-grained restrictions, but this whole project kind of needs a real use case to flesh out what is needed.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span id=&amp;quot;connection_merging&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;Having one backend TCP connection per frontend server is probably not a good thing, in terms of efficiency, or of scalability with a cluster of machines. We could change it to have one backend connection per frontend ''process'' and funnel everything through it. The mostly-implemented but unused and untested MultiWriterMessageQueue was meant, in part, to support this (there are multiple threads writing, but only one thread reading, which writes to the socket).&lt;br /&gt;
&lt;br /&gt;
: Then when messages are received in the frontend there needs to be some way of passing the message to the right thread and signaling them something is present to be handled. This is all unimplemented but the format of the backend messages is meant to take care of this case (in particular, the two &amp;quot;server IDs&amp;quot; in the header are for dispatching messages to the correct thread).&lt;br /&gt;
&lt;br /&gt;
: However, essentially the same changes would be necessary if the backend server is folded into the main server so there is only one process; then &amp;quot;sending&amp;quot; messages to the backend server is just putting them on the (shared) queue that would have been used to funnel everything through one connection, and &amp;quot;receiving&amp;quot; them is just taking them off that queue since there's no TCP connection to deal with.&lt;br /&gt;
&lt;br /&gt;
== New functionality ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span id=&amp;quot;scripting&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;I am guessing Cyan's server handles the GameMgr stuff with server-side scripting. At the time MOSS was implemented there was no expectation that new game types may be added so adding in a scripting language was not worth the problems incumbent with doing so. Also the overall value of scripting is not clear (especially for the cost in server complication). However, it could be done. The project would have to include embedding the scripting and then rewriting stuff using scripts.&lt;br /&gt;
: Please note, a lot of effort went into getting the Heek right, handling ties, allowing people to accidentally stand up and sit back down in the game, and probably other details I forgot. If you want to script Heek, it really ought to still work as well.&lt;br /&gt;
&lt;br /&gt;
* Really adventurous hardcore project: destroy KI hacks. The server would have to be able to analyze all game traffic to decide whether it looks okay. To do it right the server would have to have and understand PRP files and do physics. Also &amp;quot;console&amp;quot; commands have to be wisely filtered. If you're daunted, join the club.&lt;br /&gt;
&lt;br /&gt;
== Redesigns ==&lt;br /&gt;
&lt;br /&gt;
[[Category:MOSS]]&lt;/div&gt;</summary>
		<author><name>A'moaca'</name></author>
	</entry>
	<entry>
		<id>https://wiki.openuru.org/index.php?title=MOSS/Distribution_Specific_Instructions&amp;diff=961</id>
		<title>MOSS/Distribution Specific Instructions</title>
		<link rel="alternate" type="text/html" href="https://wiki.openuru.org/index.php?title=MOSS/Distribution_Specific_Instructions&amp;diff=961"/>
		<updated>2011-04-04T06:39:54Z</updated>

		<summary type="html">&lt;p&gt;A'moaca': &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document is meant to collect any known distribution-specific instructions&lt;br /&gt;
for installing MOSS. There are two main parts: installing the prerequisite&lt;br /&gt;
packages, and setting up the PostgreSQL database. Feel free to add any other&lt;br /&gt;
notes you may find useful.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Prerequisite Packages ==&lt;br /&gt;
&lt;br /&gt;
=== NetBSD pkgsrc ===&lt;br /&gt;
&lt;br /&gt;
Only PostgreSQL and the autotools are needed. You can build the packages&lt;br /&gt;
or use the prebuilt packages with pkg_add.&lt;br /&gt;
&lt;br /&gt;
 pkg_add automake&lt;br /&gt;
 pkg_add libtool&lt;br /&gt;
 pkg_add libpqxx&lt;br /&gt;
I recommend starting with libpqxx because it seems to lag the postgresql-client&lt;br /&gt;
package, and installing libpqxx will get the correct client.&lt;br /&gt;
 pkg_add postgresqlNN-server&lt;br /&gt;
Get the version number to match the client installed for pqxx.&lt;br /&gt;
&lt;br /&gt;
Now follow the instructions:&lt;br /&gt;
* copy /usr/pkg/share/examples/rc.d/pgsql to /etc/rc.d/pgsql&lt;br /&gt;
* chmod 555 /etc/rc.d/pgsql&lt;br /&gt;
* append pgsql=YES to /etc/rc.conf&lt;br /&gt;
&lt;br /&gt;
== Database Setup ==&lt;br /&gt;
&lt;br /&gt;
=== NetBSD pkgsrc ===&lt;br /&gt;
&lt;br /&gt;
Copy moss_uuidgen.so to /usr/pkg/lib/postgresql/&lt;br /&gt;
&lt;br /&gt;
The database user is &amp;lt;tt&amp;gt;pgsql&amp;lt;/tt&amp;gt;. It has root access to the DB by default.&lt;br /&gt;
Connect from localhost (the default).&lt;br /&gt;
&lt;br /&gt;
Create the database:&lt;br /&gt;
 su -m pgsql -c &amp;quot;psql postgres&amp;quot;&lt;br /&gt;
 create database moss with encoding='UTF8';&lt;br /&gt;
 \c moss&lt;br /&gt;
 create role moss with login;&lt;br /&gt;
 \q&lt;br /&gt;
 su -m pgsql -c &amp;quot;psql postgres -f moss.sql&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Then set db_user=moss in moss_backend.cfg.&lt;br /&gt;
&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
&lt;br /&gt;
[[Category:MOSS]]&lt;/div&gt;</summary>
		<author><name>A'moaca'</name></author>
	</entry>
	<entry>
		<id>https://wiki.openuru.org/index.php?title=MOSS/Setup&amp;diff=960</id>
		<title>MOSS/Setup</title>
		<link rel="alternate" type="text/html" href="https://wiki.openuru.org/index.php?title=MOSS/Setup&amp;diff=960"/>
		<updated>2011-04-04T06:39:30Z</updated>

		<summary type="html">&lt;p&gt;A'moaca': &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MOSS currently only runs on Unix. Not Windows. It ought to work on Mac OS/X&lt;br /&gt;
(even PowerPC) but nobody has tried yet.&lt;br /&gt;
&lt;br /&gt;
Please also see the&lt;br /&gt;
[http://foundry.openuru.org/fisheye/browse/MOSS/doc/setup main setup instructions].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Compile ==&lt;br /&gt;
&lt;br /&gt;
=== Prerequisites ===&lt;br /&gt;
&lt;br /&gt;
Before you start, you need to ensure you have the following:&lt;br /&gt;
* pthreads (almost certainly installed already)&lt;br /&gt;
* libiconv (almost certainly installed already)&lt;br /&gt;
* OpenSSL (also almost certainly installed) -- you need both the libraries and the development headers if that's separate (I'm looking at you, Debian)&lt;br /&gt;
* Zlib (also probably installed) -- both the library and the development stuff if separate&lt;br /&gt;
* PostgreSQL -- both the sever and client, plus any development packages&lt;br /&gt;
* libpqxx -- both the library and the development package&lt;br /&gt;
* gcc, g++, whatever all you need for compiling C++&lt;br /&gt;
&lt;br /&gt;
If you are compiling from a clone of an Hg respository and there is no &lt;br /&gt;
&amp;quot;configure&amp;quot; script, you also need the autotools:&lt;br /&gt;
* autoconf&lt;br /&gt;
* automake&lt;br /&gt;
* libtool&lt;br /&gt;
&lt;br /&gt;
'''If you are reading this, please go over to'''&lt;br /&gt;
[[MOSS-Distribution_Specific_Instructions]] '''and fill in how to install all&lt;br /&gt;
that on YOUR distribution/OS. Thank you!'''&lt;br /&gt;
&lt;br /&gt;
=== configure ===&lt;br /&gt;
&lt;br /&gt;
If you don't have a &amp;quot;configure&amp;quot; file, it must be generated. Run the&lt;br /&gt;
&amp;quot;bootstrap.sh&amp;quot; script to create it.&lt;br /&gt;
&lt;br /&gt;
Run &amp;quot;./configure&amp;quot;. The configure script takes many options. For a full listing&lt;br /&gt;
run &amp;quot;./configure --help&amp;quot;. The default options set up the server to match the&lt;br /&gt;
way Cyan's works. Here are the options you are probably interested in:&lt;br /&gt;
; --prefix&lt;br /&gt;
: Specify where &amp;quot;make install&amp;quot; places the files. If you are using a non-typical location you may need to add ''prefix''/lib to your LDFLAGS or something.&lt;br /&gt;
; &amp;lt;span id=&amp;quot;ackless&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;--enable-fast-download&lt;br /&gt;
: During auth file downloads, Cyan's server waits for the client to acknowledge every 32k of data sent. I believe this was to fix the &amp;quot;zero seconds remaining&amp;quot; bug. MOSS does not have that bug. Use --enable-fast-download to configure the server to send data as fast as it can, thereby using all the bandwidth available.&lt;br /&gt;
; --disable-single-login&lt;br /&gt;
: If you use this, multiple different avatars on the same account can be logged in at once. Logging into the same avatar will boot the other. Without disabling &amp;quot;single login&amp;quot;, logging into the same account will boot whatever avatar is logged in from that account.&lt;br /&gt;
Other options:&lt;br /&gt;
; --enable-require-secure-download&lt;br /&gt;
: Boot users who don't download Python.pak.&lt;br /&gt;
; --enable-encryption=type&lt;br /&gt;
: The default is &amp;quot;cyan_dh&amp;quot;. MOSS allows you to disable encryption, or (legacy) use [[MOSS-Notes#RSA | RSA ]].&lt;br /&gt;
; --enable-fork&lt;br /&gt;
: The primary use for this is if you need to debug auth or file servers. It is much easier to debug single-threaded programs.&lt;br /&gt;
; --enable-debug&lt;br /&gt;
: Anyone developing MOSS or willing to run some extra bug-hunting code should use this. If the bug-hunting code finds a bad thing it will make the server dump core so you can debug it.&lt;br /&gt;
; --enable-old-protocol&lt;br /&gt;
: This makes MOSS use older protocol versions. You probably don't need this.&lt;br /&gt;
If you have any trouble with configure finding the locations of various&lt;br /&gt;
libraries, you can use these:&lt;br /&gt;
; --with-postgres=PREFIX&lt;br /&gt;
; --with-libpqxx=PREFIX&lt;br /&gt;
; --with-openssl=PREFIX&lt;br /&gt;
; --with-zlib=PREFIX&lt;br /&gt;
; --with-iconv=PREFIX&lt;br /&gt;
&lt;br /&gt;
=== Compile ===&lt;br /&gt;
&lt;br /&gt;
Run &amp;quot;make&amp;quot;. Assuming that succeeds, you probably should use &amp;quot;make install&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Now cd into the postgresql directory. Here you need to compile a custom&lt;br /&gt;
PostgreSQL module that creates UUIDs. Follow the instructions in the README&lt;br /&gt;
file there, but for most people this should just be running &amp;quot;make&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Install the postgres module in your postgres install. Do this by copying the&lt;br /&gt;
moss_uuidgen.so file you just compiled. You'll need to log in as root to do&lt;br /&gt;
this (&amp;quot;sudo cp moss_uuidgen.so /path/to/postgres/modules&amp;quot; on most&lt;br /&gt;
systems). Please check [[MOSS-Distribution_Specific_Instructions]] and fill in&lt;br /&gt;
where to copy it for your system if it's not there already. Consult PostgreSQL&lt;br /&gt;
documentation if you're not sure. After the library is installed, restart the&lt;br /&gt;
DB server.&lt;br /&gt;
&lt;br /&gt;
== Set Up the Database ==&lt;br /&gt;
&lt;br /&gt;
The easiest way to set up the database is to create a &amp;quot;moss&amp;quot; user to be&lt;br /&gt;
associated with the MOSS database. It needs to be able to modify tables in the&lt;br /&gt;
MOSS DB. Most distributions create some user that has root access to the DB&lt;br /&gt;
when connecting from the local machine. In my example this user is &amp;quot;pgsql&amp;quot; but&lt;br /&gt;
yours may be different. Please check&lt;br /&gt;
[[MOSS-Distribution_Specific_Instructions]] for hints or to fill in the user&lt;br /&gt;
for your distribution.&lt;br /&gt;
&lt;br /&gt;
Start by creating the database. The default database name is &amp;quot;moss&amp;quot;; if you use&lt;br /&gt;
any other you'll have to set it in the MOSS&lt;br /&gt;
[[#Configuration_Files | configuration file]]. Make sure to use the 'UTF8'&lt;br /&gt;
encoding. Then create the user in the new database. If you want to use a&lt;br /&gt;
different username, you will have to edit the moss.sql file to match. Then load&lt;br /&gt;
postgresql/moss.sql into the new database.&lt;br /&gt;
&lt;br /&gt;
I did the following:&lt;br /&gt;
 su pgsql -c &amp;quot;psql postgres&amp;quot;&lt;br /&gt;
 create database moss with encoding='UTF8';&lt;br /&gt;
 \c moss&lt;br /&gt;
 create role moss with login;&lt;br /&gt;
 \q&lt;br /&gt;
 su pgsql -c &amp;quot;psql postgres -f moss.sql&amp;quot;&lt;br /&gt;
After this, you can connect to the database as the &amp;quot;moss&amp;quot; user:&lt;br /&gt;
 pgql -U moss&lt;br /&gt;
&lt;br /&gt;
If all that works, you are done setting up the database!&lt;br /&gt;
&lt;br /&gt;
To set up AllAgeGlobalSDLNodes, use global_sdl_manager (we have no VaultManager&lt;br /&gt;
to do it). This program is installed in ''prefix''/bin. To aid setup, the&lt;br /&gt;
support/set_to_moul.txt file can be used to set the global SDL state to a&lt;br /&gt;
reasonable default (with no sparks) by running something like:&lt;br /&gt;
 global_sdl_manager game/SDL &amp;lt; set_to_moul.txt&lt;br /&gt;
If you want sparks, you can turn them on yourself using this program, but the&lt;br /&gt;
Minkata one is still broken.&lt;br /&gt;
&lt;br /&gt;
== Set Up Files ==&lt;br /&gt;
&lt;br /&gt;
There are quite a few files that the server needs to use. All these files are&lt;br /&gt;
located by default in locations relative to where you will *start* the&lt;br /&gt;
server. The location of all the files can be configured in the&lt;br /&gt;
[[#Configuration_Files | configuration files]]; you may find it easiest to&lt;br /&gt;
specify absolute paths (starting with &amp;quot;/&amp;quot;) there.&lt;br /&gt;
&lt;br /&gt;
=== File Server Data ===&lt;br /&gt;
&lt;br /&gt;
You need to start with your current Uru install (MOULagain, presumably). This&lt;br /&gt;
procedure assumes you can run a Windows application to create the file server&lt;br /&gt;
manifets MOSS needs. This seems a reasonable assumption when the client itself&lt;br /&gt;
is a Windows app.&lt;br /&gt;
&lt;br /&gt;
Copy support/ManifestCreator.exe and support/Mainfests.zip to your Windows&lt;br /&gt;
install. Unzip Manifests.zip. This will make a &amp;quot;CyanStructure&amp;quot; folder. The .txt&lt;br /&gt;
files in this folder are input. They describe the files which need to be in the&lt;br /&gt;
final manifests.&lt;br /&gt;
&lt;br /&gt;
Start up ManifestCreator. To generate a manifest, click &amp;quot;Make Manifest&amp;quot; and it&lt;br /&gt;
brings up a dialog. Navigate to the CyanStructure folder, and select all the&lt;br /&gt;
.txt files there. Then click OK and when it pops up a dialog asking for the&lt;br /&gt;
location of your Uru install, navigate to that directory, click OK and wait for&lt;br /&gt;
a bit.&lt;br /&gt;
&lt;br /&gt;
When it is done stop and consider which files you need the file server to&lt;br /&gt;
actually give to clients. If you are making this shard for yourself it could be&lt;br /&gt;
basically nothing, or everything. Note that we do not have a license to&lt;br /&gt;
redistribute Cyan's data files. So it is recommended not to copy any files you&lt;br /&gt;
should not distribute to your file server.&lt;br /&gt;
&lt;br /&gt;
Back on the machine which will run MOSS, create a file server directory. The&lt;br /&gt;
default is &amp;quot;./file&amp;quot; (relative to where you start it up). I recommend you make&lt;br /&gt;
it ''prefix''/file, where ''prefix'' is the installed location. Copy all the&lt;br /&gt;
.mbm files created in the CyanStructure folder to this directory. If you are&lt;br /&gt;
serving up a CWE client (built from open source) you will want to copy the&lt;br /&gt;
gzipped executable and libraries. They are located in&lt;br /&gt;
CyanStructure\Client\External and need to be in ''file dir''/Client/External on&lt;br /&gt;
your server to match. Anything you can distribute and that clients will need to&lt;br /&gt;
download, like a new age, also should be copied. Make sure to match the&lt;br /&gt;
directory structures when copying them over.&lt;br /&gt;
&lt;br /&gt;
Finally, Mac clients request the &amp;quot;macExternal&amp;quot; manifest instead of&lt;br /&gt;
&amp;quot;External&amp;quot;. There are added files in the Mac manifest, but if you don't have&lt;br /&gt;
them to generate a proper manifest from, just copy or symlink External.mbm to&lt;br /&gt;
macExternal.mbm. If you do have the files, you can generate the proper manifest&lt;br /&gt;
using ManifestCreator.exe and the support/macExternal.txt file.&lt;br /&gt;
&lt;br /&gt;
=== Auth Server Data ===&lt;br /&gt;
&lt;br /&gt;
Like for the file server data, the default auth directory is &amp;quot;./auth&amp;quot; (relative&lt;br /&gt;
to where you start it up). I recommend using ''prefix''/auth.&lt;br /&gt;
&lt;br /&gt;
A script automating all the following steps in this section is in the works.&lt;br /&gt;
&lt;br /&gt;
This directory is required to have another subdirectory named &amp;quot;default&amp;quot;. You&lt;br /&gt;
must keep a copy here of the encrypted Python and SDL files for clients to&lt;br /&gt;
download. The easiest way to get a set of these files is from the Cyan-provided&lt;br /&gt;
[http://assets.openuru.org/cyan/AuthFiles.zip AuthFiles.zip]. Download this&lt;br /&gt;
file, and unzip it. Copy the entire contents of the resulting AuthFiles/893&lt;br /&gt;
directory to ''auth dir''/default/. The resulting directory structure is:&lt;br /&gt;
 auth&lt;br /&gt;
   default&lt;br /&gt;
     Python&lt;br /&gt;
       python.pak&lt;br /&gt;
     SDL&lt;br /&gt;
       various .sdl files&lt;br /&gt;
     encryption.key&lt;br /&gt;
&lt;br /&gt;
Now you have to make manifest files here as well. Make a Python.txt file which&lt;br /&gt;
contains one line: &amp;quot;Python\python.pak&amp;quot;. Make an SDL.txt file with contains one&lt;br /&gt;
line per file in the SDL directory. The lines look like&lt;br /&gt;
&amp;quot;SDL\BaronCityOffice.sdl&amp;quot;. I just toss these in the auth/default directory but&lt;br /&gt;
you don't have to. The server does not look at them.&lt;br /&gt;
&lt;br /&gt;
If you have user-created ages with SDL files, be sure to add them to the SDL&lt;br /&gt;
directory here. Encrypt them with the encryption.key. (A tool to do this does&lt;br /&gt;
exist in the CWE source.) Similarly, if you want to add Python, you can rebuild&lt;br /&gt;
the Python.pak file, but if you are adding a new age, you may find it easier to&lt;br /&gt;
add a new .pak file. If you do that, encrypt it and then add a new line to the&lt;br /&gt;
Python.txt file for your new .pak. The client will download them all.&lt;br /&gt;
&lt;br /&gt;
Once you have listed each SDL and Python file, you can use the perl script&lt;br /&gt;
support/make-mbam.pl to create the .mbam files. If you don't have Perl,&lt;br /&gt;
ManifestCreator.exe will also create the files. Select &amp;quot;Auth Server&amp;quot; in the&lt;br /&gt;
&amp;quot;Manifest type&amp;quot; dropdown. If you use ManifestCreator, make sure it has the&lt;br /&gt;
Python and SDL directories and their contents. Make sure to copy the resulting&lt;br /&gt;
two .mbam files to your ''auth-dir''/default directory.&lt;br /&gt;
&lt;br /&gt;
=== Game Server Data ===&lt;br /&gt;
&lt;br /&gt;
Just like for the file and auth server data, the default game directory is&lt;br /&gt;
&amp;quot;./game&amp;quot; (relative to where you start it up). I recommend using&lt;br /&gt;
''prefix''/game.&lt;br /&gt;
&lt;br /&gt;
A script automating all the following steps in this section is in the works.&lt;br /&gt;
&lt;br /&gt;
The game servers need unencrypted .sdl and .age files. The easiest way to get a&lt;br /&gt;
set of these files is from the Cyan-provided&lt;br /&gt;
[http://assets.openuru.org/cyan/Scripts.zip Scripts.zip]. Download this file&lt;br /&gt;
and unzip it. Copy/move the Scripts/SDL directory to ''game-dir''. Then create&lt;br /&gt;
''game-dir''/age and copy Scripts/dat/*.age to it. (MOSS does not use the .fni&lt;br /&gt;
files.)&lt;br /&gt;
&lt;br /&gt;
Do not forget to copy any user-created ages' SDL and .age files here. This copy&lt;br /&gt;
needs to be unencrypted.&lt;br /&gt;
&lt;br /&gt;
Now there is one more step. The SDL files the game serer uses need to be moved&lt;br /&gt;
around, some into subdirectories, and some renamed because Unix treats file&lt;br /&gt;
names case-sensitively. Please read the details in the doc/setup file (linked&lt;br /&gt;
at the top of this page). You should have three subdirectories when you're&lt;br /&gt;
done. User-created ages may need subdirectories too, if they have multiple .sdl&lt;br /&gt;
files. If you find this way too complex, just move all the .sdl files into&lt;br /&gt;
the common subdirectory. You lose some small optimizations this way.&lt;br /&gt;
&lt;br /&gt;
At the end the directory structure should be:&lt;br /&gt;
 game&lt;br /&gt;
   age&lt;br /&gt;
     various .age files&lt;br /&gt;
   SDL&lt;br /&gt;
     common&lt;br /&gt;
       some .sdl files&lt;br /&gt;
     Garrison&lt;br /&gt;
       a couple of .sdl files&lt;br /&gt;
     Teledahn&lt;br /&gt;
       other .sdl files&lt;br /&gt;
     more .sdl files&lt;br /&gt;
&lt;br /&gt;
== Key Files ==&lt;br /&gt;
&lt;br /&gt;
The modified Diffie-Helman algorithm used in the client and MOSS by default&lt;br /&gt;
requires the server to have private keys. '''Do not share them with anyone.'''&lt;br /&gt;
They should not be world-readable.&lt;br /&gt;
&lt;br /&gt;
You can generate keys using the &amp;quot;make_cyan_dh&amp;quot; program which will be installed&lt;br /&gt;
in ''prefix''/bin. Or, there might be a program to generate keys in the CWE&lt;br /&gt;
source, but the chance of it outputting the private keys in the format MOSS&lt;br /&gt;
wants is basically zero. Generate a key for each of auth, game, and&lt;br /&gt;
gatekeeper. Run &amp;quot;make_cyan_dh -h&amp;quot; to see what generators to use if you want to&lt;br /&gt;
match those MOULagain is using. If you're building your own client you can use&lt;br /&gt;
whatever generator you want. Note: I see no reason not to use OpenSSL default&lt;br /&gt;
generators such as 2 or 5. In fact, unless you are a cryptographer, I do not&lt;br /&gt;
recommend departing from these. If you are a cryptographer, you probably did&lt;br /&gt;
not need to hear that from me!&lt;br /&gt;
&lt;br /&gt;
The -s and -c options direct the program to write the data for the server and&lt;br /&gt;
client to files, respectively, e.g.:&lt;br /&gt;
 make_cyan_dh -g 2 -s auth_key.der -c auth_key.bin&lt;br /&gt;
&lt;br /&gt;
If you're compiling a CWE client, make_cyan_dh does not currently output data&lt;br /&gt;
in that format. See [https://foundry.openuru.org/jira/browse/MOSS-3 the bug]&lt;br /&gt;
for the workaround. If you're not compiling a client, it's up to you what to do&lt;br /&gt;
with the .bin file.&lt;br /&gt;
&lt;br /&gt;
Take the .der file (contains the PRIVATE key) and move it to ''prefix''. I&lt;br /&gt;
suggest using ''prefix''/etc/auth_key.der. Make it readable only by the user&lt;br /&gt;
which will be running the server: &amp;quot;chmod 400 ''prefix''/etc/auth_key.der; chown&lt;br /&gt;
mossuser ''prefix''/etc/auth_key.der&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Do the same for the game and gatekeeper keys. ''prefix''/etc/game_key.der and&lt;br /&gt;
''prefix''/etc/gatekeeper_key.der.&lt;br /&gt;
&lt;br /&gt;
== Configuration Files ==&lt;br /&gt;
&lt;br /&gt;
Now that you have all the other files set up, it's time to configure MOSS&lt;br /&gt;
itself. There is a configuration file for each server process. The default&lt;br /&gt;
location for moss_backend is ./etc/moss_backend.cfg and the default&lt;br /&gt;
location for moss is ./etc/moss.cfg. I recommend copying main.cfg to&lt;br /&gt;
''prefix''/etc/moss.cfg and backend.cfg to ''prefix''/etc/moss_backend.cfg.&lt;br /&gt;
&lt;br /&gt;
Now open each up in your text editor. The files contain instructions for how to&lt;br /&gt;
set the various options.&lt;br /&gt;
&lt;br /&gt;
I recommend you set the following in moss.cfg to the absolute paths&lt;br /&gt;
corresponding to where you installed these files in earlier steps:&lt;br /&gt;
&amp;lt;tt&amp;gt;auth_download_dir&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;auth_key_file&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;file_download_dir&amp;lt;/tt&amp;gt;,&lt;br /&gt;
&amp;lt;tt&amp;gt;game_data_dir&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;game_key_file&amp;lt;/tt&amp;gt;,&lt;br /&gt;
&amp;lt;tt&amp;gt;gatekeeper_key_file&amp;lt;/tt&amp;gt;. In addition I recommend you set &amp;lt;tt&amp;gt;log_dir&amp;lt;/tt&amp;gt;&lt;br /&gt;
to somewhere you want log files to go. Remember the log directory has to be&lt;br /&gt;
writable by the user that will run the server. You may also need to set&lt;br /&gt;
&amp;lt;tt&amp;gt;pid_file&amp;lt;/tt&amp;gt; to a location writable by that user. If you want the .pid&lt;br /&gt;
file to be created. Read through all the options to make sure your setup is as&lt;br /&gt;
you want. The only mandatory configuration directive is&lt;br /&gt;
&amp;lt;tt&amp;gt;external_address&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For moss_backend.cfg look especially into &amp;lt;tt&amp;gt;log_dir&amp;lt;/tt&amp;gt; and&lt;br /&gt;
&amp;lt;tt&amp;gt;pid_file&amp;lt;/tt&amp;gt;. In addition, depending on how your DB is&lt;br /&gt;
[[#Set_Up_the_Database | set up]] you likely need to specify &amp;lt;tt&amp;gt;db_user&amp;lt;/tt&amp;gt;,&lt;br /&gt;
and maybe other DB parameters.&lt;br /&gt;
&lt;br /&gt;
== Security Considerations ==&lt;br /&gt;
&lt;br /&gt;
'''Please''' read about them at the end of&lt;br /&gt;
[http://foundry.openuru.org/fisheye/browse/MOSS/doc/setup doc/setup].&lt;br /&gt;
&lt;br /&gt;
Do not run MOSS as root.&lt;br /&gt;
&lt;br /&gt;
== Before You Open Your Server ==&lt;br /&gt;
&lt;br /&gt;
If you plan to let anyone other than you connect to your server, you have&lt;br /&gt;
certain obligations under the licenses of the software/data you will be&lt;br /&gt;
distributing from the file and auth servers.&lt;br /&gt;
&lt;br /&gt;
* The MOULagain EULA still does not provide for you to modify and redistribute the files. So do not put original or modified Cyan files on your file server. You can still have them listed in the .mbm (manifest) files. If someone has an incomplete install they will be forced to get the files from Cyan's file server. That is as yet still the only place from which you're supposed to get those files.&lt;br /&gt;
&lt;br /&gt;
* You are supplying GPL'd Python code. You must provide a way to acquire that code. If you are using unmodified Python you can link to the [http://assets.openuru.org/cyan/Scripts.zip original source]. If you modify it for any reason, you must make your changes available.&lt;br /&gt;
&lt;br /&gt;
* If you are providing client executables from a CWE build:&lt;br /&gt;
** You must add the GPL license file to the client install. This means you'll have to add it to ThinExternal.txt and generate a new .mbm file, copying the .mbm file and LICENSE.txt.gz over to the appropriate locations.&lt;br /&gt;
** You must provide a way to acquire the source for your client. If you use an unmodified version you should be able to link to the repository (make sure you point to the changeset you used). If you modify files for your shard's public keys, status hostname, and/or gatekeeper/auth addresses, you have to additionally provide that source. Note: these are ''public'' keys, so don't worry, you're not giving anything away.&lt;br /&gt;
** Unless someone changes the jpeg library again, you need to credit IJG for jpeglib. The easiest may be to add another file doing so to the install. Or, if you are modifying Python for some reason, you could add it to the in-game credits along with all the other licenses:&lt;br /&gt;
 xUruCreditsJournalEnglish.py&lt;br /&gt;
 xUruCreditsJournalFrench.py&lt;br /&gt;
 xUruCreditsJournalGerman.py&lt;br /&gt;
 xUruCreditsJournalItalian.py&lt;br /&gt;
 xUruCreditsJournalSpanish.py&lt;br /&gt;
&lt;br /&gt;
The links or whatever means you use to provide access to the source of the&lt;br /&gt;
binaries and Python don't have to go into the client install, but they must be&lt;br /&gt;
somewhere reasonable for your users to find. I would put links to a copy of the&lt;br /&gt;
files on your shard's home page or something.&lt;br /&gt;
&lt;br /&gt;
See also [[CyanWorlds.com_Engine/FAQ#What_are_my_open_source_license_.28GPLv3.29_responsibilities_as_a_user.2C_developer_or_server_operator_.28e.g._shard_owner.29.3F | the CWE FAQ]].&lt;br /&gt;
&lt;br /&gt;
Please do not consider this advice the final or complete word on the&lt;br /&gt;
matter. All the licenses of all the data you use expect you to follow them. So&lt;br /&gt;
you have to do your due diligence. If you find something obviously missing from&lt;br /&gt;
this section, please add it!&lt;br /&gt;
&lt;br /&gt;
== Start It Up ==&lt;br /&gt;
&lt;br /&gt;
Now you should be set to run your server. Hopefully someone will contribute a&lt;br /&gt;
nice startup script. For now, cd to the directory you planned from the start to&lt;br /&gt;
start the server from (that's ''prefix'' in the earlier recommendations). Make&lt;br /&gt;
sure you are su'd to the user you want to run as. '''NOT root!''' Start&lt;br /&gt;
moss_backend first, then moss. E.g., if you have put the config files in&lt;br /&gt;
''prefix''/etc, you can just do:&lt;br /&gt;
 bin/moss_backend&lt;br /&gt;
 bin/moss&lt;br /&gt;
You can instead specify the location of the config file with the -c option.&lt;br /&gt;
If you've used absolute paths in the config files, you can thus easily run&lt;br /&gt;
the server from any directory.&lt;br /&gt;
&lt;br /&gt;
== Create Accounts ==&lt;br /&gt;
&lt;br /&gt;
Don't forget to create accounts for your users, or it will be difficult to log&lt;br /&gt;
in... Please just refer directly to &lt;br /&gt;
[http://foundry.openuru.org/fisheye/browse/MOSS/doc/user-management doc/user-management].&lt;br /&gt;
&lt;br /&gt;
Hopefully someone will contribute a script to add users. A CGI script to&lt;br /&gt;
automatically add users would be neat too.&lt;br /&gt;
&lt;br /&gt;
== More Hints ==&lt;br /&gt;
&lt;br /&gt;
Please see the following for more information of interest to running a server.&lt;br /&gt;
&lt;br /&gt;
* [[MOSS-Notes]]&lt;br /&gt;
* [http://foundry.openuru.org/fisheye/browse/MOSS/doc/running doc/running]&lt;br /&gt;
&lt;br /&gt;
[[Category:MOSS]]&lt;/div&gt;</summary>
		<author><name>A'moaca'</name></author>
	</entry>
	<entry>
		<id>https://wiki.openuru.org/index.php?title=MOSS&amp;diff=959</id>
		<title>MOSS</title>
		<link rel="alternate" type="text/html" href="https://wiki.openuru.org/index.php?title=MOSS&amp;diff=959"/>
		<updated>2011-04-04T06:39:04Z</updated>

		<summary type="html">&lt;p&gt;A'moaca': &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MOSS is a unix-based server for the Myst Online: Uru Live client. Development&lt;br /&gt;
began after the announcement of the shutdown of MOUL. It is complete enough to&lt;br /&gt;
play the entire game, supports multiplayer use, is licensed under GPLv3, and is&lt;br /&gt;
not ported to Windows.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
MOSS was developed by a'moaca' and cjkelly1. a'moaca' wrote all the C/C++ code,&lt;br /&gt;
and cjkelly1 wrote most of the SQL code, including doing research to determine&lt;br /&gt;
how to set up the vault. cjkelly1 wrote a tool to create the manifest files&lt;br /&gt;
required by the server, and also made the invaluable contribution of a lot of&lt;br /&gt;
testing over the years. Weldergeek helped with some of the multiplayer testing,&lt;br /&gt;
especially Heek. a'moaca' sincerely hopes there will be more contributors now&lt;br /&gt;
that MOSS is released.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Why Use MOSS? ==&lt;br /&gt;
&lt;br /&gt;
If you just want to host a private shard, MOSS should serve your purposes. Do&lt;br /&gt;
be sure to consult [[MOSS-Setup#Before You Open Your Server]] for some help on&lt;br /&gt;
what you need to do if you host an Uru shard.&lt;br /&gt;
&lt;br /&gt;
The server definitely works with the [[CyanWorlds.com_Engine | CWE client]]! If&lt;br /&gt;
you are thinking of doing client development you will probably find a server&lt;br /&gt;
that is not MOULagain to test with quite valuable. (MOSS was also tested with&lt;br /&gt;
PlasmaClient, but it does not fully work for PlasmaClient because it does some&lt;br /&gt;
things that a'moaca' argues are bugs from the system perspective. Let's fix&lt;br /&gt;
PlasmaClient.)&lt;br /&gt;
&lt;br /&gt;
The server has some features meant to help make it a little easier to test ages&lt;br /&gt;
you are creating. The SDL files for an age are loaded each time the age is&lt;br /&gt;
started up so you can change them without restarting MOSS. There is full&lt;br /&gt;
support for multiple .pak files. So, run your own server, test at your own&lt;br /&gt;
pace. Test in the CWE client and not the PotS one.&lt;br /&gt;
&lt;br /&gt;
== How to Get It ==&lt;br /&gt;
&lt;br /&gt;
{{tba}}&lt;br /&gt;
&lt;br /&gt;
The source code is hosted in a Mercurial repository here at OpenUru.org.&lt;br /&gt;
You can clone (download) a copy of the repository using Mercurial, or you can&lt;br /&gt;
use a snapshot. If you are considering making changes to the code, you will&lt;br /&gt;
probably prefer using the version control. If you just want to compile and run&lt;br /&gt;
a server, a snapshot should do. In addition, a compiled version is&lt;br /&gt;
available for the TBD platform.&lt;br /&gt;
&lt;br /&gt;
If you are new to Mercurial, you may want to check the&lt;br /&gt;
[http://mercurial.selenic.com/wiki/QuickStart QuickStart]. There are links to&lt;br /&gt;
more complete documentation at the bottom. The Foundry is secured via SSL&lt;br /&gt;
throughout the site. A browser security certificate is needed. Instructions are&lt;br /&gt;
available on the [[Foundry_Certificate_Installation | certificate installation&lt;br /&gt;
page]].&lt;br /&gt;
&lt;br /&gt;
'''Repository address:''' https://foundry.openuru.org/hg/MOSS&lt;br /&gt;
&lt;br /&gt;
'''Snapshot location:''' TBD&lt;br /&gt;
&lt;br /&gt;
'''Binary package:''' TBD&lt;br /&gt;
&lt;br /&gt;
== How to Set Up a Server ==&lt;br /&gt;
&lt;br /&gt;
The [http://foundry.openuru.org/fisheye/browse/MOSS/doc/setup setup] file&lt;br /&gt;
contains a complete set of installation instructions. They do assume you are&lt;br /&gt;
conversant with setting up software and basic management of a database. For&lt;br /&gt;
additional setup instructions, see [[MOSS-Setup]]. Feel free to add any hints&lt;br /&gt;
specific to your distribution [[MOSS-Distribution_Specific_Instructions | here]].&lt;br /&gt;
&lt;br /&gt;
Cyan has provided a copy of the files needed for a server hosting MOUL content.&lt;br /&gt;
The .sdl, .age, and Python source are all available at&lt;br /&gt;
http://assets.openuru.org/cyan/Scripts.zip. If you are not interested in&lt;br /&gt;
compiling your own Python from this source, you can also get a copy of the&lt;br /&gt;
compiled Python from http://assets.openuru.org/cyan/AuthFiles.zip.&lt;br /&gt;
&lt;br /&gt;
== How to Contribute ==&lt;br /&gt;
&lt;br /&gt;
Contributing to the wiki pages is welcome. Adding extra setup instructions, or&lt;br /&gt;
adding documentation about how MOSS works, are two good examples. It's a wiki,&lt;br /&gt;
please contribute anything you think others might want to read.&lt;br /&gt;
&lt;br /&gt;
Almost any code contribution is welcome. What is unwelcome? Protocol/behavior&lt;br /&gt;
changes without corresponding client support (obviously). Changes that remove&lt;br /&gt;
security without the option of keeping it. Changes that introduce security&lt;br /&gt;
holes, either in the server itself or the vault. Changes that break big-endian&lt;br /&gt;
support (call it a pet peeve if you like, it's still unwelcome). Changes that&lt;br /&gt;
break the build (accidents do happen, but don't break it on purpose). Hopefully&lt;br /&gt;
it is not difficult to see why these things are unwelcome.&lt;br /&gt;
&lt;br /&gt;
If you find a bug, please report it. Please, please, please search first to see&lt;br /&gt;
if it's already reported. The bug tracker is here:&lt;br /&gt;
https://foundry.openuru.org/jira/browse/MOSS&lt;br /&gt;
&lt;br /&gt;
If you find a bug and fix it, include the patch with the bug report! This&lt;br /&gt;
increases the chances of it getting fixed rather a lot.&lt;br /&gt;
&lt;br /&gt;
Bug fixes are very valuable.&lt;br /&gt;
[https://foundry.openuru.org/jira/browse/MOSS Grab a bug] and fix it! Check&lt;br /&gt;
out [[MOSS-Project_Ideas]] for more ideas.&lt;br /&gt;
&lt;br /&gt;
If you want to add a feature or change something, you can file a feature&lt;br /&gt;
request or task bug to get your change considered for the&lt;br /&gt;
[https://foundry.openuru.org/hg/MOSS central repository].&lt;br /&gt;
&lt;br /&gt;
If you want write access to the central repository, contribute. I think the&lt;br /&gt;
best for MOSS will be to use similar standards for determining who is given&lt;br /&gt;
write access as CWE. At this time that's undecided, so I leave MOSS equally&lt;br /&gt;
undecided. However, MOSS's original author is more involved than CWE's so if&lt;br /&gt;
only a couple people show up to help then it's pretty clear a couple people&lt;br /&gt;
will get write access soon enough!&lt;br /&gt;
&lt;br /&gt;
Code reviewers might be needed. If you are willing to be a reviewer, say so! It&lt;br /&gt;
is a very valuable contribution.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
[[MOSS-Setup]]&lt;br /&gt;
&lt;br /&gt;
[[MOSS-Developer_Notes]]&lt;br /&gt;
&lt;br /&gt;
[[CyanWorlds.com_Engine]]&lt;br /&gt;
&lt;br /&gt;
[[Category:MOSS]]&lt;/div&gt;</summary>
		<author><name>A'moaca'</name></author>
	</entry>
	<entry>
		<id>https://wiki.openuru.org/index.php?title=MOSS/Project_Ideas&amp;diff=958</id>
		<title>MOSS/Project Ideas</title>
		<link rel="alternate" type="text/html" href="https://wiki.openuru.org/index.php?title=MOSS/Project_Ideas&amp;diff=958"/>
		<updated>2011-04-04T06:36:52Z</updated>

		<summary type="html">&lt;p&gt;A'moaca': Created page with &amp;quot;The initial list was generated over the lengthy period of MOSS's initial development. These project ideas mostly cover missing functionality. None of the missing functionality is...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The initial list was generated over the lengthy period of MOSS's initial&lt;br /&gt;
development. These project ideas mostly cover missing functionality. None of&lt;br /&gt;
the missing functionality is known to cause gameplay issues so these did not&lt;br /&gt;
really seem like bugs. These ideas are grouped by general type of change&lt;br /&gt;
required, and sort of by increasing approximate difficulty level and sort of by&lt;br /&gt;
decreasing value.&lt;br /&gt;
&lt;br /&gt;
Bigger ideas, such as entirely new functionality now made possible by the&lt;br /&gt;
release of the client, could go here too. Be realistic, though. Remember that&lt;br /&gt;
protocol changes are not to be made lightly, because it causes an&lt;br /&gt;
incompatibility problem. It is probably better to propose large changes in&lt;br /&gt;
discussion format on the forums. Do not ''expect'' someone else to take up and&lt;br /&gt;
implement your proposal.&lt;br /&gt;
&lt;br /&gt;
The whole idea of this list is to provide some ideas for anyone wishing to dive&lt;br /&gt;
into MOSS. Sometimes a little direction helps.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Fix bugs ==&lt;br /&gt;
&lt;br /&gt;
The bug tracker is here: https://foundry.openuru.org/jira/browse/MOSS&lt;br /&gt;
&lt;br /&gt;
== Detail work (little Uru-specific knowledge required) ==&lt;br /&gt;
&lt;br /&gt;
* Try disabling the Nagle algorithm on sockets. This should result in less latency to the client when small messages are involved. Make sure to test the whole game thoroughly.&lt;br /&gt;
&lt;br /&gt;
* Figure out and implement a good way to use autoconf to compile in default pathnames. This would apply to the default config file, key file, moss_serv binary, and log/auth/game/file directory locations. The idea is if I say --prefix=/foo the defaults become /foo/etc/moss.cfg and so forth instead of ./etc/moss.cfg. Don't forget autoconf lets you override the etcdir, bindir, etc. separately.&lt;br /&gt;
&lt;br /&gt;
* Treat SDL filenames case-insensitively. This is very annoying in Unix, since it requires using readdir() and strcasecmp() instead of just open().&lt;br /&gt;
&lt;br /&gt;
* Log the PID of all forked servers in moss.log.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span id=&amp;quot;libevent&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;See if we can switch to libevent for inter-thread communication instead of raw signals. This should be fairly portable and take advantage of the different per-OS lightweight signalling mechanisms.&lt;br /&gt;
&lt;br /&gt;
* Allow ''skipping'' overlong messages (messages MOSS thinks are too big). This requires, upon catching the exception, tossing out the message, and if it has not all been read in yet, keeping track of how much more to toss in the future. The RC4 state must be updated too for the tossed message length.&lt;br /&gt;
&lt;br /&gt;
* It would be nice to use atomic operations for refcounts instead of having to use (bigger, slower) mutexes for them. This does make MOSS not architecture-independent, which is part of why I have been resisting it. (See also signal handling next.)&lt;br /&gt;
&lt;br /&gt;
* Signal handlers and the operations to read and reset the values in the main loops should be using atomic operations.&lt;br /&gt;
&lt;br /&gt;
* Catch and handle std::bad_alloc whenever possible.&lt;br /&gt;
&lt;br /&gt;
== Fairly contained changes ==&lt;br /&gt;
&lt;br /&gt;
* Make it so game servers can be forked as separate processes. This helps a lot for debugging and also would help for age development, making it easier to change SDL and retest. Otherwise you have to shut down the whole frontend server or wait out the age's linger time. This work was started but not completed, and that code can be found inside &amp;lt;tt&amp;gt;FORK_GAME_TOO&amp;lt;/tt&amp;gt; #ifdefs. If you do this, I suggest you consider separating &amp;lt;tt&amp;gt;FORK_GAME_TOO&amp;lt;/tt&amp;gt; from &amp;lt;tt&amp;gt;FORK_ENABLE&amp;lt;/tt&amp;gt; so that one could have forked game servers and *not* forked auth/file servers.&lt;br /&gt;
&lt;br /&gt;
* In the getpublicagelist() SQL function, there is a comment about the 50-hood limit. The current code returns the first 50 hoods. We should return the most recently used 50 hoods. The hard part is knowing which those are. This is mostly if not wholly DB/SQL work.&lt;br /&gt;
&lt;br /&gt;
* Age population limits are unimplemented. The value is in the vault, but the server does not look at it.&lt;br /&gt;
&lt;br /&gt;
* Figure out how to throw out clones and SDL when a player leaves the age. Please see the &amp;quot;clean up clone, SDL&amp;quot; section in GameServer::conn_shutdown(). Right now this is full of special cases: it handles the Kemo bugs and and Quabs specially (a different thing for each). It may be that this is required for best behavior, but I still feel like I've missed something despite heavy scrutiny of the data. This is more of a research project and not much of a code project.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span id=&amp;quot;SDL_timestamps&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;MOUL parsed SDL nodes on the way into the vault. It probably only updated the node with fields having the Dirty bit set. In addition it added timestamps to the fields because the client does not put in the timestamps (reasonably so, as its time may be wrong). MOSS currently saves the SDL wholesale. This basically works, but with the timestamps properly added, the game server can merge the vault, age, and global SDL in any order and without strange rules. Note: if you do this, you also need to write a script or some other way to update all the SDL nodes in existing MOSS DBs.&lt;br /&gt;
&lt;br /&gt;
* The kickable SDL filtering algorithm is the same one I put in Alcugs ages ago. It is better than nothing but not as good as Plasma's. You will see more warping of kickables than with Cyan's server. This project is to come up with a better way of deciding what physical SDL to send to all the clients, based on those messages all the clients are sending to the server.&lt;br /&gt;
&lt;br /&gt;
* The server is probably supposed to use RelevanceRegion information to avoid sending SDL updates to clients who don't share a relevance region with the originating client. (The idea being to reduce network traffic, since hopefully the client already avoids rendering/physics on things in irrelevant regions.) Things work if the server doesn't filter, so MOSS doesn't. Also, I do not have strong evidence to believe this supposition is actually correct. Which is the other reason MOSS doesn't do it. Finding out, and implementing it if so, would be a nice project.&lt;br /&gt;
&lt;br /&gt;
* Figure out what the server is supposed to do with plSetNetGroupIDMsg and do it. Right now MOSS just drops it to no apparent ill effect. I am deeply suspicious of this message due to seeing it at aurally unpleasant times in UU. (Old, old notes: &amp;quot;may have to do with infinitely looping scraping noises&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;kCli2Auth_SendFriendInviteRequest&amp;lt;/tt&amp;gt; is not fully supported (it is dropped on the floor).&lt;br /&gt;
&lt;br /&gt;
== Bigger changes ==&lt;br /&gt;
&lt;br /&gt;
* The following messages are unimplemented.&lt;br /&gt;
** &amp;lt;tt&amp;gt;kCli2Auth_VaultSetSeen&amp;lt;/tt&amp;gt;  --  unimplemented in client&lt;br /&gt;
** &amp;lt;tt&amp;gt;kCli2Auth_ScoreDelete&amp;lt;/tt&amp;gt;  --  never saw one, so couldn't implement it&lt;br /&gt;
** &amp;lt;tt&amp;gt;kCli2Auth_ScoreSetPoints&amp;lt;/tt&amp;gt;  --  never saw one, so couldn't implement it&lt;br /&gt;
** &amp;lt;tt&amp;gt;kCli2Auth_ScoreGetRanks&amp;lt;/tt&amp;gt;  --  never saw one, so couldn't implement it&lt;br /&gt;
** &amp;lt;tt&amp;gt;kCli2Csr_PingRequest&amp;lt;/tt&amp;gt;  --  no recorded Csr messages&lt;br /&gt;
** &amp;lt;tt&amp;gt;kCli2Csr_RegisterRequest&amp;lt;/tt&amp;gt;&lt;br /&gt;
** &amp;lt;tt&amp;gt;kCli2Csr_LoginRequest&amp;lt;/tt&amp;gt;&lt;br /&gt;
** &amp;lt;tt&amp;gt;kCsr2Cli_PingReply&amp;lt;/tt&amp;gt;&lt;br /&gt;
** &amp;lt;tt&amp;gt;kCsr2Cli_RegisterReply&amp;lt;/tt&amp;gt;&lt;br /&gt;
** &amp;lt;tt&amp;gt;kCsr2Cli_LoginReply&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Add hood randomization to DRC hoods. Player-created hoods are randomized by the Python in the Nexus when the hood is created. DRC hoods, however, are created by the server. In MOSS's case, they are created entirely by SQL code. So adding DRC hood randomization means noticing when the DB has created a new DRC hood, creating and modifying SDL in the backend, and then finding and modifying the age SDL node for that new hood. All before responding to the client creating the new avatar and thus the new DRC hood.&lt;br /&gt;
&lt;br /&gt;
* The MessageQueue class has a concept of priorities. The idea was to enable dropping of lower-priority messages if a queue to a given client starts to back up. (The lowest priority being voice chat, then avatar movements, with world state changes being highest.) The measurement of queue length or throughput necessary for that is not implemented. So, neither is the dropping. (There is the very beginnings of some if &amp;lt;tt&amp;gt;DO_PRIORITIES&amp;lt;/tt&amp;gt; is #defined.) As such, queue users don't do a good job of priority-setting, although VOICE and FRONT are properly used. The idea wasn't to order the queue (except for FRONT), but to skip sending, say, a VOICE message when we encounter one, if the queue congestion measure says to.&lt;br /&gt;
&lt;br /&gt;
* '''Vault security'''&lt;br /&gt;
: The MOSS vault is as insecure as the MOUL vault. Need I say more? Here are some starter thoughts.&lt;br /&gt;
:* MOSS should parse incoming SDL messages and sanity-check them. See also [[#SDL_timestamps | adding timestamps]].&lt;br /&gt;
:* MOSS could probably verify other blob contents too.&lt;br /&gt;
:* Anyone can save anything to any node, and can fetch any node if they know its type and ID. We can deny these requests if the user shouldn't have access. Possibly [[MOSS-Developer_Notes#notifier | the notifier field]] can help.&lt;br /&gt;
:* Much more, I'm sure. Better vault security ''is'' possible.&lt;br /&gt;
&lt;br /&gt;
* Eliminate excessive byteswapping of opaque server IDs in BackendMessages. This is to say, in the backend server, when reading in the messages, it byte-swaps the IDs to store them, only ever uses them in equality tests with other IDs, and then byte-swaps them back when sending new messages. (On a little-endian box there's no swapping so it does not cost much, but it's the principle of the matter.) Unfortunately this really needs to be tested on a big-endian machine.&lt;br /&gt;
&lt;br /&gt;
* Try changing the File server to do [[MOSS-Setup#ackless | ackless downloads]], too. Maybe only if there is only one download at a time, though.&lt;br /&gt;
&lt;br /&gt;
== Scalability issues ==&lt;br /&gt;
&lt;br /&gt;
Performance and scalability are always interesting questions. And frequently ignored, because they only matter for larger installations.&lt;br /&gt;
&lt;br /&gt;
These are ideas unimplemented because they only really matter for large&lt;br /&gt;
shards. Large as in having, let's say, 50+ concurrent '''busy''' users. (50&lt;br /&gt;
people standing in the city chatting doesn't actually do much.) Maybe MOSS is&lt;br /&gt;
okay with that number now, in which case &amp;quot;large&amp;quot; is more. It is entirely&lt;br /&gt;
unknown.&lt;br /&gt;
&lt;br /&gt;
* Performance testing. Instrumentation. There should be a load generator to do this. This was not high on the list during development, with a user base of 3.&lt;br /&gt;
&lt;br /&gt;
* See the last paragraph in the comments at the top of FileTransaction.h about how multiple file transactions of the same file should share a single opened file.&lt;br /&gt;
&lt;br /&gt;
* Allow speculative pre-caching of AgeInfoNodes and PlayerInfoNodes when node changed notifications come from the vault server and are forwarded to any connected client. Cache in the auth server, vault server, or both. The goal is to reduce latency on those requests the client freezes for.&lt;br /&gt;
&lt;br /&gt;
* The backend protocol supports game servers requesting batches of GameMgr IDs. However, there is no code on either side to actually do so. The idea for this was that more populated ages, like the city, would benefit from doing batch requests. Every person who links in with a marker game needs a new global game ID, and it would be nice to cut out any extra backend round trips for links, even though this particular round trip does not block the link process (aside from being something the backend is doing when it could be doing something else).&lt;br /&gt;
&lt;br /&gt;
* Database performance could be measured and the SQL or even tables optimized.&lt;br /&gt;
&lt;br /&gt;
* MOSS currently uses a single blocking connection to the DB. Implement and investigate performance of multiple DB connections, or asynchronous ones. Maybe the backend server has to become threaded to gain the best advantage.&lt;br /&gt;
&lt;br /&gt;
* In a big shard, we may need to split the backend server work up. The [[MOSS-Developer_Notes#backend_typecodes | backend protocol]] is designed to support separating backend work between threads. The &amp;quot;classes&amp;quot; of backend messages in a bitfield are meant as a way to quickly route a backend message to an appropriate backend thread or process.&lt;br /&gt;
&lt;br /&gt;
== Frontend/backend interactions ==&lt;br /&gt;
&lt;br /&gt;
* Add encryption to the backend protocol. This itself is not a big deal (though you have to pick a good key negotiation, and do not forget to consider authentication mechanisms), but it does mean all the BackendMessage fill_buffer() code paths would be newly exercised, so a lot of regression testing would be in order.&lt;br /&gt;
&lt;br /&gt;
* It would be much easier on the DB if updates to markers are batched by the game server. This especially applies to capturing markers. See the comments in the setmarkerto() and startmarkergame() SQL functions.&lt;br /&gt;
&lt;br /&gt;
* The backend protocol allows for frontends hosting ages to specify only a subset of ages that can be hosted there. This is unused right now; the message has a field saying, &amp;quot;this is the length of the following age restriction list&amp;quot; and it is always zero. When there are no restrictions the backend can request any frontend to host any age.&lt;br /&gt;
** The need for splitting hostable ages is unclear, but in a very large shard you might, for example, put all city instances, or even only the public one, on a separate server. It would also allow someone to join a shard and host just their own age, or whatever.&lt;br /&gt;
** Since the frontend never sends restrictions, the backend currently has no way to store and use them. So there is work on both sides.&lt;br /&gt;
** Presumably which ages a frontend server can host would be a configuration option but it could be done instead by restricting the contents of the game/age directory. That would not allow even finer-grained restrictions, but this whole project kind of needs a real use case to flesh out what is needed.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span id=&amp;quot;connection_merging&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;Having one backend TCP connection per frontend server is probably not a good thing, in terms of efficiency, or of scalability with a cluster of machines. We could change it to have one backend connection per frontend ''process'' and funnel everything through it. The mostly-implemented but unused and untested MultiWriterMessageQueue was meant, in part, to support this (there are multiple threads writing, but only one thread reading, which writes to the socket).&lt;br /&gt;
&lt;br /&gt;
: Then when messages are received in the frontend there needs to be some way of passing the message to the right thread and signaling them something is present to be handled. This is all unimplemented but the format of the backend messages is meant to take care of this case (in particular, the two &amp;quot;server IDs&amp;quot; in the header are for dispatching messages to the correct thread).&lt;br /&gt;
&lt;br /&gt;
: However, essentially the same changes would be necessary if the backend server is folded into the main server so there is only one process; then &amp;quot;sending&amp;quot; messages to the backend server is just putting them on the (shared) queue that would have been used to funnel everything through one connection, and &amp;quot;receiving&amp;quot; them is just taking them off that queue since there's no TCP connection to deal with.&lt;br /&gt;
&lt;br /&gt;
== New functionality ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span id=&amp;quot;scripting&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;I am guessing Cyan's server handles the GameMgr stuff with server-side scripting. At the time MOSS was implemented there was no expectation that new game types may be added so adding in a scripting language was not worth the problems incumbent with doing so. Also the overall value of scripting is not clear (especially for the cost in server complication). However, it could be done. The project would have to include embedding the scripting and then rewriting stuff using scripts.&lt;br /&gt;
: Please note, a lot of effort went into getting the Heek right, handling ties, allowing people to accidentally stand up and sit back down in the game, and probably other details I forgot. If you want to script Heek, it really ought to still work as well.&lt;br /&gt;
&lt;br /&gt;
* Really adventurous hardcore project: destroy KI hacks. The server would have to be able to analyze all game traffic to decide whether it looks okay. To do it right the server would have to have and understand PRP files and do physics. Also &amp;quot;console&amp;quot; commands have to be wisely filtered. If you're daunted, join the club.&lt;br /&gt;
&lt;br /&gt;
== Redesigns ==&lt;/div&gt;</summary>
		<author><name>A'moaca'</name></author>
	</entry>
	<entry>
		<id>https://wiki.openuru.org/index.php?title=MOSS/Developer_Notes&amp;diff=957</id>
		<title>MOSS/Developer Notes</title>
		<link rel="alternate" type="text/html" href="https://wiki.openuru.org/index.php?title=MOSS/Developer_Notes&amp;diff=957"/>
		<updated>2011-04-04T06:34:37Z</updated>

		<summary type="html">&lt;p&gt;A'moaca': Created page with &amp;quot;Comments of interest to those working with the MOSS code should go here. If you plan to just run a server and not modify it, you don't need to be here.   == Working with the Code...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Comments of interest to those working with the MOSS code should go here. If&lt;br /&gt;
you plan to just run a server and not modify it, you don't need to be here.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Working with the Code ==&lt;br /&gt;
&lt;br /&gt;
=== Requirements ===&lt;br /&gt;
&lt;br /&gt;
* Handle byte-swapping. A networking person wrote MOSS, and such people care about working with both endiannesses. Do not break it.&lt;br /&gt;
&lt;br /&gt;
* This does mean you cannot drop in someone else's code handling the MOUL protocol if it assumes you are using a little-endian machine. This is '''the''' reason for not casting incoming byte data to structs and writing out structs.&lt;br /&gt;
&lt;br /&gt;
* Including &amp;quot;config.h&amp;quot; should always look like this:&lt;br /&gt;
 #ifdef HAVE_CONFIG_H&lt;br /&gt;
 #include &amp;quot;config.h&amp;quot;&lt;br /&gt;
 #endif&lt;br /&gt;
&lt;br /&gt;
=== Code Conventions ===&lt;br /&gt;
&lt;br /&gt;
* Keep C++-style comments out of preprocessor lines.&lt;br /&gt;
&lt;br /&gt;
* Keep code to 78 columns whenever possible.&lt;br /&gt;
&lt;br /&gt;
* Include (.h) files have comments at the top listing which other include files are required before including this file. (Some may be missing but I tried.)&lt;br /&gt;
&lt;br /&gt;
* I use emacs. Please keep the &amp;lt;tt&amp;gt;/* -*- c++ -*- */&amp;lt;/tt&amp;gt; at the top of .h files if they are indeed C++. Feel free to add similar magic for your editor.&lt;br /&gt;
&lt;br /&gt;
* Please match indentation, spacing, and brace styles, etc. (It is the default &amp;quot;gnu&amp;quot; style in emacs.)&lt;br /&gt;
&lt;br /&gt;
* Limit direct including of other include files in .h files. I don't remember why, but it's the project's convention. (It does help with dependencies sometimes.)&lt;br /&gt;
&lt;br /&gt;
=== Advice ===&lt;br /&gt;
&lt;br /&gt;
* If you add a client message type, make sure to add it to check_useable(). Otherwise the server will toss the message and drop the client.&lt;br /&gt;
&lt;br /&gt;
* If you add a client message type, test compiling with the --enable-old-protocol=yes configure option set.&lt;br /&gt;
&lt;br /&gt;
* When handling byte-swapping, never assign the result of readNNle() to a larger variable. This is wrong. Consider a 16-bit little-endian number with two bytes ''XY'', represented as &amp;lt;tt&amp;gt;YX&amp;lt;/tt&amp;gt;. read16le() returns &amp;lt;tt&amp;gt;YX&amp;lt;/tt&amp;gt;, and assigned to a 32-bit number on a big-endian system, the result is &amp;lt;tt&amp;gt;00YX&amp;lt;/tt&amp;gt;. A 32-bit little-endian number of value ''XY'' is '''correctly''' represented as &amp;lt;tt&amp;gt;YX00&amp;lt;/tt&amp;gt;. Assigning the result of readNN() is fine, as that value is in host order. Similarly you can't writeNNle() a number stored in a smaller type, but this is a harder mistake to make.&lt;br /&gt;
&lt;br /&gt;
* As a corollary, don't save anything explicitly kept little-endian in anything other than a sized int type. Don't use size_t, enum types, or anything along those lines. Especially not size_t.&lt;br /&gt;
&lt;br /&gt;
* Remember that protocol changes are not to be made lightly, because it causes an incompatibility problem. &lt;br /&gt;
&lt;br /&gt;
* Be very, very, careful about any changes to game server startup code in the backend. Triple-check all the logic (or more). Do not forget to take into account the client disconnecting/timing out after the request, the game server never starting, the game server shutting down as the request arrives, and everything in between.&lt;br /&gt;
&lt;br /&gt;
* Before writing new DB query code or changing how current ones work, make sure to read up on the [http://pqxx.org/devprojects/libpqxx/doc/stable/html/Tutorial/ch03s07.html pqxx transactor model].&lt;br /&gt;
&lt;br /&gt;
* There is a reftree.sql file in the test directory. If you are working with the DB and need a view into the trees of data the change notification routines are working with, you may find this file useful. Load it into the DB, and it adds a &amp;quot;reftree&amp;quot; function which, given a node, will generate a list of the whole tree below it by following the noderefs. The output includes node and folder type '''names''' and the information used to determine where change notifications have to be sent.&lt;br /&gt;
&lt;br /&gt;
== Implementation Choices ==&lt;br /&gt;
&lt;br /&gt;
Oftentimes, in a hobbyist project such as MOSS was in the beginning, there is not a lot of design documentation. MOSS had some, but most of it became obsolete as goals changed. Here are some short descriptions answering some &amp;quot;Why did you do it this way?&amp;quot; questions.&lt;br /&gt;
&lt;br /&gt;
Terminology used here: the &amp;quot;backend&amp;quot; server is that process named moss_backend, which talks to the DB and handles anything needing centralized management, while &amp;quot;frontend&amp;quot; servers are everything else (auth/file/game/gatekeeper servers talking to the client, and the dispatcher listening for connections). The &amp;quot;backend protocol&amp;quot; is the protocol used between the frontend and backend servers.&lt;br /&gt;
&lt;br /&gt;
; Why is there all this read32/read32le stuff?&lt;br /&gt;
: [[#Requirements | A networking person wrote MOSS.]] readNN() byte-swaps a little-endian value (from the protocol on the wire) to host order. writeNN() byte-swaps from host to little-endian. If you run it on a little-endian box this is a no-op. readNNle() ''doesn't'' byte-swap, returning a number of size NN in little-endian order. If you run it on a little-endian box this is a no-op. On a big-endian box these are critical. In addition, these macros/functions handle hardware that does not allow unaligned access of memory locations. At the time of release, MOSS appeared to work correctly on big-endian machines.&lt;br /&gt;
&lt;br /&gt;
; Why are there two ways to write every message?&lt;br /&gt;
: For larger messages, the writev() syscall is considered more efficient, because less data has to be copied when crossing the user/kernel memory boundary. In other words, you save one copy of the entire contents of what you write at the price of computing and copying the set of iovecs. However, writev() won't work when you have to encrypt the data first, so for encrypted connections we have to copy the data into a buffer and then encrypt it.&lt;br /&gt;
&lt;br /&gt;
; Why do the backend message classes have &amp;quot;little-endian&amp;quot; comments all over?&lt;br /&gt;
: The backend protocol is handled somewhat differently in MOSS. For frontend servers, any data read in and used by the server is stored in host order. But for the backend messages, the data is mostly stored in ''little-endian'' order, because the protocol is (currently!) unencrypted and I can use writev() and skip copying into a buffer. For many messages, writev() may not be better than copying, because the iovec is bigger than the data it represents. On the other hand, the actual copy into the buffer is avoided. The performance of each approach is unknown. There is no MessageQueue support for mixing the iovec and buffer strategies in a single queue based on message type.&lt;br /&gt;
&lt;br /&gt;
; Why do you use a single-threaded big select loop for each game server?&lt;br /&gt;
: The other typical strategy would be to have a thread per client and pass messages between threads. The MultiWriterMessageQueue class was originally intended to cover that case (in addition to [[MOSS-Project_Ideas#connection_merging | others]]). But the fundamental problem with this plan is that I did not have a good portable way to wake up threads when a message is queued. It can be done, but signals are probably not the way to do it.&lt;br /&gt;
&lt;br /&gt;
; Speaking of signals, why do you use them between threads instead of epoll()?&lt;br /&gt;
: I don't have epoll() on my development machine. Signals are the most portable. [[MOSS-Project_Ideas#libevent | Replacing the use of signals + select() with libevent]] might be the right answer because part of its goal is to work on many OSes.&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;span id=&amp;quot;backend_typecodes&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;Explain the funky backend protocol numbering scheme?&lt;br /&gt;
: The protocol was designed to facilitate using multiple processes or servers in the backend. Thus messages have a bitmask &amp;quot;class&amp;quot; which would allow them to be quickly routed to the right location by checking the bitmask, rather than having a giant case statement to decide.&lt;br /&gt;
&lt;br /&gt;
: Then, I wanted the pairs of messages to be recognizable from the number, so a message TO the backend is numbered the same the corresponding message FROM the backend, with the addition of a bit to mark which direction the message is going. Since each server knows its own identity, this bit is basically a big favor for the Wireshark dissector. Trust me, it's really nice.&lt;br /&gt;
&lt;br /&gt;
: Finally, because once upon a time I knew many messages by their number, I assigned backend messages the same number as a corresponding frontend (client) message. When it made sense. We don't need to do this going forward, but we aren't allowed to change the current ones.&lt;br /&gt;
&lt;br /&gt;
: There are some bits in the middle &amp;quot;left over&amp;quot;. Maybe someone will need them for something creative someday!&lt;br /&gt;
&lt;br /&gt;
; Why did you choose [http://www.postgresql.org/ PostgreSQL]?&lt;br /&gt;
: There were not a lot of differentiators between it and MySQL. But, PostgreSQL provides &amp;quot;triggers&amp;quot; -- this is a way to request that when a table is changed, the DB tells anything subscribed to the triggers about the change. I was intrigued by them, and thought they could prove useful for providing the vault node update notifications to clients (VaultNodeChanged/VaultNodeAdded/VaultNodeDeleted). Unfortunately, doing this ended up requiring at least two connections to the DB, one like the current one, and another to listen for triggers. So triggers were not used in the interest of simplicity in the backend server. Nothing else is preventing their use.&lt;br /&gt;
&lt;br /&gt;
; What is up with this giant DB schema!&lt;br /&gt;
: First, it was a conscious decision to put as much SQL code as possible into stored procedures. This makes it so you can modify the DB functionality without recompiling the server, and it reduces the amount of data you have to push over the socket.&lt;br /&gt;
&lt;br /&gt;
: The single giant table as seen in PotS, UU, and to some extent (how much exactly is unknown) MOUL/MOULa is so hard to work with. And it has scalability, relations, and clarity built right out of it. We were thinking of how to split the database load up to help with the bottleneck the DB still proved to be in MOUL. While no implementation was done for that (realistic expectations of MOSS suggest it is not needed), this did lead to the decision to experiment with splitting the table up into many tables by node type.&lt;br /&gt;
&lt;br /&gt;
: There's no way to know if these design choices are more efficient, without changing the design, implementing it, and comparing the performance of the two in a like-for-like way. But it sure is a lot easier to write queries with the stored procedures and tables by node type!&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;span id=&amp;quot;notifier&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;What is this new &amp;quot;notifier&amp;quot; thing in the noderefs table?&lt;br /&gt;
: It is the answer to the question &amp;quot;How do I know which client to tell about changes to this reference or referred-to node?&amp;quot;&lt;br /&gt;
&lt;br /&gt;
: After drawing many pictures of node trees, it became clear that the &amp;quot;owner&amp;quot;, coming from the client, was mostly but not really right for this. I was left with the impression that's what the &amp;quot;owner&amp;quot; field is for... but since it wasn't what I wanted I added a new one. For player trees, the notifier is the player. For age trees, it's the age, and then the DB looks up what players are interested in that age.&lt;br /&gt;
&lt;br /&gt;
: I do not know how Cyan solved the problem, but this was the way to push the decision about who to tell into the DB where most of the data is. Otherwise, the backend (vault) server would have to cache all the active trees itself in order to find the answer.&lt;br /&gt;
&lt;br /&gt;
; Why did you make the SDL files be in a directory tree instead of a single directory?&lt;br /&gt;
: The goal was to improve the age development experience. If the server loads all the SDL at startup, and you want to change the SDL because you have a new version to test, you have to restart the server. If instead, a given age's SDL is loaded at the time the game server starts up, you only need to restart the game server. I then put the files common to all ages in a &amp;quot;common&amp;quot; directory so that it is loaded once, and the data can be shared between game servers, but that is just a small optimization. If users have serious issues with this they can put ''all'' the SDL files in the common subdirectory.&lt;br /&gt;
&lt;br /&gt;
; Why .mbm and .mbam files?&lt;br /&gt;
: I did not want the server to have to stat and checksum files all the time. File and auth files don't change much.&lt;br /&gt;
&lt;br /&gt;
; Why didn't you put Python in to script Heek?&lt;br /&gt;
: I suspect Cyan did this. I am not a fan of embedding scripting where it is not needed, and at the time I had no reason to believe there would ever be new GameMgr types requiring the kind of dynamic rapid development that embedded scripting is good for. Still, it's in the [[MOSS-Project_Ideas#scripting | project ideas]] for those who are into that sort of thing.&lt;br /&gt;
&lt;br /&gt;
== Project Ideas ==&lt;br /&gt;
&lt;br /&gt;
The whole idea of this list is to provide some ideas for anyone wishing to dive&lt;br /&gt;
into MOSS. Sometimes a little direction helps. See [[MOSS-Project_Ideas]]. Of&lt;br /&gt;
course, you are not limited to this list!&lt;/div&gt;</summary>
		<author><name>A'moaca'</name></author>
	</entry>
	<entry>
		<id>https://wiki.openuru.org/index.php?title=MOSS/Notes&amp;diff=956</id>
		<title>MOSS/Notes</title>
		<link rel="alternate" type="text/html" href="https://wiki.openuru.org/index.php?title=MOSS/Notes&amp;diff=956"/>
		<updated>2011-04-04T06:32:43Z</updated>

		<summary type="html">&lt;p&gt;A'moaca': Created page with &amp;quot;This page just holds various notes about running a MOSS server.   == Questions ==  I can't really call this a FAQ until the questions have been asked frequently.  ; How do I add ...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page just holds various notes about running a MOSS server.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Questions ==&lt;br /&gt;
&lt;br /&gt;
I can't really call this a FAQ until the questions have been asked frequently.&lt;br /&gt;
&lt;br /&gt;
; How do I add a user?&lt;br /&gt;
: [[MOSS-Setup#Create_Accounts]]&lt;br /&gt;
; How do I change the Python?&lt;br /&gt;
: Start with the source Cyan has generously provided us under the GPL. To compile that source you'll have to add in the glue. Maybe there is a tool do that in the CWE source. Make your changes. After compiling and creating the .pak (another tool?), copy the .pak to the [[MOSS-Setup#Auth_Server_Data | correct server directory]] and encrypt it. Make a new .mbam file.&lt;br /&gt;
; How do I add a new age?&lt;br /&gt;
: Copy the encrypted .pak to the [[MOSS-Setup#Auth_Server_Data | correct server directory]], add the file to the Python.txt, and make a new .mbam file. Copy any SDL files to the auth SDL directory and encrypt them. Copy unencrypted SDL files to the [[MOSS-Setup#Game_Server_Data | correct server directory]]. Note if you have more than one SDL file for your age, or the file is not named the same as the age, you'll need to put the age's SDL file(s) in a directory named after the age. Copy the unencrypted .age file to the game server directory.&lt;br /&gt;
; Why would I use --enable-fork?&lt;br /&gt;
: This is primarily useful for testing. It's easier to debug a non-threaded process.&lt;br /&gt;
; What resource limitations are there (file descriptors, memory, etc.)?&lt;br /&gt;
: This is a question that's not obvious to answer. But here is what is known:&lt;br /&gt;
:* Currently MOSS uses about 5 file descriptors when idle. It uses about 10 per connected user. (4 are for the game server, so if the user links around a lot, it will be more, and if you have multiple users in one age it will be less.) If you are running a large shard, you may need to adjust per-process file descriptor limits (see the &amp;quot;ulimit&amp;quot; command) or even kernel (global) limits. If you adjust the global limit, pay attention to &amp;lt;tt&amp;gt;FD_SETSIZE&amp;lt;/tt&amp;gt;. See the select() man page.&lt;br /&gt;
:* Currently MOSS uses 7 big buffers for network data per connected user. The buffer size is set by &amp;lt;tt&amp;gt;BUFSIZE&amp;lt;/tt&amp;gt; in constants.h. The default is 64k, so a total of 448k per user. If you have enough users that your moss processes grow too large you can reduce the &amp;lt;tt&amp;gt;BUFSIZE&amp;lt;/tt&amp;gt;.&lt;br /&gt;
:* There is not a lot of disk I/O, except for whatever the database has to write. If you set the log levels very low (DEBUG or worse, MSGS) then there will be a lot of I/O for log files.&lt;br /&gt;
; Does MOSS work on my Power PC?&lt;br /&gt;
: It is supposed to! Testing of big-endian systems was done, but not a full, complete run-through of all game mechanics and multiplayer testing. If it does not work, [[MOSS#How_to_Contribute | it's a bug]].&lt;br /&gt;
; Does MOSS work on Windows? OS X?&lt;br /&gt;
: Not Windows. There is a fair bit of porting work to do. OS/X theoretically works but nobody has tried yet. (If you try and it works, fix this!)&lt;br /&gt;
; What is the &amp;quot;status&amp;quot; server type?&lt;br /&gt;
: MOSS will provide the status string normally fetched from a web server. You do have to make the client send the HTTP request to port 14617 or it won't do much good. This is a feature that perhaps only the author wants.&lt;br /&gt;
&lt;br /&gt;
== Warnings ==&lt;br /&gt;
&lt;br /&gt;
* Please note: The MOSS vault is as insecure as MOUL's. (I don't know what was done to MOULagain.) The MOSS server is almost as trusting of the client as MOUL's. (Or maybe more, in other ways; for example, there is no server-side profanity filter.) This is because a MOUL server was implemented, not some other server. Doing better is definitely possible. But to do it right is a very big project, because the entire ''system'' was designed with this trust model. You can't always change just one part of it to get where you want to be.&lt;br /&gt;
&lt;br /&gt;
* Don't change the .mbm or file server files while you have clients doing File transactions. Doing so will give everything indigestion.&lt;br /&gt;
&lt;br /&gt;
* I'm sure the same applies for .mbam and auth server files.&lt;br /&gt;
&lt;br /&gt;
* The SDL mechanism depends on all servers in the shard having synchronized time. Use NTP if you have more than one server. (You'll also need to NFS mount the game/state directory on all the servers so the age SDL is available to all.)&lt;br /&gt;
&lt;br /&gt;
== Setup Choices ==&lt;br /&gt;
&lt;br /&gt;
* Disabling the client&amp;lt;-&amp;gt;server encryption is NOT recommended. However, if you subscribe to the shortsighted idea that protecting your users is not important, go ahead. But be warned, there are code paths in MOSS that are completely untested when all encryption is disabled. You'll have to fix any bugs. (The Wireshark plugin does support decrypting connections when you have the key, so you ''can'' use encrypted connections during development/testing.)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span id=&amp;quot;RSA&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;MOSS supports using RSA for key negotiation. The client contribution to the session key is RSA-encrypted with the server public key and then sent to the server, which decrypts the message. Ironically, this actually is less crypto work, while using a non-modified standard encryption technology. And it has the same pseudo-authentication properties as the Cyan-style modified Diffie-Hellman. The assembler changes required for this are astonishingly small, but there's not much value in using RSA. Nonetheless, there's no need to remove working server support for it...&lt;br /&gt;
&lt;br /&gt;
== While Running the Server ==&lt;br /&gt;
&lt;br /&gt;
* You can change age SDL state server-side by modifying the state saved in files in the game/state directory. Keeping backups is advised. You may modify the files with the &amp;quot;sdl_reader&amp;quot; program (which you need to build separately using &amp;quot;make sdl_reader&amp;quot;). This is a very simple command-line program. Use the -l option to specify a saved file to read. When in the program, use the &amp;quot;h&amp;quot; command to see the help. Saving this file while a game server for that age is running is pointless; the new version won't be read and it will be overwritten when the server exits.&lt;br /&gt;
&lt;br /&gt;
== Client Bug Workarounds ==&lt;br /&gt;
&lt;br /&gt;
MOSS works around a few client bugs.&lt;br /&gt;
&lt;br /&gt;
* MOSS &amp;quot;fixes&amp;quot; the KI light bug. It is a bug in the PRP files. MOSS has an extra check for determining whether SDL state is avatar-related, instead of relying on the flag that says whether to keep the SDL state around. That check covers the KI light, so the light SDL is tossed along with the rest of avatar SDL when a person leaves an age.&lt;br /&gt;
&lt;br /&gt;
* MOSS may &amp;quot;fix&amp;quot; the footstep region bug. This bug is when you get the wrong footstep sound stuck, like that wooden bridge you left long ago clumping around while you're on stone. Everyone in the age hears the wrong footstep sounds. I believe that in normal play (that is, without things like /spawn) it is due to a race with the exclusive locking mechanism used to keep things like multiple button presses from being processed at the same time. Why footstep regions take a server-side exclusive lock is beyond me**, so MOSS grants '''all''' footstep region lock requests. This should make the problem occur less frequently, if at all (depending on how the client actually responds to receiving the lock after leaving the region). MOSS decides you are asking for a footstep region lock by looking for the word &amp;quot;Footstep&amp;quot; in the object name. ''Do not name buttons, door regions, or whatever with &amp;quot;Footstep&amp;quot; in your new ages.'' I suggest you do name footstep regions with &amp;quot;Footstep&amp;quot;. The special case can be removed by removing &amp;lt;tt&amp;gt;#define GRANT_ALL_FOOTSTEPS&amp;lt;/tt&amp;gt; from GameState.cc and recompiling.&lt;br /&gt;
:: **In fact, as a friend of mine pointed out, why are footstep sounds decided by the represented avatar's client and propagated to everyone else in the first place? It should be a purely local decision based on the location of each avatar as seen by that client. That would save on traffic and always be accurate, never mind the race with locking on the region since there would be no need to coordinate anything for a purely local decision.&lt;br /&gt;
&lt;br /&gt;
* Quab game Python is not really complete. The first person to link to the age becomes the &amp;quot;owner&amp;quot; of the quab game. The Python sort of attempts to handle the situation where the game owner leaves the age while there are still quabs around, but it does not actually handle it. If the server attempts to pass ownership to someone else, that client will break. And the current MOULagain client even crashes. So MOSS works around the problem by intentionally breaking the whole game when the owner leaves the age and quabs are still present. All the quabs will remain frozen in place until the age has been cleared of all players. The age does not have to restart to revive the game, just be empty.&lt;br /&gt;
&lt;br /&gt;
* The client supports two kinds of passwords, depending on the format of the username. If the username has the format x@x.x it uses algorithm 1 (a more secure one but also one with a fencepost error), and otherwise algorithm 2.  Unfortunately the /changepassword command does not know about algorithm 2 and if you logged in with algorithm 2, it will try to change your password hash to the one for algorithm 1. This would result in you being unable to log in.  So MOSS rejects requests to change the password if the username does not have the x@x.x format.&lt;br /&gt;
&lt;br /&gt;
== Server Non-Bugs ==&lt;br /&gt;
&lt;br /&gt;
These are problems with Cyan's server that MOSS does not have.&lt;br /&gt;
&lt;br /&gt;
* MOSS does not have the infamous &amp;quot;zero seconds remaining&amp;quot; bug. Thus it is possible to do the auth downloads without the server waiting for acks from the client. This speeds up the download substantially as now the bandwidth can be fully utilized. (The [[MOSS-Setup#configure | --enable-fast-download]] configure option turns this on.)&lt;br /&gt;
&lt;br /&gt;
* The MOUL server has a bug with quabs in Ahnonay. If you are the first person who linked into the age, the quabs are associated with your ID. When you link out of the age, the server is supposed to send a LoadClone message telling other clients to unload your clone (the avatar). The MOUL server sends the message, but it says to unload one of the quabs with your ID in it instead of the player avatar. Oddly, the client seems just fine with that. MOSS does not have this bug.&lt;br /&gt;
&lt;br /&gt;
* You should see less client hitching while moving around with MOSS. The MOUL server sends a ton of node update messages for the (unchanged) city AgeInfo node. Each node update causes the client to fetch your pellet scores. The client is frozen during this (and most any) vault transaction. The MOSS server does not send all those useless updates. Interesting note: One measurement during MOUL was approximately 400 pellet score fetches an hour. That is the client freezing every 9 seconds regardless of what age you are in or how many people are in it or on your buddy list. (The pellet score fetch itself can probably be fixed in the Python but you'd still be wasting time on the city node.)&lt;br /&gt;
&lt;br /&gt;
* The pellet score freeze can be further reduced by #defining &amp;lt;tt&amp;gt;PELLET_SCORE_CACHE&amp;lt;/tt&amp;gt;, which does what it sounds like: it caches the client's pellet score in the Auth server to cut out the round-trip time to the DB. However, there's little value to it without the city node update problem; when you open the KI it fetches the score but it's also fetching other vault nodes. Plus you aren't trying to move at the time so the freeze is less obvious. So &amp;lt;tt&amp;gt;PELLET_SCORE_CACHE&amp;lt;/tt&amp;gt; is undefined by default, and in fact it is ''untested''.&lt;/div&gt;</summary>
		<author><name>A'moaca'</name></author>
	</entry>
	<entry>
		<id>https://wiki.openuru.org/index.php?title=MOSS/Distribution_Specific_Instructions&amp;diff=955</id>
		<title>MOSS/Distribution Specific Instructions</title>
		<link rel="alternate" type="text/html" href="https://wiki.openuru.org/index.php?title=MOSS/Distribution_Specific_Instructions&amp;diff=955"/>
		<updated>2011-04-04T06:29:36Z</updated>

		<summary type="html">&lt;p&gt;A'moaca': Created page with &amp;quot;This document is meant to collect any known distribution-specific instructions for installing MOSS. There are two main parts: installing the prerequisite packages, and setting up...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document is meant to collect any known distribution-specific instructions&lt;br /&gt;
for installing MOSS. There are two main parts: installing the prerequisite&lt;br /&gt;
packages, and setting up the PostgreSQL database. Feel free to add any other&lt;br /&gt;
notes you may find useful.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Prerequisite Packages ==&lt;br /&gt;
&lt;br /&gt;
=== NetBSD pkgsrc ===&lt;br /&gt;
&lt;br /&gt;
Only PostgreSQL and the autotools are needed. You can build the packages&lt;br /&gt;
or use the prebuilt packages with pkg_add.&lt;br /&gt;
&lt;br /&gt;
 pkg_add automake&lt;br /&gt;
 pkg_add libtool&lt;br /&gt;
 pkg_add libpqxx&lt;br /&gt;
I recommend starting with libpqxx because it seems to lag the postgresql-client&lt;br /&gt;
package, and installing libpqxx will get the correct client.&lt;br /&gt;
 pkg_add postgresqlNN-server&lt;br /&gt;
Get the version number to match the client installed for pqxx.&lt;br /&gt;
&lt;br /&gt;
Now follow the instructions:&lt;br /&gt;
* copy /usr/pkg/share/examples/rc.d/pgsql to /etc/rc.d/pgsql&lt;br /&gt;
* chmod 555 /etc/rc.d/pgsql&lt;br /&gt;
* append pgsql=YES to /etc/rc.conf&lt;br /&gt;
&lt;br /&gt;
== Database Setup ==&lt;br /&gt;
&lt;br /&gt;
=== NetBSD pkgsrc ===&lt;br /&gt;
&lt;br /&gt;
Copy moss_uuidgen.so to /usr/pkg/lib/postgresql/&lt;br /&gt;
&lt;br /&gt;
The database user is &amp;lt;tt&amp;gt;pgsql&amp;lt;/tt&amp;gt;. It has root access to the DB by default.&lt;br /&gt;
Connect from localhost (the default).&lt;br /&gt;
&lt;br /&gt;
Create the database:&lt;br /&gt;
 su -m pgsql -c &amp;quot;psql postgres&amp;quot;&lt;br /&gt;
 create database moss with encoding='UTF8';&lt;br /&gt;
 \c moss&lt;br /&gt;
 create role moss with login;&lt;br /&gt;
 \q&lt;br /&gt;
 su -m pgsql -c &amp;quot;psql postgres -f moss.sql&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Then set db_user=moss in moss_backend.cfg.&lt;br /&gt;
&lt;br /&gt;
== Additional Notes ==&lt;/div&gt;</summary>
		<author><name>A'moaca'</name></author>
	</entry>
	<entry>
		<id>https://wiki.openuru.org/index.php?title=MOSS/Setup&amp;diff=954</id>
		<title>MOSS/Setup</title>
		<link rel="alternate" type="text/html" href="https://wiki.openuru.org/index.php?title=MOSS/Setup&amp;diff=954"/>
		<updated>2011-04-04T06:28:43Z</updated>

		<summary type="html">&lt;p&gt;A'moaca': Created page with &amp;quot;MOSS currently only runs on Unix. Not Windows. It ought to work on Mac OS/X (even PowerPC) but nobody has tried yet.  Please also see the [http://foundry.openuru.org/fisheye/brow...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MOSS currently only runs on Unix. Not Windows. It ought to work on Mac OS/X&lt;br /&gt;
(even PowerPC) but nobody has tried yet.&lt;br /&gt;
&lt;br /&gt;
Please also see the&lt;br /&gt;
[http://foundry.openuru.org/fisheye/browse/MOSS/doc/setup main setup instructions].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Compile ==&lt;br /&gt;
&lt;br /&gt;
=== Prerequisites ===&lt;br /&gt;
&lt;br /&gt;
Before you start, you need to ensure you have the following:&lt;br /&gt;
* pthreads (almost certainly installed already)&lt;br /&gt;
* libiconv (almost certainly installed already)&lt;br /&gt;
* OpenSSL (also almost certainly installed) -- you need both the libraries and the development headers if that's separate (I'm looking at you, Debian)&lt;br /&gt;
* Zlib (also probably installed) -- both the library and the development stuff if separate&lt;br /&gt;
* PostgreSQL -- both the sever and client, plus any development packages&lt;br /&gt;
* libpqxx -- both the library and the development package&lt;br /&gt;
* gcc, g++, whatever all you need for compiling C++&lt;br /&gt;
&lt;br /&gt;
If you are compiling from a clone of an Hg respository and there is no &lt;br /&gt;
&amp;quot;configure&amp;quot; script, you also need the autotools:&lt;br /&gt;
* autoconf&lt;br /&gt;
* automake&lt;br /&gt;
* libtool&lt;br /&gt;
&lt;br /&gt;
'''If you are reading this, please go over to'''&lt;br /&gt;
[[MOSS-Distribution_Specific_Instructions]] '''and fill in how to install all&lt;br /&gt;
that on YOUR distribution/OS. Thank you!'''&lt;br /&gt;
&lt;br /&gt;
=== configure ===&lt;br /&gt;
&lt;br /&gt;
If you don't have a &amp;quot;configure&amp;quot; file, it must be generated. Run the&lt;br /&gt;
&amp;quot;bootstrap.sh&amp;quot; script to create it.&lt;br /&gt;
&lt;br /&gt;
Run &amp;quot;./configure&amp;quot;. The configure script takes many options. For a full listing&lt;br /&gt;
run &amp;quot;./configure --help&amp;quot;. The default options set up the server to match the&lt;br /&gt;
way Cyan's works. Here are the options you are probably interested in:&lt;br /&gt;
; --prefix&lt;br /&gt;
: Specify where &amp;quot;make install&amp;quot; places the files. If you are using a non-typical location you may need to add ''prefix''/lib to your LDFLAGS or something.&lt;br /&gt;
; &amp;lt;span id=&amp;quot;ackless&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;--enable-fast-download&lt;br /&gt;
: During auth file downloads, Cyan's server waits for the client to acknowledge every 32k of data sent. I believe this was to fix the &amp;quot;zero seconds remaining&amp;quot; bug. MOSS does not have that bug. Use --enable-fast-download to configure the server to send data as fast as it can, thereby using all the bandwidth available.&lt;br /&gt;
; --disable-single-login&lt;br /&gt;
: If you use this, multiple different avatars on the same account can be logged in at once. Logging into the same avatar will boot the other. Without disabling &amp;quot;single login&amp;quot;, logging into the same account will boot whatever avatar is logged in from that account.&lt;br /&gt;
Other options:&lt;br /&gt;
; --enable-require-secure-download&lt;br /&gt;
: Boot users who don't download Python.pak.&lt;br /&gt;
; --enable-encryption=type&lt;br /&gt;
: The default is &amp;quot;cyan_dh&amp;quot;. MOSS allows you to disable encryption, or (legacy) use [[MOSS-Notes#RSA | RSA ]].&lt;br /&gt;
; --enable-fork&lt;br /&gt;
: The primary use for this is if you need to debug auth or file servers. It is much easier to debug single-threaded programs.&lt;br /&gt;
; --enable-debug&lt;br /&gt;
: Anyone developing MOSS or willing to run some extra bug-hunting code should use this. If the bug-hunting code finds a bad thing it will make the server dump core so you can debug it.&lt;br /&gt;
; --enable-old-protocol&lt;br /&gt;
: This makes MOSS use older protocol versions. You probably don't need this.&lt;br /&gt;
If you have any trouble with configure finding the locations of various&lt;br /&gt;
libraries, you can use these:&lt;br /&gt;
; --with-postgres=PREFIX&lt;br /&gt;
; --with-libpqxx=PREFIX&lt;br /&gt;
; --with-openssl=PREFIX&lt;br /&gt;
; --with-zlib=PREFIX&lt;br /&gt;
; --with-iconv=PREFIX&lt;br /&gt;
&lt;br /&gt;
=== Compile ===&lt;br /&gt;
&lt;br /&gt;
Run &amp;quot;make&amp;quot;. Assuming that succeeds, you probably should use &amp;quot;make install&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Now cd into the postgresql directory. Here you need to compile a custom&lt;br /&gt;
PostgreSQL module that creates UUIDs. Follow the instructions in the README&lt;br /&gt;
file there, but for most people this should just be running &amp;quot;make&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Install the postgres module in your postgres install. Do this by copying the&lt;br /&gt;
moss_uuidgen.so file you just compiled. You'll need to log in as root to do&lt;br /&gt;
this (&amp;quot;sudo cp moss_uuidgen.so /path/to/postgres/modules&amp;quot; on most&lt;br /&gt;
systems). Please check [[MOSS-Distribution_Specific_Instructions]] and fill in&lt;br /&gt;
where to copy it for your system if it's not there already. Consult PostgreSQL&lt;br /&gt;
documentation if you're not sure. After the library is installed, restart the&lt;br /&gt;
DB server.&lt;br /&gt;
&lt;br /&gt;
== Set Up the Database ==&lt;br /&gt;
&lt;br /&gt;
The easiest way to set up the database is to create a &amp;quot;moss&amp;quot; user to be&lt;br /&gt;
associated with the MOSS database. It needs to be able to modify tables in the&lt;br /&gt;
MOSS DB. Most distributions create some user that has root access to the DB&lt;br /&gt;
when connecting from the local machine. In my example this user is &amp;quot;pgsql&amp;quot; but&lt;br /&gt;
yours may be different. Please check&lt;br /&gt;
[[MOSS-Distribution_Specific_Instructions]] for hints or to fill in the user&lt;br /&gt;
for your distribution.&lt;br /&gt;
&lt;br /&gt;
Start by creating the database. The default database name is &amp;quot;moss&amp;quot;; if you use&lt;br /&gt;
any other you'll have to set it in the MOSS&lt;br /&gt;
[[#Configuration_Files | configuration file]]. Make sure to use the 'UTF8'&lt;br /&gt;
encoding. Then create the user in the new database. If you want to use a&lt;br /&gt;
different username, you will have to edit the moss.sql file to match. Then load&lt;br /&gt;
postgresql/moss.sql into the new database.&lt;br /&gt;
&lt;br /&gt;
I did the following:&lt;br /&gt;
 su pgsql -c &amp;quot;psql postgres&amp;quot;&lt;br /&gt;
 create database moss with encoding='UTF8';&lt;br /&gt;
 \c moss&lt;br /&gt;
 create role moss with login;&lt;br /&gt;
 \q&lt;br /&gt;
 su pgsql -c &amp;quot;psql postgres -f moss.sql&amp;quot;&lt;br /&gt;
After this, you can connect to the database as the &amp;quot;moss&amp;quot; user:&lt;br /&gt;
 pgql -U moss&lt;br /&gt;
&lt;br /&gt;
If all that works, you are done setting up the database!&lt;br /&gt;
&lt;br /&gt;
To set up AllAgeGlobalSDLNodes, use global_sdl_manager (we have no VaultManager&lt;br /&gt;
to do it). This program is installed in ''prefix''/bin. To aid setup, the&lt;br /&gt;
support/set_to_moul.txt file can be used to set the global SDL state to a&lt;br /&gt;
reasonable default (with no sparks) by running something like:&lt;br /&gt;
 global_sdl_manager game/SDL &amp;lt; set_to_moul.txt&lt;br /&gt;
If you want sparks, you can turn them on yourself using this program, but the&lt;br /&gt;
Minkata one is still broken.&lt;br /&gt;
&lt;br /&gt;
== Set Up Files ==&lt;br /&gt;
&lt;br /&gt;
There are quite a few files that the server needs to use. All these files are&lt;br /&gt;
located by default in locations relative to where you will *start* the&lt;br /&gt;
server. The location of all the files can be configured in the&lt;br /&gt;
[[#Configuration_Files | configuration files]]; you may find it easiest to&lt;br /&gt;
specify absolute paths (starting with &amp;quot;/&amp;quot;) there.&lt;br /&gt;
&lt;br /&gt;
=== File Server Data ===&lt;br /&gt;
&lt;br /&gt;
You need to start with your current Uru install (MOULagain, presumably). This&lt;br /&gt;
procedure assumes you can run a Windows application to create the file server&lt;br /&gt;
manifets MOSS needs. This seems a reasonable assumption when the client itself&lt;br /&gt;
is a Windows app.&lt;br /&gt;
&lt;br /&gt;
Copy support/ManifestCreator.exe and support/Mainfests.zip to your Windows&lt;br /&gt;
install. Unzip Manifests.zip. This will make a &amp;quot;CyanStructure&amp;quot; folder. The .txt&lt;br /&gt;
files in this folder are input. They describe the files which need to be in the&lt;br /&gt;
final manifests.&lt;br /&gt;
&lt;br /&gt;
Start up ManifestCreator. To generate a manifest, click &amp;quot;Make Manifest&amp;quot; and it&lt;br /&gt;
brings up a dialog. Navigate to the CyanStructure folder, and select all the&lt;br /&gt;
.txt files there. Then click OK and when it pops up a dialog asking for the&lt;br /&gt;
location of your Uru install, navigate to that directory, click OK and wait for&lt;br /&gt;
a bit.&lt;br /&gt;
&lt;br /&gt;
When it is done stop and consider which files you need the file server to&lt;br /&gt;
actually give to clients. If you are making this shard for yourself it could be&lt;br /&gt;
basically nothing, or everything. Note that we do not have a license to&lt;br /&gt;
redistribute Cyan's data files. So it is recommended not to copy any files you&lt;br /&gt;
should not distribute to your file server.&lt;br /&gt;
&lt;br /&gt;
Back on the machine which will run MOSS, create a file server directory. The&lt;br /&gt;
default is &amp;quot;./file&amp;quot; (relative to where you start it up). I recommend you make&lt;br /&gt;
it ''prefix''/file, where ''prefix'' is the installed location. Copy all the&lt;br /&gt;
.mbm files created in the CyanStructure folder to this directory. If you are&lt;br /&gt;
serving up a CWE client (built from open source) you will want to copy the&lt;br /&gt;
gzipped executable and libraries. They are located in&lt;br /&gt;
CyanStructure\Client\External and need to be in ''file dir''/Client/External on&lt;br /&gt;
your server to match. Anything you can distribute and that clients will need to&lt;br /&gt;
download, like a new age, also should be copied. Make sure to match the&lt;br /&gt;
directory structures when copying them over.&lt;br /&gt;
&lt;br /&gt;
Finally, Mac clients request the &amp;quot;macExternal&amp;quot; manifest instead of&lt;br /&gt;
&amp;quot;External&amp;quot;. There are added files in the Mac manifest, but if you don't have&lt;br /&gt;
them to generate a proper manifest from, just copy or symlink External.mbm to&lt;br /&gt;
macExternal.mbm. If you do have the files, you can generate the proper manifest&lt;br /&gt;
using ManifestCreator.exe and the support/macExternal.txt file.&lt;br /&gt;
&lt;br /&gt;
=== Auth Server Data ===&lt;br /&gt;
&lt;br /&gt;
Like for the file server data, the default auth directory is &amp;quot;./auth&amp;quot; (relative&lt;br /&gt;
to where you start it up). I recommend using ''prefix''/auth.&lt;br /&gt;
&lt;br /&gt;
A script automating all the following steps in this section is in the works.&lt;br /&gt;
&lt;br /&gt;
This directory is required to have another subdirectory named &amp;quot;default&amp;quot;. You&lt;br /&gt;
must keep a copy here of the encrypted Python and SDL files for clients to&lt;br /&gt;
download. The easiest way to get a set of these files is from the Cyan-provided&lt;br /&gt;
[http://assets.openuru.org/cyan/AuthFiles.zip AuthFiles.zip]. Download this&lt;br /&gt;
file, and unzip it. Copy the entire contents of the resulting AuthFiles/893&lt;br /&gt;
directory to ''auth dir''/default/. The resulting directory structure is:&lt;br /&gt;
 auth&lt;br /&gt;
   default&lt;br /&gt;
     Python&lt;br /&gt;
       python.pak&lt;br /&gt;
     SDL&lt;br /&gt;
       various .sdl files&lt;br /&gt;
     encryption.key&lt;br /&gt;
&lt;br /&gt;
Now you have to make manifest files here as well. Make a Python.txt file which&lt;br /&gt;
contains one line: &amp;quot;Python\python.pak&amp;quot;. Make an SDL.txt file with contains one&lt;br /&gt;
line per file in the SDL directory. The lines look like&lt;br /&gt;
&amp;quot;SDL\BaronCityOffice.sdl&amp;quot;. I just toss these in the auth/default directory but&lt;br /&gt;
you don't have to. The server does not look at them.&lt;br /&gt;
&lt;br /&gt;
If you have user-created ages with SDL files, be sure to add them to the SDL&lt;br /&gt;
directory here. Encrypt them with the encryption.key. (A tool to do this does&lt;br /&gt;
exist in the CWE source.) Similarly, if you want to add Python, you can rebuild&lt;br /&gt;
the Python.pak file, but if you are adding a new age, you may find it easier to&lt;br /&gt;
add a new .pak file. If you do that, encrypt it and then add a new line to the&lt;br /&gt;
Python.txt file for your new .pak. The client will download them all.&lt;br /&gt;
&lt;br /&gt;
Once you have listed each SDL and Python file, you can use the perl script&lt;br /&gt;
support/make-mbam.pl to create the .mbam files. If you don't have Perl,&lt;br /&gt;
ManifestCreator.exe will also create the files. Select &amp;quot;Auth Server&amp;quot; in the&lt;br /&gt;
&amp;quot;Manifest type&amp;quot; dropdown. If you use ManifestCreator, make sure it has the&lt;br /&gt;
Python and SDL directories and their contents. Make sure to copy the resulting&lt;br /&gt;
two .mbam files to your ''auth-dir''/default directory.&lt;br /&gt;
&lt;br /&gt;
=== Game Server Data ===&lt;br /&gt;
&lt;br /&gt;
Just like for the file and auth server data, the default game directory is&lt;br /&gt;
&amp;quot;./game&amp;quot; (relative to where you start it up). I recommend using&lt;br /&gt;
''prefix''/game.&lt;br /&gt;
&lt;br /&gt;
A script automating all the following steps in this section is in the works.&lt;br /&gt;
&lt;br /&gt;
The game servers need unencrypted .sdl and .age files. The easiest way to get a&lt;br /&gt;
set of these files is from the Cyan-provided&lt;br /&gt;
[http://assets.openuru.org/cyan/Scripts.zip Scripts.zip]. Download this file&lt;br /&gt;
and unzip it. Copy/move the Scripts/SDL directory to ''game-dir''. Then create&lt;br /&gt;
''game-dir''/age and copy Scripts/dat/*.age to it. (MOSS does not use the .fni&lt;br /&gt;
files.)&lt;br /&gt;
&lt;br /&gt;
Do not forget to copy any user-created ages' SDL and .age files here. This copy&lt;br /&gt;
needs to be unencrypted.&lt;br /&gt;
&lt;br /&gt;
Now there is one more step. The SDL files the game serer uses need to be moved&lt;br /&gt;
around, some into subdirectories, and some renamed because Unix treats file&lt;br /&gt;
names case-sensitively. Please read the details in the doc/setup file (linked&lt;br /&gt;
at the top of this page). You should have three subdirectories when you're&lt;br /&gt;
done. User-created ages may need subdirectories too, if they have multiple .sdl&lt;br /&gt;
files. If you find this way too complex, just move all the .sdl files into&lt;br /&gt;
the common subdirectory. You lose some small optimizations this way.&lt;br /&gt;
&lt;br /&gt;
At the end the directory structure should be:&lt;br /&gt;
 game&lt;br /&gt;
   age&lt;br /&gt;
     various .age files&lt;br /&gt;
   SDL&lt;br /&gt;
     common&lt;br /&gt;
       some .sdl files&lt;br /&gt;
     Garrison&lt;br /&gt;
       a couple of .sdl files&lt;br /&gt;
     Teledahn&lt;br /&gt;
       other .sdl files&lt;br /&gt;
     more .sdl files&lt;br /&gt;
&lt;br /&gt;
== Key Files ==&lt;br /&gt;
&lt;br /&gt;
The modified Diffie-Helman algorithm used in the client and MOSS by default&lt;br /&gt;
requires the server to have private keys. '''Do not share them with anyone.'''&lt;br /&gt;
They should not be world-readable.&lt;br /&gt;
&lt;br /&gt;
You can generate keys using the &amp;quot;make_cyan_dh&amp;quot; program which will be installed&lt;br /&gt;
in ''prefix''/bin. Or, there might be a program to generate keys in the CWE&lt;br /&gt;
source, but the chance of it outputting the private keys in the format MOSS&lt;br /&gt;
wants is basically zero. Generate a key for each of auth, game, and&lt;br /&gt;
gatekeeper. Run &amp;quot;make_cyan_dh -h&amp;quot; to see what generators to use if you want to&lt;br /&gt;
match those MOULagain is using. If you're building your own client you can use&lt;br /&gt;
whatever generator you want. Note: I see no reason not to use OpenSSL default&lt;br /&gt;
generators such as 2 or 5. In fact, unless you are a cryptographer, I do not&lt;br /&gt;
recommend departing from these. If you are a cryptographer, you probably did&lt;br /&gt;
not need to hear that from me!&lt;br /&gt;
&lt;br /&gt;
The -s and -c options direct the program to write the data for the server and&lt;br /&gt;
client to files, respectively, e.g.:&lt;br /&gt;
 make_cyan_dh -g 2 -s auth_key.der -c auth_key.bin&lt;br /&gt;
&lt;br /&gt;
If you're compiling a CWE client, make_cyan_dh does not currently output data&lt;br /&gt;
in that format. See [https://foundry.openuru.org/jira/browse/MOSS-3 the bug]&lt;br /&gt;
for the workaround. If you're not compiling a client, it's up to you what to do&lt;br /&gt;
with the .bin file.&lt;br /&gt;
&lt;br /&gt;
Take the .der file (contains the PRIVATE key) and move it to ''prefix''. I&lt;br /&gt;
suggest using ''prefix''/etc/auth_key.der. Make it readable only by the user&lt;br /&gt;
which will be running the server: &amp;quot;chmod 400 ''prefix''/etc/auth_key.der; chown&lt;br /&gt;
mossuser ''prefix''/etc/auth_key.der&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Do the same for the game and gatekeeper keys. ''prefix''/etc/game_key.der and&lt;br /&gt;
''prefix''/etc/gatekeeper_key.der.&lt;br /&gt;
&lt;br /&gt;
== Configuration Files ==&lt;br /&gt;
&lt;br /&gt;
Now that you have all the other files set up, it's time to configure MOSS&lt;br /&gt;
itself. There is a configuration file for each server process. The default&lt;br /&gt;
location for moss_backend is ./etc/moss_backend.cfg and the default&lt;br /&gt;
location for moss is ./etc/moss.cfg. I recommend copying main.cfg to&lt;br /&gt;
''prefix''/etc/moss.cfg and backend.cfg to ''prefix''/etc/moss_backend.cfg.&lt;br /&gt;
&lt;br /&gt;
Now open each up in your text editor. The files contain instructions for how to&lt;br /&gt;
set the various options.&lt;br /&gt;
&lt;br /&gt;
I recommend you set the following in moss.cfg to the absolute paths&lt;br /&gt;
corresponding to where you installed these files in earlier steps:&lt;br /&gt;
&amp;lt;tt&amp;gt;auth_download_dir&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;auth_key_file&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;file_download_dir&amp;lt;/tt&amp;gt;,&lt;br /&gt;
&amp;lt;tt&amp;gt;game_data_dir&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;game_key_file&amp;lt;/tt&amp;gt;,&lt;br /&gt;
&amp;lt;tt&amp;gt;gatekeeper_key_file&amp;lt;/tt&amp;gt;. In addition I recommend you set &amp;lt;tt&amp;gt;log_dir&amp;lt;/tt&amp;gt;&lt;br /&gt;
to somewhere you want log files to go. Remember the log directory has to be&lt;br /&gt;
writable by the user that will run the server. You may also need to set&lt;br /&gt;
&amp;lt;tt&amp;gt;pid_file&amp;lt;/tt&amp;gt; to a location writable by that user. If you want the .pid&lt;br /&gt;
file to be created. Read through all the options to make sure your setup is as&lt;br /&gt;
you want. The only mandatory configuration directive is&lt;br /&gt;
&amp;lt;tt&amp;gt;external_address&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For moss_backend.cfg look especially into &amp;lt;tt&amp;gt;log_dir&amp;lt;/tt&amp;gt; and&lt;br /&gt;
&amp;lt;tt&amp;gt;pid_file&amp;lt;/tt&amp;gt;. In addition, depending on how your DB is&lt;br /&gt;
[[#Set_Up_the_Database | set up]] you likely need to specify &amp;lt;tt&amp;gt;db_user&amp;lt;/tt&amp;gt;,&lt;br /&gt;
and maybe other DB parameters.&lt;br /&gt;
&lt;br /&gt;
== Security Considerations ==&lt;br /&gt;
&lt;br /&gt;
'''Please''' read about them at the end of&lt;br /&gt;
[http://foundry.openuru.org/fisheye/browse/MOSS/doc/setup doc/setup].&lt;br /&gt;
&lt;br /&gt;
Do not run MOSS as root.&lt;br /&gt;
&lt;br /&gt;
== Before You Open Your Server ==&lt;br /&gt;
&lt;br /&gt;
If you plan to let anyone other than you connect to your server, you have&lt;br /&gt;
certain obligations under the licenses of the software/data you will be&lt;br /&gt;
distributing from the file and auth servers.&lt;br /&gt;
&lt;br /&gt;
* The MOULagain EULA still does not provide for you to modify and redistribute the files. So do not put original or modified Cyan files on your file server. You can still have them listed in the .mbm (manifest) files. If someone has an incomplete install they will be forced to get the files from Cyan's file server. That is as yet still the only place from which you're supposed to get those files.&lt;br /&gt;
&lt;br /&gt;
* You are supplying GPL'd Python code. You must provide a way to acquire that code. If you are using unmodified Python you can link to the [http://assets.openuru.org/cyan/Scripts.zip original source]. If you modify it for any reason, you must make your changes available.&lt;br /&gt;
&lt;br /&gt;
* If you are providing client executables from a CWE build:&lt;br /&gt;
** You must add the GPL license file to the client install. This means you'll have to add it to ThinExternal.txt and generate a new .mbm file, copying the .mbm file and LICENSE.txt.gz over to the appropriate locations.&lt;br /&gt;
** You must provide a way to acquire the source for your client. If you use an unmodified version you should be able to link to the repository (make sure you point to the changeset you used). If you modify files for your shard's public keys, status hostname, and/or gatekeeper/auth addresses, you have to additionally provide that source. Note: these are ''public'' keys, so don't worry, you're not giving anything away.&lt;br /&gt;
** Unless someone changes the jpeg library again, you need to credit IJG for jpeglib. The easiest may be to add another file doing so to the install. Or, if you are modifying Python for some reason, you could add it to the in-game credits along with all the other licenses:&lt;br /&gt;
 xUruCreditsJournalEnglish.py&lt;br /&gt;
 xUruCreditsJournalFrench.py&lt;br /&gt;
 xUruCreditsJournalGerman.py&lt;br /&gt;
 xUruCreditsJournalItalian.py&lt;br /&gt;
 xUruCreditsJournalSpanish.py&lt;br /&gt;
&lt;br /&gt;
The links or whatever means you use to provide access to the source of the&lt;br /&gt;
binaries and Python don't have to go into the client install, but they must be&lt;br /&gt;
somewhere reasonable for your users to find. I would put links to a copy of the&lt;br /&gt;
files on your shard's home page or something.&lt;br /&gt;
&lt;br /&gt;
See also [[CyanWorlds.com_Engine/FAQ#What_are_my_open_source_license_.28GPLv3.29_responsibilities_as_a_user.2C_developer_or_server_operator_.28e.g._shard_owner.29.3F | the CWE FAQ]].&lt;br /&gt;
&lt;br /&gt;
Please do not consider this advice the final or complete word on the&lt;br /&gt;
matter. All the licenses of all the data you use expect you to follow them. So&lt;br /&gt;
you have to do your due diligence. If you find something obviously missing from&lt;br /&gt;
this section, please add it!&lt;br /&gt;
&lt;br /&gt;
== Start It Up ==&lt;br /&gt;
&lt;br /&gt;
Now you should be set to run your server. Hopefully someone will contribute a&lt;br /&gt;
nice startup script. For now, cd to the directory you planned from the start to&lt;br /&gt;
start the server from (that's ''prefix'' in the earlier recommendations). Make&lt;br /&gt;
sure you are su'd to the user you want to run as. '''NOT root!''' Start&lt;br /&gt;
moss_backend first, then moss. E.g., if you have put the config files in&lt;br /&gt;
''prefix''/etc, you can just do:&lt;br /&gt;
 bin/moss_backend&lt;br /&gt;
 bin/moss&lt;br /&gt;
You can instead specify the location of the config file with the -c option.&lt;br /&gt;
If you've used absolute paths in the config files, you can thus easily run&lt;br /&gt;
the server from any directory.&lt;br /&gt;
&lt;br /&gt;
== Create Accounts ==&lt;br /&gt;
&lt;br /&gt;
Don't forget to create accounts for your users, or it will be difficult to log&lt;br /&gt;
in... Please just refer directly to &lt;br /&gt;
[http://foundry.openuru.org/fisheye/browse/MOSS/doc/user-management doc/user-management].&lt;br /&gt;
&lt;br /&gt;
Hopefully someone will contribute a script to add users. A CGI script to&lt;br /&gt;
automatically add users would be neat too.&lt;br /&gt;
&lt;br /&gt;
== More Hints ==&lt;br /&gt;
&lt;br /&gt;
Please see the following for more information of interest to running a server.&lt;br /&gt;
&lt;br /&gt;
* [[MOSS-Notes]]&lt;br /&gt;
* [http://foundry.openuru.org/fisheye/browse/MOSS/doc/running doc/running]&lt;/div&gt;</summary>
		<author><name>A'moaca'</name></author>
	</entry>
	<entry>
		<id>https://wiki.openuru.org/index.php?title=MOSS&amp;diff=953</id>
		<title>MOSS</title>
		<link rel="alternate" type="text/html" href="https://wiki.openuru.org/index.php?title=MOSS&amp;diff=953"/>
		<updated>2011-04-04T06:21:26Z</updated>

		<summary type="html">&lt;p&gt;A'moaca': Created page with &amp;quot;MOSS is a unix-based server for the Myst Online: Uru Live client. Development began after the announcement of the shutdown of MOUL. It is complete enough to play the entire game,...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MOSS is a unix-based server for the Myst Online: Uru Live client. Development&lt;br /&gt;
began after the announcement of the shutdown of MOUL. It is complete enough to&lt;br /&gt;
play the entire game, supports multiplayer use, is licensed under GPLv3, and is&lt;br /&gt;
not ported to Windows.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
MOSS was developed by a'moaca' and cjkelly1. a'moaca' wrote all the C/C++ code,&lt;br /&gt;
and cjkelly1 wrote most of the SQL code, including doing research to determine&lt;br /&gt;
how to set up the vault. cjkelly1 wrote a tool to create the manifest files&lt;br /&gt;
required by the server, and also made the invaluable contribution of a lot of&lt;br /&gt;
testing over the years. Weldergeek helped with some of the multiplayer testing,&lt;br /&gt;
especially Heek. a'moaca' sincerely hopes there will be more contributors now&lt;br /&gt;
that MOSS is released.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Why Use MOSS? ==&lt;br /&gt;
&lt;br /&gt;
If you just want to host a private shard, MOSS should serve your purposes. Do&lt;br /&gt;
be sure to consult [[MOSS-Setup#Before You Open Your Server]] for some help on&lt;br /&gt;
what you need to do if you host an Uru shard.&lt;br /&gt;
&lt;br /&gt;
The server definitely works with the [[CyanWorlds.com_Engine | CWE client]]! If&lt;br /&gt;
you are thinking of doing client development you will probably find a server&lt;br /&gt;
that is not MOULagain to test with quite valuable. (MOSS was also tested with&lt;br /&gt;
PlasmaClient, but it does not fully work for PlasmaClient because it does some&lt;br /&gt;
things that a'moaca' argues are bugs from the system perspective. Let's fix&lt;br /&gt;
PlasmaClient.)&lt;br /&gt;
&lt;br /&gt;
The server has some features meant to help make it a little easier to test ages&lt;br /&gt;
you are creating. The SDL files for an age are loaded each time the age is&lt;br /&gt;
started up so you can change them without restarting MOSS. There is full&lt;br /&gt;
support for multiple .pak files. So, run your own server, test at your own&lt;br /&gt;
pace. Test in the CWE client and not the PotS one.&lt;br /&gt;
&lt;br /&gt;
== How to Get It ==&lt;br /&gt;
&lt;br /&gt;
{{tba}}&lt;br /&gt;
&lt;br /&gt;
The source code is hosted in a Mercurial repository here at OpenUru.org.&lt;br /&gt;
You can clone (download) a copy of the repository using Mercurial, or you can&lt;br /&gt;
use a snapshot. If you are considering making changes to the code, you will&lt;br /&gt;
probably prefer using the version control. If you just want to compile and run&lt;br /&gt;
a server, a snapshot should do. In addition, a compiled version is&lt;br /&gt;
available for the TBD platform.&lt;br /&gt;
&lt;br /&gt;
If you are new to Mercurial, you may want to check the&lt;br /&gt;
[http://mercurial.selenic.com/wiki/QuickStart QuickStart]. There are links to&lt;br /&gt;
more complete documentation at the bottom. The Foundry is secured via SSL&lt;br /&gt;
throughout the site. A browser security certificate is needed. Instructions are&lt;br /&gt;
available on the [[Foundry_Certificate_Installation | certificate installation&lt;br /&gt;
page]].&lt;br /&gt;
&lt;br /&gt;
'''Repository address:''' https://foundry.openuru.org/hg/MOSS&lt;br /&gt;
&lt;br /&gt;
'''Snapshot location:''' TBD&lt;br /&gt;
&lt;br /&gt;
'''Binary package:''' TBD&lt;br /&gt;
&lt;br /&gt;
== How to Set Up a Server ==&lt;br /&gt;
&lt;br /&gt;
The [http://foundry.openuru.org/fisheye/browse/MOSS/doc/setup setup] file&lt;br /&gt;
contains a complete set of installation instructions. They do assume you are&lt;br /&gt;
conversant with setting up software and basic management of a database. For&lt;br /&gt;
additional setup instructions, see [[MOSS-Setup]]. Feel free to add any hints&lt;br /&gt;
specific to your distribution [[MOSS-Distribution_Specific_Instructions | here]].&lt;br /&gt;
&lt;br /&gt;
Cyan has provided a copy of the files needed for a server hosting MOUL content.&lt;br /&gt;
The .sdl, .age, and Python source are all available at&lt;br /&gt;
http://assets.openuru.org/cyan/Scripts.zip. If you are not interested in&lt;br /&gt;
compiling your own Python from this source, you can also get a copy of the&lt;br /&gt;
compiled Python from http://assets.openuru.org/cyan/AuthFiles.zip.&lt;br /&gt;
&lt;br /&gt;
== How to Contribute ==&lt;br /&gt;
&lt;br /&gt;
Contributing to the wiki pages is welcome. Adding extra setup instructions, or&lt;br /&gt;
adding documentation about how MOSS works, are two good examples. It's a wiki,&lt;br /&gt;
please contribute anything you think others might want to read.&lt;br /&gt;
&lt;br /&gt;
Almost any code contribution is welcome. What is unwelcome? Protocol/behavior&lt;br /&gt;
changes without corresponding client support (obviously). Changes that remove&lt;br /&gt;
security without the option of keeping it. Changes that introduce security&lt;br /&gt;
holes, either in the server itself or the vault. Changes that break big-endian&lt;br /&gt;
support (call it a pet peeve if you like, it's still unwelcome). Changes that&lt;br /&gt;
break the build (accidents do happen, but don't break it on purpose). Hopefully&lt;br /&gt;
it is not difficult to see why these things are unwelcome.&lt;br /&gt;
&lt;br /&gt;
If you find a bug, please report it. Please, please, please search first to see&lt;br /&gt;
if it's already reported. The bug tracker is here:&lt;br /&gt;
https://foundry.openuru.org/jira/browse/MOSS&lt;br /&gt;
&lt;br /&gt;
If you find a bug and fix it, include the patch with the bug report! This&lt;br /&gt;
increases the chances of it getting fixed rather a lot.&lt;br /&gt;
&lt;br /&gt;
Bug fixes are very valuable.&lt;br /&gt;
[https://foundry.openuru.org/jira/browse/MOSS Grab a bug] and fix it! Check&lt;br /&gt;
out [[MOSS-Project_Ideas]] for more ideas.&lt;br /&gt;
&lt;br /&gt;
If you want to add a feature or change something, you can file a feature&lt;br /&gt;
request or task bug to get your change considered for the&lt;br /&gt;
[https://foundry.openuru.org/hg/MOSS central repository].&lt;br /&gt;
&lt;br /&gt;
If you want write access to the central repository, contribute. I think the&lt;br /&gt;
best for MOSS will be to use similar standards for determining who is given&lt;br /&gt;
write access as CWE. At this time that's undecided, so I leave MOSS equally&lt;br /&gt;
undecided. However, MOSS's original author is more involved than CWE's so if&lt;br /&gt;
only a couple people show up to help then it's pretty clear a couple people&lt;br /&gt;
will get write access soon enough!&lt;br /&gt;
&lt;br /&gt;
Code reviewers might be needed. If you are willing to be a reviewer, say so! It&lt;br /&gt;
is a very valuable contribution.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
[[MOSS-Setup]]&lt;br /&gt;
&lt;br /&gt;
[[MOSS-Developer_Notes]]&lt;br /&gt;
&lt;br /&gt;
[[CyanWorlds.com_Engine]]&lt;/div&gt;</summary>
		<author><name>A'moaca'</name></author>
	</entry>
	<entry>
		<id>https://wiki.openuru.org/index.php?title=CyanWorlds.com_Engine&amp;diff=924</id>
		<title>CyanWorlds.com Engine</title>
		<link rel="alternate" type="text/html" href="https://wiki.openuru.org/index.php?title=CyanWorlds.com_Engine&amp;diff=924"/>
		<updated>2011-04-01T06:11:08Z</updated>

		<summary type="html">&lt;p&gt;A'moaca': /* OpenUru.org Announcement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;float: right; padding: 10px;&amp;quot;&amp;gt;http://assets.openuru.org/logos/gpl/gplv3-127x51.png&amp;lt;/div&amp;gt;&lt;br /&gt;
== CyanWorlds.Com Engine Open Source Project ==&lt;br /&gt;
&lt;br /&gt;
The wait is over!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Introduction ===&lt;br /&gt;
Cyan Worlds, Inc. and OpenUru.org jointly announce open source delivery of the CyanWorlds.com Engine client and 3ds Max plugin, aka Plasma, the engine used to power Myst Online: Uru Live.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Cyan Worlds Announcement ====&lt;br /&gt;
The following message was posted on the MystOnline.com forums on (date):&lt;br /&gt;
&amp;lt;blockquote class=&amp;quot;bluebox&amp;quot;&amp;gt;(Insert Cyan Worlds' announcement text here)&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== OpenUru.org Announcement ====&lt;br /&gt;
OpenUru.org introduces the CyanWorlds.Com Engine, Cyan Worlds' Plasma game engine used to power Myst Online: Uru Live.  The OpenUru.org team is thrilled that the CyanWorlds.com Engine has been released by Cyan Worlds as open source.  We are honored that Cyan Worlds has given OpenUru.org the opportunity to prepare and release it to the Uru community and the world.  The initial release of the CyanWorlds.Com Engine includes Cyan Worlds' client and 3ds Max Plugin.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OpenUru.org is especially pleased to simultaneously announce MOSS, a CyanWorlds.Com Engine server, by a'moaca' with cjkelly1.  MOSS was largely derived from a'moaca's work on her client protocol Wireshark plugin, a project also hosted on OpenUru.org.  Cyan Worlds cannot release their server code until more is done to clear it for open source, so a'moaca's completion of her open source server couldn't have been more perfectly timed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OpenUru.org is prepared with tools to support new development of the CyanWorlds.com Engine with MOSS.  We welcome all developers, issue reporters and users to contribute to the effort.  Contributors can work on our Foundry with Atlassian tools such as JIRA, Fisheye and Crucible to manage development projects and Jenkins (previously known as Hudson) for Continuous Integration to produce automated builds.&lt;br /&gt;
&lt;br /&gt;
=== What It Is ===&lt;br /&gt;
CyanWorlds.Com Engine is the client, server and tools used to develop and operate the Myst Online: Uru Live MMO.  The server code needs more work before Cyan Worlds can clear it for open source.  However, the client and 3ds Max plugin are now available in open source.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How To Get It ===&lt;br /&gt;
CyanWorlds.Com Engine is available on OpenUru.org's Foundry, hosted on a Mercurial code repository.  There was much discussion on the Myst Online forums about the strengths of various repositories after Cyan Worlds' initial open source announcement in 2008.  We listened.  Mercurial was selected due to the needs of a distributed developer community.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OpenUru.org needs to throttle the initial download traffic due to the expected extreme demand built up during the long wait for open source.  Therefore, any developer wishing to get the initial release needs to register an account on the Foundry at https://Foundry.OpenUru.org/jira.  The Foundry is secured via SSL throughout the site.  A browser security certificate is needed.  Instructions are available on the  [[Foundry Certificate Installation|certificate installation page]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Developers with an account will be given access to pull the CyanWorlds.Com Engine repository as quickly as possible.  Once the developer traffic has subsided, the repository will be opened to the public and the curious.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Steps'''&lt;br /&gt;
&lt;br /&gt;
1. Register for a Foundry account at https://Foundry.OpenUru.org/jira.&lt;br /&gt;
&lt;br /&gt;
2. We will see the registration, place you in the queue, and note it in the forum thread given below.&lt;br /&gt;
&lt;br /&gt;
3. Look for an asterisk by your account name in the forum thread, then download as soon as possible.&lt;br /&gt;
&lt;br /&gt;
4. Pull the CWE repository from the address given below.&lt;br /&gt;
&lt;br /&gt;
5. As downloads are completed, more accounts will be enabled for download.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''View account queue:''' http://forums.OpenUru.org/viewtopic.php?f=91&amp;amp;t=507&lt;br /&gt;
&lt;br /&gt;
'''Repository address:''' https://Foundry.OpenUru.org/hg/CWE&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Development ===&lt;br /&gt;
Some developers will be invited to join the team in management and development positions for the CyanWorlds.Com Engine project.  But generally, anyone who demonstrates the skills and becomes a positive force in the project may contribute to development.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
CyanWorlds.Com Engine version 1.0 will consist only of a buildable client and plugin.  There will be no new features and no bug fixes, except those necessary to replace proprietary third party libraries that Cyan Worlds needed to removed before the release.  Once a successful build is released, phase two may begin to fix known issues.  After that, the fun begins with new features and full steam ahead to keep on chugging down that open source track.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once things get rolling, we'll be looking for people to fill or help with the following positions:&lt;br /&gt;
&lt;br /&gt;
* Project lead (integration of job flow, patches, release schedules)&lt;br /&gt;
* Documentation lead (create and integrate cross-platform documentation for JIRA, web, Wiki, PDF, IDE)&lt;br /&gt;
* Technology lead (site integration, resource integration, security, builds) &lt;br /&gt;
* Development lead (prioritization of issues, issue assignments, tools, set up code review)&lt;br /&gt;
* Web community lead (development of web presence and content to introduce, educate and deliver open source projects&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Documentation ===&lt;br /&gt;
What documentation?  The code documents itself!  Right? Actually, there was an apparent early effort to maintain directives used for automated Doxygen documentation from code.  Their use fell off as time went on.  Introduction of integrated documentation is considered crucial to the successful development of the CyanWorlds.Com Engine.  Therefore, Doxygen directives will be accepted into the main trunk from the start.  We want to build integrated documentation originating from the source code for use beginning with Fisheye (our repo browser), HTML, PDF, and the Visual Studio IDE.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Everyone ===&lt;br /&gt;
Everyone will be able to download and watch progress of the CyanWorlds.Com Engine project and enjoy the benefits of exploring new worlds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== The Team ===&lt;br /&gt;
The CyanWorlds.com Engine Project was brought to you by Cyan Worlds' Rand Miller, Tony Fryman, Mark DeForest and the collective talents of everyone at Cyan Worlds who ever worked on Uru Live over many years.  The original release team at OpenUru.org who are helping to make the open source CyanWorlds.com Engine project possible are JWPlatt, Mac_Fife, rarified, a'moaca', and cjkelly1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Building The Client ===&lt;br /&gt;
In the article &amp;quot;[[Build the client with MSVC 2003]]&amp;quot;, cjkelly1 describes how to build a working client from the CWE sources. Note that this build uses sources and makefiles that have been modified to substitute some of the libraries that could not be distributed with the original sources.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
=== [[CyanWorlds.com Engine/FAQ|CyanWorlds.com Engine FAQ]] ===&lt;br /&gt;
=== [[Cyan Worlds Sources And Tools]] ===&lt;br /&gt;
=== [[CWE Libraries and SDKs|CyanWorlds.com Engine Libraries and SDKs]] ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Cyan_Worlds]]&lt;/div&gt;</summary>
		<author><name>A'moaca'</name></author>
	</entry>
	<entry>
		<id>https://wiki.openuru.org/index.php?title=Wireshark_Plugin&amp;diff=588</id>
		<title>Wireshark Plugin</title>
		<link rel="alternate" type="text/html" href="https://wiki.openuru.org/index.php?title=Wireshark_Plugin&amp;diff=588"/>
		<updated>2010-06-01T00:27:08Z</updated>

		<summary type="html">&lt;p&gt;A'moaca': /* Contributing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to the main page for the Uru Wireshark plugin!&lt;br /&gt;
&lt;br /&gt;
= Do I care about this? =&lt;br /&gt;
&lt;br /&gt;
Wireshark is a GUI-based network protocol analysis tool. (There is a command-line version too.) In short, it lets you look at network traffic to see what is going on, even in real-time. a'moaca' has figured out Uru bugs based on real-time behavior related to what is seen on the network, in addition to more subtle bugs discovered with detailed later analysis.&lt;br /&gt;
&lt;br /&gt;
Generally this tool will only be of interest to those working on the protocol or client/server code. It is also interesting for a more hobbyist &amp;quot;figure out how it works&amp;quot; perspective.&lt;br /&gt;
&lt;br /&gt;
But there is a caveat. The MOUL protocol (which the plugin calls &amp;quot;UruLive&amp;quot;) is protected by a form of public-key encryption. This means that the Uru plugin cannot read the contents of any but the very first packets of each connection, unless you have the private key or some means of determining the negotiated session key.&lt;br /&gt;
&lt;br /&gt;
Only Cyan should have the private key. Anyone writing new clients can choose to expose the session key for use with the Wireshark plugin. When people can run their own servers, they will in turn have their own private keys and they can use the plugin too. If you wish to use the plugin otherwise, I leave you to your creativity.&lt;br /&gt;
&lt;br /&gt;
The plugin will work on old UU/Alcugs traffic, though, should you happen to have any to look at.&lt;br /&gt;
&lt;br /&gt;
= History (why are things this weird way?) =&lt;br /&gt;
&lt;br /&gt;
a'moaca' first started the plugin while debugging a linking hang with old Alcugs (unet2) code. The resulting bare-bones transport-layer only version of the plugin was checked into the Alcugs repository (where some Alcugs-specific code was later added that is not present in this version as of now). Later, in support of other projects, a'moaca' began adding dissection of the rest of the protocol, based almost entirely on the Alcugs server code itself. This is the reason many of the names in the plugin are what they are.&lt;br /&gt;
&lt;br /&gt;
The hobbyist perspective led to gradually more dissection, proceeding on to the MOUL protocol. Over time, cjkelly1 has contributed a lot to the plugin as well, including some code contributions, effort spent figuring things out, testing, a lot of Windows-specific testing (usually unintentional but sometimes planned), and providing some of the correct names for things.&lt;br /&gt;
&lt;br /&gt;
Very little of the knowledge added by a'moaca' and cjkelly1 after what originated from the Alcugs source came from disassembly, the &amp;quot;usual&amp;quot; method of Uru reverse-engineering. It was done by looking at real traffic and educated guessing. This is the reason many other names are what they are, and this is why there are still some gaps in the dissection.&lt;br /&gt;
&lt;br /&gt;
If you want to fix any of this, submit a patch!&lt;br /&gt;
&lt;br /&gt;
= How to use it =&lt;br /&gt;
&lt;br /&gt;
(At the moment there isn't a compiled executable to distribute. This could change in the future. Until/unless a precompiled version is available, you will have to compile your own. For that, see the next section.)&lt;br /&gt;
&lt;br /&gt;
Using the Uru plugin is not much different than using Wireshark for any other protocol. Here are some extra notes:&lt;br /&gt;
* There are two configuration sections, &amp;quot;Uru&amp;quot; and &amp;quot;UruLive&amp;quot;. The &amp;quot;Uru&amp;quot; section covers configuration specific to the Prologue/UU/PotS protocol. The &amp;quot;UruLive&amp;quot; section covers configuration specific to the MOUL/MOULa protocol. Anything common to both is also in the &amp;quot;Uru&amp;quot; section (this is the toggle for hiding fields, and all SDL-related configuration).&lt;br /&gt;
* Be careful with your SDL files. Unfortunately, the MOUL SDL files are not a strict superset of PotS files (I believe there is at least one mismatch with the same version number, for example). Genrally one copy will suffice, though. If you do not provide SDL files, the plugin will use a crummy but serviceable algorithm that guesses the field types.&lt;br /&gt;
* The UruLive configuration contains several choices for protocol versioning. These apply to MOUL versions. You can basically ignore them unless you have ''old'' uncrypted traces. The default (Live 9, autodetect) should be good.&lt;br /&gt;
* Two ways to decrypt MOUL connections are provided: giving Wireshark each session key, or giving it the private key data for each type of connection.&lt;br /&gt;
** The first way requires configuring the 7-byte session key, if you have a way to determine it. This key is negotiated each connection. The input box accepts a comma-separated list of port=key pairs. Use the client port number (the one that is not 14617); this is how the plugin associates each key with a connection. The 7 bytes of the key should be in hexadecimal. An example value might be:&lt;br /&gt;
 1050=1A2B3C4D5E6F70,1053=1234ABCD5678EF&lt;br /&gt;
:* The second way requires knowledge of the server private key. Provide a key file for each connection type (auth, game, gatekeeper). The format of the key file is 128 bytes of binary data. The first 64 bytes are the modulus in '''big-endian''' order (note it is little-endian in the exectuables), and the second 64-bytes are the private key, again '''big-endian'''. (This key file choice is based on the baseless assumption that the actual key files are stored in a common format such as DER, which is big-endian.)&lt;br /&gt;
&lt;br /&gt;
= How to compile it =&lt;br /&gt;
&lt;br /&gt;
The code is present in OpenURU.org's Subversion repository at [http://foundry.openuru.org/svn/wireshark_plugin http://foundry.openuru.org/svn/wireshark_plugin]. To check it out, use your favorite Subversion GUI with username &amp;quot;guest&amp;quot; and password &amp;quot;guest&amp;quot;, or on the command line:&lt;br /&gt;
 svn co --username guest --password guest http://foundry.openuru.org/svn/wireshark_plugin&lt;br /&gt;
This will check out the latest version of the source in the current directory. You will also need a copy of the Wireshark source. It may be downloaded from [http://www.wireshark.org/download.html the Wireshark site]. Using the &amp;quot;Development Release&amp;quot; is recommended, as the patch provided will work with that tree. Version 1.2.8 or newer will also work, but you will need to patch plugins\Makefile.nmake yourself, as the structure of the file differs between 1.2.x and the development trunk.&lt;br /&gt;
&lt;br /&gt;
In the plugin directory, the INSTALL file provides build directions. The basic idea is that you patch the plugin into the Wireshark build and then build Wireshark normally. So you should be able to follow Wireshark's build documentation.&lt;br /&gt;
&lt;br /&gt;
The [http://www.wireshark.org/docs/wsdg_html_chunked Developer's Guide] contains [http://www.wireshark.org/docs/wsdg_html_chunked/ChSrcBuildFirstTime.html build instructions], which are pretty minimal. If you are building for Windows, check [http://www.wireshark.org/docs/wsdg_html_chunked/ChSetupWin32.html the additional instructions] and a'moaca' uses [http://wiki.wireshark.org/Development/MSVC7 this wiki page].&lt;br /&gt;
&lt;br /&gt;
= Contributing =&lt;br /&gt;
&lt;br /&gt;
OpenURU.org has a JIRA installation. You may use it for [http://foundry.openuru.org:7080/browse/WIREPLUG bugs and patch contributions]. As of right now there is a limited number of JIRA accounts, so you can submit bugs &amp;quot;anonymously&amp;quot;. Please include in the report a forum name or some other reasonable contact information!&lt;br /&gt;
&lt;br /&gt;
Code contributions will be code-reviewed for safety and correctness. Please keep code to 79 columns or fewer. There are currently no plans to reject anything based on content unless it is actually incorrect. If you want commit access, contribute a couple working patches and then ask for access. This protocol may change in the future if it does not work.&lt;/div&gt;</summary>
		<author><name>A'moaca'</name></author>
	</entry>
	<entry>
		<id>https://wiki.openuru.org/index.php?title=Wireshark_Plugin&amp;diff=576</id>
		<title>Wireshark Plugin</title>
		<link rel="alternate" type="text/html" href="https://wiki.openuru.org/index.php?title=Wireshark_Plugin&amp;diff=576"/>
		<updated>2010-05-17T08:15:02Z</updated>

		<summary type="html">&lt;p&gt;A'moaca': Created page with 'Welcome to the main page for the Uru Wireshark plugin!  = Do I care about this? =  Wireshark is a GUI-based network protocol analysis tool. (There is a command-line version too.)…'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to the main page for the Uru Wireshark plugin!&lt;br /&gt;
&lt;br /&gt;
= Do I care about this? =&lt;br /&gt;
&lt;br /&gt;
Wireshark is a GUI-based network protocol analysis tool. (There is a command-line version too.) In short, it lets you look at network traffic to see what is going on, even in real-time. a'moaca' has figured out Uru bugs based on real-time behavior related to what is seen on the network, in addition to more subtle bugs discovered with detailed later analysis.&lt;br /&gt;
&lt;br /&gt;
Generally this tool will only be of interest to those working on the protocol or client/server code. It is also interesting for a more hobbyist &amp;quot;figure out how it works&amp;quot; perspective.&lt;br /&gt;
&lt;br /&gt;
But there is a caveat. The MOUL protocol (which the plugin calls &amp;quot;UruLive&amp;quot;) is protected by a form of public-key encryption. This means that the Uru plugin cannot read the contents of any but the very first packets of each connection, unless you have the private key or some means of determining the negotiated session key.&lt;br /&gt;
&lt;br /&gt;
Only Cyan should have the private key. Anyone writing new clients can choose to expose the session key for use with the Wireshark plugin. When people can run their own servers, they will in turn have their own private keys and they can use the plugin too. If you wish to use the plugin otherwise, I leave you to your creativity.&lt;br /&gt;
&lt;br /&gt;
The plugin will work on old UU/Alcugs traffic, though, should you happen to have any to look at.&lt;br /&gt;
&lt;br /&gt;
= History (why are things this weird way?) =&lt;br /&gt;
&lt;br /&gt;
a'moaca' first started the plugin while debugging a linking hang with old Alcugs (unet2) code. The resulting bare-bones transport-layer only version of the plugin was checked into the Alcugs repository (where some Alcugs-specific code was later added that is not present in this version as of now). Later, in support of other projects, a'moaca' began adding dissection of the rest of the protocol, based almost entirely on the Alcugs server code itself. This is the reason many of the names in the plugin are what they are.&lt;br /&gt;
&lt;br /&gt;
The hobbyist perspective led to gradually more dissection, proceeding on to the MOUL protocol. Over time, cjkelly1 has contributed a lot to the plugin as well, including some code contributions, effort spent figuring things out, testing, a lot of Windows-specific testing (usually unintentional but sometimes planned), and providing some of the correct names for things.&lt;br /&gt;
&lt;br /&gt;
Very little of the knowledge added by a'moaca' and cjkelly1 after what originated from the Alcugs source came from disassembly, the &amp;quot;usual&amp;quot; method of Uru reverse-engineering. It was done by looking at real traffic and educated guessing. This is the reason many other names are what they are, and this is why there are still some gaps in the dissection.&lt;br /&gt;
&lt;br /&gt;
If you want to fix any of this, submit a patch!&lt;br /&gt;
&lt;br /&gt;
= How to use it =&lt;br /&gt;
&lt;br /&gt;
(At the moment there isn't a compiled executable to distribute. This could change in the future. Until/unless a precompiled version is available, you will have to compile your own. For that, see the next section.)&lt;br /&gt;
&lt;br /&gt;
Using the Uru plugin is not much different than using Wireshark for any other protocol. Here are some extra notes:&lt;br /&gt;
* There are two configuration sections, &amp;quot;Uru&amp;quot; and &amp;quot;UruLive&amp;quot;. The &amp;quot;Uru&amp;quot; section covers configuration specific to the Prologue/UU/PotS protocol. The &amp;quot;UruLive&amp;quot; section covers configuration specific to the MOUL/MOULa protocol. Anything common to both is also in the &amp;quot;Uru&amp;quot; section (this is the toggle for hiding fields, and all SDL-related configuration).&lt;br /&gt;
* Be careful with your SDL files. Unfortunately, the MOUL SDL files are not a strict superset of PotS files (I believe there is at least one mismatch with the same version number, for example). Genrally one copy will suffice, though. If you do not provide SDL files, the plugin will use a crummy but serviceable algorithm that guesses the field types.&lt;br /&gt;
* The UruLive configuration contains several choices for protocol versioning. These apply to MOUL versions. You can basically ignore them unless you have ''old'' uncrypted traces. The default (Live 9, autodetect) should be good.&lt;br /&gt;
* Two ways to decrypt MOUL connections are provided: giving Wireshark each session key, or giving it the private key data for each type of connection.&lt;br /&gt;
** The first way requires configuring the 7-byte session key, if you have a way to determine it. This key is negotiated each connection. The input box accepts a comma-separated list of port=key pairs. Use the client port number (the one that is not 14617); this is how the plugin associates each key with a connection. The 7 bytes of the key should be in hexadecimal. An example value might be:&lt;br /&gt;
 1050=1A2B3C4D5E6F70,1053=1234ABCD5678EF&lt;br /&gt;
:* The second way requires knowledge of the server private key. Provide a key file for each connection type (auth, game, gatekeeper). The format of the key file is 128 bytes of binary data. The first 64 bytes are the modulus in '''big-endian''' order (note it is little-endian in the exectuables), and the second 64-bytes are the private key, again '''big-endian'''. (This key file choice is based on the baseless assumption that the actual key files are stored in a common format such as DER, which is big-endian.)&lt;br /&gt;
&lt;br /&gt;
= How to compile it =&lt;br /&gt;
&lt;br /&gt;
The code is present in OpenURU.org's Subversion repository at [http://foundry.openuru.org/svn/wireshark_plugin http://foundry.openuru.org/svn/wireshark_plugin]. To check it out, use your favorite Subversion GUI with username &amp;quot;guest&amp;quot; and password &amp;quot;guest&amp;quot;, or on the command line:&lt;br /&gt;
 svn co --username guest --password guest http://foundry.openuru.org/svn/wireshark_plugin&lt;br /&gt;
This will check out the latest version of the source in the current directory. You will also need a copy of the Wireshark source. It may be downloaded from [http://www.wireshark.org/download.html the Wireshark site]. Using the &amp;quot;Development Release&amp;quot; is recommended, as the patch provided will work with that tree. Version 1.2.8 or newer will also work, but you will need to patch plugins\Makefile.nmake yourself, as the structure of the file differs between 1.2.x and the development trunk.&lt;br /&gt;
&lt;br /&gt;
In the plugin directory, the INSTALL file provides build directions. The basic idea is that you patch the plugin into the Wireshark build and then build Wireshark normally. So you should be able to follow Wireshark's build documentation.&lt;br /&gt;
&lt;br /&gt;
The [http://www.wireshark.org/docs/wsdg_html_chunked Developer's Guide] contains [http://www.wireshark.org/docs/wsdg_html_chunked/ChSrcBuildFirstTime.html build instructions], which are pretty minimal. If you are building for Windows, check [http://www.wireshark.org/docs/wsdg_html_chunked/ChSetupWin32.html the additional instructions] and a'moaca' uses [http://wiki.wireshark.org/Development/MSVC7 this wiki page].&lt;br /&gt;
&lt;br /&gt;
= Contributing =&lt;br /&gt;
&lt;br /&gt;
OpenURU.org has a JIRA installation. You may use it for [http://foundry.openuru.org:7080/browse/WIREPLUG bugs and patch contributions]. As of right now there is a limited number of JIRA accounts, so you can submit bugs &amp;quot;anonymously&amp;quot;. Please include in the report a forum name or some other reasonable contact information!&lt;br /&gt;
&lt;br /&gt;
Code contributions will be code-reviewed for safety and correctness. There are currently no plans to reject anything based on content unless it is actually incorrect. If you want commit access, contribute a couple working patches and then ask for access. This protocol may change in the future if it does not work.&lt;/div&gt;</summary>
		<author><name>A'moaca'</name></author>
	</entry>
	<entry>
		<id>https://wiki.openuru.org/index.php?title=Projects_and_Resources&amp;diff=575</id>
		<title>Projects and Resources</title>
		<link rel="alternate" type="text/html" href="https://wiki.openuru.org/index.php?title=Projects_and_Resources&amp;diff=575"/>
		<updated>2010-05-17T08:06:23Z</updated>

		<summary type="html">&lt;p&gt;A'moaca': &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{draft}}&lt;br /&gt;
Sample of an index to articles on Projects and Resources on the OpenURU.org site (and elsewhere?)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Keep thing simple here! Avoid unnecessary wiki markup between the INC tags. --&amp;gt;&lt;br /&gt;
&amp;lt;!--INC--&amp;gt;== Info &amp;amp; HowTo On OpenURU.org ==&amp;lt;!--/INC--&amp;gt;&lt;br /&gt;
* &amp;lt;!--INC--&amp;gt;[http://forums.openuru.org/viewtopic.php?f=5&amp;amp;t=164 How to request a new project]&amp;lt;!--/INC--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--INC--&amp;gt;== Projects On OpenURU.org ==&amp;lt;!--/INC--&amp;gt;&lt;br /&gt;
* &amp;lt;!--INC--&amp;gt;[http://forums.openuru.org/viewforum.php?f=17 System Concepts]&amp;lt;!--/INC--&amp;gt;&lt;br /&gt;
* &amp;lt;!--INC--&amp;gt;[http://forums.openuru.org/viewforum.php?f=20 Building &amp;amp; Testing]&amp;lt;!--/INC--&amp;gt;&lt;br /&gt;
* &amp;lt;!--INC--&amp;gt;[http://forums.openuru.org/viewforum.php?f=20 Building &amp;amp; Testing]&amp;lt;!--/INC--&amp;gt;&lt;br /&gt;
* &amp;lt;!--INC--&amp;gt;[http://forums.openuru.org/viewforum.php?f=47 Myst/Uru-Style Hypergrid &amp;amp; Open Simulators]&amp;lt;!--/INC--&amp;gt;&lt;br /&gt;
* &amp;lt;!--INC--&amp;gt;[[David's Journey]]&amp;lt;!--/INC--&amp;gt;&lt;br /&gt;
* &amp;lt;!--INC--&amp;gt;[[SD&amp;amp;D_Overview|Standards For Discussion &amp;amp; Debate]]&amp;lt;!--/INC--&amp;gt;&lt;br /&gt;
* &amp;lt;!--INC--&amp;gt;[[Wireshark Plugin]]&amp;lt;!--/INC--&amp;gt;&lt;br /&gt;
* &amp;lt;!--inc--&amp;gt;Just some text&amp;lt;!--/inc--&amp;gt; &amp;lt;!-- A bit without a link, and with lower case tags --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An example of &amp;lt;!--inc--&amp;gt;'''''some bold italic text taken out of context'''''&amp;lt;!--/inc--&amp;gt; just to show that it can work.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Do not edit --&amp;gt;&lt;br /&gt;
[[Category:OpenUru.org]]&lt;br /&gt;
[[Category:Documentation]]&lt;br /&gt;
[[Category:Age Projects]]&lt;/div&gt;</summary>
		<author><name>A'moaca'</name></author>
	</entry>
</feed>