public APICall <PostRoomPlayersOperation> PostRoomPlayers(string world, string language, string room, bool bypassCaptcha = false)
    {
        PostRoomPlayersOperation postRoomPlayersOperation = new PostRoomPlayersOperation(world, language, room);

        postRoomPlayersOperation.BypassCaptcha = bypassCaptcha;
        return(new APICall <PostRoomPlayersOperation>(clubPenguinClient, postRoomPlayersOperation));
    }
Exemple #2
0
    private void onPostRoomPlayersResponse(PostRoomPlayersOperation operation, HttpResponse httpResponse)
    {
        signedJoinRoomData = operation.SignedJoinRoomData;
        string subContentVersion = new ContentIdentifier(signedJoinRoomData.Data.room).subContentVersion;

        if (subContentVersion != clubPenguinClient.ContentVersionDate.ToString("yyyy-MM-dd"))
        {
            DateTime dateTime = DateTime.Parse(subContentVersion);
            clubPenguinClient.ContentVersionDate = dateTime;
            Service.Get <EventDispatcher>().DispatchEvent(new WorldServiceEvents.ContentDateChanged(dateTime));
        }
        clubPenguinClient.GameServer.AddEventListener(GameServerEvent.ROOM_JOIN, onRoomJoin);
        clubPenguinClient.GameServer.AddEventListener(GameServerEvent.ROOM_JOIN_ERROR, onRoomJoinError);
        clubPenguinClient.GameServer.AddEventListener(GameServerEvent.ROOM_FULL, onRoomFull);
        clubPenguinClient.GameServer.JoinRoom(signedJoinRoomData);
    }
Exemple #3
0
    protected override void PerformOfflineAction(OfflineDatabase offlineDatabase, IOfflineDefinitionLoader offlineDefinitions)
    {
        string world = "Igloo";

        switch (LocalizationLanguage.GetLanguageFromLanguageString(Language))
        {
        case DevonLocalization.Core.Language.es_LA:
            world = "Iglú";
            break;

        case DevonLocalization.Core.Language.fr_FR:
            world = "Iglou";
            break;

        case DevonLocalization.Core.Language.pt_BR:
            world = "Iglu";
            break;
        }
        SignedJoinRoomData = PostRoomPlayersOperation.JoinRoom(world, Language, IglooId, offlineDatabase, offlineDefinitions);
        SignedJoinRoomData.Data.extraLayoutData = offlineDatabase.Read <IglooEntity>().Data.activeLayout;
        if (SignedJoinRoomData.Data.extraLayoutData == null)
        {
            SignedJoinRoomData.Data.extraLayoutData = new SceneLayout
            {
                zoneId = IglooId.name
            };
        }
        RegistrationProfile registrationProfile = offlineDatabase.Read <RegistrationProfile>();

        SignedJoinRoomData.Data.roomOwnerName = registrationProfile.displayName;
        if (string.IsNullOrEmpty(SignedJoinRoomData.Data.roomOwnerName))
        {
            SignedJoinRoomData.Data.roomOwnerName = registrationProfile.userName;
        }
        SignedJoinRoomData.Data.roomOwner = true;
    }
Exemple #4
0
 private void onPostRoomPlayersError(PostRoomPlayersOperation operation, HttpResponse response)
 {
     Log.LogNetworkErrorFormatted(this, "onPostRoomPlayersError, status: {0}, body: {1}", response.StatusCode, response.Text);
     NetworkErrorService.OnError(response, errorHandler, onPostRoomPlayersErrorMapper);
 }