Inheritance: MonoBehaviour
Ejemplo n.º 1
0
 protected override void SendEvent (string category, string action, string label = null, long value = 0L)
 {
     CurrentSendData = new SendData ();
     CurrentSendData.Category = category;
     CurrentSendData.Action = action;
     CurrentSendData.Label = label;
     throw new ArgumentException (SendEventExceptionMessage);
 }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            Console.WriteLine("When the services are ready, press <ENTER> to start the credit check.");
            Console.ReadLine();

            Console.WriteLine("Starting credit check...");
            Client.ServiceReference1.RentalApprovalServiceClient client = new Client.ServiceReference1.RentalApprovalServiceClient();
            SendData sendData = new SendData();
            sendData.credit = 600;
            sendData.value = 100000;
            if (client.SendData(sendData) == true)
            {
                Console.WriteLine("Credit approved!");
            }
            else
            {
                Console.WriteLine("Credit not approved...");
            }
            client.Close();
            client.ChannelFactory.Close();
            Console.WriteLine();
            Console.WriteLine("Press <ENTER> to terminate client.");
            Console.ReadLine();
        }
Ejemplo n.º 3
0
    public void Awake()
    {
        //TODO: Make a loading scene to wait for data after we send data...

        finishText = GameObject.Find ("Finished").GetComponent<Text> ();
        //crashText.text = "";

        sendData = this.GetComponent<SendData>();
        sensors = this.GetComponent<Sensors>();

        initialPosition = transform.position;
        initialRotation = transform.rotation;

        rb = GetComponent<Rigidbody> ();
        rb.centerOfMass = centerOfMass;
        audioSource = GetComponent<AudioSource> ();
        if (MoveCar.isControlledByAI) {
            //Change to IEnumerator
            StartCoroutine(sendData.GetDataFromServer());
        }
        StartAgain ();
        //Start sending data only when acceleration is pressed for the first time
    }
Ejemplo n.º 4
0
 /// <inheritdoc />
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         if (StaticPlot != null)
         {
             hashCode = hashCode * 59 + StaticPlot.GetHashCode();
         }
         if (PlotlyServerUrl != null)
         {
             hashCode = hashCode * 59 + PlotlyServerUrl.GetHashCode();
         }
         if (Editable != null)
         {
             hashCode = hashCode * 59 + Editable.GetHashCode();
         }
         if (Edits != null)
         {
             hashCode = hashCode * 59 + Edits.GetHashCode();
         }
         if (AutoSizable != null)
         {
             hashCode = hashCode * 59 + AutoSizable.GetHashCode();
         }
         if (Responsive != null)
         {
             hashCode = hashCode * 59 + Responsive.GetHashCode();
         }
         if (FillFrame != null)
         {
             hashCode = hashCode * 59 + FillFrame.GetHashCode();
         }
         if (FrameMargins != null)
         {
             hashCode = hashCode * 59 + FrameMargins.GetHashCode();
         }
         if (ScrollZoom != null)
         {
             hashCode = hashCode * 59 + ScrollZoom.GetHashCode();
         }
         if (DoubleClick != null)
         {
             hashCode = hashCode * 59 + DoubleClick.GetHashCode();
         }
         if (DoubleClickDelay != null)
         {
             hashCode = hashCode * 59 + DoubleClickDelay.GetHashCode();
         }
         if (ShowAxisDragHandles != null)
         {
             hashCode = hashCode * 59 + ShowAxisDragHandles.GetHashCode();
         }
         if (ShowAxisRangeEntryBoxes != null)
         {
             hashCode = hashCode * 59 + ShowAxisRangeEntryBoxes.GetHashCode();
         }
         if (ShowTips != null)
         {
             hashCode = hashCode * 59 + ShowTips.GetHashCode();
         }
         if (ShowLink != null)
         {
             hashCode = hashCode * 59 + ShowLink.GetHashCode();
         }
         if (LinkText != null)
         {
             hashCode = hashCode * 59 + LinkText.GetHashCode();
         }
         if (SendData != null)
         {
             hashCode = hashCode * 59 + SendData.GetHashCode();
         }
         if (ShowSources != null)
         {
             hashCode = hashCode * 59 + ShowSources.GetHashCode();
         }
         if (DisplayModeBar != null)
         {
             hashCode = hashCode * 59 + DisplayModeBar.GetHashCode();
         }
         if (ShowSendToCloud != null)
         {
             hashCode = hashCode * 59 + ShowSendToCloud.GetHashCode();
         }
         if (ShowEditInChartStudio != null)
         {
             hashCode = hashCode * 59 + ShowEditInChartStudio.GetHashCode();
         }
         if (ModeBarButtonsToRemove != null)
         {
             hashCode = hashCode * 59 + ModeBarButtonsToRemove.GetHashCode();
         }
         if (ModeBarButtonsToAdd != null)
         {
             hashCode = hashCode * 59 + ModeBarButtonsToAdd.GetHashCode();
         }
         if (ModeBarButtons != null)
         {
             hashCode = hashCode * 59 + ModeBarButtons.GetHashCode();
         }
         if (ToImageButtonOptions != null)
         {
             hashCode = hashCode * 59 + ToImageButtonOptions.GetHashCode();
         }
         if (DisplayLogo != null)
         {
             hashCode = hashCode * 59 + DisplayLogo.GetHashCode();
         }
         if (Watermark != null)
         {
             hashCode = hashCode * 59 + Watermark.GetHashCode();
         }
         if (PlotGlPixelRatio != null)
         {
             hashCode = hashCode * 59 + PlotGlPixelRatio.GetHashCode();
         }
         if (SetBackground != null)
         {
             hashCode = hashCode * 59 + SetBackground.GetHashCode();
         }
         if (TopoJsonUrl != null)
         {
             hashCode = hashCode * 59 + TopoJsonUrl.GetHashCode();
         }
         if (MapboxAccessToken != null)
         {
             hashCode = hashCode * 59 + MapboxAccessToken.GetHashCode();
         }
         if (Logging != null)
         {
             hashCode = hashCode * 59 + Logging.GetHashCode();
         }
         if (NotifyOnLogging != null)
         {
             hashCode = hashCode * 59 + NotifyOnLogging.GetHashCode();
         }
         if (QueueLength != null)
         {
             hashCode = hashCode * 59 + QueueLength.GetHashCode();
         }
         if (GlobalTransforms != null)
         {
             hashCode = hashCode * 59 + GlobalTransforms.GetHashCode();
         }
         if (Locale != null)
         {
             hashCode = hashCode * 59 + Locale.GetHashCode();
         }
         if (Locales != null)
         {
             hashCode = hashCode * 59 + Locales.GetHashCode();
         }
         return(hashCode);
     }
 }
 private Task SendDataHandler(ArraySegment <byte> data)
 {
     SendData?.Invoke(this, data);
     return(Task.CompletedTask);
 }
