Thud 2-DO ========= To-do list for Thud issues. The main bugs at the moment are: *) Endgames are badly detected, if at all! *) Resuming second half of games does not work correctly. *) Two people talking simultaneously can crash the client! *) Opera crashes when loading the client! *) Challenges are blocking and run in the same thread as the chat, causing pings to fail. Unsorted: # Renames that are non-case-sensitive should be respected, maybe (Dewi Morgan <=> dewi morgan). Store names internally under a hash as "dewimorgan", though, maybe. # Check that renames during games don't muck things up. # ctrl-backspace/del = del word left/right # nicklist sorting # tab-completion in main chat # more complex highlighting of stuff. # passwords containing spaces - particularly multiple consecutive ones - won't work. # Detection of admins # /commands for admins # cursor sometimes disappears from the input box (not in the debug version!) # Cut'n'paste? # code preventing people from registering bad drupal names should be put back in. # Have a checkbox "accepting games". # gameserv does the authentication, rather than the server itself. Both should. # thudboard file compatibility (allow files as input: ignore for rankings). # sgf file compatibility (allow files as input: ignore for rankings). Skinning ======== # Sounds don't play # Padding should probably scale as a percentage of prefsize. # Would board.setsize work to keep the board proportions correct and the chat window as large as possible even in long tall layouts? # Need HTML on all lightweight components. # Hyperlink listeners on all HTMLable components # Some method for users to CHOOSE a skin. # On close, Boards should remove themselves from skinlisteners, for GC. # Config panel doesn't use the correct settings notification system. # Fonts and styles aren't skinned. Do as a single css block: different components use different classes, so no conflict. # Other skinning items aren't configged. # Textarea throws exceptions when clicked # Textarea text is not selectable/copyable. # Race condition: skins could change before a skinlistener is added. # Some clients don't load graphics # HARD PROBLEM: Load skins from a stream. Sounds *must* come from a URL, and applet security restrictions prevent new URLHandlers being created. However, images may be streamable, by the VERY hoop-jumpy: byte[] buf = ...; ZipInputStream zis = ZipInputStream(new ByteArrayInputStream(buf)); while (Zipentry ze = zip.getNextEntry()) { byte[] imgBuf = byte[ze.getSize()]; zis.read(imgBuf, 0, ze.getSize()); Image im = ThudChat.getChatID().createImage(Toolkit.getDefaultToolkit().createImage(imgBuf)); } COMMUNITY ========= # [*** Game must always be free-beer free ***] Anyone can play, for free, forever. # Get payment service up. # Allow paying members to join clans. # Clan you are a member of will affect your ranging title (archmagister<->hedgewizard, squire<->knight, apprentice<->master, etc) # Event type: "Chat with trevor Truran" - gold members have free speech, others are silenced, but can submit questions. # Community requires name and email address, and other info. # Experience (attention economy) - 1 xp per move? # Reserved usernames # Timed games # Rules variations creatable by players. # RL Reseller ability. SERVER ====== # Endgames... don't. # Sometimes when resuming, get no rock? # Confusion about who is dwarfs/trolls # Refreshes affect both players. Should probably affect only one to prevent spam. # Ending the second half of the game crashes the server. # autoboot existing user, if log in as an already connected user. # Security: set people -v on connect/nickchange, and +v on login. Set channel +s. Or require a password on /nick # Protect the GameServ names. # Get bot running in background at startup, and restarting on cron. # Make thudgame the only op (or an admin with op rights) and all chans +m. # change ping time for the server to 90 seconds+ for regular users? # Most calls to is_player() should send a HOLDGAME to the player if false. # DEBUG: Unrecognised replay metastring: 1 # Continuing a rejected challenge (or any 0-move game) shouldn't count as a continue: shouldn't even be saved. # Throughout, the $params array is trusted WAY too much. Needs a lot more use of mysql_escape_chars, or type-verification functions. # hammering on the challenge button sends lots of challenge spam. Ignore all after the first? # moving against someone not logged in, server should make them login. # moving against someone not playing, server should send a resumegame request. # suspend doesn't close own board. server should send the holdgame message to both? # Human-readable reasons for move rejection aren't given: should be (pass as a global or something?). # Give english reasons for move refusals, rather than/as well as numeric. # acceptedcontinue and play have an extra param, "ThudGame". Probably from start_game/continue_game # very active users quitting makes for a LOT of SQL queries. Roll them all into one? # Send a GAMEMESSAGE rather than a MESSAGE for all game related messages. # resuming should set game.held = 0 # At the moment, GameServe MUST be called GameServe. Allow GameServeNNNN, and/or nick ghosting. CLIENT ====== Known bugs: ----------- # Do some work with the profiler to get memory and CPU use down. # Shouldn't be able to select own name in nicklist, and it should perhaps be marked differently. # Closing the window/terminating the process can raise various exceptions. Should exit cleanly. # A resumegame request to the client when it thinks it's already playing should result in an accept. # A resumegame command from the server when the client's already got a game open should be ignored. # When you rechallenge a player who may not have seen the challenge, it claims you are already playing (not "already challenging"). You can't rechallenge them. # A data line for a game that's already in progress should overwrite that game. # "Failing to move because bp was null" whenever opponent moves, though move works anyway # Resizing the text area to fit vertically, and both text components horizontally. # Mouse wheel should work in log window (no longer even works in jbuilder, never did in Sun JDK). # Apparently, troll captures are somewhat optional. *sob* # Playerinfo gives game id as 0: data 0 player - client must deal. Settings dialog: ---------------- # Remember window size that player last displayed each skin. # 2 event-based deprecation warnings from TabPanel when compiling. # Settings should (by default at least) apply only to the widow for which they were called. # Ability to save preferences for a user: a "make default" option. # "Apply settings just for this skin"/"make settings default" radiobutton # Textarea opacity and colour [b][Urgent][/b] # Default textarea font properties (size, colours, opacity, face and style). [b][urgent][/b] # Whether to override the other person's font properties when displaying locally (and if so, which ones). # Button font properties (defaults to whatever the skinner sets as default). # Link font properties. # Highlighted text font properties. # Max font size to display (at the moment the max size is "the size where one character will fit onscreen" and font sizes will be scaled down to fit that), # Max image size to display (again, images are currently scaled to fit the screen, even though they don't display at the moment) # Whether to autoconvert sent smileys, [":)" to "[img]http://forum.thudgame.com/images/smiles/icon_smile.gif[/img]". # Parental password. # Curse filter on/off (parental setting). # Display "risqué images" on/off (parental setting) # Whether to allow images to be displayed from domains outside the thudgame/thudguild network. (parental setting, IP protection) # Default skin. # Troll capture preferences. # Whether the main screen should be an on-page applet or a resizable, flying window. # Size of the on-page applet. Rich Text: ---------- # Wrapped text should (MUST) be indented, as otherwise users can spoof spoken text by wrapping on a [/]. # Selecting text doesn't. # Allow users to block seeing the vile colours and sizes (or to set limits on them) used by others. # BIU etc buttons under the chat window? Or a floating pallette that modifies the default font for all windows? # Variables ([var] tags) should have values. # [pgimg] tag for PG images. All smileys would use this. # Blocked/failed images have a clickable "retry" icon. # Filter the background by a coloured alpha layer, or change to a more mono default bg. # Transparent text isn't "cut out" of backgrounds # [rainbow] tag? # [pre] tag? People would still need [/] to say [/pre] ("[/[/]pre]") though # [default] tag to return style to normal? # Octarine is not visible. Possibly represent with a kinda shifting, blue-red colour, with spacey twinkles? # Display own name in a different colour. # Excellent graphics/multiple boards, etc. GFX: ---- # Get portrait display on the game board. # Get name display on the game board. # Get icon display on the game board. # Get score display on the game board. [solve all the above with a generic label/image system] # Game components should not be positioned with a grid, but absolutely (or at least, game window shouldn't be resizable) # Either background should scale to fit a maximised window, or maximisation/resize should be prevented. # Get skinning working. Get a skinning protocol up and announced. IMPORTANT: ---------- # Don't show departures "name left (QUIT:..." except in the game board of a game against them, or if there are < N players.. # Users should re-auth when bot goes down and comes up again. [bot should send a re-login request when reconnecting.] # Games should be resumed correctly when bot dies and comes back up again. [game should send a board layout request when re-logging in.] NON-VITAL: (just a wishlist. Some repetition here) ---------- # setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); and stuff # Implement BiDi (haha just kidding) # Nicklist should be sorted by name. # Fontlist should be sorted by name. # Font changer should allow different components to be selected. # Font changer should allow fg/bg colour selection? # ToolTips # Make all graphic components into beans for reusability. # Ability to listen in to others' games in progress # More than two users. # Tab-completion of nicks. # More pleasant parsing of ACTION, and other server messages. # Use threads for things like loading sounds, and animations. # Sound thread. # Animation thread. # Animate # Animations for events, like sounds. Animations to be optionally: loopable, blocking, with sound. # Animated movement/deaths. # Death stands in the wings, trundles out and collects the pieces. # Dead players also stand in the wings. # Pieces have names and unique identities/configurable personalities. # Add a bunch more sound events (gamestart, gamewin, gamelose, gameend, propose/proposed/accept/accepted/reject/rejectedquit) and so on. # Bot detection # Have the server send "hurryup" packets to the player who's go it is, according to the server. If the client disagrees, it should ask for a resynch. # Display a download progress bar # Display places you can move from, places you can move to, places you'd be threatened on... etc etc in different colours. # Arrow to indicate movement, colour indicates validity. # Ability to spawn non-java games. # At the moment chat<>game comms assume that game is a java thread of chat. It should allow them to be completely different languages. # Allow limited /commands for the cognoscenti? # Some clientside commands to control per-user settings: /emotestyle (irc, furc, ...) # Detect clicking through the transparent part of one piece, onto another piece graphic behind. # Highlight selected items # Needs much, MUCH better detection of whether it's managed to connect or not. # "notloggedin opponent" should give opponent few seconds to login, then resend player message, & only send notloggedin message if still not. # Select new boards and/or piece sets. # Wireframe/boxframe/textured graphics. # A "radar" screen, overhead view, small, in a corner. Does just what the regular board does, including hilighting squares/drawing arrow on the main board. # Pieces are animated 3d textured meshes. CHANGELOG ========= Some changes are serverside, so will retroactively affect all client versions. 2007m ----- # Rightclick menu added # Ignore added # "Silence" admin command added clientside # "Muffle" admin command added clientside 2007l ----- # upper case links do not work (">>rcvd: :arcturus.morganalley.com 401 GameServ2 nickserv :No such nick/channel - Warning, unrecognised server command nickserv. # Should reconnect if get this: commandString=ERROR :Closing Link: [195.147.177.17] (Ping Timeout), waitingFor=2 # Bug: Privmsg to nickserv lacks a colon. # Authentication. # Bug: Taken pieces don't redraw completely. # Bug: Redraw button clears the board. # Bug: Ending a game crashes the server. # Bug: Ending a game allows people to continue playing anyway. # Bug: resuming a game sent the game id rather than the username. # Thud is not reading in the MACE lib correctly, so logins are not working. 2005p ----- # Playback spams with "My move!" # Bad takes by trolls don't fix themselves (Does the replay unkill all the pieces?) # Setup a "latest" symlink so people can bookmark the game. # User's own nick disappears from the list when they log in or change their nick. 2005o ----- # decide on a zero-downtime server-move strategy # update to a new ircd version # recode ircd to have the option to conceal itself better (no motd, change "ircd" name throughout) # move the server over to .69 using the above strategy # get client logins working # faster logins: don't check identd - done in ircd.conf, replaced all *@* with * [no, made no difference] # BUGFIX: games were ended once either side scored 32 total, rather than 32 in that half. 2005n ----- # Sometimes, rotating pieces do not redraw properly. Redraw-area calc is correct, poss the sizes are determined before the images are loaded? # Moves, rotates, and other operations that require a full redraw are very flickery. Optimise? 2005m ----- # Only need to redraw current/last square-hilights on mouse move to ajacent square. # Only need to redraw selected piece if facing changes on mouse move to ajacent square. # Add space to the top of the board (a transparent padding graphic?) # java.lang.NullPointerException at ThudGameBoard.mouseClicked(ThudGameBoard.java:437) # java.lang.IllegalAccessError: getGraphics() only valid for images created with createImage(w, h) # Cursor diamond should not display outside the board. # Piece hilight doesn't uncheck when rightclicking. # Piece hilight doesn't show the whole square when first clicking, viewing diagonally. # Cursor diamond not drawing/clearing completely. 2005l ----- # Improve CPU handling by sleeping during the polling loop. 2005k ----- # Reduce the chroma subsampling of the background so that all JVMs can load it. 2005j ----- # optimise graphics # unkill pieces before the second half 2005i ----- # Initial game window is the wrong size to display the spin buttons. # "guest1004 became ." - server doesn't quite understand nick changes? # Get a skinning discussion board up. # Check that cancelchallenges closes the challenge request windows on the opponents and lets them know what happenned. # User challenges should be able to resume existing games. # Need to respect the server's wishes when moves are rejected. # Allow server to send "Current board layout". # Allow server to send "move sequence to play". # search for occurances of "should", "yet", "will", etc. :) # For IRC normally, encoding is Latin-1. Should use that unless there are characters being sent that are not L1. That would avoid sending the BOM. # updated begin_game to fill board field. # updated cmd_requestboard to deal with if that board field is empty. # added moves field into the database. # added board field into the database. # created a get_board_name(game_id) function. # created boardname_to_URL(name) function. # cmd_requestboard asks for a field (board) that doesn't exist. # cmd_requestplayerinfo requires one more param than it uses. # cmd_requestgameinfo requires one more param than it uses. # cmd_requestplayerinfo never sends any info back to the caller. # cmd_requestgameinfo never sends any info back to the caller. # function resume_game($game, $name_array) deleted # function replay_game($game, $name_array) deleted # function get_skin_data($skin) deleted # begin_game does nothing about the board name. added third param "$boardname" # removed extra "boardurl" param from play # removed extra "boardurl" param from acceptedcontinue # removed extra "boardurl" param from gameinfo # removed extra "boardurl" param from startgame() # removed extra "boardurl" param from resumegame() # Button events need to go off button objects, not labels. # Error messages should say NO COW: instead of ERROR: # gameinfo not implemented clientside. # playerinfo not implemented clientside. # resumegame never called. # board data is sent null. # gameinfo (current player) is not implemented on client # gameinfo is sent twice to the same player # begin_game flips the players too often, maybe: mustn't flip if it's resumed! # STill getting Undefined index on line 222 # non-bug: is_up is printing '0' or '1' to the log in each daemon-check. # typo in sql field in game-resign # resumes only seem to be detected one way round. # rejectedmove should automatically request a refresh and update. # replay: Too few parameters for data. (missing slice number) # Nothing I can do/1-off glitch? Got: "Connection aborted by peer: JVM_recv in socket input stream read" # replay: Improper parameters for data: bad slice count. # End games aren't written into ThudGameBoard.replayFromData() # Board changes aren't written into ThudGameBoard.replayFromData() # When resigning the first half, resigner's window is closed. # Board graphics are copyrighted. 2005h ----- # Obfuscate compiled code to reduce size. # First attempt at fixing the font size issues. 2005g ----- # Game windows should close gracefully, maybe have "abandon game", "ask to postpone game" buttons? 2005f ----- # When starting a game, tell player if they're trolls or dwarves, and whether they need to wait their turn. # Need end game button # Need save&quit button # Chat client text bar should empty itself # The textarea should be scrolled to the bottom. # Rotation audio does not play. # Select/unselect audios do not play. # Troll hit audio does not play. # Multibyte support. 2005e ----- # Screen flicker is godawful. Fix it. 2005d ----- # Use jar files. 2005c ----- # Board rotation shouldn't lag on slow machines. # Should use a jar archive for size and download speed. 2005b ----- # Chat client should show channel chat nicely (begins "Channel:") # "Starting game against 4" message is wrong, it's starting a game numbered 4. # Make initial name "guest" instead of "guestNNNN"? [No, made initial guest name auto-signon instead] # Board should be transparent # Optimised piece graphics from 81,943 bytes down to a total of 20,382 bytes. # Optimised board graphics from 588,507 bytes down to a total of 235,711 bytes. 2005a ----- # Stop chat client spam beginning MS=, DEBUG, Sent:, Name: unknown: # Allow the spam if the debug param is set. # change the board spawning so it actually SPAWNS the board. # Get the debugger loading the client properly. # Change "connecting..." prompt to "Please click the Login button" (actually, it appears to autologin. Good.) # gameserv is displayed as gameserv-debug, but shouldn't be displayed at all. # Change the board spawning on the debugger so it fills out right. # Change the board spawning so that the board fills out right. # Figure out why moves are being rejected. # Get IRC server up. # Get forums up. # Get bot installed. 2002c ----- # Board on a flyoff window, rather than the applet window. # No requirement for port numbers. 2002b ----- # Semi-skinned board # Sounds. # Proper rotation. 2002a ----- # Hilight selected squares. # Rotatable board (90 degrees, or even 45). SCRATCHPAD ========== This is where I stick design notes that I'm ruminating about. ======== Could create: class Separator extends Component implements Adjustable { This could be used by users to drag separation from nicklist to textarea. Doubleclick could "collapse" nicklist. However, this has all kinds of repercussions for skinning and the gridbaglayout. It would need to be a "collapsible" Panel, as the rightmost element of the gridbag, taking up the whole height, (including the button? Either that or skinning needs to deal with panels) I have NO IDEA how it could change the scale of the components to either side so that the frame was where it was told to be... could call the collapsing panel's setSize(), I guess, and have that as non-resizable while the component is being dragged, then convert to resizable if the window is resized, while other components (to the left) are always resizable? Possibly could need a whole new layout manager. It MUST be a separate component from the RTA anyway, since the RTA is used without the nicklist in the game windows. ======== Sorting: public static void bubbleSort4(int[] x) { int newLowest = 0; // index of first comparison int newHighest = x.length-1; // index of last comparison while (newLowest < newHighest) { int highest = newHighest; int lowest = newLowest; newLowest = x.length; // start higher than any legal index for (int i=lowest; i x[i+1]) { // exchange elements int temp = x[i]; x[i] = x[i+1]; x[i+1] = temp; if (inewHighest) { newHighest = i+1; } } } } }//end method bubbleSort4 /* Above was released on the MIT license. Copyleft 2005 Fred Swartz http://www.leepoint.net/notes-java/data/arrays/32arraybubblesort.html http://www.opensource.org/licenses/mit-license.php Note that the part of the array that is completely sorted grows at only one end of the array. The ability to quit early is not symmetrical. The extreme values move all the way to the end in one direction, but only one place in the other direction. The algorithm can be improved by "bubbling" in opposite directions on alternate passes. This is left as an exercise. */ PD Bubblesort here: http://popper.cs-i.brandeis.edu:8088/typcs06/cs22a/labs/lab02/Sorting.java Suggest using the pd version but implement all the versions from the MIT licensed one, plus the suggested further improvement. Then rerelease as PD. Current: ======== Each indentation level implies that all previous levels are necessary precursors. SKINNING: decide on naming scheme for gfx-only/gfx-&-class/gfx-&-ini skins decide on default layout for gfx-only skins decide on client-server dialogue to establish what skins they can use decide on a UI for selecting your preferred skin +-get client loading graphics as one image and slicing it up | +-get client loading skins in as a zip from a URL | | +-get gui component inserted and working | | +-get server to pass the right boardname to opponent | | +-get server to remember their preference | +-get client loading skins in as data lines from the bot +-get client loading classes in from server +-get client parsing the text UNDO/SAVEGAMES: decide how to store takes in the DB decide how to implement the "undo/rewind/replay" interface in the GUI decide how to pass/forward undos in the client/server dialog decide how to store undos in the DB +-implement the undo interface | +-pass/forward undo requests | +-store undos in the DB +-possibly pass the takes with each move TROLL TAKING: decide on GUI modify client UI to prompt for which should be taken decide on DB storage format modify database to store new format modify DB reading fns to read in new format modify DB writing fns to write out new format decide on transmission format modify client moves to send new format modify client moves to read new format modify client moves to respect choices modify server moves to read new format modify server moves to validate choices PORT 80 PROXY: figure out how on earth to do this. +-do it. Misc: ===== Forum logins: when someone signs in correctly, have it make a Thud user with that ID and password. If they sign in as an existing user, with a different but valid password, change their password to match. Don't check guest passwords. Server thinks speech is a dodgy command. >>>rcvd: :megthraeryn!@80.216.85.48 PRIVMSG #thudgame :oki.. sec.. :) oki.. sec.. Error, faulty game command PRIVMSG #thudgame :oki... Get rid of all these spammy warnings: >>>rcvd: :php2.wavechat.net 462 GameServ1 :Already Registered Warning, unrecognised server command :Already. >>>rcvd: :php2.wavechat.net 491 GameServ1 :No O-Lines for your nick Warning, unrecognised server command :No. >>>rcvd: :GameServ1!@66.197.210.71 JOIN #thudgame1 GameServ1 joined. >>>rcvd: :php2.wavechat.net 332 GameServ1 #thudgame1 :#thudgame1 Warning, unrecognised server command #thudgame1. >>>rcvd: :php2.wavechat.net 333 GameServ1 #thudgame1 php2.wavechat.net 1133531006 Warning, unrecognised server command #thudgame1. >>>rcvd: :php2.wavechat.net 353 GameServ1 = #thudgame1 :GameServ1 Detected user GameServ1 >>>rcvd: :php2.wavechat.net 366 GameServ1 #thudgame1 :End of /NAMES list Warning, unrecognised server command #thudgame1. >>>rcvd: :php2.wavechat.net MODE #thudgame1 :+o GameServ1 Warning, unrecognised server command :+o. Resources: ---------- See D:\java\tutorial\applet\practical\threadExample.html for more info. Click the "Playing sounds" link for a multiple-sounds-at-a-time thready thing. Nice. D:\java\tutorial\applet\practical\clientExample.html">D:\java\tutorial\applet\practical\clientExample.html - networking example.
D:\java\tutorial\applet\practical\workaround.html">D:\java\tutorial\applet\practical\workaround.html - Network CHAT example! \tutorial\new\OLDui\drawing\movingImage.html">\tutorial\new\OLDui\drawing\movingImage.html - Images-on-images example.