コード例 #1
0
        public override void ProcessRawData()
        {
            try
            {
                _timer.Elapsed -= TimerOnElapsed;
            }
            catch (Exception)
            {
            }
            finally
            {
                _timer.Elapsed += TimerOnElapsed;
            }
            try
            {
                //Kiểm tra nếu chưa kết thúc nhận dữ liệu
                if (!StringData.Contains(DeviceHelper.EOT.ToString(CultureInfo.InvariantCulture)))
                {
                    _timer.Enabled = true;
                    _timer.Start();
                    return;
                }
                _timer.Stop();
                string[] allResult = StringData.Split(DeviceHelper.CR);

                foreach (string record in allResult)
                {
                    TestResult.TestDate = DateTime.Now.ToString("dd/MM/yyyy");
                    bool startsWithD   = record.StartsWith(string.Format("{0}D", DeviceHelper.STX));
                    bool startsWithRcs = record.StartsWith(string.Format("{0}RCS", DeviceHelper.STX));
                    if (startsWithD || startsWithRcs)
                    {
                        string[] strResult = DeviceHelper.DeleteAllBlankLine(record, " ");
                        try
                        {
                            TestResult.Barcode = strResult[0].Substring(startsWithD ? 2 : 7);
                        }
                        catch (Exception)
                        {
                            TestResult.Barcode = "";
                        }
                        try
                        {
                            TestResult.Add(new ResultItem(strResult[1], strResult[2], strResult[3]));
                        }
                        catch (Exception)
                        {
                        }
                        ImportResults();
                    }
                }
                ClearData();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #2
0
ファイル: Urisys1100.cs プロジェクト: vunb/CoreServicesNew
 private Boolean ValidData()
 {
     try
     {
         return(StringData.Contains("...................."));
     }
     catch (Exception)
     {
         return(false);
     }
 }
コード例 #3
0
        public bool Execute(params object[] Params)
        {
            if (Params == null || Params.Length == 0)
            {
                return(false);
            }

            Habbo Player = (Habbo)Params[0];

            if (Player == null || Player.GetClient() == null || string.IsNullOrWhiteSpace(StringData))
            {
                return(false);
            }

            RoomUser User = Player.CurrentRoom.GetRoomUserManager().GetRoomUserByHabbo(Player.Username);

            if (User == null)
            {
                return(false);
            }

            string Message = StringData;

            if (StringData.Contains("%USERNAME%"))
            {
                Message = Message.Replace("%USERNAME%", Player.Username);
            }

            if (StringData.Contains("%ROOMNAME%"))
            {
                Message = Message.Replace("%ROOMNAME%", Player.CurrentRoom.Name);
            }

            if (StringData.Contains("%USERCOUNT%"))
            {
                Message = Message.Replace("%USERCOUNT%", Player.CurrentRoom.UserCount.ToString());
            }

            if (StringData.Contains("%USERSONLINE%"))
            {
                Message = Message.Replace("%USERSONLINE%", PlusEnvironment.GetGame().GetClientManager().Count.ToString());
            }



            Player.GetClient().SendPacket(new WhisperComposer(User.VirtualId, Message, 0, 34));
            return(true);
        }
コード例 #4
0
        public bool Execute(params object[] Params)
        {
            if (Params == null || Params.Length == 0)
            {
                return(false);
            }

            Habbo Player = (Habbo)Params[0];

            if (Player == null || Player.GetClient() == null || string.IsNullOrWhiteSpace(StringData))
            {
                return(false);
            }

            RoomUser User = Player.CurrentRoom.GetRoomUserManager().GetRoomUserByHabbo(Player.Username);

            if (User == null)
            {
                return(false);
            }

            string Message = StringData;

            if (StringData.Contains("%USERNAME%"))
            {
                Message = Message.Replace("%USERNAME%", Player.Username);
            }

            if (StringData.Contains("%ROOMNAME%"))
            {
                Message = Message.Replace("%ROOMNAME%", Player.CurrentRoom.Name);
            }

            if (StringData.Contains("%USERCOUNT%"))
            {
                Message = Message.Replace("%USERCOUNT%", Player.CurrentRoom.UserCount.ToString());
            }

            if (StringData.Contains("%USERSONLINE%"))
            {
                Message = Message.Replace("%USERSONLINE%", BiosEmuThiago.GetGame().GetClientManager().Count.ToString());
            }

            if (StringData.Contains("%USERID%"))
            {
                Message = Message.Replace("%USERID%", Convert.ToString(Player.Id));
            }

            if (StringData.Contains("%HONOR%"))
            {
                Message = Message.Replace("%HONOR%", Convert.ToString(Player.GOTWPoints));
            }

            if (StringData.Contains("%DUCKETS%"))
            {
                Message = Message.Replace("%DUCKETS%", Convert.ToString(Player.Duckets));
            }

            if (StringData.Contains("%DIAMONDS%"))
            {
                Message = Message.Replace("%DIAMONDS%", Convert.ToString(Player.Diamonds));
            }

            if (StringData.Contains("%RANGO%")) // Put names not number
            {
                Message = Message.Replace("%RANGO%", Convert.ToString(Player.Rank));
            }

            if (StringData.Contains("%LIKESROOM%"))
            {
                Message = Message.Replace("%LIKESROOM%", Player.CurrentRoom.Score.ToString());
            }



            Player.GetClient().SendMessage(new WhisperComposer(User.VirtualId, Message, 0, 34));
            return(true);
        }
コード例 #5
0
ファイル: ShowMessageBox.cs プロジェクト: pedruhb/RavenServer
        private void SendMessageToUser(Habbo Player)
        {
            RoomUser User = Player.CurrentRoom.GetRoomUserManager().GetRoomUserByHabbo(Player.Username);

            if (User == null)
            {
                return;
            }

            string Message         = StringData;
            string MessageFiltered = StringData;

            // Convertir esta chapuza integral a switch

            // USER VARIABLES
            if (StringData.Contains("%user%"))
            {
                MessageFiltered = MessageFiltered.Replace("%user%", Player.Username);
            }
            if (StringData.Contains("%userid%"))
            {
                MessageFiltered = MessageFiltered.Replace("%userid%", Convert.ToString(Player.Id));
            }
            if (StringData.Contains("%honor%"))
            {
                MessageFiltered = MessageFiltered.Replace("%honor%", Convert.ToString(Player.GOTWPoints));
            }
            if (StringData.Contains("%pixeles%"))
            {
                MessageFiltered = MessageFiltered.Replace("%pixeles%", Convert.ToString(Player.GOTWPoints));
            }
            if (StringData.Contains("%duckets%"))
            {
                MessageFiltered = MessageFiltered.Replace("%duckets%", Convert.ToString(Player.Duckets));
            }
            if (StringData.Contains("%diamonds%"))
            {
                MessageFiltered = MessageFiltered.Replace("%diamonds%", Convert.ToString(Player.Diamonds));
            }
            if (StringData.Contains("%rank%"))
            {
                MessageFiltered = MessageFiltered.Replace("%rank%", Convert.ToString(Player.Rank));
            }

            // ROOM VARIABLES
            if (StringData.Contains("%roomname%"))
            {
                MessageFiltered = MessageFiltered.Replace("%roomname%", Player.CurrentRoom.Name);
            }
            if (StringData.Contains("%roomusers%"))
            {
                MessageFiltered = MessageFiltered.Replace("%userson%", Player.CurrentRoom.UserCount.ToString());
            }
            if (StringData.Contains("%roomowner%"))
            {
                MessageFiltered = MessageFiltered.Replace("%roomowner%", Player.CurrentRoom.OwnerName.ToString());
            }
            if (StringData.Contains("%roomlikes%"))
            {
                MessageFiltered = MessageFiltered.Replace("%roomlikes%", Player.CurrentRoom.Score.ToString());
            }

            // HOTEL VARIABLES
            if (StringData.Contains("%userson%"))
            {
                MessageFiltered = MessageFiltered.Replace("%userson%", RavenEnvironment.GetGame().GetClientManager().Count.ToString());
            }

            // SPECIAL VARIABLES
            if (StringData.Contains("%SIT%"))
            {
                Message = Message.Replace("%SIT%", "Te has sentado");

                if (User.Statusses.ContainsKey("lie") || User.isLying || User.RidingHorse || User.IsWalking)
                {
                    return;
                }

                if (!User.Statusses.ContainsKey("sit"))
                {
                    if ((User.RotBody % 2) == 0)
                    {
                        if (User == null)
                        {
                            return;
                        }

                        try
                        {
                            User.Statusses.Add("sit", "1.0");
                            User.Z           -= 0.35;
                            User.isSitting    = true;
                            User.UpdateNeeded = true;
                        }
                        catch { }
                    }
                    else
                    {
                        User.RotBody--;
                        User.Statusses.Add("sit", "1.0");
                        User.Z           -= 0.35;
                        User.isSitting    = true;
                        User.UpdateNeeded = true;
                    }
                }
                else if (User.isSitting == true)
                {
                    User.Z += 0.35;
                    User.Statusses.Remove("sit");
                    User.Statusses.Remove("1.0");
                    User.isSitting    = false;
                    User.UpdateNeeded = true;
                }
            }

            if (StringData.Contains("%STAND%"))
            {
                Message = Message.Replace("%STAND%", "Te has levantado");
                if (User.isSitting)
                {
                    User.Statusses.Remove("sit");
                    User.Z           += 0.35;
                    User.isSitting    = false;
                    User.UpdateNeeded = true;
                }
                else if (User.isLying)
                {
                    User.Statusses.Remove("lay");
                    User.Z           += 0.35;
                    User.isLying      = false;
                    User.UpdateNeeded = true;
                }
            }

            if (StringData.Contains("%LAY%"))
            {
                Message = Message.Replace("%LAY%", "Te has tumbado");

                Room Room = Player.GetClient().GetHabbo().CurrentRoom;

                if (!Room.GetGameMap().ValidTile(User.X + 2, User.Y + 2) && !Room.GetGameMap().ValidTile(User.X + 1, User.Y + 1))
                {
                    Player.GetClient().SendWhisper("Oops, no te puedes acostar aqui!");
                    return;
                }

                if (User.Statusses.ContainsKey("sit") || User.isSitting || User.RidingHorse || User.IsWalking)
                {
                    return;
                }

                if (Player.GetClient().GetHabbo().Effects().CurrentEffect > 0)
                {
                    Player.GetClient().GetHabbo().Effects().ApplyEffect(0);
                }

                if (!User.Statusses.ContainsKey("lay"))
                {
                    if ((User.RotBody % 2) == 0)
                    {
                        if (User == null)
                        {
                            return;
                        }

                        try
                        {
                            User.Statusses.Add("lay", "1.0 null");
                            User.Z           -= 0.35;
                            User.isLying      = true;
                            User.UpdateNeeded = true;
                        }
                        catch { }
                    }
                    else
                    {
                        User.RotBody--;//
                        User.Statusses.Add("lay", "1.0 null");
                        User.Z           -= 0.35;
                        User.isLying      = true;
                        User.UpdateNeeded = true;
                    }
                }
                else
                {
                    User.Z += 0.35;
                    User.Statusses.Remove("lay");
                    User.Statusses.Remove("1.0");
                    User.isLying      = false;
                    User.UpdateNeeded = true;
                }
            }

            Player.GetClient().SendMessage(new WhisperComposer(User.VirtualId, MessageFiltered, 0, 34));
        }
コード例 #6
0
        public bool Execute(params object[] Params)
        {
            if (Params == null || Params.Length == 0)
            {
                return(false);
            }

            Habbo Player = (Habbo)Params[0];

            if (Player == null || Player.GetClient() == null || string.IsNullOrWhiteSpace(StringData))
            {
                return(false);
            }

            RoomUser User = Player.CurrentRoom.GetRoomUserManager().GetRoomUserByHabbo(Player.Username);

            if (User == null)
            {
                return(false);
            }

            string Message = StringData;

            if (StringData.Contains("%USERNAME%"))
            {
                Message = Message.Replace("%USERNAME%", Player.Username);
            }

            if (StringData.Contains("%username%"))
            {
                Message = Message.Replace("%username%", Player.Username);
            }

            if (StringData.Contains("%ROOMNAME%"))
            {
                Message = Message.Replace("%ROOMNAME%", Player.CurrentRoom.Name);
            }

            if (StringData.Contains("%roomname%"))
            {
                Message = Message.Replace("%roomname%", Player.CurrentRoom.Name);
            }

            if (StringData.Contains("%USERCOUNT%"))
            {
                Message = Message.Replace("%USERCOUNT%", Player.CurrentRoom.UserCount.ToString());
            }

            if (StringData.Contains("%usercount%"))
            {
                Message = Message.Replace("%usercount%", Player.CurrentRoom.UserCount.ToString());
            }

            if (StringData.Contains("%USERSONLINE%"))
            {
                Message = Message.Replace("%USERSONLINE%", NeonEnvironment.GetGame().GetClientManager().Count.ToString());
            }

            if (StringData.Contains("%usersonline%"))
            {
                Message = Message.Replace("%usersonline%", NeonEnvironment.GetGame().GetClientManager().Count.ToString());
            }

            if (StringData.Contains("%USERID%"))
            {
                Message = Message.Replace("%USERID%", Convert.ToString(Player.Id));
            }

            if (StringData.Contains("%userid%"))
            {
                Message = Message.Replace("%userid%", Convert.ToString(Player.Id));
            }

            if (StringData.Contains("%GOTW%"))
            {
                Message = Message.Replace("%GOTW%", Convert.ToString(Player.GOTWPoints));
            }

            if (StringData.Contains("%gotw%"))
            {
                Message = Message.Replace("%gotw%", Convert.ToString(Player.GOTWPoints));
            }

            if (StringData.Contains("%DUCKETS%"))
            {
                Message = Message.Replace("%DUCKETS%", Convert.ToString(Player.Duckets));
            }

            if (StringData.Contains("%duckets%"))
            {
                Message = Message.Replace("%duckets%", Convert.ToString(Player.Duckets));
            }

            if (StringData.Contains("%DIAMONDS%"))
            {
                Message = Message.Replace("%DIAMONDS%", Convert.ToString(Player.Diamonds));
            }

            if (StringData.Contains("%diamonds%"))
            {
                Message = Message.Replace("%diamonds%", Convert.ToString(Player.Diamonds));
            }

            if (StringData.Contains("%RANK%")) // Put names not number
            {
                Message = Message.Replace("%RANK%", Convert.ToString(Player.Rank));
            }

            if (StringData.Contains("%rank%")) // Put names not number
            {
                Message = Message.Replace("%rank%", Convert.ToString(Player.Rank));
            }

            if (StringData.Contains("%LIKESROOM%"))
            {
                Message = Message.Replace("%LIKESROOM%", Player.CurrentRoom.Score.ToString());
            }

            if (StringData.Contains("%likes%"))
            {
                Message = Message.Replace("%likes%", Player.CurrentRoom.Score.ToString());
            }

            Player.GetClient().SendNotification(Message);
            return(true);
        }
コード例 #7
0
        public bool Execute(params object[] Params)
        {
            if (Params == null || Params.Length == 0)
            {
                return(false);
            }

            Habbo Player = (Habbo)Params[0];

            if (Player == null || Player.GetClient() == null || string.IsNullOrWhiteSpace(StringData))
            {
                return(false);
            }

            RoomUser User = Player.CurrentRoom.GetRoomUserManager().GetRoomUserByHabbo(Player.Username);

            if (User == null)
            {
                return(false);
            }

            string Message = StringData;

            if (StringData.Contains("%HABBIS%"))
            {
                Message = Message.Replace("%HABBIS%", Player.Username);
            }

            if (StringData.Contains("%KAMERNAAM%"))
            {
                Message = Message.Replace("%KAMERNAAM%", Player.CurrentRoom.Name);
            }

            if (StringData.Contains("%SETMAX%"))
            {
                Message = Message.Replace("%SETMAX%", Player.CurrentRoom.UserCount.ToString());
            }

            if (StringData.Contains("%ONLINE%"))
            {
                Message = Message.Replace("%ONLINE%", QuasarEnvironment.GetGame().GetClientManager().Count.ToString());
            }

            if (StringData.Contains("%ID%"))
            {
                Message = Message.Replace("%ID%", Convert.ToString(Player.Id));
            }

            if (StringData.Contains("%DUCKETS%"))
            {
                Message = Message.Replace("%DUCKETS%", Convert.ToString(Player.Duckets));
            }

            if (StringData.Contains("%DIAMANTEN%"))
            {
                Message = Message.Replace("%DIAMANTEN%", Convert.ToString(Player.Diamonds));
            }

            if (StringData.Contains("%CREDITS%"))
            {
                Message = Message.Replace("%CREDITS%", Convert.ToString(Player.Credits));
            }

            if (StringData.Contains("%RANK%")) // Put names not number
            {
                Message = Message.Replace("%RANK%", Convert.ToString(Player.Rank));
            }

            if (StringData.Contains("%STEMMEN%"))
            {
                Message = Message.Replace("%STEMMEN%", Player.CurrentRoom.Score.ToString());
            }

            Player.GetClient().SendMessage(new WhisperComposer(User.VirtualId, Message, 0, 34));
            return(true);
        }
コード例 #8
0
ファイル: Uriscreen500.cs プロジェクト: vunb/CoreServicesNew
        public override void ProcessRawData()
        {
            try
            {
                if (!StringData.Contains("URINALYSIS"))
                {
                    return;
                }
                Log.Trace("Begin Process Data");
                Log.Trace(DeviceHelper.CRLF + StringData);
                string[] allPatients = SeparatorData(StringData);

                foreach (string patient in allPatients)
                {
                    try
                    {
                        string[] tempResult = patient.Split(DeviceHelper.CR);
                        TestResult.TestDate = tempResult[1].Split()[0];
                        try
                        {
                            string tempbarcode = tempResult[3].Split(':')[1].Trim();
                            //if(string.IsNullOrEmpty(tempbarcode))
                            //    tempbarcode = tempResult[2].Split(':')[1].Trim().Replace(".","");
                            TestResult.Barcode = tempbarcode == "" ? "0000" : tempbarcode;
                        }
                        catch (Exception)
                        {
                            TestResult.Barcode = "0000";
                        }

                        for (int i = 4; i < 15; i++)
                        {
                            try
                            {
                                string[] tempresultarr = DeviceHelper.DeleteAllBlankLine(tempResult[i], "");
                                if (tempresultarr.Length > 1)
                                {
                                    string testName  = tempresultarr[0];
                                    string testValue = tempresultarr[1];
                                    TestResult.Add(new ResultItem(testName, testValue));
                                    Log.Debug("Add new Result: TestName = {0}, TestValue = {1}", testName, testValue);
                                }
                            }
                            catch (Exception)
                            {
                            }
                        }


                        Log.Debug("Begin Import Result");
                        ImportResults();
                        Log.Debug("Import Result Success");
                    }
                    catch (Exception)
                    {
                    }
                }
                ClearData();
            }
            catch (Exception)
            {
                ClearData();
            }
        }