Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 16, 2011, 2:32:57 PM (14 years ago)
Author:
smerkli
Message:

merged changes from masterserver2 branch into newer trunk here.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/masterserverfix/src/libraries/network/ServerList.h

    r8351 r8935  
    3737namespace orxonox
    3838{
     39  /* HELPER STRUCTURES */
     40  struct ServerListElem
     41  {
     42    /* server information (name, IP, etc) */
     43    packet::ServerInformation ServerInfo;
     44
     45    /* peer pointer */
     46    ENetPeer* peer;
     47  };
     48
     49  struct ServerListSearchResult
     50  {
     51    /* list element found */
     52    ServerListElem result;
     53
     54    /* successful search */
     55    bool success;
     56  };
     57
     58
     59
     60
     61
    3962  /** This class is keeps a list of game servers
    4063   * and some info about them.
     
    5477       * Add server to the game server list
    5578       */
    56       int addServer( packet::ServerInformation toadd );
     79      int addServer( packet::ServerInformation toadd,
     80        ENetPeer *peer );
    5781
    5882      /** \param name Name of the server to remove
     
    6993
    7094
    71       /* SORTING (to be implemented) */
    7295
     96
     97      /* SEARCHING */
     98      /* \param address The address of the server that is to be
     99       *  found
     100       * \return A struct containing a result of the search and a boolean
     101       *  that is only true if the search was successful
     102       *
     103       * Find and return the list handle of a given address.
     104       */
     105      ServerListSearchResult
     106      findServerByAddress( std::string address );
     107
     108
     109      /* \param name The name of the server that is to be
     110       *  found
     111       * \return The struct containing the list entry of the server
     112       *
     113       * Find and return the list handle of a given name.
     114       */
     115      ServerListSearchResult
     116      findServerByName( std::string name );
     117
     118
     119      /* SORTING */
    73120      /** sort by name  */
    74121      void sortByName();
     
    78125
    79126      /** the list of servers for internal storage */
    80       std::list<packet::ServerInformation> serverlist;
     127      std::list<ServerListElem> serverlist;
    81128    private:
    82129  };
Note: See TracChangeset for help on using the changeset viewer.