Protocol: | pserver | User: | anonymous |
Machine: | crossfire.cvs.sourceforge.net | CVSROOT: | /cvsroot/crossfire |
Filename: Edit.c | |||
Revision 1.21 | mwedel | 2006/05/18 00:27:43 | +11 -1 |
This commit adds support for the map2 protocol command (10 layer map). This changes how the data is stored and sent to the client. This also implements the idea of client handling map animations, so adds some object flags so that the server knows if it should let the client handle animations or not. Support for the original map protocol command is removed. --- aclocal.m4: rebuilt configure.ac: Add checks for zlib.h, libz - not used right now, but will probably be used in the future, so no reason to remove it. common/loader.l: Add client_anim_sync, client_anim_random FLAGS. common/map.c: Add add_face_layer() to set face for a layer. Redo/simplify update_position to store faces away based on layering criteria. common/time.c: Replace long pticks with a uint32, since size of a long will vary, and we now send pticks to the client as a 32 bit value. crossedit/CrEdit.c: Update the draw logic based on the fact there are more layers now. crossedit/Edit.c: Comment out some code that probably should be fixed. Replace calls of SET_MAP_FACE with SET_MAP_FACE_OBJ doc/Developers/protocol: Updated with map2, tick protocol additions. Reorganize the parameters in the setup protocol command so they are now listed in alphabetical order. include/autoconf.h.in: Add HAVE_ZLIB_H define. include/define.h: Update for the FLAG_CLIENT_ANIM values. include/face.h: Remove MapLook structure - no longer used. include/global.h: change extern type for pticks from long to uint32 include/map.h: Change MAP_LAYERS to 10. Add definitions for what each map layer is. Remove GET/SET_MAP_FACE macro - no longer used, GET/SET_MAP_FACE_OBJ replaces it. Add GET_MAP_FACE_OBJS which returns pointer to all the object info for the space. Remove faces from MapSpace structure. include/newclient.h: Update with new defines used for map2 protocol command. include/newserver.h: Change type of faces in map_cell_struct to be uint16 to be consistent. Change 'count' to 'darkness' to more accurately describe what it represents. Add MAP2_COORD_OFFSET define. Add Map2Cmd to MapMode enum. Add map_scroll_x/y to socket structure so we send those as part of map2 command. Add tick field to socket structure to know if we should send tick data to the client. server/login.c: Remove extern long pticks declaration - declared in global.h - don't need to declare it again locally. socket/info.c: Rewrite magic map code to use GET_MAP_FACE_OBJ instead of GET_MAP_FACE macros. socket/init.c: Initialize new fields in socket structure to 0. socket/loop.c: If client wants tick data sent, send one each tick. socket/request.c: Add setup responses for tick, map2 requests. Remove some extra code in Map1a setup. Send error message to client if not using at least Map1 protocol level. Modify map_newmap_cmd() to clear scroll information when using Map2. Remove original (map0) protocol logic. Update map_clearcell() to clear all 10 layers. Replace MAX_LAYERS with MAP_LAYERS. Add add_head() to remove some of the complication from update_space(). Add code in draw_client_map1() to find which 3 layers to send to the client from the 10 we now have. Add map2_add_ob(), map2_delete_layer(), check_space_for_heads(), draw_client_map2() to handle map2 protocol. Add send_tick() - sends tick to client, but also forces flush of data to reduce lag. utils/config.guess.utils/config.sub,utils/ltmain.sh: rebuilt MSW 2006-05-15 | |||
Show difference between Revision 1.20 and 1.21 | |||
Revision 1.20 | akirschbaum | 2006/03/16 14:59:51 | +7 -5 |
Apply patch #1439143 (code-cleanup: crossedit) by Stefan Huehner: Remove unused code, add static/const where appropriate. | |||
Show difference between Revision 1.19 and 1.20 | |||
Revision 1.19 | akirschbaum | 2005/12/09 15:24:06 | +84 -225 |
Apply slightly modified first part of patch #1275563 (Crossedit: fix map attributes window): make the map attributes dialogs work again. | |||
Show difference between Revision 1.18 and 1.19 | |||
Revision 1.18 | mwedel | 2005/11/16 02:16:00 | +1 -1 |
Commit for new blocking code. Not going to dictate all the changes - but will outline the broad points. Note also that the doc/Developers/objects is updated and goes into more details also. - check for P_WALL no longer used - instead, need to use GET_MAP_MOVE_BLCOK and check against movement type of objects. - arch_blocked() changed to ob_blocked(), now takes object. Needed because just looking at archetype move_ values is no longer sufficient. - find_first_free_spot() changed to take object, since it just calls arch_blocked() - FLAG_FLYING removed, now in move type. - walk_on/walk_off/fly_on/fly_off removed - now based on move_on and move_off fields. - Map space structure extended to hold the move_on/move_off, etc values so that we can shortcut some processing by not having to check every object on the space when something enters it if move_on isn't set. - archetypes recollected - boulders needed move_walk to properly trigger buttons. - Note that the new plugin code has to be fixed up for the new movement code. Look for FIXME in plugins/cfpython/cfpython_object.c MSW 2005-11-15 | |||
Show difference between Revision 1.17 and 1.18 | |||
Revision 1.17 | akirschbaum | 2005/10/28 14:08:53 | +2 -1 |
Fix compiler warnings. Most changes do not change the program (remove unused variables, convert "if(x = y)" into "x = y; if(x)"); a few actually fix (possible) problems (fix uninitialized variables, fix printf format specifiers, fix mismatches between signed and unsigned variables, add missing return and default statements). | |||
Show difference between Revision 1.16 and 1.17 | |||
Revision 1.16 | akirschbaum | 2005/10/07 12:54:48 | +2 -2 |
common/{arch.c, object.c}, crossedit/{Attr.c, Defines.h, Edit.c}, include/libproto.h, server/{plugins.c, time.c}: Rename functions with mixed-case names to lower case only. crossedit/Defines.h: Remove prototypes for nonexisting functions. | |||
Show difference between Revision 1.15 and 1.16 | |||
Revision 1.15 | akirschbaum | 2005/08/28 01:58:18 | +55 -9 |
Add patch #1271417 by Kevin Rudat to stop crossedit losing regions. Patch is slightly modified to properly handle all map fields. crossedit/Edit.c: Copy all map fields in MapMoveScrollResize(). Do not add a msg header to already existing maps. crossedit/crossedit.c: Call init_regions() at program initialization. | |||
Show difference between Revision 1.14 and 1.15 | |||
Revision 1.14 | akirschbaum | 2005/07/10 08:54:05 | +3 -1 |
server/{login.c, player.c}: Fix buffer overflow with pl->title. Based on patch by Scott Kullberg. crossedit/{Edit.c, Cnv/CnvPrompt.c}, server/{ban.c, hiscore.c, login.c, player.c, shop.c, win32.c}: Properly terminate destination string of strncpy with '\0'. | |||
Show difference between Revision 1.13 and 1.14 | |||
Revision 1.13 | elsbernd | 2005/03/08 06:58:29 | +2 -1 |
Load can modify self->w only, if self->w was created, which is not alwas the case | |||
Show difference between Revision 1.12 and 1.13 | |||
Revision 1.12 | mwedel | 2003/03/07 23:22:04 | +3 -2 |
Minor changes to clean up some compiler warnings. MSW 2003-03-07 | |||
Show difference between Revision 1.11 and 1.12 | |||
Revision 1.11 | mwedel | 2003/01/08 02:39:17 | +1 -1 |
Bulk of this commit is to improve code for tiled maps - replace wall/blocks_magic/blocks_cleric, etc with get_map_flags which also does map tiling translation as needed. This should fix a lot of the bugs related to map tiling (there are sure to be more out there - all the get_map_ob still need to be checked). Other changes - many spells stopped progressing on spaces that blocked view - that is now removed - didn't make a lot of sense. Other fixes - some cleric spells (eg, word of recall) checked to see if magic was prohibited, didn't check to see if cleric was prohibited. Clean up some bugs in the lighting code that would cause erroneous results. Also, allow players to see immediately around them on outdoor maps no matter how dark the map really is - behaviour on indoor maps is the same. Lots of code reformatted, and lots of obsoleted/dead code removed. Add max range to dimension door. Fix magic map - got broken when the layer stuff was redone - was not showing proper colors. IT also works sensibly on tiled maps now - rather than display based on the map, it gives the player a 50x50 area centered on where the player is. Change fire_bow - move special player fire modes into own function - makes code much cleaner. Hopefully this fixes more bugs than it introduces. common/los.c, common/map.c, common/object.c, crossedit/Edit.c, include/libproto.h, include/sockproto.h, include/map.h, include/spellist.h, include/sproto.h, random_maps/treasure.c, random_maps/wall.c, server/attack.c, server/c_misc.c, server/c_wiz.c, server/disease.c, server/main.c, server/monster.c, server/pets.c, server/player.c, server/rune.c, server/shop.c, server/skill_util.c, server/skills.c, server/spell_effect.c, server/spell_util.c, server/time.c, socket/info.c: See note above server/apply.c: Limit number of times weapon can be enchanted so that it won't overflow item_power. Modify enchant armor to enchant as normal armor is enchanted, also only allows one item to be enchanted. MSW 2002-01-07 | |||
Show difference between Revision 1.10 and 1.11 | |||
Revision 1.10 | mwedel | 2002/06/07 02:00:43 | +10 -14 |
Mostly bugfixes. I'm not sure if this will fix the disappearing arch problem- none of the changes made in the original multiple name would seem to cause it, so hard to say if any of these changes may fix it. -- common/arch.c: Change get_archetype_by_name to be more efficient and not leak memory. Modify code that frees all archetype data to free the name_pl information. Make sure the clone.name_pl is set to NULL. When singularites are created, set the name_pl for them. common/loader.l, common/loader.c: Modify code that fixes up name_pl to be more correct when it fixes up name_pl for old objects. common/map.c: Modify load_map_header so that tile_paths will be normalized - need for editor to be able to load maps that have a multipart object that spans the maps. crossedit/Edit.c: Modify some calls of out_of_map to OUT_OF_REAL_MAP, since tiling code really isn't fully in place for the editor. Modify EditPerformFill so that it actually works and doesn't crash the editor. include/global.h: Move FREE_AND_COPY macro from loader.l to here so that all source code files can use it. lib/adm/map_info: Modify to actually be able to examine just a sub portion of the map directories, and not all of them. Don't always show the unused objects - information isn't very interesting if only a portion is being examined. Modify the exit examining code to properly deal with random maps (if there is a finalmap component, make sure that does exist.) Loade the bmaps file and not the faces file to find valid faces. plugin/plugin_python.c: Add missing %s that described what script was actually loaded. random_maps/special.c, server/alchemy.c, server/c_misc.c, server/gods.c, server/login.c, server/player.c, server/spell_effect.c: Set up proper name_pl value for code that changes the name of objects. server/apply.c: Use FREE_AND_COPY to set up names. Set up proper name_pl values for cases that change name. In apply_lighter, call fix_player if player is lighting an object in his inventory - necessary for the players glow_radius to get updated so the change actually takes effect. socket/request.c: Modify esrv_map_scroll so that it properly clears cells that are moving out of view - failure to do this was resulting in the map1a updating these spaces with empty faces. This was causing fog of war wackiness with the client. MSW 2002-06-06 | |||
Show difference between Revision 1.9 and 1.10 | |||
Revision 1.9 | mwedel | 2001/12/23 02:17:36 | +2 -0 |
common/loader.l, common/loader.c, common/object.c, include/object.h, socket/item.c: Remove sub_type and sub_type2 information - these were poorly named fields and not properly implemented. common/treasure.c: Add missing return type to change_treasure function. crossedit/Edit.c: Add SET_MAP_FLAGS macro to set P_NEED_UPDATE flag before calling update_position. include/config.h: Add NEW_WORLD_MAP selection which results in proper emergency save paths if you are using the maps-bigworld distribution. server/c_wiz.c: Fix the formatting (indentation) of the command_create function. No actual changes in how it runs, but the old formatting was really terrible and inconsistent. server/main.c: remove call to send_mapstats_cmd server/monster.c: Update the comment style to be proper, as well as the comments themselves. socket/request.c: Fix up improper indentation in esrv_update_stats. remove send_mapstats_cmd function. MSW 2001-12-23 | |||
Show difference between Revision 1.8 and 1.9 | |||
Revision 1.8 | tchize | 2001/11/11 07:10:05 | +3 -3 |
Fixed a bug that caused editor to crash when closing maps or cut/pasting: Map strings had to be created with strdup_local() and not add_string() | |||
Show difference between Revision 1.7 and 1.8 | |||
Revision 1.7 | mwedel | 2001/07/13 23:05:28 | +193 -34 |
crossedit/Attr.c: Rename Layout to AppLayout so other files can use it. crossedit/CrEdit.c: Modified to use new map header. Modified drawing routines, as face values could be null crossedit/Edit.c: Move many functions from common/map.c that are only used here and thus don't need to be in common/map.c. Modify to use new map structure. crossedit/Makefile.in: Change to use cproto to make proto.h file. crossedit/png.c: change user_read_data to be static so proto doesn't pick it up. MSW 2001-07-13 | |||
Show difference between Revision 1.6 and 1.7 | |||
Revision 1.6 | mwedel | 2001/06/04 01:41:02 | +19 -19 |
Checkin of code that supports larger map sizes (configurable in config.h). common/los.c: update los code since it only handled 11x11 maps. Now uses formulatic approach so any map size should be supported. This does result in a few more spaces getting blocked around corners, but it doesn't seem that bad - certainly not compared to the ability to have larger viewable maps. common/map.c, crossedit/CrEdit.c, crossedit/Edit.c, include/global.h, include/map.h,random_maps/monster.c,random_maps/special.c, random_maps/standalone.c, server/apply.c,server/c_misc.c, server/spell_effect.c,socket/info.c: change mapx,mapy to what they really point to, as it prevented using those as variable/structure element names. common/object.c: update_position - if faces for different layers are duplicate, set the duplicates to be blank to increase client update efficiency. doc/Protocol: Add map1 command description, update setup command to describe setting of mapsize. include/config.h: add MAP_CLIENT_X/Y to set maximum map size we can send to the client. include/newserver.h: add mapx, mapy values to socket structure include/player.h: Use MAP_CLIENT_X/Y for sizing arrays that hold map related information in player structure. server/player.c: As per player.h above, use appropriate sizing when initializing player stucture. server/shop.c: Update mapx,mapy like above, but re-do shop listings code as it was doing a lot more work than necessarily (I think some changes got put in for sorting, and the old object manipulation was never removed when that got done) socket/init.c: set default client map size to 11x11 in the socket. socket/item.c: LookAt - change checks for position checking (such that you can only look at things in bounds) use max viewable map size. socket/request.c: Make setup commands a little more forgiving if there are extra spaces. Add 'mapsize' command to setup command. Update old map sending code to use socket map sizes (to support even smaller than normal maps, or 13x13 or 15x15 maps). add draw_client_map1 command which implements the map1 protocol command. MSW 2001-06-03 | |||
Show difference between Revision 1.5 and 1.6 | |||
Revision 1.5 | cvs | 2000/12/04 01:19:56 | +4 -4 |
MSW 2000/12/3: Misc changes. Main one is adding PNG support to the editor. TODO: Remove outdated things to do (like partial resistance code) configure, configure.in, include/autoconf.h.in: Add check for libpng. include/global.h: Remove displaymodes - moved to crossedit/Defines.h crossedit/App.c, crossedit/App.h crossedit/CrEdit.c crossedit/CrFace.c crossedit/CrList.c crossedit/CrUtil.c crossedit/Edit.c crossedit/crossedit.c crossedit/xutil.c, crossedit/png.c (new file): Add support for png display in crossedit. crossedit/Makefile.in: Add png.c file. server/c_misc.c: Change who command to only display real players, and not players in process of connecting/unconnecting. Also, remove code to display old sockets, since those are not supported anymore. | |||
Show difference between Revision 1.4 and 1.5 | |||
Revision 1.4 | peterm | 2000/10/20 15:46:41 | +1 -1 |
Fix from AV for crashing bug on map creation New. Also, put in player changers. | |||
Show difference between Revision 1.3 and 1.4 | |||
Revision 1.3 | cvs | 1999/08/17 22:56:44 | +13 -0 |
Change by dragonm@absolut.tegris.org - improve crossedit so that if you try to load a map you alreay have in memory, it will raise the window - it will also give you the option to forget, save changes, or just raise the window if the in memory version of that map has been modified. Checked in by msw. (crossedit, App.c, Edit.c, Edit.h) | |||
Show difference between Revision 1.2 and 1.3 | |||
Revision 1.2 | azzie | 1999/06/09 14:29:13 | +2 -1 |
Fix in edit.c to ensure map objects (mainly is_floor objects) are actually removed visually as well as from a pure object standpoint. | |||
Show difference between Revision 1.1 and 1.2 | |||
Revision 1.1 | uid200 | 1999/04/02 13:10:11 | None |
Initial revision | |||
First version | |||
Revision 1.1.1.1 | uid200 | 1999/04/02 13:10:11 | +0 -0 |
First CVS revsion: crossfire-0.95.3 | |||
Show difference between Revision 1.1 and 1.1.1.1 |