RakNet::Ranking_UpdateRating Struct Reference

#include <Lobby2Message.h>

Inheritance diagram for RakNet::Ranking_UpdateRating:

RakNet::Lobby2Message List of all members.

Public Member Functions

virtual bool RequiresAdmin (void) const
virtual bool CancelOnDisconnect (void) const
virtual bool RequiresLogin (void) const
virtual void Serialize (bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream)
 Overridable serialization of the contents of this message. Defaults to SerializeBase().
virtual bool PrevalidateInput (void)

Detailed Description

Essentially performs the C function below (CalculateNewEloRating) for two players, updating the new rating for each player. This function will be manually called from C++, as the input parameters are too complex to be determined automatically. Each call to this function should be logged to a separate table. This way if invalid ratings are submitted, the cheating recordings can be pruned. The log should store all parameters to this function, as well as the old and new rating for each player. This operation does not have to be written in C, as long as it performs the same. playerARating and playerBRating are looked up from the database based on playerAHandle and playerBHandle, the titleName, and the gameType. The C code is called twice, once for each player. For example:

John gets 5 points and has a current rating of 100. Jim gets 10 points and has a current rating of 200.

John's new rating = CalculateNewEloRating(100, 200, 5, 10, kFactor); Jim's new rating = CalculateNewEloRating(200, 100, 10, 5, kFactor);


Member Function Documentation

virtual bool RakNet::Ranking_UpdateRating::RequiresAdmin ( void   )  const [inline, virtual]

Is this message something that should only be run by a system with admin privileges? Set admin privledges with Lobby2Server::AddAdminAddress()

Implements RakNet::Lobby2Message.

virtual bool RakNet::Ranking_UpdateRating::CancelOnDisconnect ( void   )  const [inline, virtual]

Should this message not be processed on the server if the requesting user disconnects before it completes? This should be true for functions that only return data. False for functions that affect other users, or change the database

Implements RakNet::Lobby2Message.

virtual bool RakNet::Ranking_UpdateRating::RequiresLogin ( void   )  const [inline, virtual]

Does this function require logging into the server before it can be executed? If true, the user id and user handle will be automatically inferred by the last login by looking up the sender's system address. If false, the message should include the username so the database query can lookup which user is performing this operation.

Implements RakNet::Lobby2Message.

bool Ranking_UpdateRating::PrevalidateInput ( void   )  [virtual]

If data members can be validated for correctness in the server's main thread, override this function and do those checks here.

Returns:
True for input OK. False if the input is bad and does not need to be further processed in the database threads.

Reimplemented from RakNet::Lobby2Message.


The documentation for this struct was generated from the following files:
Generated on Sun Sep 7 23:17:21 2008 for RakNet by  doxygen 1.5.1-p1