1 // network.cxx -- data structures for managing network.
3 // Written by Oliver Delise, started May 1999.
5 // Copyleft (C) 1999 Oliver Delise - delise@mail.isis.de
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License as
9 // published by the Free Software Foundation; either version 2 of the
10 // License, or (at your option) any later version.
12 // This program is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 // General Public License for more details.
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
35 # define exception c_exception
44 # include <values.h> // for MAXINT
47 #include <simgear/logstream.hxx>
48 #include <simgear/constants.h>
49 #include <simgear/fg_random.h>
50 #include <simgear/polar3d.hxx>
52 #include <Aircraft/aircraft.hxx>
54 #include <Scenery/scenery.hxx>
55 #include <Time/fg_timer.hxx>
57 #if defined ( __sun__ ) || defined ( __sgi )
59 extern void *memmove(void *, const void *, size_t);
65 #include <Cockpit/hud.hxx>
66 #include <NetworkOLK/network.h>
68 extern char *fgd_callsign;
71 void net_hud_update(){
72 static char fgd_str[80];
73 static float fgd_lon, fgd_lat, fgd_alt;
76 fgd_lon = get_longitude();
77 fgd_lat = get_latitude();
78 fgd_alt = get_altitude();
79 // sprintf(fgd_str,"Found %s %3.3f %3.3f", net_callsign, fgd_lat, fgd_lon);
80 // HUD_TextList.add( fgText( 40, 18, fgd_str) );
83 while ( other != tail) {
84 if ( strcmp( other->ipadr, fgd_mcp_ip) != 0 ) {
85 sprintf( fgd_str, "%-16s%-16s", other->callsign, other->ipadr);
86 HUD_TextList.add( fgText( 40, LinePos, fgd_str) );
91 sprintf(fgd_str,"%-16s%-16s", fgd_callsign, fgd_mcp_ip);
92 HUD_TextList.add( fgText( 40, LinePos ,fgd_str) );
93 sprintf(fgd_str,"Callsign IP");
94 HUD_TextList.add( fgText( 40, LinePos + 13 ,fgd_str) );