Update of /cvsroot/playerstage/code/player/server
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9714/server
Modified Files:
Makefile.am server.cc
Log Message:
fixed up build, added auto registration to server
Index: Makefile.am
===================================================================
RCS file: /cvsroot/playerstage/code/player/server/Makefile.am,v
retrieving revision 1.100
retrieving revision 1.101
diff -C2 -d -r1.100 -r1.101
*** Makefile.am 20 Aug 2007 19:42:48 -0000 1.100
--- Makefile.am 26 Sep 2007 23:07:44 -0000 1.101
***************
*** 16,19 ****
--- 16,22 ----
#
player_LDADD = -lm
$(top_builddir)/server/libplayerdrivers/libplayerdrivers.la
$(top_builddir)/libplayercore/libplayercore.la
$(top_builddir)/libplayercore/libplayererror.la
$(top_builddir)/libplayercore/libplayerutils.la
$(top_builddir)/libplayertcp/libplayertcp.la
$(top_builddir)/libplayertcp/libplayerudp.la
$(top_builddir)/libplayerxdr/libplayerxdr.la @PLAYER_DRIVER_EXTRA_LIBS@
$(RTKGUI_LIBS) $(top_builddir)/replace/libreplace.la @ARTOOLKITPLUS_LIBS@
@GEOS_LIBS@
+ if HAVE_PLAYERSD
+ player_LDADD += $(top_builddir)/libplayersd/libplayersd.la
+ endif
#player_LDADD = -lm
$(top_builddir)/server/libplayerdrivers/.libs/libplayerdrivers.a
$(top_builddir)/libplayercore/.libs/libplayercore.a
$(top_builddir)/libplayercore/.libs/libplayererror.a
$(top_builddir)/libplayertcp/.libs/libplayertcp.a
$(top_builddir)/libplayerxdr/.libs/libplayerxdr.a @PLAYER_DRIVER_EXTRA_LIBS@
$(RTKGUI_LIBS) $(top_builddir)/replace/.libs/libreplace.a
Index: server.cc
===================================================================
RCS file: /cvsroot/playerstage/code/player/server/server.cc,v
retrieving revision 1.39
retrieving revision 1.40
diff -C2 -d -r1.39 -r1.40
*** server.cc 24 Sep 2007 20:43:41 -0000 1.39
--- server.cc 26 Sep 2007 23:07:44 -0000 1.40
***************
*** 85,88 ****
--- 85,92 ----
/** @} */
+ #if HAVE_CONFIG_H
+ #include <config.h>
+ #endif
+
#include <stdio.h>
#include <assert.h>
***************
*** 93,96 ****
--- 97,101 ----
#include <libplayercore/playercore.h>
+ #include <libplayercore/interface_util.h>
#include <libplayertcp/playertcp.h>
#include <libplayertcp/playerudp.h>
***************
*** 98,101 ****
--- 103,110 ----
#include <libplayerdrivers/driverregistry.h>
+ #if HAVE_PLAYERSD
+ #include <libplayersd/playersd.h>
+ #endif
+
void PrintVersion();
***************
*** 118,121 ****
--- 127,134 ----
ConfigFile* cf;
+ #if HAVE_PLAYERSD
+ player_sd_t* sd;
+ #endif
+
int
main(int argc, char** argv)
***************
*** 237,242 ****
{
// Get the old port and the new port
! int oport = ports[i];
! int nport = new_ports[i];
// If the old and new ports are the same, nothing to do
--- 250,255 ----
{
// Get the old port and the new port
! unsigned int oport = ports[i];
! unsigned int nport = new_ports[i];
// If the old and new ports are the same, nothing to do
***************
*** 254,257 ****
--- 267,291 ----
}
+ #if HAVE_PLAYERSD
+ sd = player_sd_init();
+ char servicename[PLAYER_SD_NAME_MAXLEN];
+ char host[PLAYER_SD_NAME_MAXLEN];
+ if(gethostname(host,sizeof(host)) == -1)
+ strcpy(host,"localhost");
+
+ // Register all devices with zerconf
+ for(Device* device = deviceTable->GetFirstDevice();
+ device;
+ device = deviceTable->GetNextDevice(device))
+ {
+ snprintf(servicename,sizeof(servicename),"%s %s:%u",
+ host, interf_to_str(device->addr.interf), device->addr.index);
+ if(player_sd_register(sd,servicename,device->addr) != 0)
+ {
+ PLAYER_WARN("player_sd_register returned error");
+ }
+ }
+ #endif
+
printf("Listening on ports: ");
for(int i=0;i<num_ports;i++)
***************
*** 311,314 ****
--- 345,352 ----
player_globals_fini();
delete cf;
+ #if HAVE_PLAYERSD
+ if(sd)
+ player_sd_fini(sd);
+ #endif
}
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit