Skip to content

Friends

Francisco Dias edited this page Dec 17, 2024 · 2 revisions

Friends

Functions

Functions related to the Friends functionality.

Constants

Constants related to the Friends functionality.

Structs

Structs related to the Friends functionality.



Back To Top

GOG_Friends_ClearRichPresence

Removes all rich presence data for the user. This is an asynchronous function that will trigger a Social Async Event when the task is finished.

This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.


Syntax:

GOG_Friends_ClearRichPresence()



Returns:

N/A


Triggers:

Social Async Event

Key Type Description
type String "GOG_Friends_ClearRichPresence"
error String The error message; only if the request failed ✴️ OPTIONAL

Example:

GOG_Friends_ClearRichPresence();

The code sample above starts a clear rich presence task which results can be caught inside a Social Async Event.

if (async_load[? "type"] == "GOG_Friends_ClearRichPresence")
{
    if (ds_map_exists(async_load, "error"))
    {
        show_debug_message(async_load[?"error"]);
        exit;
    }

    show_debug_message("ClearRichPresence SUCCESS");
}

This code sample provides an example of handling the returned callback data.




Back To Top

GOG_Friends_DeleteFriend

This function removes a user from the friend list. This is an asynchronous function that will trigger a Social Async Event when the task is finished.

This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.


Syntax:

GOG_Friends_DeleteFriend(userID)
Argument Type Description
userID GalaxyID The GalaxyID of the user to be removed from the friend list.



Returns:

N/A


Triggers:

Social Async Event

Key Type Description
type String "GOG_Friends_DeleteFriend"
error String The error message; only if request failed ✴️ OPTIONAL
userID GalaxyID GOG Galaxy user identifier

Example:

GOG_Friends_DeleteFriend(myFriendID);

The code sample above starts a friend deletion task which result can be caught inside a Social Async Event.

if (async_load[? "type"] == "GOG_Friends_DeleteFriend")
{
    if (ds_map_exists(async_load, "error"))
    {
        show_debug_message(async_load[?"error"]);
        exit;
    }
    var _deletedFriend = async_load[?"userID"];
    show_debug_message("Friend Deleted");
}

This code sample provides an example of handling the returned callback data.




Back To Top

GOG_Friends_DeleteRichPresence

This function removes the variable value under a specified name. If the variable doesn't exist, the method call has no effect. This is an asynchronous function that will trigger a Social Async Event when the task is finished.

This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.


Syntax:

GOG_Friends_DeleteRichPresence(key)
Argument Type Description
key String The name of the variable to be removed.



Returns:

N/A


Triggers:

Social Async Event

Key Type Description
type String "GOG_Friends_DeleteRichPresence"
error String The error message; only if the request failed ✴️ OPTIONAL

Example:

GOG_Friends_DeleteRichPresence("playing");

The code sample above starts a rich presence delete task of which the results can be caught inside an Social Async Event.

if (async_load[? "type"] == "GOG_Friends_DeleteRichPresence")
{
    if (ds_map_exists(async_load, "error"))
    {
        show_debug_message(async_load[?"error"]);
        exit;
    }

    show_debug_message("DeleteRichPresence SUCCESS");
}

This code sample provides an example of handling the returned callback data.




Back To Top

GOG_Friends_FindUser

This function finds a specified user. This is an asynchronous function that will trigger a Social Async Event when the task is finished.

This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.


Syntax:

GOG_Friends_FindUser(userSpecifier)
Argument Type Description
userSpecifier String The specifier of the user.



Returns:

N/A


Triggers:

Social Async Event

Key Type Description
type String "GOG_Friends_FindUser"
error String The error message; only if request failed ✴️ OPTIONAL
userID GalaxyID The ID of the user.

Example:

GOG_Friends_FindUser(userSpecifier);

The code sample above starts a find user task which results can be caught inside a Social Async Event.

if (async_load[? "type"] == "GOG_Friends_FindUser")
{
    if (ds_map_exists(async_load, "error"))
    {
        show_debug_message(async_load[?"error"]);
        exit;
    }
    var _user = async_load[?"userID"];
    show_debug_message("FindUser SUCCESS");
}

