protected override void Initialize() { if (server == null) { server = gameObject.AddComponent <ServerConnect>(); } steminaChargeTime = new TimeSpan(0, 0, 10); GetDataFromServer(); /* * FirstSetting(); * MoneyUI.SetSteminaUI(Stemina, MaxStemina); * MoneyUI.SetGoldUI(Gold); * MoneyUI.SetCashUI(Cash); * if(!ES3.KeyExists("FirstRun")) * { * FirstSetting(); * ES3.Save<bool>("FirstRun", true); * } * else * { * * } */ }
void ReleaseDesignerOutlets() { if (ServerConnect != null) { ServerConnect.Dispose(); ServerConnect = null; } if (ServerDisconnect != null) { ServerDisconnect.Dispose(); ServerDisconnect = null; } if (ServicesSpotifyForceAuthentication != null) { ServicesSpotifyForceAuthentication.Dispose(); ServicesSpotifyForceAuthentication = null; } if (ServicesDiscordForceAuthentication != null) { ServicesDiscordForceAuthentication.Dispose(); ServicesDiscordForceAuthentication = null; } if (ServicesStreamlabsForceAuthentication != null) { ServicesStreamlabsForceAuthentication.Dispose(); ServicesStreamlabsForceAuthentication = null; } }
async private void AddPetAction() { var serverConnect = new ServerConnect(); var petObject = new Pet { PetID = StringOperations.GenerateID(), UserID = MainApp.Session.UserID, PetName = Pet_Name, PetBreed = Pet_Breed, PetDesc = Pet_Desc }; IsBusy = true; ServerResponseObject response = await serverConnect.ConnectApi(petObject, Keys.Aws_Resource_SavePet); IsBusy = false; if (response.status == ServerReplyStatus.Success) { await MainApp.MainPage.DisplayAlert("Attention!", "Pet data saved successfully!", "Ok"); } else if (response.status == ServerReplyStatus.Fail) { await MainApp.MainPage.DisplayAlert("Attention!", "Error saving pet data!", "Ok"); } else if (response.status == ServerReplyStatus.Unknown) { await MainApp.MainPage.DisplayAlert("Attention!", $"Error saving pet data!:{response.error}", "Ok"); } }
public void waitResponce() { Response response; while (true) { while (!stream.DataAvailable) { } response = ServerConnect.getInstance().receiveResponce(); if (response == null) { continue; } if (response.Entity == Entities.UserMessage) { response.success = true; response.code = ResponseCodes.OK; addMessagePublic(response.data as UserMessage); } if (response.Entity == Entities.UserList) { response.success = true; response.code = ResponseCodes.OK; refreshUserList(response.data as List <User>); } } }
void Start() { S = this; CreateSocketRef(); if (socketManager == null) { Debug.Log("Socket Manager Unable to find Reference"); return; } // Socket messages that we are listening for socketManager.Socket.On("connect", OnConnect); socketManager.Socket.On("connecting", OnConnecting); socketManager.Socket.On("reconnect_attempt", onReconAttempt); socketManager.Socket.On("error", onError); socketManager.Socket.On("reconnect_failed", onReconFailed); //socketManager.Socket.On("event", onSocketEvent); socketManager.Socket.On("disconnect", onSocketDisconnect); socketManager.Socket.On("connect_error", onConnectError); socketManager.Socket.On("connect_timeout", onConnectTimeout); socketManager.Socket.On(SocketIOEventTypes.Error, OnError); socketManager.Socket.On("picture", getPicture); socketManager.Socket.On("command", onCommand); //StartCoroutine(RunSwitchWWW()); /*HTTPRequest request = new HTTPRequest(new Uri("http://db45ecb7.ngrok.io/socket.io/?EIO=4&transport=polling")); * request.Send();*/ }
void Awake() { if (!mInstance) { mInstance = this; } else { Destroy(this.gameObject); return; } DontDestroyOnLoad(this); if (RESET_ALL_DATA) { PlayerPrefs.DeleteAll(); } #if UNITY_EDITOR path = Application.persistentDataPath + "/"; #else path = Application.persistentDataPath + "/"; #endif serverConnect = GetComponent <ServerConnect>(); avatarImages = GetComponent <AvatarImages>(); hiscoresByMissions = GetComponent <HiscoresByMissions>(); LoadUser(); hiscoresByMissions.Init(); }
public void Start() { sc = GameObject.Find("ServerConnect").GetComponent <ServerConnect> (); Socket = sc.Socket; tc = GameObject.Find("TurnController").GetComponent <TurnController> (); }
void Start() { sc = GameObject.Find ("ServerConnect").GetComponent<ServerConnect> (); Socket = sc.Socket; tc = GameObject.Find ("TurnController").GetComponent<TurnController> (); }
private async void LoadItemsServer() { var _object = new GenericID_Action { UserID = MainApp.Session.UserID,// ID will be extracted from Auth pool in aws }; var serverConnect = new ServerConnect(); IsBusy = true; var response = await serverConnect.ConnectApi(_object, Keys.Aws_Resource_PetsLoad); IsBusy = false; if (response.status != ServerReplyStatus.Success) { await MainApp.MainPage.DisplayAlert("Error!", "Error loading pets data!", "Ok"); return; } Debug.WriteLine("list data are:"); Debug.WriteLine(response.data); var result = JsonConvert.DeserializeObject <BaseReturnPets>(response.data); ItemsList = new ObservableCollection <Pet>(result.Pets); }
/// <summary> /// Closes the form and connects to the server /// </summary> /// <param name="server"></param> private void Connect(Server server) { ServerConnect?.Invoke(this, new ServerConnectEventArgs() { Server = server }); DialogResult = DialogResult.OK; }
// Use this for initialization void Start() { rb = GetComponent<Rigidbody2D> (); sc = GameObject.Find ("ServerConnect").GetComponent<ServerConnect> (); tc = GameObject.Find ("TurnController").GetComponent<TurnController> (); Socket = sc.Socket; }
public frmViewData(ServerConnect server, DataTable dtTable, string sqlQuery) : this() { serverDB = server; LoadData(sqlQuery); ddlTables.BindingListControl(dtTable, Constants.Name, Constants.ID); ddlTables.SelectedIndexChanged += ddlTables_SelectedIndexChanged; }
// Use this for initialization void Start() { rb = GetComponent <Rigidbody2D> (); sc = GameObject.Find("ServerConnect").GetComponent <ServerConnect> (); tc = GameObject.Find("TurnController").GetComponent <TurnController> (); Socket = sc.Socket; }
// Use this for initialization void Start() { sc = GameObject.Find("ServerConnect").GetComponent <ServerConnect> (); tc = GameObject.Find("TurnController").GetComponent <TurnController> (); sw = GameObject.Find("StopWatch").GetComponent <StopWatch>(); Socket = sc.Socket; }
public void CreateRoom() { RoomList.roomListReference.Clear(); string itemtext = DropdownRoomLvls.dropdownRoomLvls.GetComponent <Text>().text; itemtext = itemtext.Split(' ')[1]; ServerConnect.CreateRoom(itemtext); }
void Start() { DontDestroyOnLoad(this); sc = GameObject.Find("ServerConnect").GetComponent <ServerConnect> (); mm = GameObject.Find("Canvas").GetComponent <MenuManager> (); Socket = sc.Socket; }
void Awake() { DontDestroyOnLoad(this); sc = GameObject.Find ("ServerConnect").GetComponent<ServerConnect> (); mc = GameObject.Find ("MenuController").GetComponent<MenuController> (); Socket = sc.Socket; }
void Awake() { DontDestroyOnLoad(this); sc = GameObject.Find("ServerConnect").GetComponent <ServerConnect> (); mc = GameObject.Find("MenuController").GetComponent <MenuController> (); Socket = sc.Socket; }
private void frmViewData_FormClosing(object sender, FormClosingEventArgs e) { if (serverDB != null) { ddlTables.SelectedIndexChanged -= ddlTables_SelectedIndexChanged; serverDB = null; } }
private void AddToBlackList_Click(object sender, EventArgs e) { if (GroupChatMembers_listBox.Items.Count > 0) { BlackList_listBox.Items.Add(GroupChatMembers_listBox.SelectedItem); currentUser.BlackList.Add(GroupChatMembers_listBox.SelectedItem as User); ServerConnect.getInstance().RefreshBlackList(this.currentUser); } }
private void Messanger_FormClosed(object sender, FormClosedEventArgs e) { ServerConnect.getInstance().Bye(); if (currentUser != null) { Users_listBox.Items.Remove(currentUser); RefreshUserList(); } }
public void ConnectManually() { int port = 0; if (Int32.TryParse(ManualServerPort, out port)) { ServerConnect.Connect(ManualServerAddress, port); } }
private void LogIn_btn_Click(object sender, EventArgs e) { currentUser = ServerConnect.getInstance() .LogIn(Email_txtBox.Text, Password_txtBox.Text); if (currentUser != null) { Chat_txtBox.Text += currentUser.name; } }
public void LoginButtonClicked() { string Username = UsernameField.text; string PWord = PWordField.text; Debug.Log(Username + " " + PWord); string hash = MD5.Md5Sum(Username + PWord); StartCoroutine(ServerConnect.GetAuthenticated(Username, hash)); }
private void Send_btn_Click(object sender, EventArgs e) { if (currentUser != null) { message = ServerConnect.getInstance().SendMessage(Send_txtBox.Text); if (message != null) { Chat_txtBox.Text += currentUser.name + message + "\n"; } } }
public Messanger() { InitializeComponent(); ServerConnect.getInstance(); ClientListener.addMessagePublic = GetMessage; ClientListener.refreshUserList = GetUsersList; ClientListener.OnUser = GetUser; //проверка на запуск RefreshUserList(); }
private void Send_btn_Click(object sender, EventArgs e) { if (currentUser != null) { UserMessage mes = new UserMessage() { message = Send_txtBox.Text, UserFrom = currentUser }; ServerConnect.getInstance().SendMessage(mes); } }
public void Register() { ServerConnect.SendRegistrationRequest(RegistrationUsername, RegistrationPassword, (bool success, String message) => { if (success) { SceneManager.LoadScene("Main"); } else { // TODO handle bad registration request } }); }
/*public void Connect(String address, int port) * { * ServerConnect.Connect(address, port, (bool success, String message) => { * if (success) * { * ServerConnect.connected = false; * EnterServerTitleScreen(); * } * else * { * // TODO handle bad connect * } * }); * }*/ public void Login() { ServerConnect.SendLoginRequest(LoginUsername, LoginPassword, (bool success, String message) => { if (success) { SceneManager.LoadScene("Main"); } else { // TODO handle bad login request } }); }
public void CloseConnection() { if (ServerConnect.IsConnected) { ServerConnect.Disconnect(); } if (ServerConnect.IsConnecting) { ServerConnect.StopConnectionTry(); } KadEngine.Stop(); }
void Awake() { wc = GameObject.Find("ShootButton").GetComponent <WeaponController> (); tc = GameObject.Find("TurnController").GetComponent <TurnController> (); sc = GameObject.Find("ServerConnect").GetComponent <ServerConnect> (); sw = GameObject.Find("StopWatch").GetComponent <StopWatch>(); Socket = sc.Socket; an = GetComponentInChildren <Animator>(); rb = GetComponent <Rigidbody2D> (); Physics2D.IgnoreLayerCollision(15, 10); Physics2D.IgnoreLayerCollision(15, 11); }
void Awake() { sc = GameObject.Find("ServerConnect").GetComponent <ServerConnect> (); Socket = sc.Socket; weaponChangeMap.Add("noweapon", new weaponChange(noWeapon)); weaponChangeMap.Add("jetpack", new weaponChange(reqUnsetJetPack)); weaponChangeMap.Add("bazooka", new weaponChange(reqUnsetBazooka)); weaponChangeMap.Add("bat", new weaponChange(reqUnsetBat)); weaponChangeMap.Add("sheep", new weaponChange(reqUnsetSheep)); weaponChangeMap.Add("explodeSheep", new weaponChange(reqUnsetSheep)); weaponChangeMap.Add("donkey", new weaponChange(reqUnsetDonkey)); weaponChangeMap.Add("hbomb", new weaponChange(reqUnsetHbomb)); weaponChangeMap.Add("teleport", new weaponChange(reqUnsetTeleport)); weaponChangeMap.Add("superSheep", new weaponChange(reqUnsetSuperSheep)); weaponChangeMap.Add("rope", new weaponChange(reqUnsetRope)); }
private void ConnectWorker_DoWork(object sender, DoWorkEventArgs passValue) { object[] argument = (object[])passValue.Argument; ServerConnect serverConnect = argument[0] as ServerConnect; SftpClient client = serverConnect.GetSftpClient; serverConnect.StartConnect(); m_ServerConnect.Add(serverConnect); if (SavesManager.GetSavesFolder(client).Count == 0) { SavesManager.CreatSavesFolder(client); } UI.SaveFolders_Cloud = SavesManager.GetSavesFolder(client); passValue.Result = new object[] { serverConnect }; }
protected void GetListFromServer(object sender, System.EventArgs e) { newServerCon = new ServerConnect(itemList, listoffilenames, TargetUri); Thread.Sleep(100); newServerCon.Show(); }
// Use this for initialization void Start() { sc = GameObject.Find ("ServerConnect").GetComponent<ServerConnect> (); target = GameObject.Find (sc.clientId).GetComponent<Transform>(); }
void Awake() { sc = GameObject.Find ("ServerConnect").GetComponent<ServerConnect> (); Socket = sc.Socket; weaponChangeMap.Add ("noweapon", new weaponChange (noWeapon)); weaponChangeMap.Add ("jetpack", new weaponChange (reqUnsetJetPack)); weaponChangeMap.Add ("bazooka",new weaponChange(reqUnsetBazooka)); weaponChangeMap.Add ("bat", new weaponChange (reqUnsetBat)); weaponChangeMap.Add ("sheep", new weaponChange (reqUnsetSheep)); weaponChangeMap.Add ("explodeSheep",new weaponChange (reqUnsetSheep)); weaponChangeMap.Add ("donkey", new weaponChange (reqUnsetDonkey)); weaponChangeMap.Add ("hbomb", new weaponChange (reqUnsetHbomb)); weaponChangeMap.Add ("teleport", new weaponChange (reqUnsetTeleport)); weaponChangeMap.Add ("superSheep", new weaponChange(reqUnsetSuperSheep)); weaponChangeMap.Add ("rope",new weaponChange(reqUnsetRope)); }
public void Start() { sc = GameObject.Find ("ServerConnect").GetComponent<ServerConnect> (); Socket = sc.Socket; }
void Start() { DontDestroyOnLoad(this); sc = GameObject.Find ("ServerConnect").GetComponent<ServerConnect> (); mm = GameObject.Find ("Canvas").GetComponent<MenuManager> (); Socket = sc.Socket; }
void Awake() { wc = GameObject.Find ("ShootButton").GetComponent<WeaponController> (); tc = GameObject.Find ("TurnController").GetComponent<TurnController> (); sc = GameObject.Find ("ServerConnect").GetComponent<ServerConnect> (); sw = GameObject.Find ("StopWatch").GetComponent<StopWatch>(); Socket = sc.Socket; an = GetComponentInChildren<Animator>(); rb = GetComponent<Rigidbody2D> (); Physics2D.IgnoreLayerCollision (15, 10); Physics2D.IgnoreLayerCollision (15, 11); }
void Awake() { gc = GameObject.Find ("GameController").GetComponent<GameController> (); sc = GameObject.Find ("ServerConnect").GetComponent<ServerConnect> (); Socket = sc.Socket; }
void Awake() { sc = GameObject.Find ("ServerConnect").GetComponent<ServerConnect> (); Socket = sc.Socket; }