Skip to content

Commit

Permalink
minor update
Browse files Browse the repository at this point in the history
  • Loading branch information
Magnus Auvinen committed Jul 8, 2008
1 parent 9d632dd commit a13b94f
Show file tree
Hide file tree
Showing 8 changed files with 84 additions and 39 deletions.
16 changes: 16 additions & 0 deletions datasrc/compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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

Expand Down Expand Up @@ -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
Expand Down
12 changes: 9 additions & 3 deletions datasrc/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
NetIntAny("teamscore_blue"),
]),

NetObject("Player_Core", [
NetObject("Character_Core", [
NetIntAny("x"),
NetIntAny("y"),
NetIntAny("vx"),
Expand All @@ -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),
Expand Down Expand Up @@ -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", []),

Expand Down
2 changes: 1 addition & 1 deletion docs/conf/Languages.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
83 changes: 56 additions & 27 deletions docs/conf/Menu.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Format: 1.35
Format: 1.4


# You can add a title and sub-title to your menu like this:
Expand All @@ -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"


# --------------------------------------------------------------------------
#
Expand All @@ -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)
5 changes: 1 addition & 4 deletions docs/conf/Topics.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 0 additions & 2 deletions license.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.

------------------------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion scripts/make_docs.sh
Original file line number Diff line number Diff line change
@@ -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
1 change: 0 additions & 1 deletion src/engine/e_system.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit a13b94f

Please sign in to comment.