This code sample provides an example of handling the returned callback data.




Back To Top

GOG_Friends_GetDefaultAvatarCriteria

This function returns the default avatar criteria which is a Real with the bit sum of the default AvatarType.


Syntax:

GOG_Friends_GetDefaultAvatarCriteria()



Returns:

Real


Example:

var _AvatarCriteria = GOG_Friends_GetDefaultAvatarCriteria();

The code above provides a simple usage example.




Back To Top

GOG_Friends_GetFriendAvatarImageID

This function returns the ID of the avatar of a specified user.

Note

This function returns the ID used internally by the GOG SDK. To get an actual avatar image as a sprite you can either get the image data using GOG_Friends_GetFriendAvatarImageRGBA and create a sprite from the buffer data (using buffer_set_surface and sprite_create_from_surface) or add the sprite directly using sprite_add from the URL returned by GOG_Friends_GetFriendAvatarUrl.

Warning

REQUIREMENT Retrieve the avatar image first by calling GOG_Friends_RequestUserInformation with appropriate avatar criteria.


Syntax:

GOG_Friends_GetFriendAvatarImageID(userID, avatarType)
Argument Type Description
userID GalaxyID The ID of the user.
avatarType AvatarType The type of avatar.



Returns:

Real


Example:

var _ImageID = GOG_Friends_GetFriendAvatarImageID(userID, GOG_AVATAR_TYPE_SMALL);

The code above provides a simple usage example.




Back To Top

GOG_Friends_GetFriendAvatarImageRGBA

This function copies the avatar of a specified user.

Warning

REQUIREMENT You might need to retrieve the data first by calling GOG_Friends_RequestUserInformation.

Note

The size of the output buffer will be 4 * height * width (check AvatarType for width and height values).

Warning

This function creates a new buffer everytime it is called, unless a buffer is already specified. You need to ensure you correctly delete the buffer when you don't need it anymore using the buffer_delete function. Failing to do so will result in memory leaks.


Syntax:

GOG_Friends_GetFriendAvatarImageRGBA(userID, AvatarType, bufferID=undefined, byteOffset=undefined)
Argument Type Description
userID GalaxyID The ID of the user.
AvatarType AvatarType The type of avatar.
bufferID Buffer OPTIONAL: use an existing buffer instead of allocating a new one
byteOffset Real OPTIONAL: write data to a specific offset in the buffer



Returns:

Buffer


Example:

if(GOG_Friends_IsFriendAvatarImageRGBAAvailable(userID, GOG_AVATAR_TYPE_LARGE))
{
    var _buff = GOG_Friends_GetFriendAvatarImageRGBA(userID, GOG_AVATAR_TYPE_LARGE);

    var _size = buffer_get_size(_buff);
    var _L = sqrt(_size/4);

    surf = surface_create(_L, _L);
    buffer_set_surface(_buff, surf, 0);

    buffer_delete(_buff);
}

The code above provides a simple usage example.




Back To Top

GOG_Friends_GetFriendAvatarUrl

Returns the URL of the avatar of a specified user.

Warning

REQUIREMENT You might need to retrieve the data first by calling GOG_Friends_RequestUserInformation.


Syntax:

GOG_Friends_GetFriendAvatarUrl(userID, avatarType)
Argument Type Description
userID GalaxyID The ID of the user.
avatarType AvatarType The type of avatar.



Returns:

String


Example:

var _url = GOG_Friends_GetFriendAvatarUrl(userID, GOG_AVATAR_TYPE_SMALL);

The code above provides a simple usage example.




Back To Top

GOG_Friends_GetFriendByIndex

This function returns the GalaxyID for a friend.

Warning

REQUIREMENT Retrieve the list of friends first by calling GOG_Friends_RequestFriendList.


Syntax:

GOG_Friends_GetFriendByIndex(index)
Argument Type Description
index Real Index as an integer in the range of [0, number of friends].



Returns:

GalaxyID


Example:

for(var a = 0 ; a < GOG_Friends_GetFriendCount() ; a++)
{
    var _friendID = GOG_Friends_GetFriendByIndex(a);
}

