// Room Handlers private void roomJoinHandler(BaseEvent e) { trace("Joined Room: " + e.Params["room"]); // Remove SFS2X listeners sfs.RemoveAllEventListeners(); SceneManager.LoadScene("Menu"); }
private void ShutdownServer() { if (smartFox != null) { smartFox.RemoveAllEventListeners(); if (smartFox.IsConnected) { smartFox.Disconnect(); } } }
public void Button_Clicked(string buttonName) { if (buttonName == "LoginButton") { string EncryptedPW = PasswordUtil.MD5Password(PasswordTB.text); SFServer.Send(new LoginRequest(UsernameTB.text, EncryptedPW, GAME_ZONE)); } if (buttonName == "RegisterButton") { SFServer.Send(new LoginRequest("", "", GAME_ZONE)); this.RegisterPanel.SetActive(true); this.LoginPanel.SetActive(false); } if (buttonName == "ExitButton") { SFServer.Disconnect(); SFServer.RemoveAllEventListeners(); Application.Quit(); } if (buttonName == "CreateButton") { InputField UsernameTB = GameObject.Find("UsernameTB").GetComponent <InputField>(); InputField PasswordTB = GameObject.Find("PasswordTB").GetComponent <InputField>(); InputField ConfirmPasswordTB = GameObject.Find("ConfirmPasswordTB").GetComponent <InputField>(); InputField EmailTB = GameObject.Find("EmailTB").GetComponent <InputField>(); InputField RegistrationKeyTB = GameObject.Find("RegistrationKeyTB").GetComponent <InputField>(); if (PasswordTB.text == ConfirmPasswordTB.text) { SFSObject NewAccountObject = new SFSObject(); NewAccountObject.PutUtfString("Username", UsernameTB.text); NewAccountObject.PutUtfString("PasswordHash", PasswordTB.text); NewAccountObject.PutUtfString("Email", EmailTB.text); NewAccountObject.PutUtfString("RegistrationKey", RegistrationKeyTB.text); this.SFServer.Send(new ExtensionRequest("$SignUp.Submit", NewAccountObject)); } else { if (!MessageText.activeInHierarchy) { MessageText.SetActive(true); } MessageText.GetComponent <Text>().text = "Passwords do not match! Please check and try again."; } } if (buttonName == "BackButton") { this.LoginPanel.SetActive(true); this.RegisterPanel.SetActive(false); } }
//-----------------------------------------------------------------------Reset private void reset() { // Remove SFS2X listeners sfs.RemoveAllEventListeners(); // Enable interface enableInterface(true); }
}//end extension private void reset() { // Remove SFS2X listeners sfs.RemoveAllEventListeners(); sfs = null; }
void OnRoomJoin(BaseEvent e) { // remove sfs2x listeners and re-enable interface sfs.RemoveAllEventListeners(); // load into game SceneManager.LoadScene("main"); }
private void reset() { // Remove SFS2X listeners // This should be called when switching scenes, so events from the server do not trigger code in this scene sfs.RemoveAllEventListeners(); // Enable interface enableLoginUI(true); }
void OnApplicationQuit() { if (_smartFox.IsConnected) { Debug.Log("Quit..."); _smartFox.RemoveAllEventListeners(); _smartFox.Disconnect(); } }
void ResetLogin() { if (_smartFoxServer != null) { _smartFoxServer.RemoveAllEventListeners(); } _connectButton.interactable = true; }
private void reset() { List <Room> roomList = sfs.RoomManager.GetJoinedRooms(); roomList.ForEach(room => { Debug.Log("sending leave room request " + room.Name); sfs.Send(new LeaveRoomRequest(room)); }); sfs.RemoveAllEventListeners(); }
void OnRoomJoin(BaseEvent e) { // Debug.Log("joined room test"); // remove sfs2x listeners and re-enable interface sfs.RemoveAllEventListeners(); // load into game SceneManager.LoadScene("game"); }
internal void RemoveListeners(SmartFox smartFox) { smartFox.RemoveAllEventListeners(); if (smartFox.Debug) { smartFox.RemoveLogListener(LogLevel.DEBUG, onDebugMessage); smartFox.RemoveLogListener(LogLevel.INFO, onInfoMessage); smartFox.RemoveLogListener(LogLevel.WARN, onWarnMessage); smartFox.RemoveLogListener(LogLevel.ERROR, onErrorMessage); } }
public static void Disconnect() { if (sfs != null) { sfs.RemoveAllEventListeners(); if (sfs.IsConnected) { sfs.Disconnect(); } } }
private void reset() { List <Room> roomList = sfs.RoomManager.GetJoinedRooms(); roomList.ForEach(room => sfs.Send(new LeaveRoomRequest(room))); // Remove SFS2X listeners // This should be called when switching scenes, // so events from the server do not trigger code in this scene sfs.RemoveAllEventListeners(); }
private void AddEventListeners() { if (smartFox == null) { Logger.traceError("[NetworkManager::AddEventListeners] - unable to add listeners -- smartFox is null "); return; } smartFox.RemoveAllEventListeners(); smartFox.AddEventListener(SFSEvent.CONNECTION, OnConnection); smartFox.AddEventListener(SFSEvent.CONNECTION_LOST, OnConnectionLost); smartFox.AddEventListener(SFSEvent.LOGIN, OnLogin); smartFox.AddEventListener(SFSEvent.LOGIN_ERROR, OnLoginError); smartFox.AddEventListener(SFSEvent.ROOM_JOIN, OnJoinRoom); smartFox.AddEventListener(SFSEvent.USER_ENTER_ROOM, OnUserEnterRoom); smartFox.AddEventListener(SFSEvent.USER_EXIT_ROOM, OnUserExitRoom); smartFox.AddEventListener(SFSEvent.LOGOUT, OnLogout); smartFox.AddEventListener(SFSEvent.EXTENSION_RESPONSE, OnExtensionResponse); smartFox.AddEventListener(SFSEvent.USER_VARIABLES_UPDATE, UpdateUserVariables); smartFox.AddEventListener(SFSEvent.ROOM_REMOVE, OnRoomDeleted); smartFox.AddEventListener(SFSEvent.ROOM_VARIABLES_UPDATE, OnUpdateRoomVariables); }
private void reset() { // Remove SFS2X listeners sfs.RemoveAllEventListeners(); sfs.RemoveLogListener(LogLevel.DEBUG, OnDebugMessage); sfs.RemoveLogListener(LogLevel.INFO, OnInfoMessage); sfs.RemoveLogListener(LogLevel.WARN, OnWarnMessage); sfs.RemoveLogListener(LogLevel.ERROR, OnErrorMessage); sfs = null; }
}//end create account private void reset() { // Remove SFS2X listeners sfs.RemoveAllEventListeners(); sfs = null; // Enable interface enableInterface(true); UserName.text = ""; Password.text = ""; ConPassword.text = ""; Email.text = ""; FirstName.text = ""; LastName.text = ""; }
/// <summary> /// Método que recria a instância do SmartFox. É necessário ser chamado sempre que o cliente perde a conexão com o servidor. Em modo de /// debug essa instância também redireciona as mensagens do log para o console da Unity. /// </summary> /// <returns>A instância do SmartFox.</returns> public SmartFox Reset() { if (sfs != null) { sfs.RemoveAllEventListeners(); } #if DEBUG sfs = new SmartFox(true); sfs.Logger.LoggingLevel = LogLevel.INFO; sfs.AddLogListener(LogLevel.INFO, OnInfoMessage); sfs.AddLogListener(LogLevel.WARN, OnWarnMessage); sfs.AddLogListener(LogLevel.ERROR, OnErrorMessage); #else sfs = new SmartFox(false); #endif return(sfs); }
private void lostConnectionHandler(BaseEvent evt) { gm.trace("Lost Connection"); sfs.RemoveAllEventListeners(); SceneManager.LoadScene("Connection"); }
public void RemoveListener() { sfs.RemoveAllEventListeners(); }
private void OnConnectionLost(BaseEvent e) { // Reset all internal states so we kick back to login screen smartfox.RemoveAllEventListeners(); Application.LoadLevel(0); }
private void reset() { sfs.RemoveAllEventListeners(); }
private void OnConnectionLost(BaseEvent e) { sfs.RemoveAllEventListeners(); sfs.Disconnect(); // might not need this? SceneManager.LoadScene("main"); }
public void OnConnectionLost(BaseEvent evt) { Debug.LogWarning("OnConnectionLost"); sfs.RemoveAllEventListeners(); SceneManager.LoadScene("Connection"); }
private void OnConnectionLost(BaseEvent e) { Log.text = "connection lost"; sfs.RemoveAllEventListeners(); }
private void UnsubscribeDelegates() { smartFox.RemoveAllEventListeners(); }
public void reset() { //sfs.Disconnect(); sfs.RemoveAllEventListeners(); }
public void OnConnectionLost(BaseEvent evt) { // Reset all internal states so we kick back to login screen sfs.RemoveAllEventListeners(); SceneManager.LoadScene("Connection"); }
/* ==================================================== * Sonstige Hilfsmethoden * * * * * ==================================================== */ // ------------------------------------------------------------------------ // Vor einem Scene-Wechsel alle Callbacks removen. Die neue Scene richtet ihre eigenen ein void UnregisterSFSSceneCallbacks() { Debug.Log("[" + this.name + "] [" + this.GetType().Name + "] Alle Callbacks der Scene " + Application.loadedLevelName + " werden zurueckgesetzt"); sfs.RemoveAllEventListeners(); }
protected void UnregisterSFSSceneCallbacks() { // This should be called when switching scenes, so callbacks from the backend do not trigger code in this scene smartFox.RemoveAllEventListeners(); handlers.Clear(); }