This has been on my hard disk for far too long and I want it out there.
As you all know by now, I've been spending a lot of (too much?) time inside this demo.
I analyzed the script parsing engine, created a decompiler for it.
I discovered lots of unused functions like writing back DYNAMIC0 and made patches to enable them.
DYNAMIC0 is what you can call the world state, it includes all player(s), shopkeepers and their inventories in one file. (The file even contains the accounts of OSI people who worked on the demo...)
I also discovered the demo contained many socket functions, that gave me the idea, does the demo supports multiple clients connecting to it? The demo is really more than just some demo guys, it's contains code from the real OSI servers from June 1998, there is no doubt about that. And yes, it supports multiple clients!
I discovered that the demo supports by default:
- bind/listen socket code (yes the demo is capable of listening to a port, the code just never gets called)
- accepting incomming connections (bind/listen is never enough, you need to accept connections too)
- a linked list to store multiple incoming sockets (connecting players that is)
- select API operations on the linked list (is data available/can data be sent/is error?)
- sending data to a socket
The demo is (read:was) missing:
- calls to the functions listed above
- WSAStartup (to initalize socket operations)
(WSAStartup is available and unused, but that's from the client side, not the server side)
- receive data from a socket
By analyzing the socket classes and by carefully modding the demo I was able to make it all work. I brought the unused pieces together and added the missing code like WSAStartup and receiving data from sockets.
There a currently a few limitations, these are:
- you can only connect to it with a patched uodemo to act as a pure client
(that is due to the many protocol changes OSI made, nothing I can do about that)
- the demo creates new accounts based on the "user's gameplay encryption key"
http://kec.cz/tartaros/steamengine/uplo ... cket00.htm
NOTE: the last two fields are not available in the demo, the packet length is 0x64 instead 0x68.
- when logging in, the demo uses your IP number as the account ID
(this is incompatible with the create account approach)
This means you have to create a new character every time you close the patched client
(I will patch the demo someday to modify this behaviour)
- Character names have to be UNIQUE! (as it was on OSI back then?)
- if you are running the demo in a Virtual Machine set the VM's priority class to Normal (for both active/inactive)
- Never connect to 127.0.0.1, the internal client of the uodemo uses that socket address, even though it's a linked list in memory, for your information, the socket handle is 0xBEEF (OSI humor?)
Now, the server starts listening on the port defined in the uogolddemo directory in the DAT file. By default this is port 10016. If you want to change that port you will need to extract all files from the DAT file and modify the server.txt file. If you set the port value to 0 the server function will be disabled. WSAStartup will always be called because that was really required to make my patch possible.
About the patched client: I named this beast UoDmClnt, you have to place the EXE somewhere

I hope some of you guys have the time to experiment with it, it would be interesting to have some of the UOSA timings verified or deverified. Just remember: it's June 1998, all patch notes after that are not in the demo this includes pre-casting and meditation.
Oh yeah, Razor and UOAM won't work

The downloads are here:
UoDemo+: http://uodemo.joinuo.com/index.php?title=Uodemo%2B
UoDmClnt: http://uodemo.joinuo.com/index.php?title=UoDmClnt
EDIT: updated the links