CryOnline

Забаненный
Статус
Оффлайн
Регистрация
16 Фев 2021
Сообщения
45
Реакции[?]
40
Поинты[?]
0
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
CONNECTION DOMAIN = "game"
CHAT = "conference.warface"

C++:
#pragma once

#ifndef IONLINE_HPP
#define IONLINE_HPP

#include "IOnlineQueryBinder.hpp"

#include "IOnlineLog.hpp"
#include "IOnlineConnection.hpp"
#include "IOnlineConfiguration.hpp"

interface IOnline {

    virtual void Tick();
    virtual void Shutdown();
    virtual IOnlineConnection* CreateConnection(const char* domain);
    virtual void ReleaseConnection(const char* domain);
    virtual void RegisterLog(IOnlineLog* log);
    virtual void UnregisterLog();
    virtual IOnlineLog* GetLog();
    virtual IOnlineConfiguration* GetConfiguration(const char* configuration);
    virtual IOnlineConnection* GetConnection(const char* connection);
    virtual bool RegisterConnectionListener(interface IOnlineConnectionListener* listener, const char* name);
    virtual bool UnregisterConnectionListener(IOnlineConnectionListener* listener);
    virtual void RegisterQueryBinder(IOnlineQueryBinder* binder, const char* name);
    virtual void UnregisterQueryBinder(IOnlineQueryBinder* binder);

    static IOnline* GetInstance() {
        return *reinterpret_cast<IOnline**>(0x142422190);
    }
};

#endif // !IONLINE_HPP

C++:
#pragma once

#ifndef IONLINECHAT_HPP
#define IONLINECHAT_HPP

#include "IOnlineChatRoom.hpp"

interface IOnlineChat {

    virtual bool RegisterListener(interface IOnlineChatListener* listener);
    virtual bool UnregisterListener(IOnlineChatListener* listener);
    virtual void DiscoverChatRooms();
    virtual IOnlineChatRoom* GetChatRoom(const char* a, const char* b);
};

#endif // !IONLINECHAT_HPP

C++:
#pragma once

#ifndef IONLINECHATROOM_HPP
#define IONLINECHATROOM_HPP

enum EOnlinePresence {

    eOnlinePresence_Unknown = 0x0,
    eOnlinePresence_Available = 0x1,
    eOnlinePresence_Chat = 0x2,
    eOnlinePresence_Away = 0x3,
    eOnlinePresence_Dnd = 0x4,
    eOnlinePresence_Xa = 0x5,
    eOnlinePresence_Unavailable = 0x6,
};

interface IOnlineChatRoomListener {
public:
    virtual void DIOnlineChatRoomListener() { };
    virtual void OnChatRoomMessage(const char* nickname, const char* message, bool isPrivate) { };
    virtual void OnChatRoomPresence(const char*, EOnlinePresence) { };
    virtual void OnChatRoomParticipant(const char*, bool) { };
};

interface IOnlineChatRoom {
   
    virtual void DestructorIOnlineChatRoom();
    virtual bool RegisterListener(IOnlineChatRoomListener* listener);
    virtual bool UnregisterListener(IOnlineChatRoomListener* listener);
    virtual bool IsListenersEmpty();
    virtual void Join();
    virtual void Leave();
    virtual void EnumerateParticipants();
    virtual void Send(const char* message);
    virtual void SendPrivate(const char* nickname, const char* message);
};

#endif // !IONLINECHATROOM_HPP

C++:
#pragma once

#ifndef IONLINECONFIGURATION_HPP
#define IONLINECONFIGURATION_HPP

enum EOnlineTLSPolicy {

    eOnlineTLS_Disabled = 0x0,
    eOnlineTLS_Optional = 0x1,
    eOnlineTLS_Required = 0x2,
};

interface IOnlineConfiguration {

