24 #ifndef __NETCOMM_WORLDINFO_TRANSCEIVER_H_
25 #define __NETCOMM_WORLDINFO_TRANSCEIVER_H_
27 #include <core/exception.h>
28 #include <core/utils/lock_list.h>
30 #include <netcomm/worldinfo/handler.h>
31 #include <netcomm/worldinfo/defs.h>
32 #include <netcomm/worldinfo/messages.h>
42 class WorldInfoMessageEncryptor;
43 class WorldInfoMessageDecryptor;
44 class NetworkNameResolver;
62 const char *addr,
unsigned short port,
63 const char *key,
const char *iv,
72 void set_pose(
float x,
float y,
float theta,
float *covariance);
73 void set_velocity(
float vel_x,
float vel_y,
float vel_theta,
float *covariance);
75 void set_rel_ball_pos(
float dist,
float bearing,
float slope,
float *covariance);
84 void set_score(
unsigned int score_cyan,
unsigned int score_magenta);
88 void add_penalty(
unsigned int player,
unsigned int penalty,
89 unsigned int seconds_remaining);
96 void recv(
bool block =
false,
unsigned int max_num_msgs = 0);
107 void reset_outbound();
108 void crypt_outbound();
109 void append_outbound(uint16_t msg_type,
void *msg, uint16_t msg_size);
118 bool resolver_delete;
122 void *crypted_out_buffer;
123 void *crypted_in_buffer;
124 size_t crypt_buffer_size;
126 size_t crypted_out_bytes;
127 size_t crypted_in_bytes;
133 size_t fatmsg_bufsize;
138 unsigned int out_seq;
141 unsigned char *outbound_buffer;
142 unsigned int outbound_bytes;
143 unsigned int outbound_num_msgs;
145 unsigned char *inbound_buffer;
146 size_t inbound_bytes;
152 float *pose_covariance;
158 float *vel_covariance;
160 bool rel_ball_changed;
161 bool rel_ball_visible;
162 int rel_ball_visibility_history;
164 float rel_ball_bearing;
165 float rel_ball_slope;
166 float *rel_ball_covariance;
168 bool rel_ball_vel_changed;
169 float rel_ball_vel_x;
170 float rel_ball_vel_y;
171 float rel_ball_vel_z;
172 float *rel_ball_vel_covariance;
174 bool glob_ball_changed;
175 bool glob_ball_visible;
176 int glob_ball_visibility_history;
180 float *glob_ball_covariance;
182 bool glob_ball_vel_changed;
183 float glob_ball_vel_x;
184 float glob_ball_vel_y;
185 float glob_ball_vel_z;
186 float *glob_ball_vel_covariance;
188 bool gamestate_changed;
199 std::list<opponent_t> opponents;
200 std::list<opponent_t>::iterator oppit;
202 std::list<unsigned int> disappeared_opponents;
203 std::list<unsigned int>::iterator doppit;
205 std::map<unsigned int, worldinfo_penalty_message_t> penalties;
206 std::map<unsigned int, worldinfo_penalty_message_t>::iterator penit;
208 LockList<WorldInfoHandler *> handlers;
209 LockList<WorldInfoHandler *>::iterator hit;
212 std::map<uint32_t, unsigned int> sequence_numbers;
213 std::map<uint32_t, time_t> last_received_time;
214 std::map<uint32_t, time_t>::iterator lrtit;