3 ms·
I've been working on a server for Ragnarok Online in Erlang if anyone's interested: http://github.com/aliter/aliter http://github.com/aliter/aliter . It's struc
by vito 17y ago
I've been working on a server for Ragnarok Online in Erlang if anyone's interested: http://github.com/aliter/aliter http://github.com/aliter/aliter . It's structured similarly I suppose, except it has no monitoring server. Players are represented as gen_fsms, and the servers (login, char, and all the zone servers) can be distributed across various nodes, etc. It uses Mnesia for its database, and the scripting language will likely be lfe or Reia. (It's lfe at the moment, but if Reia evolves enough we may jump over to that.)
Unfortunately as I'm reimplementing a server for a client that already exists, I had to offload some of the time-sensitive stuff onto C as it's simply too slow in Erlang (in this case, walking + pathfinding).
Edit: Also, hot code loading is f'ing incredible for stuff like this. Get on, walk a bit, notice a bug, update it in the code, make:all([netload]) in the shell, bam, fixed. (Though I had to patch stdlib to fix a bug in c:nc that makes make:all([netload]) useless. I've submitted a patch and it's in the pu branch.)
- steamboiler 17y agoI recently got introduced to Erlang and have a question. How do you unit test your code? I recall reading that the CouchDB author was obliged to use JavaScript for automating his unit tests. What was your experience?
- roder 17y agoLook at eunit
- steamboiler 17y agoThanks. Checking it out presently.
- evgen 17y agoeunit is good for simple functional tests (etap is another option here) but it is not really sufficient for testing things like gen_servers and more complex behavior. OTP includes a testing framework (common test) that does these sorts of tests and is in fact used to test the rest of OTP, but it is a PITA to configure and documentation is rather thin so most people opt for low-level eunit tests and hope for the best when it comes to the more complicated bahaviors of the system...