    virtual void DestructorIOnlineConfiguration();
    virtual const char* GetDomain();
    virtual void SetDomain(const char* domain);
    virtual const char* GetServer();
    virtual void SetServer(const char* server);
    virtual int GetServerPort();
    virtual void SetServerPort(int port);
    virtual const char* GetHost();
    virtual void SetHost(const char* host);
    virtual const char* GetResource();
    virtual void SetResource(const char* resource);
    virtual const char* GetPassword();
    virtual void SetPassword(const char* password);
    virtual const char* GetOnlineId();
    virtual void SetOnlineId(const char* id);
    virtual const char* GetFSProxy();
    virtual void SetFSProxy(const char* proxy);
    virtual EOnlineTLSPolicy GetTLSPolicy();
    virtual void SetTLSPolicy(EOnlineTLSPolicy policy);
    virtual int GetFSProxyPort();
    virtual void SetFSProxyPort(int port);
    virtual void SetDefaultCompression(ECompressType type);
    virtual ECompressType GetDefaultCompression();
    virtual void SetSendDelay(int delay);
    virtual int GetSendDelay();
    virtual void SetTcpReceiveBufferSize(int buffer);
    virtual int GetTcpReceiveBufferSize();
    virtual const char* GetFullOnlineId();
    virtual void SetOnlineVerbose(int verbose);
    virtual bool IsOnlineVerbose();
    virtual void SetThreadMode(int mode);
    virtual int GetThreadMode();
};

#endif // !IONLINECONFIGURATION_HPP

C++:
#pragma once

#ifndef IONLINECONNECTION_HPP
#define IONLINECONNECTION_HPP

#include "CXmlNodeHandler.hpp"
#include "IOnlineConfiguration.hpp"

#include "IOnlineChat.hpp"

enum EConnectionMode {

    eCM_Polling = 0x0,
    eCM_Blocking = 0x1,
};

enum ERequestSendType {

    eRST_Regular = 0x0,
    eRST_Immediate = 0x1,
};

enum EOnlineConnectionState {

    eOnlineConnectionState_Disconnected = 0x0,
    eOnlineConnectionState_Connecting = 0x1,
    eOnlineConnectionState_Connected = 0x2,
    eOnlineConnectionState_Unknown = 0x3,
};

interface IOnlineBandwidthStats {

    void DestructorIOnlineBandwidthStats();
    int GetTotalBytesSent();
    int GetTotalBytesRecv();
};

struct IOnlineConnection {

    virtual bool Connect(EConnectionMode mode);
    virtual int Query(IXmlNodeHandler*, const char* receiverId, const char* const* hz, unsigned __int64 p, IOnlineQueryBinder* binder, ECompressType compression, ERequestSendType type);
    virtual int Query(IXmlNodeHandler*, const char* receiverId, IOnlineQueryBinder* binder, ECompressType compression, ERequestSendType type);
    virtual int Query(const char* request, const char* receiverId, IOnlineQueryBinder* binder, ECompressType compression);
    virtual int Query(const char* request, const char* receiverId);
    virtual void Response(const SOnlineQuery* query, const char* data, ECompressType compression);
    virtual void ResponseError(const SQueryError* error, const char* data);
    virtual void ScheduleFailedQuery(EOnlineError error, const char* data, IOnlineQueryBinder* binder);
    virtual EOnlineConnectionState GetConnectionState();
    virtual IOnlineConfiguration* GetConfiguration();
    virtual IOnlineChat* GetChat(const char* domain);
    virtual void RegisterQueryStatsListener(interface IOnlineQueryStatsListener* listener);
    virtual void UnregisterQueryStatsListener(IOnlineQueryStatsListener* listener);
    virtual IOnlineBandwidthStats* GetBandwidthStatistics();
    virtual void RegisterDataProtect(interface IOnlineDataProtect* protect);
    virtual void UnregisterDataProtect();
    virtual void SendProtectionData(const char* data, const char* data1, unsigned __int64 salt);
    virtual void SetCertificateValidator(interface ICertificateValidator* validator);
};

#endif // !IONLINECONNECTION_HPP
C++:
#pragma once

#ifndef IONLINELOG_HPP
#define IONLINELOG_HPP

enum EOnlineLogLevel {

    eOnlineLog_Debug = 0x0,
    eOnlineLog_Warning = 0x1,
    eOnlineLog_Error = 0x2,
};

interface IOnlineLog {

    virtual void DestructorIOnlineLog();
    virtual void OnLogMessage(EOnlineLogLevel level, const char* message);
};

#endif // !IONLINELOG_HPP

C++:
#pragma once

#ifndef IONLINEQUERYBINDER_HPP
#define IONLINEQUERYBINDER_HPP

#include "ECompressType.hpp"

enum EQueryType {

    eQT_Unknown = 0x0,
    eQT_Request = 0x1,
    eQT_Response = 0x2,
};