Ejemplo n.º 6
0
        private string ResponseQueue(ITcpConnection connection, int dataPacketId, string dataPacketToken, SendData sendData)
        {
            var requestState = RequestState.Success;

            if (_registredUsers.TryGetValue(dataPacketToken, out UserInfoData userInfoData) && userInfoData.UserState == UserState.None)
            {
                ChangeUserState(userInfoData, UserState.Queued);
            }
            else
            {
                requestState = RequestState.Fail;
            }

            return(DataPacketBuilder.ResponseServerQueue(_id, _token, requestState, 0));
        }
Ejemplo n.º 7
0
        private string ResponseHandShake(ITcpConnection connection, int dataPacketId, string dataPacketToken, SendData sendData)
        {
            var handShake    = JsonConvert.DeserializeObject <HandShakeRequest>(sendData.MessageData);
            var requestState = RequestState.Success;

            // create token here
            int userIndex = Index;
            var salted    = (handShake.AccountName + userIndex).GetHashCode();
            var userToken = salted.ToString();
            //Console.WriteLine($"Hash: {salted} -> {token}");

            var newUserInfo = new UserInfoData
            {
                Id          = userIndex,
                Token       = userToken,
                AccountName = handShake.AccountName,
                Connection  = connection,
                UserState   = UserState.None,
                GameId      = -1,
                DeckType    = DeckType.None,
                DeckData    = string.Empty,
                PlayerState = PlayerState.None
            };

            var user = _registredUsers.Values.ToList().Find(p => p.AccountName == handShake.AccountName);

            if (user != null && user.Connection.Equals(connection))
            {
                Log.Warn($"Account {handShake.AccountName} already registred! EndPoint: {user.Connection.LocalEndPoint}, Key: {user.Connection.Key}, {user.Connection.Equals(connection)}");
                requestState = RequestState.Fail;
            }
            else if (user != null && !_registredUsers.TryUpdate(user.Token, newUserInfo, user))
            {
                Log.Warn($"Account {handShake.AccountName} couldn't be updated!");
                requestState = RequestState.Fail;
            }
            else if (!_registredUsers.TryAdd(userToken, newUserInfo))
            {
                Log.Warn($"Account {handShake.AccountName} couldn't be registred!");
                requestState = RequestState.Fail;
            }

            if (requestState == RequestState.Success)
            {
                Log.Info($"Registred account {handShake.AccountName}!");
            }

            return(DataPacketBuilder.ResponseServerHandShake(_id, _token, requestState, userIndex, userToken));
        }
Ejemplo n.º 8
0
        //*********************************************************************************************
        // AcceptCallBack / Revisto pela última vez em 01/08/2016, criado por Allyson S. Bacon
        // Conexão aceita.
        //*********************************************************************************************
        public static void AcceptCallback(IAsyncResult ar)
        {
            //EXTEND
            if (Extensions.ExtensionApp.ExtendMyApp
                    (MethodBase.GetCurrentMethod().Name, ar) != null)
            {
                return;
            }

            //CÓDIGO
            //Temporizador
            Loops.Accept_Timer = Loops.TickCount.ElapsedMilliseconds;

            // Signal the main thread to continue.
            allDone.Set();

            // Socket \o/.
            Socket listener = (Socket)ar.AsyncState;
            Socket handler  = listener.EndAccept(ar);

            //Adicionamos ele na lista
            Clients.Add(new StateObject(handler, Clients.Count - 1));
            Clients[Clients.Count - 1].Async.NoDelay = true;
            Clients[Clients.Count - 1].IsConnected   = true;

            //Vamos analisar qual index está disponível para o jogador
            for (int i = 0; i < 100; i++)
            {
                if (UserConnection.Checkindex(i))
                {
                    Clients[(Clients.Count() - 1)].index = i;
                    break;
                }
            }

            //Ele não está logado, pois se conectou agora
            PStruct.tempplayer[WinsockAsync.Clients[(WinsockAsync.Clients.Count() - 1)].index].Logged = false;

            //Ele não está no jogo pois se conectou agora
            PStruct.tempplayer[WinsockAsync.Clients[(WinsockAsync.Clients.Count() - 1)].index].ingame = false;

            //Zerar o Player_Highindex pra evitar problemas
            Globals.Player_Highindex = 0;


            //Vamos atualizar o Player_Highindex sem frescura
            for (int i = 0; i < WinsockAsync.Clients.Count(); i++)
            {
                if (WinsockAsync.Clients[i].index > Globals.Player_Highindex)
                {
                    Globals.Player_Highindex = WinsockAsync.Clients[i].index;
                }
            }

            //Vamos atualizar o Player_Highindex para todos os jogadores
            SendData.Send_UpdatePlayerHighindex();

            //WinsockAnsyc.Clients[Clients.Count() - 1].Listindex = Clients.Count() - 1;
            Log(String.Format("Cliente conectado: {0}", Clients.Count() - 1));

            // Cria o objeto de conexão do jogador
            Clients[Clients.Count - 1].Async.BeginReceive(Clients[Clients.Count - 1].buffer, 0, StateObject.BufferSize, 0,
                                                          new AsyncCallback(ReadCallback), Clients[Clients.Count - 1]);
        }
Ejemplo n.º 9
0
 public void clickBtnBoCuoc()
 {
     btn_bocuoc.gameObject.SetActive(false);
     btn_cuoc.gameObject.SetActive(false);
     SendData.onSendCuocBC(0);
 }
