123456789101112131415161718192021222324252627282930313233 |
- #ifndef CLIENT_H
- #define CLIENT_H
- #include "network/Packet.h"
- #include "utils/Error.h"
- #include "utils/Types.h"
- namespace Client {
- typedef uint16 Port;
- typedef void (*OnConnect)();
- typedef void (*OnDisconnect)();
- typedef void (*OnPacket)(InPacket&);
- Error start();
- void stop();
- Error connect(const char* server, Port port, int timeoutTicks);
- void disconnect(int timeoutTicks);
- void tick();
- void send(OutPacket& p, PacketType pt);
- void setConnectHandler(OnConnect oc);
- void setDisconnectHandler(OnDisconnect od);
- void setPacketHandler(OnPacket op);
- void resetHandler();
- bool isConnecting();
- bool isConnected();
- }
- #endif
|