The code above provides a simple usage example.




Back To Top

GOG_Friends_GetFriendCount

This function returns the number of retrieved friends in the user's list of friends.

Warning

REQUIREMENT Retrieve the list of friends first by calling GOG_Friends_RequestFriendList.


Syntax:

GOG_Friends_GetFriendCount()



Returns:

Real


Example:

for(var a = 0 ; a < GOG_Friends_GetFriendCount() ; a++)
{
    var _friendID = GOG_Friends_GetFriendByIndex(a);
}

The code above provides a simple usage example.




Back To Top

GOG_Friends_GetFriendInvitationByIndex

This function reads the details of the friend invitation.


Syntax:

GOG_Friends_GetFriendInvitationByIndex(index)
Argument Type Description
index Real Index as an integer in the range of [0, number of friend invitations].



Returns:

FriendInvitationDetails


Example:

for(var i = 0 ; i < GOG_Friends_GetFriendInvitationCount() ; i++)
{
    var _struct = GOG_Friends_GetFriendInvitationByIndex(i);
    var _userID = _struct.userID;
    var _sendTime = _struct.sendTime;
}

The code above provides a simple usage example.




Back To Top

GOG_Friends_GetFriendInvitationCount

This function returns the number of retrieved friend invitations.


Syntax:

GOG_Friends_GetFriendInvitationCount()



Returns:

Real


Example:

for(var i = 0 ; i < GOG_Friends_GetFriendInvitationCount() ; i++)
{
    var _struct = GOG_Friends_GetFriendInvitationByIndex(i);
    var _userID = _struct.userID;
    var _sendTime = _struct.sendTime;
}

The code above provides a simple usage example.




Back To Top

GOG_Friends_GetFriendPersonaName

This function returns the nickname of a specified user.

Warning

REQUIREMENT You might need to retrieve the data first by calling GOG_Friends_RequestUserInformation.


Syntax:

GOG_Friends_GetFriendPersonaName(userID)
Argument Type Description
userID GalaxyID The ID of the user.



Returns:

String


Example:

var _name = GOG_Friends_GetFriendPersonaName(GOG_User_GetGalaxyID());

The code above provides a simple usage example.




Back To Top

GOG_Friends_GetFriendPersonaState

This function returns the state of a specified user, see PersonaState.

Warning

REQUIREMENT You might need to retrieve the data first by calling GOG_Friends_RequestUserInformation.


Syntax:

GOG_Friends_GetFriendPersonaState(userID)
Argument Type Description
userID GalaxyID The ID of the user.



Returns:

PersonaState


Example:

if (GOG_Friends_GetFriendPersonaState(myFriendID) == GOG_PERSONA_STATE_ONLINE)
{
    //My friend is online, do something
}

The code above provides a simple usage example.




Back To Top

GOG_Friends_GetPersonaName

This function returns the user's nickname.


Syntax:

GOG_Friends_GetPersonaName()



Returns:

String


Example:

var _name = GOG_Friends_GetPersonaName();

The code above provides a simple usage example.




Back To Top

GOG_Friends_GetPersonaState

This function returns the user's state.


Syntax:

GOG_Friends_GetPersonaState()



Returns:

PersonaState


Example:

if(GOG_Friends_GetPersonaState() == GOG_PERSONA_STATE_ONLINE)
{
    // I'm online right now
}

The code above provides a simple usage example.




Back To Top

GOG_Friends_GetRichPresence

This function returns the rich presence of a specified user.

Warning

REQUIREMENT Retrieve the rich presence first by calling GOG_Friends_RequestRichPresence.


Syntax:

GOG_Friends_GetRichPresence(key, userID)
Argument Type Description
key String The name of the property of the user's rich presence.
userID GalaxyID The ID of the user.



Returns:

String


Example:

var _value = GOG_Friends_GetRichPresence("playing", GOG_User_GetGalaxyID());

The code above provides a simple usage example.




Back To Top

GOG_Friends_GetRichPresenceByIndex

Returns a property from the rich presence storage by index.

Warning