Ejemplo n.º 10
0
    public void DataReSend(SendData sendData)
    {
        DataPacket packet = new DataPacket(sendData.Msg, sendData.EndPoint);

        DataSender.Instance.SendMsgs.Enqueue(packet);
    }
Ejemplo n.º 11
0
 public void clickButtonBocBai()
 {
     SendData.onGetCardNoc();
     showButton(true, false, false, false, true);
     preCard = 52;
 }
Ejemplo n.º 12
0
 public static void Append(SendData data)
 {
     Patches.Add(data);
     Save();
 }
Ejemplo n.º 13
0
 public void clickOK()
 {
     GameControl.instance.sound.startClickButtonAudio();
     SendData.onChangeBetMoney(money);
     this.onHide();
 }
Ejemplo n.º 14
0
 public void OnClickBoLuot()
 {
     SendData.onSendSkipTurn();
 }
Ejemplo n.º 15
0
 public void OnClickSanSang()
 {
     SendData.onReady(1);
 }
Ejemplo n.º 16
0
 public void OnClickBoSam()
 {
     SendData.baoxam(0);
     objBoSam.SetActive(false);
 }
 public void SetSendDataFunction(SendData sd)
 {
     sendData = sd;
 }
Ejemplo n.º 18
0
 // button
 public void clickButtonDoiLuat()
 {
     SendData.onChangeRuleTbl();
 }
Ejemplo n.º 19
0
 public void OnClickBaoSam()
 {
     SendData.baoxam(1);
 }
