📄 xmj.man
字号:
.\" $Header: /home/jcb/newmj/RCS/xmj.man,v 11.22 2003/04/20 14:46:26 jcb Rel $.\" Copyright (c) 2000 J. C. Bradfield.de TQ.br.ns.TP \\$1...de GO.br.TP\fB\\$1\fP (\fB\\$2\fP) \\$3...TH XMJ 1 "Mah-Jong" "J.C.Bradfield".SH NAMExmj, mj\-server, mj\-player \- programs for playing Mah\-Jong.SH SYNOPSIS.TP\fBxmj\fP [\fB\-\-id \fIidnumber\fP] [\fB\-\-server \fIaddress\fP] [\fB\-\-name \fIplayername\fP] [\fB\-\-connect\fP] [\fB\-\-show\-wall\fP | \fB\-\-no\-show\-wall\fP] [\fB\-\-size N\fP] [\fB\-\-animate\fP] [\fB\-\-tileset \fIdirectory\fP] [\fB\-\-tileset\-path \fIdirectory-path\fP] [\fB\-\-dialogs\-popup\fP | \fB\-\-dialogs\-below\fP | \fB\-\-dialogs\-central\fP] [\fB\-\-echo\-server\fP] [\fB\-\-pass\-stdin\fP].TP \fBmj\-server\fP [\fB\-\-server \fIaddress\fP] [\fB\-\-timeout \fIseconds\fP] [\fB\-\-pause \fIdeciseconds\fP] [\fB\-\-random\-seats\fP] [\fB\-\-disconnect\-penalties \fIN1,N2,N3\fP] [\fB\-\-end-on-disconnect\fP] [\fB\-\-exit-on-disconnect\fP] [\fB\-\-save-on-exit\fP] [\fB\-\-option-file \fIfile\fP] [\fB\-\-debug\fP] [\fB\-\-logfile \fIfile\fP] [\fB\-\-no-manager\fP] [\fB\-\-no-special-scores\fP] [\fB\-\-seed N\fP] [\fB\-\-wallfile \fIfilefP] [\fB\-\-nohist\fP].TP \fBmj\-player\fP [\fB\-\-id \fIidnumber\fP] [\fB\-\-name \fIplayername\fP] [\fB\-\-server \fIaddress\fP] [\fIundocumented options\fP].SH DESCRIPTIONA set of three programs to play Mah-Jong on Unix systems, againstpeople or programs, over the Internet..TP.B mj\-serveris the program that handles communications and control ofthe game; the rules and scoring are enforced there. Players, human orcomputer, connect to a server via the network..TP.B mj\-playeris a computer player. At present, it is fairly simplistic, having only offensive tactics with no knowledge of defensive play..TP.B xmjis the X client for human players..SH QUICK STARTIf you don't want to read this long document: to start a game againstthree computer players, start \fBxmj\fR, select "New local game..." from the "Game" menu, and click "Start Game". (Wait about ten seconds foreverything to start up.).SH OPTIONS.SS All Programs.TP.BI --server " address"specifies the network address to listen on (for \fBmj-server\fR) or toconnect to (for \fBmj-player\fR and \fBxmj\fR).If \fIaddress\fR contains a colon, it specifies an Internet socket, andshould have the form \fIhost:port\fR . If \fIaddress\fR does not contain a colon, it is interpreted as a Unix file name and a Unix socket is used.The default value for \fIaddress\fR is localhost:5000 .\fIaddress\fR can also be set in a dialog box in \fBxmj\fR..SS xmj and mj-player.TP.BI \-\-id " idnumber"The server assigns a unique integer ID (which is currently just 1 to 4 in order of connection) to each player. This ID should be quoted whenreconnecting to a game in progress (after, for example, losing anetwork connection or accidentally killing \fBxmj\fR). The default IDis 0, which denotes no pre-assigned ID. .TP .BI \-\-name " name"Players can give themselves names which will be used by clientprograms. This option specifies the name. For \fBxmj\fR, the defaultis the value of the environment variable LOGNAME, or failing that theusername of the logged in user. For \fBmj-player\fR, the default is"Robot(\fIPID\fR)" where \fIPID\fR is the process id..SS xmj.TP.B \-\-connectBy default, \fBxmj\fR does not automatically connect to a server,but waits for the user to connect via a menu. If this option isspecified, \fBxmj\fR immediately connects..TP.B \-\-show\-wall.TQ.B \-\-no\-show\-wallTells \fBxmj\fR (not) to display the wall. By default, the wall is shownonly if running on a big enough screen. This option is alsocontrollable via the Display Options preference panel..TP.BI \-\-size " number"This option adjusts the size of the main window. It should be thoughtof as the length of a tile rack, measured in tiles. The default, andthe largest value accepted, is 19, or 18 if on an 800x600 display. Thesmallest usable value is 14. This is not yet changeable while theprogram is running, but since the programs correctly handle dis\- andre\-connecting in the middle of a game, this is not a major drawback..brIf the \fB\-\-show\-wall\fR option is given, a \fB\-\-size\fR smaller than 19 willhave no effect..TP.B \-\-animateThis option switches on some animation. Not all tile movementsare animated: only those that involve moving tiles to or froma hand from outside. This option is also controllable via the Display Options preference panel..brI'm not very keen on this; its main purpose is to draw attentionto the tile being discarded or whatever. I welcome comments onwhether it is liked, and whether it should be extended..TP.BI \-\-tileset " directory"\fBxmj\fR needs pixmaps to display the tiles and the tong box.This option tells it which directory to find them in.The default is set at compilation time; the default defaultis to use the compiled\-in tiles..TP.BI \-\-tileset\-path " directory-path"This gives a colon-separated (or semicolon-separated under MicrosoftWindows) list of directories in which to look for the directory namedby the \fB\-\-tileset\fP option..TP.B \-\-dialogs\-popupBy default, most of the dialog boxes for player actions arepart of the main window. If this option is used, they willinstead appear as separate transient windows..TP.B \-\-dialogs\-belowBy default, dialog boxes appear in the centre of the table.If this option is given, dialogs (apart from some popups) are positioned below the table area. Please let me knowwhich style you prefer!.TP.B \-\-dialogs\-centralThe default: dialog boxes appear in the middle of the table.These options are also controllable via the Display Optionspreference panel..TP.B \-\-echo\-serverIf this option is given, \fBxmj\fR will echo to stdout all theprotocol messages received from the server..TP.B \-\-pass\-stdinIf this option is given, \fBxmj\fR will send any text given on stdinto the server..SS mj-server.TP.BI --timeout " seconds"When a discard is made, there is a limit on the time players haveto claim it. This option sets the timeout; a value ofzero disables it. The default is 15 seconds..TP.BI --pause " deciseconds"This will make the server enforce a delay of \fIdeciseconds\fR/10seconds between each action in the game; the purpose is to slowprogrammed players down to human speed (or, in a teaching situation,to slow the game even more). The current server considers that 50(i.e. 5 seconds) is the maximum reasonable value for this option..brThe option can also be requested by players, via a PlayerOptionprotocol request..TP.B --random\-seatsBy default, players are seated in order of connection to theserver. This option seats them randomly. It will become thedefault later..TP.B --disconnect-penalties \fIN1,N2,N3\fPThis specifies the penalties applied by the following option forplayers who disconnect before the end of a game. \fIN1\fP is thepenalty for disconnecting in the middle of a hand; \fIN2\fP at the endof a hand but in the middle of a round; \fIN3\fP at the end of a round(other than end of game). They all default to 0 if not specified..TP.B --end-on-disconnectIf this option is given, a disconnection by one player will gracefullyterminate the game. Mid-hand, the hand is declared a wash-out; afterMah-Jong has been declared, then if a losing player disconnects, theirtiles are shown, the hand is scored, and then the game ends; if awinning player disconnects, the hand is a wash-out. The disconnectingplayer may be assigned a penalty, according to the\fB--disconnect-penalties\fP option, which will be included in thescores printed out by the server. (The penalties will not be visibleto the other players.).TP.B --exit-on-disconnectIf this option is given, the server will quit if any playerdisconnects, rather than waiting indefinitely for reconnection..TP.B --save-on-exitIf this option is given, the server will save the state of the gameif it quits as a result of a player disconnecting. (It will not savethe state if it quits as the result of an internal error.).TP.BI --option-file " file"This names a file of protocol commands which will be applied to everygame when it starts. Its main purpose is to set non-default gameoptions, via the GameOption protocol message (note that this is aCMsg, not a PMsg). However, users will normally set options andpreferences via the \fBxmj\fP control panel, not by this means..TP.BI --load-game " file"This names a file containing a saved game (as a suitable sequence ofprotocol commands). The server will load the game; clients connectingwill be treated as if they had disconnected and rejoined the game..TP.B --no-id-requiredIn the most common case of resuming a saved game, namely one humanplaying against three robots, the robots will not have the same namesor ids as the robots in the original game. This option tells theserver that if it cannot match a reconnecting player by id or name,it should anyway match it to one of the previously disconnectedplayers. (In this case, the human normally connects first with thesame name, so is correctly matched.).TP.B --no-managerUsually, the first player to connect becomes the game manager, andcan change all the game settings. If this option is given, no playerwill be allowed to change the game settings..TP.B --debugThis enables various debugging features. In particular, itenables protocol commands that allow one to change the tilesin a hand....TP.BI --logfile " file"The server will write a complete record of the game to \fIfile\fR;this will be quite large, and is only useful for automatic comparison ofdifferent computer players..TP.B --no-special-scoresThis option suppresses the scoring of points and doubles for flowersand seasons. It is primarily intended for running tests of differentplayers; for human use, a game option will be provided to eliminatethe specials altogether..TP.BI --seed " n"This option specifies the seed for the random number functions.Used for repeatable tests..TP.BI --wallfile " file"This names a file containing space separated tile codes giving thewall; used for repeatable tests. (This is a testing option; it isnot robust.).TP.B --nohistAnother option only used in automatic comparison: this saves someCPU time by disabling the book-keeping required to allow playersto disconnect and reconnect..SS mj-playerhas numerous options affecting its strategy, but these arenot yet documented as they are not at all stable..SH USING THE XMJ PROGRAMThe main window contains a menu-bar and a table area; the table isin a tasteful shade of dark green. The table displays a stylizedversion of the game: stylized in that there is no jazzy graphics orperspective, and the tiles are not intended to be pictures of realobjects, and so on. Otherwise, the layout is as one would expect of areal game. However, the wall may or may not be displayed, depending onoption settings and screen size. (See above.)Specifically, the four players are arranged around the four edges ofthe table, with "us" at the bottom. For each player, the concealedtiles are displayed nearest the edge of the table; our own tiles arevisible, the other players' tiles are face-down.In front of the concealed tiles are (to the player's left) anydeclared sets, and (to the player's right) flowers and seasons, andthe tong box if the player is East. The tong box displays the wind ofthe round in a white circle. If necessary, the flowers and seasonswill overflow into the concealed row.The discards are displayed face-up in the middle of the board: theyare laid down in order by each player, in the naturalorientation. TODO: add options to display discards randomly, orface-down.If animation (see \fB--animate\fR option) is not being used, then themost recent discard will be highlighted in red.The name of a face-up tile can be displayed by right-clicking in thetile. Alternatively, the Tiletips display option can be set, in whichcase the name of a tile is displayed whenever the mouse enters it.Our tiles are displayed in sorted order, which happens to beBamboos (1-9), Characters (1-9), Circles (1-9), Winds (ESWN),Dragons (RWG), Flowers, Seasons.Actions are generally carried out by clicking a button in a dialog box that appears in the middle of the board. For many actions, a tile must be selected. A tile is selected or unselected by single-clicking it;when selected, it appears as a depressed button.The program will generally pre-select a sensible tile:specifically:.brduring the initial declaration of special tiles, the rightmostspecial is selected;.brafter we draw a tile from the wall, the drawn tile is selected;.brwhen declaring concealed sets after going Mah Jong, the firstundeclared tile is selected.To describe the possible actions, let us run through the course of agame.First select "New local game..." from the "Game" menu. A panel willappear. The default options are to play a game against the computer,so click "Start Game". After a second or two, a game will start. (NOTE: this assumes correctinstallation. If this fails, start a server and players manually, anduse the "Join server..." menu item.)The first thing that happens is a dialog box "Ready to start nexthand". The server will not start playing a hand until all playershave indicated their willingness to continue play.Next, the tiles are dealt. Then each player in turn is expected todeclare flowers and seasons. When it is our turn, a dialog will appear with the following buttons:.TPDeclaredeclare the selected flower or season. (Note: theprogram auto-selects the rightmost special tile.)If no tile is selected, this finishes declarations.This button will not appear if the game is being played without
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -