$Id: Spec.2005-07-16,v 1.1 2005-10-06 10:52:43 roderick Exp $ Replied: Fri, 15 Jul 2005 13:25:01 -0400 Replied: ""Alexis Manning" " Return-Path: alexismanning@hotpop.com Delivery-Date: Fri Jul 15 11:47:36 2005 Return-Path: Received: from junior.ibcinc.com (junior.ibcinc.com [198.22.130.72]) by eeyore.ibcinc.com (8.8.5/8.8.5/1.10/ey-1.6) with ESMTP id LAA29352 for ; Fri, 15 Jul 2005 11:47:35 -0400 (EDT) Received: from owl.ibcinc.com (owl.ibcinc.com [198.22.130.134]) by junior.ibcinc.com (8.8.5/8.8.5/1.10/jr-1.45) with ESMTP id LAA25781 for ; Fri, 15 Jul 2005 11:47:34 -0400 (EDT) Received: from va-65-173-91-19.sta.sprint-hsd.net ([65.173.91.19] helo=jones.argon.org ident=foobar) by owl.ibcinc.com with esmtp (Exim 4.34) id 1DtSPW-000617-6U for roderick@ibcinc.com; Fri, 15 Jul 2005 11:47:34 -0400 Received: from 81-6-246-203.dyn.gotadsl.co.uk ([81.6.246.203] helo=spooler) by jones.argon.org with esmtp (Exim 4.50) id 1DtSPL-0001Sg-Sy for roderick@argon.org; Fri, 15 Jul 2005 11:47:31 -0400 Received: from Spooler by spooler (Mercury/32 v4.01a) ID MO000004; 15 Jul 2005 16:47:30 +0100 Received: from spooler by hotpop.com (Mercury/32 v4.01a); 15 Jul 2005 16:16:44 +0100 Received: from fishtest (127.0.0.1) by (unauthorised access is forbidden) (Mercury/32 v4.01a) ID MG000003; 15 Jul 2005 16:16:43 +0100 Message-ID: <000701c58950$35371b00$1901a8c0@fishtest> From: "Alexis Manning" To: "Roderick Schertler" Subject: Hearse updates Date: Fri, 15 Jul 2005 16:16:42 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1506 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506 X-Spam-Score: -3.8 (---) X-Spam-Report: spam=No hits=-3.8 required=8.0 autolearn=ham version=3.0.2 host=jones.argon.org * -3.3 ALL_TRUSTED Did not pass through any untrusted hosts * -2.6 BAYES_00 BODY: Bayesian spam probability is 0 to 1% * [score: 0.0000] * 2.0 RCVD_IN_SORBS_DUL RBL: SORBS: sent directly from dynamic IP address * [81.6.246.203 listed in dnsbl.sorbs.net] * 0.1 RCVD_IN_NJABL_DUL RBL: NJABL: dialup sender did non-local SMTP * [81.6.246.203 listed in combined.njabl.org] I'm going to be releasing a new Windows Hearse client in a few days or so. I've made some server-side changes to support it, but have made sure that all changes are backward compatible. I've included the list of changes below. Which, if any, of these changes you choose to implement is up to you. If you see anything that looks bizarre, please let me know -- there's only a couple of beta users who are relying on these protocol changes so far. Cheers, -- A. ====== Client side changes =================== * Match mode is now the default behaviour (renamed 'Replace mode') where a bones file is uploaded then deleted, and one of the same level is downloaded to replace it * I've shifted away from storing stuff in the registry on the Windows client to a configuration file, so the user has more control over what's going on. * Windows Hearse now (finally) allows the user to have bones in a directory other than the one Hearse runs in. * Hearse updates the last-successfully-ran timestamp even if no file is actually uploaded, similarly to the way the Unix client behaves. * When the user uploads a file, a new X_NETHACKVER header is returned by the server. This should be stored in the configuration file and sent when force downloading files (see below). This is because the new forced downloading behaviour means that the server can no longer guarantee that the type of bones file the user most recently uploaded is the one they now want to download (e.g. user w/ Slashem and Vanilla installations has most recently uploaded a Slashem bones file, but now wants to force-download Vanilla ones). * If there is no cached X_NETHACKVER value and the user wants to force the download of files, the client will call BonesCheck on the first save file it can find to determine the Nethack version. * User can choose that, if they have less than a certain number of bones files (limited between 1 and 4), Hearse will advance them more bones files (limited between 1 and 4). To manage this and maintain compatibility with older clients: - on uploading existing files, a count is kept of how many there are, excluding those which are uploaded and then deleted - this count is also maintained on downloading bones files (since a user may have 4 bones files, upload them all, deleting them, but only be given one back by the server) - Usually, when the server runs out of files for the user an INFO error is returned along with some stats (e.g. "This version (blah) has bones files, you uploaded of them"). The server sends the new header 'X_FORCEDOWNLOAD: Y' along with that stats message. The client picks that up and doesn't display the info message if it knows that we're about to try to ask for extra bones files. - We then go through the download loop again however many times we want to get a new file, sending the header 'X_FORCEDOWNLOAD: Y' to let the server know to offer the user files even if they haven't uploaded enough. The server may still refuse the request if the user has hit a server-side daily limit. On the final pass through this loop, we also send 'X_WANTSINFO: Y'so the server knows we want to get the "This version has bones files" finished-downloading stats message. This is pretty ugly, but the simplest way I could think of to preserve the existing behaviour for old clients. * The user's email address is stored in the config file. * Users may have a nickname which is also stored in the config file. This is optionally used both when downloading bones files (e.g. "Downloading BonD0.5, uploaded by Jim The Impaler") and may later be displayed on a stats webpage. Nicknames are currently limited to 40 chars. When a new user signs up (through ?act=newuser), the new X_USERNICK header is now sent as well with the value set to their chosen nickname. * A MD5 hash of their email address and nickname is kept in the config file so a change to either can be detected. If it has then a GET is sent to http://hearse.krollmark.com/bones.dll?act=changeuserinfo (in the same way that the existing actions are handled), with the X_USERTOKEN header and the new X_USEREMAIL and X_USERNICK headers set to appropriate values. Nothing is returned on a successful nick/email change, so any error info should be taken as an indication that there is something wrong with the nick or email. * To handle an eventual wodge of 64-bit Nethacks / different roguelikes, the version info is no longer passed as four separate header variables (X_VER1, X_VER2, X_VER3, X_VER4). For backward compatibility, if these headers are sent then they will be handled as before. The preferred method for clients is to generate a comma-separated string of the version info (e.g. "132099,3322682880,2115050273,3365241252"). No spaces should be used, and each element of the version info should be treated as unsigned. A MD5 hash of this string should be taken, and sent in X_VERSIONCRC. Please note that version info need only be sent when calling BonesCheck, and BonesCheck should no longer be called routinely before attempting to upload a bones file. * On downloading a bones file, a X_USERNICK header may be returned. This may optionally be displayed to the user to tell them who uploaded the bones file in the first place. * On uploading bones files, an X_MOTD header may be returned. The value of this header should be cached and displayed to the user once all the uploads/downloads are finished. This allows for messages such as "Your version of Hearse is very old, please update it by visiting http://foo" or specific messages to users who have bad email addresses. Server-side changes =================== NewUser will pick up and use X_USERNICK if it is present BonesCheck now returns the X_NETHACKVER header Upload now returns the X_NETHACKVER header Download sends the X_FORCEDOWNLOAD header with the 'finished-downloading stats' info, and will react to X_FORCEDOWNLOAD and X_WANTSINFO in the ways described above. A new action - ChangeUserInfo - takes X_TOKEN, X_USERNICK and X_USEREMAIL.