Ejemplo n.º 20
0
        public static void AlphaLoop()
        {
            long tmr100;
            long tmr256;
            long Tick;

            tmr100 = 0;
            tmr256 = 0;
            Database.DefineAdmin();
            WinsockAsync.Log("Servidor iniciado no dia " + DateTime.Now);

            do
            {
                Tick = TickCount.ElapsedMilliseconds;

                //WinsockAsync.Listen();

                Command = "First For";
                for (int i = 1; i <= Globals.Player_HighIndex; i++)
                {
                    if (PStruct.tempplayer[i].ingame)
                    {
                        PStruct.PetMove(i);
                    }
                    if ((PStruct.tempplayer[i].SORE) && (PStruct.character[i, PStruct.player[i].SelectedChar].PVPPenalty < Loops.TickCount.ElapsedMilliseconds))
                    {
                        PStruct.tempplayer[i].SORE = false;
                        PStruct.character[i, PStruct.player[i].SelectedChar].PVPPenalty = 0;
                        SendData.Send_PlayerSoreToMap(i);
                        SendData.Send_Animation(PStruct.character[i, PStruct.player[i].SelectedChar].Map, Globals.Target_Player, i, 148);
                    }
                    for (int p = 1; p < Globals.MaxPassiveEffects; p++)
                    {
                        if ((PStruct.ppassiveffect[i, p].active) && (Tick > PStruct.ppassiveffect[i, p].timer))
                        {
                            PStruct.ExecutePassiveEffect(i, p);
                        }
                    }
                    if (PStruct.tempplayer[i].RegenTimer < Tick)
                    {
                        PStruct.PlayerRegen(i);
                    }
                    if ((PStruct.tempplayer[i].preparingskill > 0) && (Tick > PStruct.tempplayer[i].skilltimer))
                    {
                        PlayerLogic.ExecuteSkill(i);
                    }
                    //Dano sobre tempo
                    for (int s = 1; s < Globals.MaxNTempSpells; s++)
                    {
                        if ((PStruct.ptempspell[i, s].active) && (Tick > PStruct.ptempspell[i, s].timer))
                        {
                            PStruct.ExecuteTempSpell(i, s);
                        }
                    }
                    if ((PStruct.tempplayer[i].Stunned) && (PStruct.tempplayer[i].StunTimer < Tick))
                    {
                        SendData.Send_Stun(PStruct.character[i, PStruct.player[i].SelectedChar].Map, 1, i, 0);
                        PStruct.tempplayer[i].Stunned = false;
                    }
                    if ((PStruct.tempplayer[i].Sleeping) && (PStruct.tempplayer[i].SleepTimer < Tick))
                    {
                        SendData.Send_Sleep(PStruct.character[i, PStruct.player[i].SelectedChar].Map, 1, i, 0);
                        PStruct.tempplayer[i].Sleeping = false;
                    }
                    if ((PStruct.tempplayer[i].Blind) && (PStruct.tempplayer[i].BlindTimer < Tick))
                    {
                        //SendData.Send_Stun(PStruct.character[i, PStruct.player[i].SelectedChar].Map, 1, i, 0);
                        PStruct.tempplayer[i].Blind = false;
                    }
                    if ((PStruct.tempplayer[i].Slowed) && (PStruct.tempplayer[i].SlowTimer < Tick))
                    {
                        if (PStruct.tempplayer[i].isFrozen)
                        {
                            PStruct.tempplayer[i].isFrozen = false;
                            SendData.Send_Frozen(Globals.Target_Player, i);
                        }
                        PStruct.tempplayer[i].Slowed    = false;
                        PStruct.tempplayer[i].movespeed = Globals.NormalMoveSpeed;
                        SendData.Send_MoveSpeed(Globals.Target_Player, i);
                    }
                }


                Command = "tmr100";
                if (tmr100 < Tick)
                {
                    for (int i = 0; i <= WinsockAsync.Clients.Count - 1; i++)
                    {
                        if (!WinsockAsync.Clients[i].IsConnected)
                        {
                            if (WinsockAsync.Clients[i].Index >= 0)
                            {
                                WinsockAsync.DisconnectUser(i);
                            }
                        }
                    }

                    for (int i = 0; i <= Globals.Max_WorkPoints - 1; i++)
                    {
                        if ((MStruct.tempworkpoint[i].respawn > 0) && (Loops.TickCount.ElapsedMilliseconds > MStruct.tempworkpoint[i].respawn))
                        {
                            MStruct.tempworkpoint[i].vitality = MStruct.workpoint[i].vitality;
                            MStruct.tempworkpoint[i].respawn  = 0;
                            SendData.Send_EventGraphicToMap(MStruct.workpoint[i].map, MStruct.tile[MStruct.workpoint[i].map, MStruct.workpoint[i].x, MStruct.workpoint[i].y].Event_Id, "", 0, Convert.ToByte(MStruct.workpoint[i].active_sprite));
                        }
                    }

                    tmr100 = Tick + 100;
                }

                Command = "tmr256";

                if (tmr256 < Tick)
                {
                    for (int i = 0; i < Globals.MaxMaps; i++)
                    {
                        MStruct.CheckMapItems(i);

                        if (MStruct.tempmap[i].WarActive)
                        {
                            if (Tick > MStruct.tempmap[i].WarTimer)
                            {
                                bool b = false;
                                for (int i2 = 0; i2 <= MStruct.tempmap[i].NpcCount; i2++)
                                {
                                    if (NStruct.tempnpc[i, i2].guildnum > 0)
                                    {
                                        if (NStruct.tempnpc[i, i2].Target > 0)
                                        {
                                            MStruct.tempmap[i].WarTimer += Tick + 20000;
                                            b = true;
                                        }
                                        NStruct.RegenNpc(i, i2, true);
                                    }
                                }
                                if (b)
                                {
                                    break;
                                }
                                SendData.Send_MsgToGuild(MStruct.map[i].guildnum, "O coletor de " + MStruct.map[i].name + " se recuperou do ataque!", Globals.ColorYellow, Globals.Msg_Type_Server);
                                MStruct.tempmap[i].WarActive = false;
                            }
                        }
                        Command = "NPC COUNT";
                        for (int i2 = 0; i2 <= MStruct.tempmap[i].NpcCount; i2++)
                        {
                            if (i2 > 0)
                            {
                                Command = "TIME DAMAGE";
                                //Dano sobre tempo
                                for (int s = 1; s < Globals.MaxNTempSpells; s++)
                                {
                                    if ((NStruct.ntempspell[i, i2, s].active) && (Tick > NStruct.ntempspell[i, i2, s].timer))
                                    {
                                        NStruct.ExecuteTempSpell(i, i2, s);
                                    }
                                }

                                //Processamento do NPC
                                if (MStruct.ExistPlayerInMap(i))
                                {
                                    Command = "NPC MOVE";
                                    NpcIA.CheckNpcMove(i, i2);
                                    if ((NStruct.tempnpc[i, i2].preparingskill > 0) && (Tick > NStruct.tempnpc[i, i2].skilltimer))
                                    {
                                        Command = "NPC EXECUTE SKILL";
                                        NpcIA.ExecuteSkill(i, i2);
                                    }
                                    if (NStruct.tempnpc[i, i2].RegenTimer < Tick)
                                    {
                                        Command = "REGEN NPC";
                                        NStruct.RegenNpc(i, i2);
                                    }
                                    if ((NStruct.tempnpc[i, i2].Stunned) && (NStruct.tempnpc[i, i2].StunTimer < Tick))
                                    {
                                        Command = "NPC STUN";
                                        SendData.Send_Stun(i, 2, i2, 0);
                                        NStruct.tempnpc[i, i2].Stunned = false;
                                    }
                                    if ((NStruct.tempnpc[i, i2].Sleeping) && (NStruct.tempnpc[i, i2].SleepTimer < Tick))
                                    {
                                        Command = "NPC SLEEP";
                                        SendData.Send_Sleep(i, 2, i2, 0);
                                        NStruct.tempnpc[i, i2].Sleeping = false;
                                    }
                                    if ((NStruct.tempnpc[i, i2].Blind) && (NStruct.tempnpc[i, i2].BlindTimer < Tick))
                                    {
                                        Command = "NPC BLIND";
                                        // A fazer SendData.Send_Stun(i, 2, i2, 0);
                                        NStruct.tempnpc[i, i2].Blind = false;
                                    }
                                    if ((NStruct.tempnpc[i, i2].Slowed) && (NStruct.tempnpc[i, i2].SlowTimer < Tick))
                                    {
                                        if (NStruct.tempnpc[i, i2].isFrozen)
                                        {
                                            NStruct.tempnpc[i, i2].isFrozen = false;
                                            SendData.Send_Frozen(Globals.Target_Npc, i2, i);
                                        }
                                        NStruct.tempnpc[i, i2].Slowed    = false;
                                        NStruct.tempnpc[i, i2].movespeed = Globals.NormalMoveSpeed;
                                        SendData.Send_MoveSpeed(Globals.Target_Npc, i2, i);
                                    }
                                }
                                else
                                {
                                    Command = "NPC SUPER REGEN";
                                    NStruct.RegenNpc(i, i2, true);
                                    if (NStruct.tempnpc[i, i2].Target > 0)
                                    {
                                        NStruct.tempnpc[i, i2].Target = 0;
                                    }
                                }
                                Command = "NPC RESPAWN";
                                if ((NStruct.tempnpc[i, i2].Dead == true) && (Tick > NStruct.tempnpc[i, i2].RespawnTimer))
                                {
                                    //Respawn
                                    NpcIA.NpcRespawned(i, i2);
                                }
                            }
                        }
                        //for (int i2 = 0; i2 <= MStruct.Ge; i2++)
                        // {
                        //}
                    }
                    tmr256 = Tick + 256;
                }
                long test1 = Tick;
                Command = "Save Timer";
                if (Save_Timer < TickCount.ElapsedMilliseconds)
                {                        //Salva o jogador SE PRECISAR
                    if (WinsockAsync.Clients.Count > 0)
                    {
                        for (int i = 0; i < WinsockAsync.Clients.Count; i++)
                        {
                            if (PStruct.tempplayer[WinsockAsync.Clients[i].Index].ingame)
                            {
                                Database.SaveCharacter(WinsockAsync.Clients[i].Index, PStruct.player[WinsockAsync.Clients[i].Index].Email, PStruct.player[WinsockAsync.Clients[i].Index].SelectedChar);
                                Database.SaveBank(WinsockAsync.Clients[i].Index);
                            }
                        }
                    }
                    Save_Timer = TickCount.ElapsedMilliseconds + 600000;
                    Console.WriteLine("Servidor Salvo.");
                }

                Command = "TPP";
                if ((test1 - Tick) > 0)
                {
                    Console.WriteLine("TPP: " + (test1 - Tick));
                }
                Thread.Sleep(10);
            }while (true);
        }
Ejemplo n.º 21
0
        //*********************************************************************************************
        // DisconnectUser / Revisto pela última vez em 01/08/2016, criado por Allyson S. Bacon
        // Desconectar o jogador.
        //*********************************************************************************************
        public static void DisconnectUser(int clientid)
        {
            //EXTEND
            if (Extensions.ExtensionApp.ExtendMyApp
                    (MethodBase.GetCurrentMethod().Name, clientid) != null)
            {
                return;
            }

            //CÓDIGO
            //LOL
            if ((Clients.Count <= 0) || (clientid > Clients.Count - 1))
            {
                return;
            }
            //Se estiver morto, resetar posição
            //PStruct.tempplayer[Clients[clientid].index].isDead = false;

            //Sai da troca
            if (PStruct.tempplayer[Clients[clientid].index].InTrade > 0)
            {
                PStruct.GiveTrade(Clients[clientid].index);
                PStruct.GiveTrade(PStruct.tempplayer[Clients[clientid].index].InTrade);

                //Verificar se o jogador não se desconectou no processo
                if (Clients[(UserConnection.Getindex(PStruct.tempplayer[Clients[clientid].index].InTrade))].IsConnected)
                {
                    SendData.Send_PlayerG(PStruct.tempplayer[Clients[clientid].index].InTrade);
                    SendData.Send_TradeClose(PStruct.tempplayer[Clients[clientid].index].InTrade);
                    SendData.Send_InvSlots(PStruct.tempplayer[Clients[clientid].index].InTrade, PStruct.player[PStruct.tempplayer[Clients[clientid].index].InTrade].SelectedChar);
                }

                PStruct.ClearTempTrade(PStruct.tempplayer[Clients[clientid].index].InTrade);
                PStruct.ClearTempTrade(Clients[clientid].index);
            }

            //Sai do Craft
            if (PStruct.tempplayer[Clients[clientid].index].InCraft)
            {
                for (int i = 1; i < Globals.Max_Craft; i++)
                {
                    if (PStruct.craft[Clients[clientid].index, i].num > 0)
                    {
                        PStruct.GiveItem(Clients[clientid].index, PStruct.craft[Clients[clientid].index, i].type, PStruct.craft[Clients[clientid].index, i].num, PStruct.craft[Clients[clientid].index, i].value, PStruct.craft[Clients[clientid].index, i].refin, PStruct.craft[Clients[clientid].index, i].exp);
                    }
                }
            }

            //Salva o jogador SE PRECISAR
            if (PStruct.tempplayer[Clients[clientid].index].ingame)
            {
                Database.SaveCharacter(Clients[clientid].index, PStruct.player[Clients[clientid].index].Email, PStruct.player[Clients[clientid].index].SelectedChar);
                Database.SaveBank(Clients[clientid].index);
                Database.SaveFriendList(Clients[clientid].index);
            }

            //Sai do grupo
            if (PStruct.tempplayer[Clients[clientid].index].Party > 0)
            {
                PStruct.KickParty(Clients[clientid].index, Clients[clientid].index, true);
            }

            //Vamos avisar ao mapa que o jogador saiu
            SendData.Send_PlayerLeft(PStruct.character[Clients[clientid].index, PStruct.player[Clients[clientid].index].SelectedChar].Map, Clients[clientid].index);

            //Apagamos o banco
            Database.ClearBank(Clients[clientid].index);

            Console.WriteLine(lang.player_cleared + " " + clientid + Clients[clientid].index);

            //Fecha a conexão
            Clients[clientid].Async.Close();

            //Limpa dados sobre o jogador
            Clients[clientid].Async = null;

            //Limpa dados temporários sobre o jogador
            Database.ClearPlayer(Clients[clientid].index, true);
            PStruct.ClearTempPlayer(Clients[clientid].index);

            //Limpa informações gerais da conexão
            Clients[clientid].index = -1;

            //Remova da lista de clientes do servidor
            Clients.RemoveAt(clientid);

            //Zerar o Player_Highindex pra evitar problemas
            Globals.Player_Highindex = 0;

            //Vamos atualizar o Player_Highindex sem frescura
            for (int i = 0; i < WinsockAsync.Clients.Count(); i++)
            {
                if (Clients[i].index > Globals.Player_Highindex)
                {
                    Globals.Player_Highindex = Clients[i].index;
                }
            }

            //Vamos atualizar o Player_Highindex para todos os jogadores
            SendData.Send_UpdatePlayerHighindex();

            Log(lang.player_disconnected + " " + clientid);
        }
Ejemplo n.º 22
0
 /// <summary>
 /// 保存文件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Confirm_Click(object sender, EventArgs e)
 {
     RefreshData();                       //更新数据
     SendData?.Invoke(MarkConfigProject); //传送配置好的项目
     this.Close();
 }
Ejemplo n.º 23
0
 /// <summary>
 /// 确定按钮
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Confirm_Click(object sender, EventArgs e)
 {
     SendData?.Invoke(ProjectNametextBox.Text, ProductNamecomboBox.SelectedItem.ToString(), MaterialNamecomboBox.SelectedItem.ToString()); //发送项目配置文件
     this.Close();                                                                                                                         //关闭窗口
 }
Ejemplo n.º 24
0
 public void clickBtnOk()
 {
     SoundManager.instance.startClickButtonAudio();
     SendData.onSendCuocBC(tienchon);
     onHide();
 }
Ejemplo n.º 25
0
        private string ResponseStats(ITcpConnection connection, int dataPacketId, string dataPacketToken, SendData sendData)
        {
            var list = new List <UserInfo>();

            _registredUsers.Values.ToList().ForEach(p =>
                                                    list.Add(new UserInfo()
            {
                Id          = p.Id,
                AccountName = p.AccountName,
                UserState   = p.UserState,
                GameId      = p.GameId,
                DeckType    = p.DeckType,
                DeckData    = p.DeckData,
                PlayerState = p.PlayerState
            }));

            return(DataPacketBuilder.ResponseServerStats(_id, _token, RequestState.Success, list));
        }
Ejemplo n.º 26
0
 public async Task UpdateChat(SendData chatToUpdate)
 {
     TableOperation updateOp = TableOperation.InsertOrReplace(chatToUpdate);
     await table.ExecuteAsync(updateOp);
 }
Ejemplo n.º 27
0
        /// <inheritdoc />
        public bool Equals([AllowNull] Config other)
        {
            if (other == null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     StaticPlot == other.StaticPlot ||
                     StaticPlot != null &&
                     StaticPlot.Equals(other.StaticPlot)
                     ) &&
                 (
                     PlotlyServerUrl == other.PlotlyServerUrl ||
                     PlotlyServerUrl != null &&
                     PlotlyServerUrl.Equals(other.PlotlyServerUrl)
                 ) &&
                 (
                     Editable == other.Editable ||
                     Editable != null &&
                     Editable.Equals(other.Editable)
                 ) &&
                 (
                     Edits == other.Edits ||
                     Edits != null &&
                     Edits.Equals(other.Edits)
                 ) &&
                 (
                     AutoSizable == other.AutoSizable ||
                     AutoSizable != null &&
                     AutoSizable.Equals(other.AutoSizable)
                 ) &&
                 (
                     Responsive == other.Responsive ||
                     Responsive != null &&
                     Responsive.Equals(other.Responsive)
                 ) &&
                 (
                     FillFrame == other.FillFrame ||
                     FillFrame != null &&
                     FillFrame.Equals(other.FillFrame)
                 ) &&
                 (
                     FrameMargins == other.FrameMargins ||
                     FrameMargins != null &&
                     FrameMargins.Equals(other.FrameMargins)
                 ) &&
                 (
                     ScrollZoom == other.ScrollZoom ||
                     ScrollZoom != null &&
                     ScrollZoom.Equals(other.ScrollZoom)
                 ) &&
                 (
                     DoubleClick == other.DoubleClick ||
                     DoubleClick != null &&
                     DoubleClick.Equals(other.DoubleClick)
                 ) &&
                 (
                     DoubleClickDelay == other.DoubleClickDelay ||
                     DoubleClickDelay != null &&
                     DoubleClickDelay.Equals(other.DoubleClickDelay)
                 ) &&
                 (
                     ShowAxisDragHandles == other.ShowAxisDragHandles ||
                     ShowAxisDragHandles != null &&
                     ShowAxisDragHandles.Equals(other.ShowAxisDragHandles)
                 ) &&
                 (
                     ShowAxisRangeEntryBoxes == other.ShowAxisRangeEntryBoxes ||
                     ShowAxisRangeEntryBoxes != null &&
                     ShowAxisRangeEntryBoxes.Equals(other.ShowAxisRangeEntryBoxes)
                 ) &&
                 (
                     ShowTips == other.ShowTips ||
                     ShowTips != null &&
                     ShowTips.Equals(other.ShowTips)
                 ) &&
                 (
                     ShowLink == other.ShowLink ||
                     ShowLink != null &&
                     ShowLink.Equals(other.ShowLink)
                 ) &&
                 (
                     LinkText == other.LinkText ||
                     LinkText != null &&
                     LinkText.Equals(other.LinkText)
                 ) &&
                 (
                     SendData == other.SendData ||
                     SendData != null &&
                     SendData.Equals(other.SendData)
                 ) &&
                 (
                     ShowSources == other.ShowSources ||
                     ShowSources != null &&
                     ShowSources.Equals(other.ShowSources)
                 ) &&
                 (
                     DisplayModeBar == other.DisplayModeBar ||
                     DisplayModeBar != null &&
                     DisplayModeBar.Equals(other.DisplayModeBar)
                 ) &&
                 (
                     ShowSendToCloud == other.ShowSendToCloud ||
                     ShowSendToCloud != null &&
                     ShowSendToCloud.Equals(other.ShowSendToCloud)
                 ) &&
                 (
                     ShowEditInChartStudio == other.ShowEditInChartStudio ||
                     ShowEditInChartStudio != null &&
                     ShowEditInChartStudio.Equals(other.ShowEditInChartStudio)
                 ) &&
                 (
                     ModeBarButtonsToRemove == other.ModeBarButtonsToRemove ||
                     ModeBarButtonsToRemove != null &&
                     ModeBarButtonsToRemove.Equals(other.ModeBarButtonsToRemove)
                 ) &&
                 (
                     ModeBarButtonsToAdd == other.ModeBarButtonsToAdd ||
                     ModeBarButtonsToAdd != null &&
                     ModeBarButtonsToAdd.Equals(other.ModeBarButtonsToAdd)
                 ) &&
                 (
                     ModeBarButtons == other.ModeBarButtons ||
                     ModeBarButtons != null &&
                     ModeBarButtons.Equals(other.ModeBarButtons)
                 ) &&
                 (
                     ToImageButtonOptions == other.ToImageButtonOptions ||
                     ToImageButtonOptions != null &&
                     ToImageButtonOptions.Equals(other.ToImageButtonOptions)
                 ) &&
                 (
                     DisplayLogo == other.DisplayLogo ||
                     DisplayLogo != null &&
                     DisplayLogo.Equals(other.DisplayLogo)
                 ) &&
                 (
                     Watermark == other.Watermark ||
                     Watermark != null &&
                     Watermark.Equals(other.Watermark)
                 ) &&
                 (
                     PlotGlPixelRatio == other.PlotGlPixelRatio ||
                     PlotGlPixelRatio != null &&
                     PlotGlPixelRatio.Equals(other.PlotGlPixelRatio)
                 ) &&
                 (
                     SetBackground == other.SetBackground ||
                     SetBackground != null &&
                     SetBackground.Equals(other.SetBackground)
                 ) &&
                 (
                     TopoJsonUrl == other.TopoJsonUrl ||
                     TopoJsonUrl != null &&
                     TopoJsonUrl.Equals(other.TopoJsonUrl)
                 ) &&
                 (
                     MapboxAccessToken == other.MapboxAccessToken ||
                     MapboxAccessToken != null &&
                     MapboxAccessToken.Equals(other.MapboxAccessToken)
                 ) &&
                 (
                     Logging == other.Logging ||
                     Logging != null &&
                     Logging.Equals(other.Logging)
                 ) &&
                 (
                     NotifyOnLogging == other.NotifyOnLogging ||
                     NotifyOnLogging != null &&
                     NotifyOnLogging.Equals(other.NotifyOnLogging)
                 ) &&
                 (
                     QueueLength == other.QueueLength ||
                     QueueLength != null &&
                     QueueLength.Equals(other.QueueLength)
                 ) &&
                 (
                     GlobalTransforms == other.GlobalTransforms ||
                     GlobalTransforms != null &&
                     GlobalTransforms.Equals(other.GlobalTransforms)
                 ) &&
                 (
                     Locale == other.Locale ||
                     Locale != null &&
                     Locale.Equals(other.Locale)
                 ) &&
                 (
                     Locales == other.Locales ||
                     Locales != null &&
                     Locales.Equals(other.Locales)
                 ));
        }
Ejemplo n.º 28
0
 internal void OnOpen(IPEndPoint endPoint, SendData sendMethod)
 {
     EndPoint        = endPoint;
     this.sendMethod = sendMethod;
 }
Ejemplo n.º 29
0
 public ServerService(string ip, int port)
 {
     socket = new ServerConnect(ip, port, RecvPacket);
     send  += socket.send;
 }
Ejemplo n.º 30
0
        public void Update()
        {
            for (Packet packet = server.GetPacket(); packet != null; packet = server.GetPacket())
            {
                PacketType packetType = packet.BeginRead();
                EndPoint   remote     = null;
                switch (type)
                {
                case ProtocolType.Tcp:
                {
                    if (((Socket)packet.peer).RemoteEndPoint != null)
                    {
                        remote = ((Socket)packet.peer).RemoteEndPoint;
                    }
                    else if (((NetServerTCP)server).SocketToEndPoint.ContainsKey((Socket)packet.peer))
                    {
                        remote = ((NetServerTCP)server).SocketToEndPoint[(Socket)packet.peer];
                    }
                    break;
                }

                case ProtocolType.Udp:
                {
                    remote = (EndPoint)packet.peer;
                    break;
                }
                }
                switch (packetType)
                {
                case PacketType.CONNECT_SUCCESSFUL:
                {
                    if (remote != null)
                    {
                        if (!ToPeer.ContainsKey(remote))
                        {
                            DebugReturn(MessageType.ConnectSuccess, remote.ToString());
                            server.ConnectSuccessful(AddPeerBase, packet);
                        }
                    }
                    break;
                }

                case PacketType.CONNECTION_LOST:
                {
                    if (remote != null)
                    {
                        if (ToPeer.ContainsKey(remote))
                        {
                            PeerBase peer = ToPeer[remote];
                            DebugReturn(MessageType.ConnectLost, remote.ToString() + ", error: " + packet.state);
                            peer.OnDisconnect();
                            server.Disconnect(packet.peer);
                            peer = null;
                        }
                    }
                    break;
                }

                case PacketType.Request:
                {
                    if (remote != null)
                    {
                        if (ToPeer.ContainsKey(remote))
                        {
                            PeerBase peer = ToPeer[remote];
                            string   key  = server.SocketToKey[packet.peer];
                            if (!string.IsNullOrEmpty(key))
                            {
                                SendData sendData = packet.ReadSendData(key);
                                peer.OnOperationRequest(sendData);
                            }
                        }
                    }
                    break;
                }
                }
                packet.CloseStream();
            }
        }
Ejemplo n.º 31
0
 public void OnClickHistoryChuyenTien()
 {
     SendData.onHistoryTranfer();
 }
Ejemplo n.º 32
0
 public void SendMessage(SendData data)
 {
     Clients.Group(data.roomName, Context.ConnectionId).newMessage(data.name + ": " + data.message);
 }
Ejemplo n.º 33
0
        private String getSendData(EventLogEntry entry)
        {
            SendData data = new SendData();
            {
                data.EventLogRecordNumber = entry.Index.ToString();
                data.EventLogTimeGenerated = DateTime.SpecifyKind(entry.TimeGenerated, DateTimeKind.Local).ToString();
                data.EventLogTimeWritten = DateTime.SpecifyKind(entry.TimeWritten, DateTimeKind.Local).ToString();
                data.EventLogId = entry.EventID.ToString(); /*entry.InstanceId.ToString();*/
                data.EventLogType = entry.EntryType.ToString();
                data.EventLogCategory = entry.CategoryNumber.ToString();
                data.EventLogRecordMessage = entry.Message;
                data.EventLogSource = entry.Source;
                data.EventLogMachine = entry.MachineName;
                data.EventLogJournal = log.Log;
                data.GUID = "3170AA1C-2A18-4396-B2EF-671773929AF3";
            }

            JavaScriptSerializer jss = new JavaScriptSerializer();
            String result = jss.Serialize(data);
            return result;
        }
