author | nireco |
Sat, 31 Jan 2009 12:33:08 +0200 | |
changeset 443 | 5d1119729f58 |
parent 434 | a8ba81432ddd |
permissions | -rw-r--r-- |
431
c6d7272a164b
rework Network send() code to use NetworkTarget/Node/Group::send classes, add a NetworkMessage class for sending NetworkObject messages, and fix a bug whereby the server's client TCP sockets weren't nonblocking.... I wonder how this has worked before?\!
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
1 |
#ifndef NETWORK_MESSAGE_HH |
c6d7272a164b
rework Network send() code to use NetworkTarget/Node/Group::send classes, add a NetworkMessage class for sending NetworkObject messages, and fix a bug whereby the server's client TCP sockets weren't nonblocking.... I wonder how this has worked before?\!
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
2 |
#define NETWORK_MESSAGE_HH |
c6d7272a164b
rework Network send() code to use NetworkTarget/Node/Group::send classes, add a NetworkMessage class for sending NetworkObject messages, and fix a bug whereby the server's client TCP sockets weren't nonblocking.... I wonder how this has worked before?\!
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
3 |
|
c6d7272a164b
rework Network send() code to use NetworkTarget/Node/Group::send classes, add a NetworkMessage class for sending NetworkObject messages, and fix a bug whereby the server's client TCP sockets weren't nonblocking.... I wonder how this has worked before?\!
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
4 |
/** |
c6d7272a164b
rework Network send() code to use NetworkTarget/Node/Group::send classes, add a NetworkMessage class for sending NetworkObject messages, and fix a bug whereby the server's client TCP sockets weren't nonblocking.... I wonder how this has worked before?\!
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
5 |
* @file |
c6d7272a164b
rework Network send() code to use NetworkTarget/Node/Group::send classes, add a NetworkMessage class for sending NetworkObject messages, and fix a bug whereby the server's client TCP sockets weren't nonblocking.... I wonder how this has worked before?\!
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
6 |
* |
c6d7272a164b
rework Network send() code to use NetworkTarget/Node/Group::send classes, add a NetworkMessage class for sending NetworkObject messages, and fix a bug whereby the server's client TCP sockets weren't nonblocking.... I wonder how this has worked before?\!
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
7 |
* NetworkPacket for use with NetworkObjects |
c6d7272a164b
rework Network send() code to use NetworkTarget/Node/Group::send classes, add a NetworkMessage class for sending NetworkObject messages, and fix a bug whereby the server's client TCP sockets weren't nonblocking.... I wonder how this has worked before?\!
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
8 |
*/ |
c6d7272a164b
rework Network send() code to use NetworkTarget/Node/Group::send classes, add a NetworkMessage class for sending NetworkObject messages, and fix a bug whereby the server's client TCP sockets weren't nonblocking.... I wonder how this has worked before?\!
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
9 |
|
432
82b0f4e55a13
add NetworkChannelPacket class, and modify NetworkTarget::send/send_raw signature. Add hard-coded DEBUG_ENABLED define
Tero Marttila <terom@fixme.fi>
parents:
431
diff
changeset
|
10 |
#include "Channel.hh" |
431
c6d7272a164b
rework Network send() code to use NetworkTarget/Node/Group::send classes, add a NetworkMessage class for sending NetworkObject messages, and fix a bug whereby the server's client TCP sockets weren't nonblocking.... I wonder how this has worked before?\!
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
11 |
#include "Object.hh" |
c6d7272a164b
rework Network send() code to use NetworkTarget/Node/Group::send classes, add a NetworkMessage class for sending NetworkObject messages, and fix a bug whereby the server's client TCP sockets weren't nonblocking.... I wonder how this has worked before?\!
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
12 |
|
c6d7272a164b
rework Network send() code to use NetworkTarget/Node/Group::send classes, add a NetworkMessage class for sending NetworkObject messages, and fix a bug whereby the server's client TCP sockets weren't nonblocking.... I wonder how this has worked before?\!
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
13 |
/** |
c6d7272a164b
rework Network send() code to use NetworkTarget/Node/Group::send classes, add a NetworkMessage class for sending NetworkObject messages, and fix a bug whereby the server's client TCP sockets weren't nonblocking.... I wonder how this has worked before?\!
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
14 |
* NetworkMessages are NetworkPackets that are related to some specfic NetworkObject and its NetworkObjectController. |
c6d7272a164b
rework Network send() code to use NetworkTarget/Node/Group::send classes, add a NetworkMessage class for sending NetworkObject messages, and fix a bug whereby the server's client TCP sockets weren't nonblocking.... I wonder how this has worked before?\!
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
15 |
*/ |
432
82b0f4e55a13
add NetworkChannelPacket class, and modify NetworkTarget::send/send_raw signature. Add hard-coded DEBUG_ENABLED define
Tero Marttila <terom@fixme.fi>
parents:
431
diff
changeset
|
16 |
class NetworkMessage : public NetworkChannelPacket { |
431
c6d7272a164b
rework Network send() code to use NetworkTarget/Node/Group::send classes, add a NetworkMessage class for sending NetworkObject messages, and fix a bug whereby the server's client TCP sockets weren't nonblocking.... I wonder how this has worked before?\!
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
17 |
public: |
c6d7272a164b
rework Network send() code to use NetworkTarget/Node/Group::send classes, add a NetworkMessage class for sending NetworkObject messages, and fix a bug whereby the server's client TCP sockets weren't nonblocking.... I wonder how this has worked before?\!
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
18 |
/** |
c6d7272a164b
rework Network send() code to use NetworkTarget/Node/Group::send classes, add a NetworkMessage class for sending NetworkObject messages, and fix a bug whereby the server's client TCP sockets weren't nonblocking.... I wonder how this has worked before?\!
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
19 |
* Create a message of the given type to be sent on the given object |
c6d7272a164b
rework Network send() code to use NetworkTarget/Node/Group::send classes, add a NetworkMessage class for sending NetworkObject messages, and fix a bug whereby the server's client TCP sockets weren't nonblocking.... I wonder how this has worked before?\!
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
20 |
*/ |
c6d7272a164b
rework Network send() code to use NetworkTarget/Node/Group::send classes, add a NetworkMessage class for sending NetworkObject messages, and fix a bug whereby the server's client TCP sockets weren't nonblocking.... I wonder how this has worked before?\!
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
21 |
NetworkMessage (NetworkObject &obj, NetworkMessageID msg_id); |
434
a8ba81432ddd
move write_object to NetworkMessage, fix player sync, and implement projectile sync
Tero Marttila <terom@fixme.fi>
parents:
432
diff
changeset
|
22 |
|
a8ba81432ddd
move write_object to NetworkMessage, fix player sync, and implement projectile sync
Tero Marttila <terom@fixme.fi>
parents:
432
diff
changeset
|
23 |
/** |
a8ba81432ddd
move write_object to NetworkMessage, fix player sync, and implement projectile sync
Tero Marttila <terom@fixme.fi>
parents:
432
diff
changeset
|
24 |
* Write the given Object's NetworkObjectID (or 0, if the obj is NULL) to this p acket |
a8ba81432ddd
move write_object to NetworkMessage, fix player sync, and implement projectile sync
Tero Marttila <terom@fixme.fi>
parents:
432
diff
changeset
|
25 |
* |
a8ba81432ddd
move write_object to NetworkMessage, fix player sync, and implement projectile sync
Tero Marttila <terom@fixme.fi>
parents:
432
diff
changeset
|
26 |
* @param obj the NetworkObject* whose NetworkObjectID to write to the packet, or NULL to write zero |
a8ba81432ddd
move write_object to NetworkMessage, fix player sync, and implement projectile sync
Tero Marttila <terom@fixme.fi>
parents:
432
diff
changeset
|
27 |
*/ |
a8ba81432ddd
move write_object to NetworkMessage, fix player sync, and implement projectile sync
Tero Marttila <terom@fixme.fi>
parents:
432
diff
changeset
|
28 |
void write_object (const NetworkObject *obj); |
431
c6d7272a164b
rework Network send() code to use NetworkTarget/Node/Group::send classes, add a NetworkMessage class for sending NetworkObject messages, and fix a bug whereby the server's client TCP sockets weren't nonblocking.... I wonder how this has worked before?\!
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
29 |
}; |
c6d7272a164b
rework Network send() code to use NetworkTarget/Node/Group::send classes, add a NetworkMessage class for sending NetworkObject messages, and fix a bug whereby the server's client TCP sockets weren't nonblocking.... I wonder how this has worked before?\!
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
30 |
|
c6d7272a164b
rework Network send() code to use NetworkTarget/Node/Group::send classes, add a NetworkMessage class for sending NetworkObject messages, and fix a bug whereby the server's client TCP sockets weren't nonblocking.... I wonder how this has worked before?\!
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
31 |
#endif /* NETWORK_MESSAGE_HH */ |