/// <summary> /// Used to setup various settings in the chatbox like chat length, chat /// app settings, authentication values, finding player camera, finding /// your player, etc. /// </summary> protected virtual void Start() { nm = (nm == null) ? FindObjectOfType <NetworkManager>() : nm; FindPlayerCam(); SetMyPlayer(); if (chatAnim == null && GetComponent <Animator>()) { chatAnim = GetComponent <Animator>(); } Application.runInBackground = true; #if PHOTON_UNITY_NETWORKING chatAppSettings = PhotonNetwork.PhotonServerSettings.AppSettings; #endif if (string.IsNullOrEmpty(chatAppSettings.AppIdChat)) { Debug.LogError("Chat - The chat id is empty in your photon server settings! The chat will not work until this is populated!"); return; } authValues = new Photon.Chat.AuthenticationValues(); images.AddRange(GetComponentsInChildren <Image>()); texts.AddRange(GetComponentsInChildren <Text>()); EnableChat(startEnabled); if (startEnabled == false) { EnableVisualBox(false); } SceneManager.sceneLoaded += SceneLoaded; }
// Token: 0x06002299 RID: 8857 RVA: 0x000AA870 File Offset: 0x000A8A70 public bool Connect(string appId, string appVersion, AuthenticationValues authValues) { this.chatPeer.TimePingInterval = 3000; this.DisconnectedCause = ChatDisconnectCause.None; this.AuthValues = authValues; this.AppId = appId; this.AppVersion = appVersion; this.didAuthenticate = false; this.chatPeer.QuickResendAttempts = 2; this.chatPeer.SentCountAllowance = 7; this.PublicChannels.Clear(); this.PrivateChannels.Clear(); this.PublicChannelsUnsubscribing.Clear(); this.NameServerAddress = this.chatPeer.NameServerAddress; bool flag = this.chatPeer.Connect(); if (flag) { this.State = ChatState.ConnectingToNameServer; } if (this.UseBackgroundWorkerForSending) { SupportClass.StartBackgroundCalls(new Func <bool>(this.SendOutgoingInBackground), this.msDeltaForServiceCalls, "ChatClient Service Thread"); } return(flag); }
/// <summary> /// Make a copy of the current object. /// </summary> /// <param name="copy">The object to be copied into.</param> /// <returns>The copied object.</returns> public AuthenticationValues CopyTo(AuthenticationValues copy) { copy.AuthType = this.AuthType; copy.AuthGetParameters = this.AuthGetParameters; copy.AuthPostData = this.AuthPostData; copy.UserId = this.UserId; return(copy); }
// public override void OnConnectedToMaster(){ // ConnectChatServer(); // } public void Connect() { this.chatClient = new ChatClient(this); #if !UNITY_WEBGL this.chatClient.UseBackgroundWorkerForSending = true; #endif authenticationValues = new Photon.Chat.AuthenticationValues(PhotonNetwork.LocalPlayer.UserId); playerName = PhotonNetwork.NickName; chatClient.Connect(this.chatAppSettings.AppIdChat, "1.0", authenticationValues); }
private void InitChat() { chatClient = new ChatClient(this); chatClient.ChatRegion = "EU"; Photon.Chat.AuthenticationValues authValues = new Photon.Chat.AuthenticationValues(); authValues.UserId = PlayerVariables.Inistance.getUserPlayFabID(); authValues.AuthType = Photon.Chat.CustomAuthenticationType.None; chatClient.Connect(PHOTON_CHAT_ID, "0.01", authValues); }
/// <summary> Authenticates on NameServer. </summary> /// <returns>If the authentication operation request could be sent.</returns> public bool AuthenticateOnNameServer(string appId, string appVersion, string region, AuthenticationValues authValues) { if (this.DebugOut >= DebugLevel.INFO) { this.Listener.DebugReturn(DebugLevel.INFO, "OpAuthenticate()"); } var opParameters = new Dictionary <byte, object>(); opParameters[ParameterCode.AppVersion] = appVersion; opParameters[ParameterCode.ApplicationId] = appId; opParameters[ParameterCode.Region] = region; if (authValues != null) { if (!string.IsNullOrEmpty(authValues.UserId)) { opParameters[ParameterCode.UserId] = authValues.UserId; } if (authValues.AuthType != CustomAuthenticationType.None) { opParameters[ParameterCode.ClientAuthenticationType] = (byte)authValues.AuthType; if (!string.IsNullOrEmpty(authValues.Token)) { opParameters[ParameterCode.Secret] = authValues.Token; } else { if (!string.IsNullOrEmpty(authValues.AuthGetParameters)) { opParameters[ParameterCode.ClientAuthenticationParams] = authValues.AuthGetParameters; } if (authValues.AuthPostData != null) { opParameters[ParameterCode.ClientAuthenticationData] = authValues.AuthPostData; } } } } return(this.SendOperation(ChatOperationCode.Authenticate, opParameters, new SendOptions() { Reliability = true, Encrypt = this.IsEncryptionAvailable })); }
public bool Connect() => default; // 0x0000000182054D50-0x0000000182054E00 public bool AuthenticateOnNameServer(string appId, string appVersion, string region, AuthenticationValues authValues) => default; // 0x0000000182054980-0x0000000182054B70
// Token: 0x060022CF RID: 8911 RVA: 0x000ABEF0 File Offset: 0x000AA0F0 public bool AuthenticateOnNameServer(string appId, string appVersion, string region, AuthenticationValues authValues) { if (this.DebugOut >= DebugLevel.INFO) { base.Listener.DebugReturn(DebugLevel.INFO, "OpAuthenticate()"); } Dictionary <byte, object> dictionary = new Dictionary <byte, object>(); dictionary[220] = appVersion; dictionary[224] = appId; dictionary[210] = region; if (authValues != null) { if (!string.IsNullOrEmpty(authValues.UserId)) { dictionary[225] = authValues.UserId; } if (authValues != null && authValues.AuthType != CustomAuthenticationType.None) { dictionary[217] = (byte)authValues.AuthType; if (!string.IsNullOrEmpty(authValues.Token)) { dictionary[221] = authValues.Token; } else { if (!string.IsNullOrEmpty(authValues.AuthGetParameters)) { dictionary[216] = authValues.AuthGetParameters; } if (authValues.AuthPostData != null) { dictionary[214] = authValues.AuthPostData; } } } } return(this.SendOperation(230, dictionary, new SendOptions { Reliability = true, Encrypt = base.IsEncryptionAvailable })); }
// Token: 0x0600229A RID: 8858 RVA: 0x000AA934 File Offset: 0x000A8B34 public bool ConnectAndSetStatus(string appId, string appVersion, AuthenticationValues authValues, int status = 2, object message = null) { this.statusToSetWhenConnected = new int?(status); this.messageToSetWhenConnected = message; return(this.Connect(appId, appVersion, authValues)); }