[Orxonox-commit 3477] r8163 - in code/branches/masterserver2: data/levels data/levels/templates src/libraries/network

smerkli at orxonox.net smerkli at orxonox.net
Thu Mar 31 15:36:00 CEST 2011


Author: smerkli
Date: 2011-03-31 15:35:59 +0200 (Thu, 31 Mar 2011)
New Revision: 8163

Modified:
   code/branches/masterserver2/data/levels/templates/spaceshipAssff.oxt
   code/branches/masterserver2/data/levels/tutorial.oxw
   code/branches/masterserver2/src/libraries/network/MasterServer.cc
   code/branches/masterserver2/src/libraries/network/MasterServer.h
Log:
Started thinking about server list cleanups

Modified: code/branches/masterserver2/data/levels/templates/spaceshipAssff.oxt
===================================================================
--- code/branches/masterserver2/data/levels/templates/spaceshipAssff.oxt	2011-03-30 10:52:13 UTC (rev 8162)
+++ code/branches/masterserver2/data/levels/templates/spaceshipAssff.oxt	2011-03-31 13:35:59 UTC (rev 8163)
@@ -7,12 +7,12 @@
    spawnparticleduration  = 3
    explosionchunks        = 6
 
-   health            = 100
-   maxhealth         = 200
-   initialhealth     = 100
+   health            = 100000
+   maxhealth         = 200000
+   initialhealth     = 100000
 
-   primaryThrust     = 100;
-   auxilaryThrust    = 30;
+   primaryThrust     = 10000;
+   auxilaryThrust    = 3000;
    rotationThrust    = 25;
 
    collisionType     = "dynamic"
@@ -56,7 +56,7 @@
 
 <Template name=spaceshipassffengine baseclass=MultiStateEngine>
   <MultiStateEngine
-   boostfactor    = 2
+   boostfactor    = 20
 
    speedfront     = 150
    speedback      =  50
@@ -66,8 +66,8 @@
    defEngineSndNormal = "sounds/Engine_low.ogg"
    defEngineSndBoost = "sounds/Engine_high.ogg"
 
-   accelerationfront     = 500
-   accelerationbrake     = 500
+   accelerationfront     = 200
+   accelerationbrake     = 200
    accelerationback      =  125
    accelerationleftright =  125
    accelerationupdown    =  125

Modified: code/branches/masterserver2/data/levels/tutorial.oxw
===================================================================
--- code/branches/masterserver2/data/levels/tutorial.oxw	2011-03-30 10:52:13 UTC (rev 8162)
+++ code/branches/masterserver2/data/levels/tutorial.oxw	2011-03-31 13:35:59 UTC (rev 8163)
@@ -29,19 +29,19 @@
 
 <Drone name="meineDrohne" primarythrust="80" auxilarythrust="10" rotationthrust="10" mass= "50" linearDamping = "0.9" angularDamping = "0.7">
   <attached>
-    <Model scale="1" mesh="drone.mesh"/>
+    <Model scale="10" mesh="drone.mesh"/>
   </attached>
   <collisionShapes>
-    <BoxCollisionShape position="0,0,0"      halfExtents="10, 10, 10" />
+    <BoxCollisionShape position="10,10,0"      halfExtents="10, 10, 10" />
   </collisionShapes>
 </Drone>
 
     <Drone name="meineDrohne" primarythrust="80" auxilarythrust="10" rotationthrust="10" mass= "50" linearDamping = "0.9" angularDamping = "0.7">
       <attached>
-        <Model scale="1" mesh="rocket.mesh"/>
+        <Model scale="1" mesh="drone.mesh"/>
       </attached>
       <collisionShapes>
-        <BoxCollisionShape position="0,0,0"      halfExtents="10, 10, 10" />
+        <BoxCollisionShape position="0,10,0"      halfExtents="10, 10, 10" />
       </collisionShapes>
     </Drone>
 

Modified: code/branches/masterserver2/src/libraries/network/MasterServer.cc
===================================================================
--- code/branches/masterserver2/src/libraries/network/MasterServer.cc	2011-03-30 10:52:13 UTC (rev 8162)
+++ code/branches/masterserver2/src/libraries/network/MasterServer.cc	2011-03-31 13:35:59 UTC (rev 8163)
@@ -98,9 +98,35 @@
     enet_host_flush( this->server );
   }
 
+  /* maybe the two methods below can be merged into one and 
+   * made to use ENet's RTT functionality to check for disconnected 
+   * servers.
+   */
+  void 
+  MasterServer::helper_pingServers( void )
+  {
+    /* get an iterator */
+    std::list<packet::ServerInformation>::iterator i;
+    /* loop through list elements */
+    for( i = mainlist.serverlist.begin(); i 
+        != mainlist.serverlist.end(); ++i ) 
+    {
+      /* to be implemented, waiting for Oli to reply to my email - sandro */
+    
+    }
+ 
+  }
 
+  void 
+  MasterServer::helper_cleanupServers()
+  {
+    /* same as above. */
 
+  }
 
+
+
+
   /***** EVENTS *****/
   /* connect event */
   int 
@@ -234,7 +260,15 @@
     }
 
     /* TODO schedule pings for servers somewhere here */
+    /* Iterate through servers and send pings */
+    helper_pingServers();
     
+    /* check for timed out pings and remove those guys from
+     * the server list
+     */
+    helper_cleanupServers();
+
+
     /* create an iterator for the loop */
     enet_host_service( this->server, event, 100 );
 

Modified: code/branches/masterserver2/src/libraries/network/MasterServer.h
===================================================================
--- code/branches/masterserver2/src/libraries/network/MasterServer.h	2011-03-30 10:52:13 UTC (rev 8162)
+++ code/branches/masterserver2/src/libraries/network/MasterServer.h	2011-03-31 13:35:59 UTC (rev 8163)
@@ -68,6 +68,8 @@
 
       /* helpers */
       void helper_sendlist( ENetEvent *event );
+      void helper_pingServers( void );
+      void helper_cleanupServers();
 
       /* members */
       ENetAddress address;




More information about the Orxonox-commit mailing list