[Orxonox-commit 2871] r7574 - code/branches/masterserver/src/modules/masterserver

smerkli at orxonox.net smerkli at orxonox.net
Wed Oct 20 23:34:21 CEST 2010


Author: smerkli
Date: 2010-10-20 23:34:21 +0200 (Wed, 20 Oct 2010)
New Revision: 7574

Added:
   code/branches/masterserver/src/modules/masterserver/PeerList.cpp
   code/branches/masterserver/src/modules/masterserver/PeerList.h
Log:
initial peerlist stuff, implementation to follow sometime this week

Added: code/branches/masterserver/src/modules/masterserver/PeerList.cpp
===================================================================
--- code/branches/masterserver/src/modules/masterserver/PeerList.cpp	                        (rev 0)
+++ code/branches/masterserver/src/modules/masterserver/PeerList.cpp	2010-10-20 21:34:21 UTC (rev 7574)
@@ -0,0 +1,63 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Sandro 'smerkli' Merkli
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "PeerList.h"
+
+namespace orxonox
+{
+  PeerList::PeerList() { }
+  PeerList::~PeerList() { }
+
+  int 
+  PeerList::addPeer( ENetPeer *toadd )
+  {
+
+
+    return 0;
+  }
+
+  int 
+  PeerList::remPeerByAddr( ENetAddress addr )
+  {
+
+
+
+    return 0;
+  }
+
+  ENetPeer *
+  PeerList::findPeerByAddr( ENetAddress addr )
+  {
+
+
+
+    return NULL;
+  }
+
+}
+

Added: code/branches/masterserver/src/modules/masterserver/PeerList.h
===================================================================
--- code/branches/masterserver/src/modules/masterserver/PeerList.h	                        (rev 0)
+++ code/branches/masterserver/src/modules/masterserver/PeerList.h	2010-10-20 21:34:21 UTC (rev 7574)
@@ -0,0 +1,75 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Sandro 'smerkli' Merkli
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _PeerList_
+#define _PeerList_
+
+#include <list>
+#include <string>
+#include <enet/enet.h>
+
+/* peer list */
+namespace orxonox 
+{
+  /** This class keeps a list of open connections 
+   * and some info about them.
+   */
+  class PeerList 
+  { public:
+      /** constructor */
+      PeerList();
+
+      /** destructor */
+      ~PeerList();
+
+      /** \param toadd The peer to add
+       * 
+       * Add new peer to list 
+       */
+      int addPeer( ENetPeer *toadd );
+
+      /** \param addr Address to look for
+       * 
+       * Remove peer from list by address 
+       */
+      int remPeerByAddr( ENetAddress addr );
+
+      /** \param addr The address to find by
+       * 
+       * Find a connection by address */
+      ENetPeer *findPeerByAddr( ENetAddress addr );
+
+    private:
+      /** the list of servers for internal storage */
+      std::list<packet::ENetPeer *> peerlist;
+  };
+}
+
+
+
+#endif /* _PeerList_ */




More information about the Orxonox-commit mailing list