Changeset 98
- Timestamp:
- Oct 24, 2007, 8:09:52 PM (17 years ago)
- Location:
- code/branches/network
- Files:
-
- 1 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/network/Orxonox.kdevelop
r96 r98 2 2 <kdevelop> 3 3 <general> 4 <author ></author>5 <email ></email>4 <author/> 5 <email/> 6 6 <version>$VERSION$</version> 7 7 <projectmanagement>KDevCustomProject</projectmanagement> … … 14 14 </secondaryLanguages> 15 15 <projectname>Orxonox</projectname> 16 <description ></description>17 <defaultencoding ></defaultencoding>16 <description/> 17 <defaultencoding/> 18 18 </general> 19 19 <kdevcustomproject> … … 23 23 <directoryradio>custom</directoryradio> 24 24 <customdirectory>/home/scheusso/orxonox/network</customdirectory> 25 <programargs ></programargs>25 <programargs/> 26 26 <terminal>false</terminal> 27 27 <autocompile>true</autocompile> 28 28 <envvars/> 29 <globaldebugarguments ></globaldebugarguments>29 <globaldebugarguments/> 30 30 <globalcwd>/home/scheusso/orxonox/network/bin/</globalcwd> 31 31 <useglobalprogram>false</useglobalprogram> … … 41 41 <numberofjobs>1</numberofjobs> 42 42 <dontact>false</dontact> 43 <makebin ></makebin>43 <makebin/> 44 44 <selectedenvironment>default</selectedenvironment> 45 45 <environments> … … 47 47 </environments> 48 48 <prio>0</prio> 49 <defaulttarget ></defaulttarget>49 <defaulttarget/> 50 50 <makeoptions>-I ./net/</makeoptions> 51 51 </make> … … 69 69 <other> 70 70 <prio>0</prio> 71 <otherbin ></otherbin>72 <defaulttarget ></defaulttarget>73 <otheroptions ></otheroptions>71 <otherbin/> 72 <defaulttarget/> 73 <otheroptions/> 74 74 <selectedenvironment>default</selectedenvironment> 75 75 <environments> … … 136 136 <version>3</version> 137 137 <includestyle>3</includestyle> 138 <root>/usr/ pack/qt-3.3.6-mo/i686-debian-linux3.1</root>138 <root>/usr/qt/3</root> 139 139 <designerintegration>EmbeddedKDevDesigner</designerintegration> 140 <qmake>/usr/ pack/qt-3.3.6-mo/i686-debian-linux3.1/bin/qmake</qmake>141 <designer>/usr/ pack/qt-3.3.6-mo/i686-debian-linux3.1/bin/designer</designer>140 <qmake>/usr/qt/3/bin/qmake</qmake> 141 <designer>/usr/qt/3/bin/designer</designer> 142 142 <designerpluginpaths/> 143 143 </qt> 144 144 <creategettersetter> 145 <prefixGet ></prefixGet>145 <prefixGet/> 146 146 <prefixSet>set</prefixSet> 147 147 <prefixVariable>m_,_</prefixVariable> … … 172 172 <kdevdebugger> 173 173 <general> 174 <gdbpath ></gdbpath>175 <dbgshell ></dbgshell>176 <configGdbScript ></configGdbScript>177 <runShellScript ></runShellScript>178 <runGdbScript ></runGdbScript>174 <gdbpath/> 175 <dbgshell/> 176 <configGdbScript/> 177 <runShellScript/> 178 <runGdbScript/> 179 179 <breakonloadinglibs>true</breakonloadinglibs> 180 180 <separatetty>false</separatetty> -
code/branches/network/Orxonox.kdevelop.filelist
r96 r98 9 9 Makefile 10 10 src 11 src/Makefile 11 zig2.1.0 12 zig2.1.0/minigame 13 zig2.1.0/minigame/conalleg.cpp 14 zig2.1.0/minigame/conalleg.h 15 zig2.1.0/minigame/gameclient.cpp 16 zig2.1.0/minigame/gameclient.h 17 zig2.1.0/minigame/gameserver.cpp 18 zig2.1.0/minigame/gameserver.h 19 zig2.1.0/minigame/main.cpp 20 zig2.1.0/minigame/main.h 21 zig2.1.0/minigame/Makefile 22 zig2.1.0/ziglib 23 zig2.1.0/ziglib/include 24 zig2.1.0/ziglib/include/nl.h 25 zig2.1.0/ziglib/include/zig 26 zig2.1.0/ziglib/include/zig/address.h 27 zig2.1.0/ziglib/include/zig/buffer.h 28 zig2.1.0/ziglib/include/zig/bzip2.h 29 zig2.1.0/ziglib/include/zig/client.h 30 zig2.1.0/ziglib/include/zig/console.h 31 zig2.1.0/ziglib/include/zig/leetnet.h 32 zig2.1.0/ziglib/include/zig/log.h 33 zig2.1.0/ziglib/include/zig/msocket.h 34 zig2.1.0/ziglib/include/zig/pfilesys.h 35 zig2.1.0/ziglib/include/zig/server.h 36 zig2.1.0/ziglib/include/zig/serverinfo.h 37 zig2.1.0/ziglib/include/zig/station.h 38 zig2.1.0/ziglib/include/zig/typereg.h 39 zig2.1.0/ziglib/include/zig/utils.h 40 zig2.1.0/ziglib/include/zig/zigclient.h 41 zig2.1.0/ziglib/include/zig/zigdefs.h 42 zig2.1.0/ziglib/include/zig/zig.h 43 zig2.1.0/ziglib/include/zig/zigserver.h 44 zig2.1.0/ziglib/src 45 zig2.1.0/ziglib/src/address.cpp 46 zig2.1.0/ziglib/src/buffer.cpp 47 zig2.1.0/ziglib/src/bzip2.cpp 48 zig2.1.0/ziglib/src/client.cpp 49 zig2.1.0/ziglib/src/console.cpp 50 zig2.1.0/ziglib/src/log.cpp 51 zig2.1.0/ziglib/src/Makefile 52 zig2.1.0/ziglib/src/msocket.cpp 53 zig2.1.0/ziglib/src/pfilesys.cpp 54 zig2.1.0/ziglib/src/server.cpp 55 zig2.1.0/ziglib/src/serverinfo.cpp 56 zig2.1.0/ziglib/src/station.cpp 57 zig2.1.0/ziglib/src/typereg.cpp 58 zig2.1.0/ziglib/src/utils.cpp 59 zig2.1.0/ziglib/src/zigclient.cpp 60 zig2.1.0/ziglib/src/zig.cpp 61 zig2.1.0/ziglib/src/zigserver.cpp -
code/branches/network/Orxonox.kdevses
r96 r98 2 2 <!DOCTYPE KDevPrjSession> 3 3 <KDevPrjSession> 4 <DocsAndViews NumberOfDocuments=" 2" >5 <Doc0 NumberOfViews="1" URL="file:/// home/scheusso/orxonox/network/src/orxonox.cc" >6 <View0 Encoding="" line=" 27" Type="Source" />4 <DocsAndViews NumberOfDocuments="1" > 5 <Doc0 NumberOfViews="1" URL="file:///pub/eth/orxonox/network/src/orxonox.cc" > 6 <View0 Encoding="" line="0" Type="Source" /> 7 7 </Doc0> 8 <Doc1 NumberOfViews="1" URL="file:///home/scheusso/orxonox/network/src/tnl/tnlVector.h" >9 <View0 Encoding="" line="316" Type="Source" />10 </Doc1>11 8 </DocsAndViews> 12 9 <pluginList> -
code/branches/network/src/orxonox.cc
r95 r98 26 26 */ 27 27 28 #include "tnl.h" 29 #include "tnlEventConnection.h" 30 #include "tnlNetInterface.h" 31 #include "tnlRPC.h" 32 #include <stdio.h> 33 bool gQuit = false; // a flag used when the client wants to quit. using namespace TNL; // make sure we can simply use the TNL classes. 28 // TODO: Change this to orxonox.h and include all necessary functions there 29 #include "ExampleApplication.h" 34 30 35 class SimpleEventConnection : public EventConnection 31 // TODO: Put creation of SceneNode and implementation of FrameListener into an extern file 32 SceneNode *lightNode; 33 34 class FrameListener : public ExampleFrameListener 36 35 { 37 typedef EventConnection Parent; 36 public: 37 FrameListener(RenderWindow* win, Camera* cam, SceneManager *sceneMgr) 38 : ExampleFrameListener(win, cam, false, false) 39 { 40 } 38 41 39 public: 40 // Let the network system know this is a valid network connection. 41 TNL_DECLARE_NETCONNECTION(SimpleEventConnection); 42 bool frameStarted(const FrameEvent &evt) 43 { 44 // add tutorial code here: 45 // ... 46 lightNode->translate(Vector3(0, -10 * evt.timeSinceLastFrame, 0)); 42 47 43 // declare the client to server message 44 TNL_DECLARE_RPC(rpcMessageClientToServer, (const char *theMessageString)); 45 46 // declare the server to client message 47 TNL_DECLARE_RPC(rpcMessageServerToClient, (const char *theMessageString)); 48 return ExampleFrameListener::frameStarted(evt); 49 } 50 private: 48 51 }; 49 52 50 TNL_IMPLEMENT_NETCONNECTION(SimpleEventConnection, NetClassGroupGame, true); 51 52 TNL_IMPLEMENT_RPC(SimpleEventConnection, rpcMessageClientToServer, (const char *messageString), NetClassGroupGameMask, RPCGuaranteedOrdered, RPCDirClientToServer, 0) 53 // TODO: Make Doxygen tags work and create scene AFTER loading in an extern file 54 //! This is the application class of Orxonox 55 /** 56 Application class. The starting point of Orxonox. 57 Loading of ressources should start in here. 58 ... 59 */ 60 class Orxonox : public ExampleApplication 53 61 { 54 // display the message the client sent 55 printf("Got message from client: %s\n", messageString); 56 // send a hello world back to the client. 57 rpcMessageServerToClient("Hello, World!"); 58 } 59 60 TNL_IMPLEMENT_RPC(SimpleEventConnection, rpcMessageServerToClient, (const char *messageString), NetClassGroupGameMask, RPCGuaranteedOrdered, RPCDirServerToClient, 0) 61 { 62 // display the message the server sent 63 printf("Got a message from server: %s\n", messageString); 64 65 // once the client has heard back from the server, it should quit. 66 gQuit = true; 67 } 68 69 int main(int argc, const char **argv) 70 { 71 if(argc != 3) 62 protected: 63 public: 64 Orxonox() 72 65 { 73 printf("usage: simpletnltest <-server|-client> <connectAddress>");74 return 1;75 }76 bool isClient = !strcmp(argv[1], "-client");77 78 // convert the command-line address into TNL address form79 Address cmdAddress(argv[2]);80 81 RefPtr<NetInterface> theNetInterface;82 if(isClient)83 {84 Address bindAddress(IPProtocol, Address::Any, 0);85 86 // create a new NetInterface bound to any interface, any port (0)87 theNetInterface = new NetInterface(bindAddress);88 89 // create a new SimpleEventConnection and tell it to connect to the90 // server at cmdAddress.91 SimpleEventConnection *newConnection = new SimpleEventConnection;92 newConnection->connect(theNetInterface, cmdAddress);93 94 // post an RPC, to be executed when the connection is established95 newConnection->rpcMessageClientToServer("Hello??");96 }97 else98 {99 // create a server net interface, bound to the cmdAddress100 theNetInterface = new NetInterface(cmdAddress);101 102 // notify the NetInterface that it can allow connections103 theNetInterface->setAllowsConnections(true);104 66 } 105 67 106 // now just loop, processing incoming packets and sending outgoing packets 107 // until the global quit flag is set. 108 while(!gQuit) 68 ~Orxonox() 109 69 { 110 theNetInterface->checkIncomingPackets();111 theNetInterface->processConnections();112 Platform::sleep(1);113 70 } 114 return 0; 71 protected: 72 void createCamera(void) 73 { 74 // create camera 75 mCamera = mSceneMgr->createCamera("PlayerCam"); 76 mCamera->setNearClipDistance(5); 77 mCamera->setPosition(Vector3(0,10,500)); 78 mCamera->lookAt(Vector3(0,0,0)); 79 } 80 81 void createScene(void) 82 { 83 // add tutorial code here: 84 // ... 85 mSceneMgr->setAmbientLight( ColourValue( 0.3, 0.3, 0.3 ) ); 86 //Entity* head = mSceneMgr->createEntity("head", "ogrehead.mesh"); 87 88 //Entity* head2 = mSceneMgr->createEntity("head2", "ogrehead.mesh"); 89 90 SceneNode *node = mSceneMgr->getRootSceneNode()->createChildSceneNode( "OgreHeadNode", Vector3( 0, 0, 0 ) ); 91 //node->attachObject( head ); 92 93 SceneNode *node2 = mSceneMgr->getRootSceneNode()->createChildSceneNode( "OgreHeadNode2", Vector3( 50, 0, 0 ) ); 94 //node2->attachObject( head2 ); 95 96 97 //mSceneMgr->setSkyBox(true, "Examples/SpaceSkyBox"); 98 99 Light *light = mSceneMgr->createLight("Light1"); 100 light->setType(Light::LT_POINT); 101 light->setPosition(Vector3(0, 100, 0)); 102 light->setDiffuseColour(0.5, 0.5, 0.0); 103 light->setSpecularColour(0.5, 0.5, 0.0); 104 105 BillboardSet *bbs = mSceneMgr->createBillboardSet("bb", 1); 106 bbs->createBillboard(Vector3::ZERO, ColourValue(1.0, 0.0, 0.0)); 107 //bbs->setMaterialName("Examples/Flare"); 108 109 lightNode = mSceneMgr->getRootSceneNode()->createChildSceneNode("LightNode", Vector3(0, 100, 0)); 110 lightNode->attachObject(bbs); 111 lightNode->attachObject(light); 112 light->setPosition(0.0, 0.0, 0.0); 113 } 114 115 void createFrameListener(void) 116 { 117 // create frame listener 118 mFrameListener = new ExampleFrameListener(mWindow, mCamera, mSceneMgr); 119 mRoot->addFrameListener(mFrameListener); 120 } 121 }; 122 123 #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32 124 #define WIN32_LEAN_AND_MEAN 125 #include "windows.h" 126 127 INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT ) 128 #else 129 130 int main(int argc, char **argv) 131 #endif 132 { 133 // Create application object 134 Orxonox orxonox; 135 136 try { 137 orxonox.go(); 138 } catch( Exception& e ) { 139 #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32 140 MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occurred!", MB_OK | MB_ICONERROR | MB_TASKMODAL); 141 #else 142 fprintf(stderr, "An exception has occurred: %s\n", 143 e.getFullDescription().c_str()); 144 #endif 145 } 146 147 return 0; 115 148 }
Note: See TracChangeset
for help on using the changeset viewer.