REQUIREMENT Retrieve the rich presence first by calling GOG_Friends_RequestRichPresence.


Syntax:

GOG_Friends_GetRichPresenceByIndex(index, userID)
Argument Type Description
index Real Index as an integer in the range of [0, number of entries].
userID GalaxyID The ID of the user.



Returns:

RichPresenceProperty


Example:

for(var i = 0 ; i < GOG_Friends_GetRichPresenceCount(GOG_User_GetGalaxyID()) ; i++)
{
    var _struct = GOG_Friends_GetRichPresenceByIndex(i, GOG_User_GetGalaxyID());
    var _key = _struct.key;
    var _value = _struct.value;
}

The code above provides a simple usage example.




Back To Top

GOG_Friends_GetRichPresenceCount

This function returns the number of retrieved properties in a user's rich presence.

Warning

REQUIREMENT Retrieve the rich presence first by calling GOG_Friends_RequestRichPresence.


Syntax:

GOG_Friends_GetRichPresenceCount(userID)
Argument Type Description
userID GalaxyID The ID of the user.



Returns:

Real


Example:

for(var i = 0 ; i < GOG_Friends_GetRichPresenceCount(GOG_User_GetGalaxyID()) ; i++)
{
    var _struct = GOG_Friends_GetRichPresenceByIndex(i, GOG_User_GetGalaxyID());
    var _key = _struct.key;
    var _value = _struct.value;
}

The code above provides a simple usage example.




Back To Top

GOG_Friends_GetRichPresenceKeyByIndex

This function returns a key from the rich presence storage by index.

Warning

REQUIREMENT Retrieve the rich presence first by calling GOG_Friends_RequestRichPresence.


Syntax:

GOG_Friends_GetRichPresenceKeyByIndex(index, userID)
Argument Type Description
index Real Index as an integer in the range of [0, number of entries].
userID GalaxyID The ID of the user.



Returns:

String


Example:

for (var i = 0; i < GOG_Friends_GetRichPresenceCount(GOG_User_GetGalaxyID()); i++)
{
    var _key = GOG_Friends_GetRichPresenceKeyByIndex(i, GOG_User_GetGalaxyID());
}

The code above provides a simple usage example.




Back To Top

GOG_Friends_IsFriend

This function checks if a specified user is a friend.

Warning

REQUIREMENT Retrieve the list of friends first by calling GOG_Friends_RequestFriendList.


Syntax:

GOG_Friends_IsFriend(userID)
Argument Type Description
userID GalaxyID The ID of the user.



Returns:

Boolean


Example:

if (GOG_Friends_IsFriend(friendID))
{
    //Is my friend, do something
}

The code above provides a simple usage example.




Back To Top

GOG_Friends_IsFriendAvatarImageRGBAAvailable

This function checks if a specified avatar image is available.


Syntax:

GOG_Friends_IsFriendAvatarImageRGBAAvailable(userID, avatarID)
Argument Type Description
userID GalaxyID The ID of the user.
avatarID AvatarType The type of avatar.



Returns:

Boolean


Example:

if (GOG_Friends_IsFriendAvatarImageRGBAAvailable(userID, GOG_AVATAR_TYPE_LARGE))
{
    var _buff = GOG_Friends_GetFriendAvatarImageRGBA(userID, GOG_AVATAR_TYPE_LARGE);

    var _size = buffer_get_size(_buff);
    var _L = sqrt(_size/4);

    surf = surface_create(_L, _L);
    buffer_set_surface(_buff, surf, 0);

    buffer_delete(_buff);
}

The code above provides a simple usage example.




Back To Top

GOG_Friends_IsUserInformationAvailable

Checks if the information of specified user is available.


Syntax:

GOG_Friends_IsUserInformationAvailable(userID)
Argument Type Description
userID GalaxyID The ID of the user.



Returns:

Boolean


Example:

if (GOG_Friends_IsUserInformationAvailable(GOG_User_GetGalaxyID()))
{
   var _name = GOG_Friends_GetPersonaName(GOG_User_GetGalaxyID());
}

The code above provides a simple usage example.




Back To Top

GOG_Friends_IsUserInTheSameGame

