SessionTerminatedMessage

A message sent to sockets when disconnectOthers() has been called.

View interactive version here

Request Parameters

Parameter Required Type Description
authToken No string Used to automatically re-authenticate a client during socket connect.

Code Samples

C#

    SessionTerminatedMessage.Listener = (message) => {
    string authToken = message.AuthToken; 
    };

ActionScript 3

    gs.getMessageHandler().setHandler(
        ".SessionTerminatedMessage",
        function (message:SessionTerminatedMessage):void {
        var authToken:String = message.getAuthToken(); 
        }
);

Objective-C

    [listener onGSSessionTerminatedMessage:^(GSSessionTerminatedMessage* message) {
    NSString* authToken = [message getAuthToken]; 
    }];

Java

    gs.getMessageHandler().setSessionTerminatedMessageListener(
        new GSEventConsumer<SessionTerminatedMessage>() {
            public void onEvent(SessionTerminatedMessage event) {
        String authToken = message.getAuthToken(); 
            }
        }
    );

C++

    using namespace GameSparks::Core;
    using namespace GameSparks::Api::Messages;
    ...
    void OnSessionTerminatedMessage(GS& gsInstance, const SessionTerminatedMessage& message)
    {
    gsstl::string authToken = message.getAuthToken(); 
    }
    ...
    GS.SetMessageListener(OnSessionTerminatedMessage);
Did this page help you? Please enter your feedback below. For questions about using this part of the platform, please contact support here