enum EOnlineError {

    eOnlineError_NoError = 0x0,
    eOnlineError_StreamError = 0x1,
    eOnlineError_StreamVersionError = 0x2,
    eOnlineError_StreamClosed = 0x3,
    eOnlineError_ProxyAuthRequired = 0x4,
    eOnlineError_ProxyAuthFailed = 0x5,
    eOnlineError_ProxyNoSupportedAuth = 0x6,
    eOnlineError_IoError = 0x7,
    eOnlineError_ParseError = 0x8,
    eOnlineError_ConnectionRefused = 0x9,
    eOnlineError_DnsError = 0xA,
    eOnlineError_OutOfMemory = 0xB,
    eOnlineError_NoSupportedAuth = 0xC,
    eOnlineError_TlsFailed = 0xD,
    eOnlineError_TlsNotAvailable = 0xE,
    eOnlineError_CompressionFailed = 0xF,
    eOnlineError_AuthenticationFailed = 0x10,
    eOnlineError_UserDisconnected = 0x11,
    eOnlineError_NotConnected = 0x12,
    eOnlineError_UnknownError = 0x13,
    eOnlineError_ServiceNotFound = 0x194,
    eOnlineError_ServiceUnavailable = 0x1F7,
    eOnlineError_QoSLimitReached = 0x3EE,
    eOnlineError_MaxOnlineUsersReached = 0x3EF,
    eOnlineError_InvalidSession = 0x3F0,
    eOnlineError_LastingServerFailure = 0x3F1,
    eOnlineError_LostConnection = 0x3F2,
    eOnlineError_QueryTimeout = 0x3F3,
    eOnlineError_TryAgain = 0x3F4,
    eOnlineError_ServerNotFound = 0x3F5,
    eOnlineError_UnknownServer = 0x3F6,
};

struct SBaseQuery {

    char sId[128];
    char online_id[128];
    char tag[128];
    char description[1024];
    int id;
};

const struct SOnlineQuery
    : SBaseQuery {

    EQueryType type;
};

const struct SQueryError
    : SBaseQuery {

    EOnlineError online_error;
    int custom_code;
};

interface IOnlineQueryBinder {

    virtual void DestructorIOnlineQueryBinder();
    virtual const char* Tag();
    virtual ECompressType GetCompressionType();
    virtual const char* GetReceiverId();
    virtual void OnQueryCompleted(interface IOnlineConnection* connection, const SOnlineQuery* query, const char* buffer);
    virtual void OnRequest(IOnlineConnection* connection, const SOnlineQuery* query, const char* buffer);
    virtual void OnQueryError(IOnlineConnection* connection, const SQueryError* error);
};

#endif // !IONLINEQUERYBINDER_HPP

C++:
#pragma once

#ifndef IXMLNODEHANDLER_HPP
#define IXMLNODEHANDLER_HPP

interface IXmlNodeHandler {

    virtual const char* GetTag();
    virtual const char* GetContent();
    virtual int GetNumAttributes();
    virtual bool GetAttributeByIndex(int index, const char** attr, const char** attr2);
    virtual int GetChildCount();
    virtual IXmlNodeHandler* GetChild(int);
};

#endif // !IXMLNODEHANDLER_HPP

C++:
#pragma once

#ifndef CXMLNODEHANDLER_HPP
#define CXMLNODEHANDLER_HPP

#include "IXmlNodeHandler.hpp"
#include "../../base/structures/XmlNodeRef.hpp"

class CXmlNodeHandler
    : IXmlNodeHandler {

    XmlNodeRef m_node;
    std::vector<CXmlNodeHandler> m_children;
};

#endif // !CXMLNODEHANDLER_HPP
C++:
#pragma once

#ifndef ECOMPRESSTYPE_HPP
#define ECOMPRESSTYPE_HPP

enum ECompressType {

    eCS_Default = 0x0,
    eCS_NoCompression = 0x1,
    eCS_ForceNoCompression = 0x2,
    eCS_Compress = 0x3,
    eCS_SmartCompress = 0x4,
};

#endif // !ECOMPRESSTYPE_HPP
 
Забаненный
Статус
Оффлайн
Регистрация
2 Мар 2021
Сообщения
1,083
Реакции[?]
406
Поинты[?]
1K
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
пастер, говно треды не создавай
 
Сверху Снизу