|
GNE
0.75.0
|
An error that occurs during the connection process if the remote machine sends incorrect or corrupted packets to us. More...
#include <Errors.h>
Public Types | |
| enum | ViolationType { OtherViolation = 0, InvalidCRP, InvalidCAP, InvalidUnreliableInfo } |
Public Types inherited from GNE::Error | |
| enum | ErrorCode { NoError = 0, ProtocolViolation, GNETheirVersionLow, GNETheirVersionHigh, WrongGame, UserVersionMismatch, CouldNotOpenSocket, ConnectionTimeOut, ConnectionAborted, ConnectionRefused, ConnectionDropped, SyncConnectionReleased, ExitNoticeReceived, Read, Write, UnknownPacket, PacketTypeMismatch, DuplicateObjectId, UnknownObjectId, InvalidObjectPacket, InvalidCreationPacketType, BufferUnderflow, BufferOverflow, InvalidBufferPosition, InvalidBufferLimit, OtherGNELevelError, OtherLowLevelError, User } |
| An enum describing connection failure type. More... | |
Public Member Functions | |
| ProtocolViolation (ViolationType T=OtherViolation) | |
| ViolationType | getViolationType () const |
| void | setViolationType (ViolationType T) |
| virtual std::string | toString () const |
| Returns a string description of this error. | |
Public Member Functions inherited from GNE::Error | |
| Error (ErrorCode ec=NoError) | |
| Create a new object representing a certain error, given by the passed ErrorCode. | |
| ErrorCode | getCode () const |
| Returns the error code for this error. | |
| const void | setCode (ErrorCode newCode) |
| Sets the error code for this error, useful after a call to createLowLevelError() to specify a more appropriate high-level error code. | |
| operator bool () const | |
| Returns getCode() != NoError, a handy shortcut so you can test for error by if (error). | |
| bool | operator== (const ErrorCode &rhs) const |
| A handy shortcut for (error.getCode() == rhs). | |
An error that occurs during the connection process if the remote machine sends incorrect or corrupted packets to us.
This might be possible if they were using a pre-alpha version of GNE, or if the connection came from a non-GNE program.
|
virtual |
Returns a string description of this error.
When possible, the string is "programmer-friendly," so you will probably want to only use this to write a debug message or out to a log, and tell the user more about the error.
Reimplemented from GNE::Error.