Up:Tutorial? The aim of this tutorial is to explain how to create a service provider for SIGVerse using Microsoft Visual Studio. We will create a simple service provider as example to send messages to a specified entity of the SIGVerse virtual world from the client side to the server side. Microsoft Visual Studio 2008 will be used as a development tool. Creation of the Service Provider †Downloading the libraries †We first need to download SIGVerse libraries, to do so, go to the service libraries web page and download the appropriate version. Creating a new project †Now let's create a new project on MVS 2008. Go to: File -> New Project , then select Empty Project, enter the project name "MyService" and press Ok. Right click on Source Files -> Add -> New Item -> C++ File (.cpp), then enter "MyService.cpp" in the Name field. Service sample †Now let's create our example. Copy/past the following code to MyService.cpp file: MyService.cpp Replace the hostname and port number with your server arguments. Setting the library †Extract the libraries in MyService project directory. Go to the MVS, Right click on the project, and go to properties. Add the include directory †
Add the library directory †
Add the "SIGService.lib" library †
Server †In the server side, we have to create the controller and the world file. Controller †controller.cpp World file †worl.xml Running the service †
In the server side, compile and run the the controller: $ cd path-to-the-controller $ make $ sigserver.sh -w ./world.xml
In the server side you will see the following message: $ [MSG] man_000(0.0.0.0) Hello Registering the plugin †To register the plugin in SIGViewer, you have to follow these steps: 1- Rename the MyService.exe in debug directory to MyService.sig. 2- Run SIGVIewer, go to Services -> Add, then click on Add button. 3- Select the path to the MyService.sig file and press OK. 4- To run the service, go to Services -> Start -> MyService.sig.
Counter: 3000,
today: 1,
yesterday: 2
|