@@ -133,19 +133,19 @@ void OnClientConnect(ClientHandler* handler)
133133{
134134 LogI (" Client Connected: " , handler->GetIpAddress (), " :" , handler->GetPort ());
135135
136- ClientPathBuffers[handler->GetUniqueId ()] = std::make_pair (new float [Config->maxPointPath * 3 ], new float [Config->maxPointPath * 3 ]);
137- Nav->NewClient (handler->GetUniqueId ());
136+ ClientPathBuffers[handler->GetId ()] = std::make_pair (new float [Config->maxPointPath * 3 ], new float [Config->maxPointPath * 3 ]);
137+ Nav->NewClient (handler->GetId ());
138138}
139139
140140void OnClientDisconnect (ClientHandler* handler)
141141{
142- Nav->FreeClient (handler->GetUniqueId ());
142+ Nav->FreeClient (handler->GetId ());
143143
144- delete[] ClientPathBuffers[handler->GetUniqueId ()].first ;
145- ClientPathBuffers[handler->GetUniqueId ()].first = nullptr ;
144+ delete[] ClientPathBuffers[handler->GetId ()].first ;
145+ ClientPathBuffers[handler->GetId ()].first = nullptr ;
146146
147- delete[] ClientPathBuffers[handler->GetUniqueId ()].second ;
148- ClientPathBuffers[handler->GetUniqueId ()].second = nullptr ;
147+ delete[] ClientPathBuffers[handler->GetId ()].second ;
148+ ClientPathBuffers[handler->GetId ()].second = nullptr ;
149149
150150 LogI (" Client Disconnected: " , handler->GetIpAddress (), " :" , handler->GetPort ());
151151}
@@ -155,22 +155,22 @@ void PathCallback(ClientHandler* handler, char type, const void* data, int size)
155155 const PathRequestData request = *reinterpret_cast <const PathRequestData*>(data);
156156
157157 int pathSize = 0 ;
158- float * pathBuffer = ClientPathBuffers[handler->GetUniqueId ()].first ;
158+ float * pathBuffer = ClientPathBuffers[handler->GetId ()].first ;
159159
160- if (Nav->GetPath (handler->GetUniqueId (), request.mapId , request.start , request.end , pathBuffer, &pathSize))
160+ if (Nav->GetPath (handler->GetId (), request.mapId , request.start , request.end , pathBuffer, &pathSize))
161161 {
162162 if ((request.flags & static_cast <int >(PathRequestFlags::CATMULLROM)) && pathSize > 9 )
163163 {
164164 int smoothedPathSize = 0 ;
165- float * smoothedPathBuffer = ClientPathBuffers[handler->GetUniqueId ()].second ;
165+ float * smoothedPathBuffer = ClientPathBuffers[handler->GetId ()].second ;
166166 Nav->SmoothPathCatmullRom (pathBuffer, pathSize, smoothedPathBuffer, &smoothedPathSize, Config->catmullRomSplinePoints , Config->catmullRomSplineAlpha );
167167
168168 handler->SendData (type, smoothedPathBuffer, smoothedPathSize * sizeof (float ));
169169 }
170170 else if ((request.flags & static_cast <int >(PathRequestFlags::CHAIKIN)) && pathSize > 6 )
171171 {
172172 int smoothedPathSize = 0 ;
173- float * smoothedPathBuffer = ClientPathBuffers[handler->GetUniqueId ()].second ;
173+ float * smoothedPathBuffer = ClientPathBuffers[handler->GetId ()].second ;
174174 Nav->SmoothPathChaikinCurve (pathBuffer, pathSize, smoothedPathBuffer, &smoothedPathSize);
175175
176176 handler->SendData (type, smoothedPathBuffer, smoothedPathSize * sizeof (float ));
@@ -192,7 +192,7 @@ void RandomPointCallback(ClientHandler* handler, char type, const void* data, in
192192 const int mapId = *reinterpret_cast <const int *>(data);
193193 float point[3 ]{};
194194
195- Nav->GetRandomPoint (handler->GetUniqueId (), mapId, point);
195+ Nav->GetRandomPoint (handler->GetId (), mapId, point);
196196 handler->SendData (type, point, VEC3_SIZE);
197197}
198198
@@ -201,7 +201,7 @@ void RandomPointAroundCallback(ClientHandler* handler, char type, const void* da
201201 const RandomPointAroundData request = *reinterpret_cast <const RandomPointAroundData*>(data);
202202 float point[3 ]{};
203203
204- Nav->GetRandomPointAround (handler->GetUniqueId (), request.mapId , request.start , request.radius , point);
204+ Nav->GetRandomPointAround (handler->GetId (), request.mapId , request.start , request.radius , point);
205205 handler->SendData (type, point, VEC3_SIZE);
206206}
207207
@@ -210,7 +210,7 @@ void MoveAlongSurfaceCallback(ClientHandler* handler, char type, const void* dat
210210 const MoveRequestData request = *reinterpret_cast <const MoveRequestData*>(data);
211211 float point[3 ]{};
212212
213- Nav->MoveAlongSurface (handler->GetUniqueId (), request.mapId , request.start , request.end , point);
213+ Nav->MoveAlongSurface (handler->GetId (), request.mapId , request.start , request.end , point);
214214 handler->SendData (type, point, VEC3_SIZE);
215215}
216216
@@ -219,7 +219,7 @@ void CastRayCallback(ClientHandler* handler, char type, const void* data, int si
219219 const CastRayData request = *reinterpret_cast <const CastRayData*>(data);
220220 dtRaycastHit hit;
221221
222- if (Nav->CastMovementRay (handler->GetUniqueId (), request.mapId , request.start , request.end , &hit))
222+ if (Nav->CastMovementRay (handler->GetId (), request.mapId , request.start , request.end , &hit))
223223 {
224224 handler->SendData (type, request.end , VEC3_SIZE);
225225 }
0 commit comments