SIGVerse
How to add a request to server from the Viewer †
Example case: Add a new element/ parameter in world xml file and load this parameter using a new request.
- Add a element to parse in the Xml file
- Prepare where how to store your new data, and how to access it. In my case I used SSimWorld.h
- Variable
- Accessor: get/set
- Modify WorldXMLReader.cpp, add the new Tags in the parser (in the big if/else)
- Use the set accessor
- Add in WordSimulator.h, a ID and a name for your event
- Be carefull to REQUEST_SIZE
- Add a request to Winmain.h (viewer side)
- Add to WordSimulator.cpp a case when answer to your request
- Use the get accessor
- Convert datas in string
- Use the socket: s
- send first the size of the message (size is store in char[6])
- then send the message
- Viewer side, Add to Winmain.cpp a case to send your request
- Use the function: sendRequest(),
- the socket mSock to receive the contain
- Parse the contain
- Apply the contain