diff --git a/datasrc/compile.py b/datasrc/compile.py index af0671de6c..30734a21e2 100644 --- a/datasrc/compile.py +++ b/datasrc/compile.py @@ -66,6 +66,8 @@ def EmitEnum(names, num): # NETWORK if gen_network_header: + print "#ifndef FILE_G_PROTOCOL_H" + print "#define FILE_G_PROTOCOL_H" print network.RawHeader for e in network.Enums: @@ -87,11 +89,13 @@ def EmitEnum(names, num): print "int netobj_validate(int type, void *data, int size);" print "const char *netobj_get_name(int type);" + print "int netobj_get_size(int type);" print "void *netmsg_secure_unpack(int type);" print "const char *netmsg_get_name(int type);" print "const char *netmsg_failed_on();" print "int netobj_num_corrections();" print "const char *netobj_corrected_on();" + print "#endif // FILE_G_PROTOCOL_H" if gen_network_source: @@ -117,9 +121,14 @@ def EmitEnum(names, num): lines += ['}'] lines += ["static const char *netobj_names[] = {"] + lines += ['\t"invalid",'] lines += ['\t"%s",' % o.name for o in network.Objects] lines += ['\t""', "};", ""] + lines += ["static int netobj_sizes[] = {"] + lines += ['\t0,'] + lines += ['\tsizeof(%s),' % o.struct_name for o in network.Objects] + lines += ['\t0', "};", ""] for l in lines: print l @@ -150,6 +159,13 @@ def EmitEnum(names, num): lines += ['};'] lines += [''] + lines += ['int netobj_get_size(int type)'] + lines += ['{'] + lines += ['\tif(type < 0 || type >= NUM_NETOBJTYPES) return 0;'] + lines += ['\treturn netobj_sizes[type];'] + lines += ['};'] + lines += [''] + for item in network.Messages: for line in item.emit_unpack(): print line diff --git a/datasrc/network.py b/datasrc/network.py index 46add62bcf..4c49f149a3 100644 --- a/datasrc/network.py +++ b/datasrc/network.py @@ -99,7 +99,7 @@ NetIntAny("teamscore_blue"), ]), - NetObject("Player_Core", [ + NetObject("Character_Core", [ NetIntAny("x"), NetIntAny("y"), NetIntAny("vx"), @@ -118,7 +118,7 @@ NetIntAny("hook_dy"), ]), - NetObject("Player_Character:Player_Core", [ + NetObject("Character:Character_Core", [ NetIntRange("player_state", 0, 'NUM_PLAYERSTATES-1'), NetIntRange("wanted_direction", -1, 1), NetIntRange("health", 0, 10), @@ -238,7 +238,13 @@ NetIntAny("color_feet"), ]), - NetMessage("cl_changeinfo:cl_startinfo", []), + NetMessage("cl_changeinfo", [ + NetString("name"), + NetString("skin"), + NetBool("use_custom_color"), + NetIntAny("color_body"), + NetIntAny("color_feet"), + ]), NetMessage("cl_kill", []), diff --git a/docs/conf/Languages.txt b/docs/conf/Languages.txt index aa9ce802fe..be96913f38 100644 --- a/docs/conf/Languages.txt +++ b/docs/conf/Languages.txt @@ -1,4 +1,4 @@ -Format: 1.35 +Format: 1.4 # This is the Natural Docs languages file for this project. If you change # anything here, it will apply to THIS PROJECT ONLY. If you'd like to change diff --git a/docs/conf/Menu.txt b/docs/conf/Menu.txt index e3d50ddb57..cce708082f 100644 --- a/docs/conf/Menu.txt +++ b/docs/conf/Menu.txt @@ -1,4 +1,4 @@ -Format: 1.35 +Format: 1.4 # You can add a title and sub-title to your menu like this: @@ -9,6 +9,22 @@ Format: 1.35 # Footer: [text] # If you want to add a copyright notice, this would be the place to do it. +# You can add a timestamp to your documentation like one of these: +# Timestamp: Generated on month day, year +# Timestamp: Updated mm/dd/yyyy +# Timestamp: Last updated mon day +# +# m - One or two digit month. January is "1" +# mm - Always two digit month. January is "01" +# mon - Short month word. January is "Jan" +# month - Long month word. January is "January" +# d - One or two digit day. 1 is "1" +# dd - Always two digit day. 1 is "01" +# day - Day with letter extension. 1 is "1st" +# yy - Two digit year. 2006 is "06" +# yyyy - Four digit year. 2006 is "2006" +# year - Four digit year. 2006 is "2006" + # -------------------------------------------------------------------------- # @@ -27,53 +43,66 @@ Format: 1.35 # time it is run. When working with groups, just deal with the braces and # forget about the indentation and comments. # +# You can use this file on other computers even if they use different +# directories. As long as the command line points to the same source files, +# Natural Docs will be able to correct the locations automatically. +# # -------------------------------------------------------------------------- -Group: Articles { +File: OS Abstraction (/home/kma/code/teeworlds/trunk/src/engine/e_system.h) + +Group: Engine { + + Group: Overview { - File: Prediction (docs/prediction.txt) - File: Time on the client (docs/client_time.txt) - } # Group: Articles + File: Time on the client (/home/kma/code/teeworlds/trunk/src/engine/docs/client_time.txt) + File: Prediction (/home/kma/code/teeworlds/trunk/src/engine/docs/prediction.txt) + } # Group: Overview -Group: Reference { + Group: Reference { - File: Lowlevel Library (no auto-title, e_system.h) + Group: Common { - Group: Common Interface { + File: Engine Interface (/home/kma/code/teeworlds/trunk/src/engine/e_if_other.h) + File: Messaging (/home/kma/code/teeworlds/trunk/src/engine/e_if_msg.h) + } # Group: Common - File: Engine Interface (e_if_other.h) - File: Message Packing (no auto-title, e_if_msg.h) - } # Group: Common Interface + Group: Client { - Group: Client Interface { + File: Client Hooks (/home/kma/code/teeworlds/trunk/src/engine/e_if_modc.h) + File: Client Interface (/home/kma/code/teeworlds/trunk/src/engine/e_if_client.h) + File: Graphics (/home/kma/code/teeworlds/trunk/src/engine/e_if_gfx.h) + File: Input (/home/kma/code/teeworlds/trunk/src/engine/e_if_inp.h) + File: Sound (/home/kma/code/teeworlds/trunk/src/engine/e_if_snd.h) + } # Group: Client - File: General (no auto-title, e_if_client.h) - File: Sound (no auto-title, e_if_snd.h) - File: Input (no auto-title, e_if_inp.h) - File: Graphics (no auto-title, e_if_gfx.h) - } # Group: Client Interface + Group: Server { - Group: Server Interface { + File: Server Hooks (/home/kma/code/teeworlds/trunk/src/engine/e_if_mods.h) + File: Server Interface (/home/kma/code/teeworlds/trunk/src/engine/e_if_server.h) + } # Group: Server - File: General (no auto-title, e_if_server.h) - } # Group: Server Interface + } # Group: Reference - Group: Mod Hooks { + } # Group: Engine - File: Client Side (no auto-title, e_if_modc.h) - File: Server Side (no auto-title, e_if_mods.h) - } # Group: Mod Hooks +Group: Game Implementation { - } # Group: Reference + File: Entity (/home/kma/code/teeworlds/trunk/src/game/server/gs_common.hpp) + } # Group: Game Implementation Group: Index { Index: Everything + Class Index: Classes Constant Index: Constants - File Index: Files Function Index: Functions - Class Index: Classes Variable Index: Variables } # Group: Index + + +##### Do not change or remove these lines. ##### +Data: 1(D3333RuEG3AEp39ufG3tGG7uHof63tHN\A36H93`pEG) +Data: 1(h3333RuEG3AEp39ufG3tGG7uHof63tHN\A36H93G\`8\G) diff --git a/docs/conf/Topics.txt b/docs/conf/Topics.txt index ee15ec837f..b1a9b939b9 100644 --- a/docs/conf/Topics.txt +++ b/docs/conf/Topics.txt @@ -1,4 +1,4 @@ -Format: 1.35 +Format: 1.4 # This is the Natural Docs topics file for this project. If you change anything # here, it will apply to THIS PROJECT ONLY. If you'd like to change something @@ -55,9 +55,6 @@ Format: 1.35 # Class Hierarchy: [yes|no] # Whether the topics are part of the class hierarchy. Defaults to no. # -# Variable Type: [yes|no] -# Whether the topics can be a variable type. Defaults to no. -# # Page Title If First: [yes|no] # Whether the topic's title becomes the page title if it's the first one in # a file. Defaults to no. diff --git a/license.txt b/license.txt index 5d83d6a330..4305f69e1c 100644 --- a/license.txt +++ b/license.txt @@ -15,8 +15,6 @@ freely, subject to the following restrictions: 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. -4. Neither this software nor any of its individual components, in original - or modified versions, may be sold by itself. ------------------------------------------------------------------------ diff --git a/scripts/make_docs.sh b/scripts/make_docs.sh index a7682d30fe..3ad7ccfcdf 100755 --- a/scripts/make_docs.sh +++ b/scripts/make_docs.sh @@ -1 +1 @@ -perl tools/naturaldocs/NaturalDocs -i src/engine -xi src/engine/external -p docs/conf -o html docs/output +perl docs/tool/NaturalDocs -i src/game -i src/engine -xi src/engine/external -p docs/conf -o html docs/output diff --git a/src/engine/e_system.c b/src/engine/e_system.c index f8fca86400..eeadbb95f1 100644 --- a/src/engine/e_system.c +++ b/src/engine/e_system.c @@ -492,7 +492,6 @@ int net_addr_comp(const NETADDR *a, const NETADDR *b) return mem_comp(a, b, sizeof(NETADDR)); } - int net_host_lookup(const char *hostname, NETADDR *addr, int types) { /* TODO: IPv6 support */