This function checks if a specified user is playing the same game.

Warning

REQUIREMENT Retrieve the rich presence first by calling GOG_Friends_RequestRichPresence.


Syntax:

GOG_Friends_IsUserInTheSameGame(userID)
Argument Type Description
userID GalaxyID The ID of the user.



Returns:

Boolean


Example:

if(GOG_Friends_IsUserInformationAvailable(friendID))
{
   if(GOG_Friends_IsUserInTheSameGame(friendID))
   {
       //my friend is on the same game, do something
   }
}

The code above provides a simple usage example.




Back To Top

GOG_Friends_RequestFriendInvitationList

This function performs a request for the user's list of incoming friend invitations.

This is an asynchronous function that will trigger a Social Async Event when the task is finished.

This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.


Syntax:

GOG_Friends_RequestFriendInvitationList()



Returns:

N/A


Triggers:

Social Async Event

Key Type Description
type String "GOG_Friends_RequestFriendInvitationList"
error String The error message; only if request failed ✴️ OPTIONAL

Example:

GOG_Friends_RequestFriendInvitationList();

The code sample above starts task for requesting friends invitation data which results can be caught inside a Social Async Event.

if (async_load[? "type"] == "GOG_Friends_RequestFriendInvitationList")
{
    if (ds_map_exists(async_load, "error"))
    {
        show_debug_message(async_load[?"error"]);
        exit;
    }

    show_debug_message("RequestFriendInvitationList SUCCESS");
}

This code sample provides an example of handling the returned callback data.




Back To Top

GOG_Friends_RequestFriendList

This function performs a request for the user's list of friends. This is an asynchronous function that will trigger a Social Async Event when the task is finished.

This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.


Syntax:

GOG_Friends_RequestFriendList()



Returns:

N/A


Triggers:

Social Async Event

Key Type Description
type String "GOG_Friends_RequestFriendList"
error String The error message; only if request failed ✴️ OPTIONAL

Example:

GOG_Friends_RequestFriendList();

The code sample above starts task for requesting friends data which results can be caught inside a Social Async Event.

if (async_load[? "type"] == "GOG_Friends_RequestFriendList")
{
    if (ds_map_exists(async_load, "error"))
    {
        show_debug_message(async_load[?"error"]);
        exit;
    }

    show_debug_message("RequestFriendList SUCCESS");
}

This code sample provides an example of handling the returned callback data.




Back To Top

GOG_Friends_RequestRichPresence

Performs a request for the user's rich presence.

This is an asynchronous function that will trigger a Social Async Event when the task is finished.

This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.


Syntax:

GOG_Friends_RequestRichPresence(userID)
Argument Type Description
userID GalaxyID The ID of the user.



Returns:

N/A


Triggers:

Social Async Event

Key Type Description
type String "GOG_Friends_RequestRichPresence"
error String The error message; only if request failed ✴️ OPTIONAL

Example:

GOG_Friends_RequestRichPresence();

The code sample above starts task for requesting rich presence data which results can be caught inside a Social Async Event.

if (async_load[? "type"] == "GOG_Friends_RequestRichPresence")
{
    if (ds_map_exists(async_load, "error"))
    {
        show_debug_message(async_load[?"error"]);
        exit;
    }

    show_debug_message("RequestRichPresence SUCCESS");
}

This code sample provides an example of handling the returned callback data.




Back To Top

GOG_Friends_RequestSentFriendInvitationList

This function performs a request for the user's list of outgoing friend invitations. This is an asynchronous function that will trigger a Social Async Event when the task is finished.

This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.


Syntax:

GOG_Friends_RequestSentFriendInvitationList()



Returns:

N/A


Triggers:

Social Async Event

Key Type Description
type String "GOG_Friends_RequestSentFriendInvitationList"
error String The error message; only if request failed ✴️ OPTIONAL

Example:

GOG_Friends_RequestSentFriendInvitationList() ;

The code sample above starts task for requesting sent friendship invitation data which results can be caught inside a Social Async Event.

