mirror of
https://git.neolegacy.dev/neoStudiosLCE/neoLegacy.git
synced 2026-12-03 14:38:59 +01:00
+Discord account connection +Friends List +UPnP Connection +Cosmetics (Iggy menus need to be fixed up a little)
128 lines
3.1 KiB
C++
128 lines
3.1 KiB
C++
#pragma once
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
namespace SocialOnlineService
|
|
{
|
|
enum ELinkState
|
|
{
|
|
eLink_Unlinked = 0,
|
|
eLink_Starting,
|
|
eLink_Pending,
|
|
eLink_Linked,
|
|
};
|
|
|
|
enum EEvent
|
|
{
|
|
eEvent_None = 0,
|
|
eEvent_LinkStarted,
|
|
eEvent_Linked,
|
|
eEvent_LinkExpired,
|
|
eEvent_LinkFailed,
|
|
eEvent_SessionReady,
|
|
eEvent_SessionFailed,
|
|
eEvent_SessionRevoked,
|
|
eEvent_FriendsUpdated,
|
|
eEvent_FriendRequestResult,
|
|
eEvent_ActionFailed,
|
|
eEvent_RenameResult,
|
|
eEvent_InviteResult,
|
|
};
|
|
|
|
struct Event
|
|
{
|
|
EEvent type;
|
|
std::wstring status;
|
|
std::wstring name;
|
|
};
|
|
|
|
struct Person
|
|
{
|
|
std::wstring onlineId;
|
|
std::wstring username;
|
|
std::wstring status;
|
|
};
|
|
|
|
enum EActivity
|
|
{
|
|
eActivity_Hidden,
|
|
eActivity_Online,
|
|
eActivity_InWorld,
|
|
};
|
|
|
|
void SetActivity(EActivity activity);
|
|
void GoOffline();
|
|
std::wstring StatusLabel(const std::wstring &status);
|
|
std::wstring GetMyStatus();
|
|
unsigned int GetCapeOverride();
|
|
bool GetPlayerEarsTexture(unsigned long long onlineId, std::wstring &outPath);
|
|
bool GetPlayer3DCosmetic(unsigned long long onlineId, std::wstring &outTexture, std::string &outBoxes, unsigned int &outIndex);
|
|
bool GetPlayerCapeTexture(unsigned long long onlineId, bool &outKnown, bool &outHasCape, std::wstring &outPath);
|
|
|
|
void Load();
|
|
void Update();
|
|
unsigned long long GetJoinOnlineId();
|
|
bool RequestJoinToken(const std::string &serverAddress, std::wstring &outToken);
|
|
bool PopEvent(Event &out);
|
|
|
|
ELinkState GetLinkState();
|
|
bool IsLinked();
|
|
bool HasSession();
|
|
bool IsConnecting();
|
|
std::wstring GetLinkedName();
|
|
unsigned long long GetOnlineId();
|
|
std::wstring GetApiUrl();
|
|
|
|
bool StartLink();
|
|
void CancelLink();
|
|
std::wstring GetLinkCode();
|
|
int GetLinkSecondsLeft();
|
|
void Unlink();
|
|
|
|
void RefreshFriends();
|
|
bool HasFriendsData();
|
|
const std::vector<Person> &GetFriends();
|
|
const std::vector<Person> &GetIncomingRequests();
|
|
void SendFriendRequest(const std::wstring &username);
|
|
void RespondToRequest(const std::wstring &onlineId, bool accept);
|
|
void RemoveFriend(const std::wstring &onlineId);
|
|
void BlockUser(const std::wstring &onlineId);
|
|
|
|
bool HasAccountSettings();
|
|
bool IsAcceptingRequests();
|
|
void SetAcceptingRequests(bool accepting);
|
|
|
|
int GetRenameSecondsLeft();
|
|
void RenameAccount(const std::wstring &username);
|
|
|
|
struct FriendGame
|
|
{
|
|
std::wstring onlineId;
|
|
std::wstring username;
|
|
std::wstring worldName;
|
|
int playerCount;
|
|
int maxPlayers;
|
|
std::vector<std::wstring> blockedPlayers;
|
|
std::wstring viaFriend;
|
|
};
|
|
|
|
void SetHosting(int port, const std::wstring &worldName, int playerCount, int maxPlayers, const std::vector<unsigned long long> &players, bool friendsOfFriends);
|
|
const FriendGame *FindFriendGame(unsigned long long onlineId);
|
|
void StopHosting();
|
|
void RefreshFriendGames();
|
|
|
|
struct GameInvite
|
|
{
|
|
std::wstring fromOnlineId;
|
|
std::wstring fromUsername;
|
|
std::wstring worldName;
|
|
};
|
|
|
|
void SendInvite(const std::wstring &onlineId);
|
|
bool PopInvite(GameInvite &out);
|
|
bool HasRecentInviteFrom(unsigned long long onlineId);
|
|
const std::vector<FriendGame> &GetFriendGames();
|
|
bool ResolveFriendGame(unsigned long long onlineId, std::string &outIp, int &outPort);
|
|
}
|