Ejemplo n.º 34
0
        private void bttn_login_Click(object sender, EventArgs e)
        {
            if (rbt_OtherTrue.Checked == true)
            {
                if (oPrintersetting.ShowDialog() == DialogResult.OK)
                {
                    CrystalReport.frm_ReportViewer _objfrm_ReportViewer = new CrystalReport.frm_ReportViewer();
                    SendData _obj = new SendData(_objfrm_ReportViewer.ReceiveDataNotice);
                    _obj(dgv_GirviDetail.Rows[dgv_GirviDetail.CurrentCell.RowIndex].Cells["gn"].Value.ToString(), txt_KhatawaniNo.Text, "Other", oPrintersetting.PrinterName);
                    //_obj(dgv_GirviDetail.Rows[dgv_GirviDetail.CurrentCell.RowIndex].Cells["AmountDeposit"].Value.ToString(), txt_KhatawaniNo.Text, "Other", oPrintersetting.PrinterName);
                    _objfrm_ReportViewer.Show();
                }
                else
                {
                    CrystalReport.frm_ReportViewer _objfrm_ReportViewer = new CrystalReport.frm_ReportViewer();
                    SendData _obj = new SendData(_objfrm_ReportViewer.ReceiveDataNotice);
                    _obj(dgv_GirviDetail.Rows[dgv_GirviDetail.CurrentCell.RowIndex].Cells["gn"].Value.ToString(), txt_KhatawaniNo.Text, "Other", oPrintersetting.PrinterName);
                    //_obj(dgv_GirviDetail.Rows[dgv_GirviDetail.CurrentCell.RowIndex].Cells["AmountDeposit"].Value.ToString(), txt_KhatawaniNo.Text, "Other", oPrintersetting.PrinterName);
                    _objfrm_ReportViewer.Show();
                }
            }
            if (rbt_English.Checked == true)
            {
                if (oPrintersetting.ShowDialog() == DialogResult.OK)
                {
                    CrystalReport.frm_ReportViewer _objfrm_ReportViewer = new CrystalReport.frm_ReportViewer();
                    SendData _obj = new SendData(_objfrm_ReportViewer.ReceiveDataNotice);
                    _obj(dgv_GirviDetail.Rows[dgv_GirviDetail.CurrentCell.RowIndex].Cells["gn"].Value.ToString(), txt_KhatawaniNo.Text, "Other", oPrintersetting.PrinterName);
                    //_obj(dgv_GirviDetail.Rows[dgv_GirviDetail.CurrentCell.RowIndex].Cells["AmountDeposit"].Value.ToString(), txt_KhatawaniNo.Text, "Other", oPrintersetting.PrinterName);
                    _objfrm_ReportViewer.Show();
                }
                else
                {
                    CrystalReport.frm_ReportViewer _objfrm_ReportViewer = new CrystalReport.frm_ReportViewer();
                    SendData _obj = new SendData(_objfrm_ReportViewer.ReceiveDataNotice);
                    _obj(dgv_GirviDetail.Rows[dgv_GirviDetail.CurrentCell.RowIndex].Cells["gn"].Value.ToString(), txt_KhatawaniNo.Text, "Other", oPrintersetting.PrinterName);
                    //_obj(dgv_GirviDetail.Rows[dgv_GirviDetail.CurrentCell.RowIndex].Cells["AmountDeposit"].Value.ToString(), txt_KhatawaniNo.Text, "Other", oPrintersetting.PrinterName);
                    _objfrm_ReportViewer.Show();
                }
            }
            else
            {
                if (oPrintersetting.ShowDialog() == DialogResult.OK)
                {
                    CrystalReport.frm_ReportViewer _objfrm_ReportViewer = new CrystalReport.frm_ReportViewer();
                    SendData _obj = new SendData(_objfrm_ReportViewer.ReceiveDataNotice);
                    _obj(dgv_GirviDetail.Rows[dgv_GirviDetail.CurrentCell.RowIndex].Cells["gn"].Value.ToString(), txt_KhatawaniNo.Text, "", oPrintersetting.PrinterName);
                    //_obj(dgv_GirviDetail.Rows[dgv_GirviDetail.CurrentCell.RowIndex].Cells["AmountDeposit"].Value.ToString(), txt_KhatawaniNo.Text, "", oPrintersetting.PrinterName);

                    _objfrm_ReportViewer.Show();
                }
                else
                {
                    CrystalReport.frm_ReportViewer _objfrm_ReportViewer = new CrystalReport.frm_ReportViewer();
                    SendData _obj = new SendData(_objfrm_ReportViewer.ReceiveDataNotice);
                    _obj(dgv_GirviDetail.Rows[dgv_GirviDetail.CurrentCell.RowIndex].Cells["gn"].Value.ToString(), txt_KhatawaniNo.Text, "", oPrintersetting.PrinterName);
                    //_obj(dgv_GirviDetail.Rows[dgv_GirviDetail.CurrentCell.RowIndex].Cells["AmountDeposit"].Value.ToString(), txt_KhatawaniNo.Text, "", oPrintersetting.PrinterName);
                    _objfrm_ReportViewer.Show();
                }
            }
        }
Ejemplo n.º 35
0
 public void clickReady()
 {
     SendData.onReady(1);// san sang
     btn_sansang.gameObject.SetActive(false);
 }
Ejemplo n.º 36
0
        private async void PublicaMuestraVidaAnaquel()
        {
            try
            {
                var Encabezado = Tools.GetInstance.GetEncabezado(Indicadores.VidaAnaquel);
                var url        = "api/QC/PostVidaAnaque";
                var urlbase    = UrlConexion.UrlConx;
                if (!Encabezado.Count.Equals(0))
                {
                    UserDialogs.Instance.ShowLoading("Subiendo...");
                    List <SendData> data = new List <SendData>();
                    foreach (var item in Encabezado)
                    {
                        var send = new SendData()
                        {
                            Encabezado = item
                        };

                        data.Add(send);
                    }
                    var connection = await apiService.CheckConnection();

                    if (!connection.IsSuccess)
                    {
                        await Application.Current.MainPage.DisplayAlert(
                            "Error",
                            connection.Message,
                            "Aceptar");

                        UserDialogs.Instance.HideLoading();
                        return;
                    }

                    var response = await this.apiService.MyPost(urlbase, url, data);

                    if (!response.IsSuccess)
                    {
                        await Application.Current.MainPage.DisplayAlert(
                            "Error de publicacion",
                            "No se han subido todos sus datos Vida de Anaquel",
                            "Aceptar");

                        UserDialogs.Instance.HideLoading();
                        return;
                    }

                    foreach (var item in data)
                    {
                        this.dataService.Delete(item.Encabezado);
                    }

                    this.AddProceso("Publicacion Vida de Anaquel", "Finalizado");
                    UserDialogs.Instance.HideLoading();
                }
            }
            catch (Exception ex)
            {
                await Application.Current.MainPage.DisplayAlert(
                    "Error de subir datos de Vida de Anaquel",
                    ex.Message.ToString(),
                    "Aceptar");

                UserDialogs.Instance.HideLoading();
                return;
            }
        }