if (async_load[? "type"] == "GOG_Friends_RequestSentFriendInvitationList")
{
    if (ds_map_exists(async_load, "error"))
    {
        show_debug_message(async_load[?"error"]);
        exit;
    }

    show_debug_message("RequestSentFriendInvitationList SUCCESS");
}

This code sample provides an example of handling the returned callback data.




Back To Top

GOG_Friends_RequestUserInformation

This function performs a request for information about a specified user.

This is an asynchronous function that will trigger a Social Async Event when the task is finished.

This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.


Syntax:

GOG_Friends_RequestUserInformation(userID)
Argument Type Description
userID GalaxyID The ID of the user.



Returns:

N/A


Triggers:

Social Async Event

Key Type Description
type String "GOG_Friends_RequestUserInformation"
error String The error message; only if request failed ✴️ OPTIONAL

Example:

GOG_Friends_RequestUserInformation();

The code sample above starts task for requesting user information data which results can be caught inside a Social Async Event.

if (async_load[? "type"] == "GOG_Friends_RequestUserInformation")
{
    if (ds_map_exists(async_load, "error"))
    {
        show_debug_message(async_load[?"error"]);
        exit;
    }

    show_debug_message("GOG_Friends_RequestUserInformation SUCCESS");
}

This code sample provides an example of handling the returned callback data.




Back To Top

GOG_Friends_RespondToFriendInvitation

This function responds to the friend invitation.

This is an asynchronous function that will trigger a Social Async Event when the task is finished.

This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.


Syntax:

GOG_Friends_RespondToFriendInvitation(userID, accept)
Argument Type Description
userID GalaxyID The ID of the user who sent the friend invitation.
accept Boolean True when accepting the invitation, false when declining.



Returns:

N/A


Triggers:

Social Async Event

Key Type Description
type String "GOG_Friends_RespondToFriendInvitation"
error String The error message; only if request failed ✴️ OPTIONAL
userID GalaxyID The ID of the user.
accept Boolean true to accept invitation, false to refuse.

Example:

GOG_Friends_RespondToFriendInvitation()

The code sample above starts task for responding to a pending invitation which results can be caught inside a Social Async Event.

if (async_load[? "type"] == "GOG_Friends_RespondToFriendInvitation")
{
    if (ds_map_exists(async_load, "error"))
    {
        show_debug_message(async_load[?"error"]);
        exit;
    }

    show_debug_message("RespondToFriendInvitation SUCCESS");
}

This code sample provides an example of handling the returned callback data.




Back To Top

GOG_Friends_SendFriendInvitation

This function sends a friend invitation. This is an asynchronous function that will trigger a Social Async Event when the task is finished.

This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.


Syntax:

GOG_Friends_SendFriendInvitation(userID)
Argument Type Description
userID GalaxyID The ID of the user.



Returns:

N/A


Triggers:

Social Async Event

Key Type Description
type String "GOG_Friends_SendFriendInvitation"
error String The error message; only if request failed ✴️ OPTIONAL
userID GalaxyID The ID of the user.

Example:

GOG_Friends_SendFriendInvitation(friendID);

The code sample above starts a task for sending a friend invitation which results can be caught inside a Social Async Event.

if(async_load[? "type"] == "GOG_Friends_SendFriendInvitation")
{
    if (ds_map_exists(async_load, "error"))
    {
        show_debug_message(async_load[?"error"]);
        exit;
    }

    show_debug_message("SendFriendInvitationSUCCESS");
}

This code sample provides an example of handling the returned callback data.




Back To Top

GOG_Friends_SendInvitation

This function sends a game invitation without using the overlay. This is an asynchronous function that will trigger a Social Async Event when the task is finished.

This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.


Syntax:

GOG_Friends_SendInvitation(userID, connectionString)
Argument Type Description
userID GalaxyID The ID of the user.
connectionString String The string which contains connection info with the limit of 4095 bytes.



Returns:

N/A


Triggers:

Social Async Event

Key Type Description
type String "GOG_Friends_RespondToFriendInvitation"
error String The error message; only if request failed ✴️ OPTIONAL
userID GalaxyID The ID of the user.
connectionString String connectionString

Example:

GOG_Friends_SendInvitation(userID, connectionString);

The code sample above starts task for sending a play invitation which results can be caught inside a Social Async Event.

if (async_load[? "type"] == "GOG_Friends_RespondToFriendInvitation")
{
    if (ds_map_exists(async_load, "error"))
    {
        show_debug_message(async_load[?"error"]);
        exit;
    }

    show_debug_message("SendInvitation SUCCESS");
}

This code sample provides an example of handling the returned callback data.




Back To Top

GOG_Friends_SetDefaultAvatarCriteria

This function sets the default avatar criteria.


Syntax:

GOG_Friends_SetDefaultAvatarCriteria(defaultAvatarCriteria)
Argument Type Description
defaultAvatarCriteria Real The bit sum of the default AvatarType.



Returns:

N/A


Example:

GOG_Friends_SetDefaultAvatarCriteria(GOG_AVATAR_TYPE_SMALL);

The code above provides a simple usage example.




Back To Top

GOG_Friends_SetRichPresence

This function sets the variable value under a specified name. There are three keys that can be used:

  • "status" - The description visible in Galaxy Client with the limit of 3000 bytes.
  • "metadata" - The metadata that describes the status to other instances of the game with the limit of 2048 bytes.
  • "connect" - The string which contains connection info with the limit of 4095 bytes. It can be regarded as a passive version of GOG_Friends_SendInvitation because it allows friends that notice the rich presence to join a multiplayer game.

This is an asynchronous function that will trigger a Social Async Event when the task is finished.

This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.


Syntax:

GOG_Friends_SetRichPresence(key, value)
Argument Type Description
key String The name of the property of the user's rich presence (see above).
value String The value of the property to set.



Returns:

N/A


Triggers:

Social Async Event

Key Type Description
type String "GOG_Friends_RespondToFriendInvitation"
error String Only if the request failed

Example:

GOG_Friends_RespondToFriendInvitation();

The code sample above starts task for setting the rich presence value which results can be caught inside a Social Async Event.

if (async_load[? "type"] == "GOG_Friends_SetRichPresence")
{
    if (ds_map_exists(async_load, "error"))
    {
        show_debug_message(async_load[?"error"]);
        exit;
    }

   show_debug_message("SetRichPresence SUCCESS");
}

This code sample provides an example of handling the returned callback data.




Back To Top

GOG_Friends_ShowOverlayInviteDialog

This function shows a game invitation dialog that allows to invite users to the game.

Note

For this call to work, the overlay needs to be initialized first. To check whether the overlay is initialized, call GOG_Utils_GetOverlayState.


Syntax:

GOG_Friends_ShowOverlayInviteDialog(connectionString)
Argument Type Description
connectionString String The string which contains connection info with the limit of 4095 bytes.



Returns:

N/A


Example:

GOG_Friends_ShowOverlayInviteDialog(connectionString);

The code above provides a simple usage example.




Back To Top

PersonaState

These constants represent the state of a user.

These constants are referenced by the following functions:


Member Description
GOG_PERSONA_STATE_OFFLINE User is not currently logged on.
GOG_PERSONA_STATE_ONLINE User is logged on.


Back To Top

AvatarType

These constants represent the type of a user avatar. They are used as a bit mask sum in the return value of GOG_Friends_GetDefaultAvatarCriteria.

These constants are referenced by the following functions:


Member Description
GOG_AVATAR_TYPE_NONE No avatar type specified.
GOG_AVATAR_TYPE_SMALL Avatar resolution size: 32x32.
GOG_AVATAR_TYPE_MEDIUM Avatar resolution size: 64x64.
GOG_AVATAR_TYPE_LARGE Avatar resolution size: 184x184.


Back To Top

FriendInvitationDetails

This struct contains details about a friend invitation.

This struct is referenced by the following functions:


Member Type Description
userID GalaxyID The ID of the user who sent the invitation.
sendTime Real The time at which the friend invitation was sent.


Back To Top

RichPresenceProperty

A struct containing the property of a rich presence.

This struct is referenced by the following functions:


Member Type Description
key String The name of the property of the user's rich presence.
value String The value of the property.

Clone this wiki locally