عرض مشاركة واحدة
احصائياتى

الردود
3

المشاهدات
6393
 
Mr.DeMo

Mr.DeMo is on a distinguished road

    غير متواجد

المشاركات
41

+التقييم
0.01

تاريخ التسجيل
Apr 2013

الاقامة

نظام التشغيل

رقم العضوية
2786
12-10-2015, 11:39 PM
المشاركة 1 
#1  
افتراضي Full Poker All In - نزل البوكر كامل فى سيرفرك All In
allin, البوكر, full, سيرفرك, poker, كامل

بسم الله الرحمن الرحيم

زي ما وعدت ووفيت
انهرضه انا لاقيت ان في ناس محتاجه البوكر قولت انزلو للرجاله الي في المنتده ومحتاج بس تقييم وكلمه شكر منكم علشان الي جاي احله
بكتيييييير



كود:
 ياريت الي جرب ينزل صور 

المهم نخش علي الاضاااااااااااااافه بسرعه


هتفتح ملف

كود:
Poker.cs 

الي في المسار ده

كود:
Game\Features\Tournaments 

تمام بدلو كلو بده


كود:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using HarryPotter.Network;
using HarryPotter.Network.GamePackets;

namespace 
HarryPotter.Game
{
    public class 
HandlePoker
    
{
        public 
HandlePoker(byte[] packetClient.GameState client)// HarryPotter
        
{
            if (
packet == null)
                return;
            if (
client == null)
                return;
            
ushort Length BitConverter.ToUInt16(packet0);
            
ushort ID BitConverter.ToUInt16(packet2);
            
ushort ID2 BitConverter.ToUInt16(packet4);
            switch (
ID)
            {
                
#region 2171 Join table
                
case 2171:// HarryPotter
                    
{
                        
Game.Entity MyChar client.Entity;
                        
uint TableId BitConverter.ToUInt32(packet8);
                        
uint PlayerId BitConverter.ToUInt32(packet12);
                        
byte Seat packet[16]; byte Typ packet[4];
                        switch (
Typ)
                        {
                            case 
0://join table
                                
{
                                    if (
Kernel.PokerTables.ContainsKey(TableId))
                                    {
                                        
Game.PokerTable T Kernel.PokerTables[TableId];
                                        if (
T.Players.ContainsKey(client.Entity.UID)) T.RemovePlayer(MyChar.UID);
                                        if (
T.FreeSeat(Seat))
                                        {
                                            
T.AddNewPlayer(client.EntitySeattrue);
                                            
MyChar.PokerTable T.Id;
                                            
byte CurrentState 1;
                                            if (!
T.Players.ContainsKey(MyChar.UID))
                                                if  (
T.Watchers.ContainsKey(MyChar.UID)) CurrentState =  T.Watchers[MyChar.UID].CurrentState;
                                             
client.Send(Game.PokerPackets.PokerPlayerInfo(SeatMyChar.UID,  CurrentStateT.Nomber));
                                            foreach (
Game.PokerPlayer P in T.Players.Values)
                                            {
                                                if (
P.PlayerId == MyChar.UID) continue;
                                                 
client.Send(Game.PokerPackets.PokerPlayerInfo(P.SeatP.PlayerId,  P.CurrentStateT.Nomber));
                                                 
P.Send(Game.PokerPackets.PokerPlayerInfo(SeatMyChar.UID,  CurrentStateT.Nomber));
                                            }
                                            foreach (
Game.PokerPlayer P in T.Watchers.Values)
                                            {
                                                if (
P.PlayerId == MyChar.UID) continue;
                                                 
client.Send(Game.PokerPackets.PokerPlayerInfo(P.SeatP.PlayerId,  P.CurrentStateT.Nomber));
                                                 
P.Send(Game.PokerPackets.PokerPlayerInfo(SeatMyChar.UID,  CurrentStateT.Nomber));
                                            }
                                            if (
T.Players.Count == && T.Pot == 0)
                                                
T.SetNewRound(5);//5 sec
                                        
}
                                    }
                                    break;
                                }
                            case 
4://watch
                                
{
                                    if (
Kernel.PokerTables.ContainsKey(TableId))
                                    {
                                        
Game.PokerTable T Kernel.PokerTables[TableId];
                                        if (
T.Players.ContainsKey(MyChar.UID) || T.Watchers.ContainsKey(MyChar.UID)) return;
                                        if (
T.FreeSeat(Seat))
                                        {
                                            
T.AddNewPlayer(MyCharSeatfalse);
                                            
T.Watchers[MyChar.UID].CurrentState 2;
                                            
MyChar.PokerTable T.Id;
                                            
client.Send(Game.PokerPackets.PokerPlayerInfo(SeatMyChar.UID2T.Nomber));
                                            foreach (
Game.PokerPlayer P in T.Players.Values)
                                            {
                                                if (
P.PlayerId == MyChar.UID) continue;
                                                 
client.Send(Game.PokerPackets.PokerPlayerInfo(P.SeatP.PlayerId,  P.CurrentStateT.Nomber));
                                                
P.Send(Game.PokerPackets.PokerPlayerInfo(SeatMyChar.UID2T.Nomber));
                                            }
                                            foreach (
Game.PokerPlayer P in T.Watchers.Values)
                                            {
                                                if (
P.PlayerId == MyChar.UID) continue;
                                                 
client.Send(Game.PokerPackets.PokerPlayerInfo(P.SeatP.PlayerId,  P.CurrentStateT.Nomber));
                                                
P.Send(Game.PokerPackets.PokerPlayerInfo(SeatMyChar.UID2T.Nomber));
                                            }
                                        }
                                    }
                                    break;
                                }
                            default:
                                {
                                    break;
                                }
                        }
                        break;
                    }
                
#endregion 2171 Join table
                #region 2093 Player move
                
case 2093:// HarryPotter
                    
{
                        
byte Typ packet[6];
                        
Game.Entity MyChar client.Entity;
                        
Game.PokerTable T = new Game.PokerTable();
                        if (
Kernel.PokerTables.ContainsKey(MyChar.PokerTable))
                            
MyChar.MyPokerTable;
                        else return;
                        switch (
Typ)
                        {

                            default:
                                {
                                    
T.NewPlayerMove(packetMyChar.UID);
                                    break;
                                }
                        }
                        break;
                    }
                
#endregion 2093 Player move
                #region 2096 Leave table
                
case 2096:// HarryPotter
                    
{
                        
Game.Entity MyChar client.Entity;
                        if (
MyChar.MyPokerTable == null) return;
                        if (
MyChar.MyPokerTable.Players.ContainsKey(MyChar.UID) && MyChar.MyPokerTable.Pot 1)
                        {
                            
byte[] = new byte[10];
                            
P[6] = 4P[9] = 200;
                            
MyChar.MyPokerTable.NewPlayerMove(PMyChar.UID);
                        }
                        else
                            
MyChar.MyPokerTable.RemovePlayer(MyChar.UID);
                        
client.Send(packet);
                        break;
                    }
                
#endregion 2096 Leave table
                #region Next Round
                
case 2090:// HarryPotter
                    
{
                        
byte Typ packet[6];
                        
Game.Entity MyChar client.Entity;
                        switch (
Typ)
                        {
                            case 
1:
                                {
                                    if (
MyChar.PokerTable 0)
                                    {
                                        if (
Kernel.PokerTables.ContainsKey(MyChar.PokerTable))
                                        {
                                            
byte Seat packet[8];
                                            
Game.PokerTable T MyChar.MyPokerTable;
                                            if (
T.Players.ContainsKey(client.Entity.UID)) return;
                                            if (
T.FreeSeat(Seat))
                                            {
                                                
T.AddNewPlayer(MyCharSeattrue);
                                                
byte CurrentState 1;
                                                if (!
T.Players.ContainsKey(MyChar.UID))
                                                    if (
T.Watchers.ContainsKey(MyChar.UID))
                                                    {
                                                        
CurrentState T.Watchers[MyChar.UID].CurrentState;
                                                        
T.Watchers.Remove(MyChar.UID);
                                                    }
                                                 
client.Send(Game.PokerPackets.PokerPlayerInfo(SeatMyChar.UID,  CurrentStateT.Nomber));
                                                foreach (
Game.PokerPlayer P in T.Players.Values)
                                                {
                                                    if (
P.PlayerId == MyChar.UID) continue;
                                                     
client.Send(Game.PokerPackets.PokerPlayerInfo(P.SeatP.PlayerId,  P.CurrentStateT.Nomber));
                                                     
P.Send(Game.PokerPackets.PokerPlayerInfo(SeatMyChar.UID,  CurrentStateT.Nomber));
                                                }
                                                foreach (
Game.PokerPlayer P in T.Watchers.Values)
                                                {
                                                    if (
P.PlayerId == MyChar.UID) continue;
                                                     
client.Send(Game.PokerPackets.PokerPlayerInfo(P.SeatP.PlayerId,  P.CurrentStateT.Nomber));
                                                     
P.Send(Game.PokerPackets.PokerPlayerInfo(SeatMyChar.UID,  CurrentStateT.Nomber));
                                                }
                                                if (
T.Players.Count == && T.Pot == 0)
                                                    
T.SetNewRound(21);//21 sec
                                            
}
                                        }
                                    }
                                    break;
                                }
                            default:
                                {

                                    
string D "";
                                    for (
int x 0packet.Lengthx++)
                                        
+= packet[x].ToString("X") + "  ";
                                    
client.Send(new Message("Unknown  type: " ID " with length " packet.Length " :- " D,  System.Drawing.Color.CadetBlueMessage.Talk));
                                    break;
                                }
                        }
                        break;
                    }
                
#endregion 2090
                #region Unknow - List
                
case 2099:// HarryPotter
                    
client.Send(packet);
                    break;
                
#endregion
            
}

        }
    }
    public class 
PokerPackets
    
{
        public static 
byte[] PokerTable(PokerTable Table)// HarryPotter
        
{
            
PacketBuilder HarryPotter = new PacketBuilder(217252 + (Table.Players.Count 6));
            
HarryPotter.Long(Table.Id);
            
HarryPotter.Long(0);
            
HarryPotter.Long(0);
            
HarryPotter.Short(Table.X);//Table X coord
            
HarryPotter.Short(Table.Y);//Table Y Coord
            
HarryPotter.Long(7217967);//Fixed nomber don't know what it is
            
HarryPotter.Short(0);
            
HarryPotter.Long(Table.Nomber);//table nomber
            
HarryPotter.Int((Table.FreeBet 0));//Limited=0    Unlimited=1
            
HarryPotter.Int(0);
            
HarryPotter.Short(0);
            
HarryPotter.Long(Table.BetType);//table bet type 1=Silver 0=CPs
            
HarryPotter.Long(Table.MinLimit);
            
HarryPotter.Int((byte)Table.State);//table state   0=unopened  1=Pocket  2=flop 3=turn 4=river 5=showdown
            
HarryPotter.ULong(Table.Pot);//Pot
            
HarryPotter.Int(Table.Players.Count);//Players Count
            
foreach (PokerPlayer Player in Table.Players.Values)
            {
                if (
Player.MyChar == null) { HarryPotter.Move(6); continue; }
                
HarryPotter.Long(Player.PlayerId);
                
HarryPotter.Int(Player.Seat);
                
HarryPotter.Int(Player.Connected 0);
            }
            return 
HarryPotter.getFinal();
        }
        public static 
byte[] PokerJoinAction(uint TableIduint PlayerIdbyte Reqbyte Seat)// HarryPotter
        
{
            
PacketBuilder HarryPotter = new PacketBuilder(217120);
            
HarryPotter.Long(Req);
            
HarryPotter.Long(TableId);
            
HarryPotter.Long(PlayerId);
            
HarryPotter.Long(Seat);
            return 
HarryPotter.getFinal();
        }
        public static 
byte[] PokerPlayerInfo(byte Seatuint PlayerIdbyte Statebyte TableNo)// HarryPotter
        
{
            
byte[] HarryPotter = new byte[25 8];
            
Writer.Ushort(250HarryPotter);
            
Writer.Ushort(20902HarryPotter);
            
Writer.Byte(14HarryPotter);
            
Writer.Byte(State5HarryPotter);
            
Writer.Byte(Seat7HarryPotter);
            
Writer.Byte(TableNo9HarryPotter);
            
Writer.Uint(PlayerId13HarryPotter);
            return 
HarryPotter.ToArray();
        }
        public static 
byte[] PokerCards1Card(PokerTable T)// HarryPotter
        
{
            
PacketBuilder HarryPotter = new PacketBuilder(209144 T.Players.Count 8);
            
HarryPotter.Short(7);
            
HarryPotter.Short(4);
            
HarryPotter.Long(0);
            
HarryPotter.Long(0);
            
HarryPotter.Long(0);
            
HarryPotter.Long(0);
            
HarryPotter.Long(0);
            
HarryPotter.Short(0);
            
HarryPotter.Short(T.Players.Count);
            
HarryPotter.Long(T._StartingPlayer);
            
HarryPotter.Long(0);
            
HarryPotter.Long(0);
            foreach (
PokerPlayer Pl in T.Players.Values)
            {
                foreach (
PokerCard C in Pl.MyCards.Values)
                {
                    
HarryPotter.Short(C.Val);
                    
HarryPotter.Short((byte)C.Typ);
                }
                
HarryPotter.Long(Pl.PlayerId);
            }
            return 
HarryPotter.getFinal();
        }
        public static 
byte[] PokerCards2Cards(PokerTable TDictionary<bytePokerCardCards// Card in list
        
{
            
PacketBuilder HarryPotter = new PacketBuilder(209144 T.Players.Count 8);
            
HarryPotter.Long(0);
            
HarryPotter.Short(2);
            foreach (
PokerCard C in Cards.Values)
            {
                
HarryPotter.Short(C.Val);
            }
            
HarryPotter.Short(0);
            
HarryPotter.Long(0);
            foreach (
PokerCard C in Cards.Values)
            {
                
HarryPotter.Short((byte)C.Typ);
            }
            
HarryPotter.Short(0);
            
HarryPotter.Long(0);
            
HarryPotter.Short(T.Players.Count);
            
HarryPotter.Long(T._StartingPlayer);
            
HarryPotter.Long(T.GetLastPlayer());
            
HarryPotter.Long(T.GetNextPlayer());
            foreach (
PokerPlayer Pl in T.Players.Values)
            {
                
HarryPotter.Short(13);
                
HarryPotter.Short(4);
                
HarryPotter.Long(Pl.PlayerId);
            }
            
Console.WriteLine("A");
            return 
HarryPotter.getFinal();
        }
        public static 
byte[] PokerTableCards(Dictionary<byte,  PokerCardCardsPokerTable Tbyte RoundStage// Card in Table
        
{
            
PacketBuilder HarryPotter = new PacketBuilder(209144);
            
HarryPotter.Short(0);
            
HarryPotter.Short(RoundStage);
            
HarryPotter.Short(Cards.Count);
            foreach (
PokerCard C in Cards.Values)
            {
                
HarryPotter.Short(C.Val);
            }
            for (
byte x 0Cards.Countx++)
                
HarryPotter.Short(0);
            foreach (
PokerCard C in Cards.Values)
            {
                
HarryPotter.Short((byte)C.Typ);
            }
            for (
byte x 0Cards.Countx++)
                
HarryPotter.Short(0);
            
HarryPotter.Short(0);
            
HarryPotter.Long(T._StartingPlayer);
            
HarryPotter.Long(T.GetLastPlayer());
            
HarryPotter.Long(T.GetNextPlayer());
            return 
HarryPotter.getFinal();
        }
        public static 
byte[] PokerPlayerTurn(uint Id1uint LastBetuint RequierdBetbyte Typebyte TimeDown// HarryPotter
        
{
            
byte[] HarryPotter = new byte[28 8];// HarryPotter
            
Writer.Ushort(280HarryPotter);
            
Writer.Ushort(20922HarryPotter);
            
Writer.Ushort(TimeDown4HarryPotter);
            
//timer count 
            
Writer.Ushort(Type6HarryPotter);
            
//Type 
            
Writer.Ulong(LastBet8HarryPotter);
            
//last bet 
            
Writer.Ulong(RequierdBet16HarryPotter);
            
//requierd bet 
            
Writer.Ulong(Id124HarryPotter);
            
//PlayerId 
            
return HarryPotter.ToArray();
        }
        public static 
byte[] PokerPlayerMove(uint PlayerIdbyte Typuint Betuint RequierdBet)// HarryPotter
        
{
            
PacketBuilder HarryPotter = new PacketBuilder(209320);// HarryPotter
            
HarryPotter.Short(0);
            
HarryPotter.Short(Typ);//move type 32 =all in one
            
HarryPotter.Long(Bet);//player bet
            
HarryPotter.Long(RequierdBet);//requierd bet
            
HarryPotter.Long(PlayerId);
            return 
HarryPotter.getFinal();
        }
        public static 
byte[] PokerShowAllCards(PokerTable T)// HarryPotter
        
{
            
PacketBuilder HarryPotter = new PacketBuilder(2094T.Players.Count 12);
            
HarryPotter.Short(0);//
            
HarryPotter.Short(T.Players.Count);
            foreach (
PokerPlayer Pl in T.Players.Values)
            {
                
byte Card1Val 0Card1Type 0Card2Val 0Card2Type 0byte Co 0;
                foreach (
PokerCard C in Pl.MyCards.Values)
                {
                    
Co++;
                    if (
Co == 1)
                    {
                        
Card1Val C.ValCard1Type = (byte)C.Typ;
                    }
                    else if (
Co == 2)
                    {
                        
Card2Val C.ValCard2Type = (byte)C.Typ;
                    }
                }
                
HarryPotter.Short(Card1Val);
                
HarryPotter.Short(Card2Val);
                
HarryPotter.Short(Card1Type);
                
HarryPotter.Short(Card2Type);
                
HarryPotter.Long(Pl.PlayerId);
            }
            return 
HarryPotter.getFinal();
        }
        public static 
byte[] PokerRoundResult(PokerTable Tuint WinnerIduint MoneyWins)
        {
            
PacketBuilder HarryPotter = new PacketBuilder(2095T.Players.Count 15);
            
HarryPotter.Short(20);//Timer
            
HarryPotter.Short(T.Players.Count);
            
HarryPotter.Int(0);
            
HarryPotter.Int(0);
            
HarryPotter.Int(0);
            
HarryPotter.Long(WinnerId);
            
HarryPotter.Long(MoneyWins);
            
HarryPotter.Long(0);
            foreach (
PokerPlayer Pl in T.Players.Values)
            {
                try
                {
                    
byte ContinuePlaying 0;
                    if (
Pl.PlayerId == WinnerId) continue;
                    if (
T.BetType == 0)
                        if (
Pl.MyChar.Money >= T.MinLimit 10)
                            
ContinuePlaying 0;
                        else 
ContinuePlaying 1;
                    else if (
T.BetType == 1)
                        if (
Pl.MyChar.ConquerPoints >= T.MinLimit 10)
                            
ContinuePlaying 0;
                        else 
ContinuePlaying 1;
                    if (
ContinuePlaying == 0)
                        
HarryPotter.Int(0);
                    else
                    {
                        
HarryPotter.Int(1);
                        
Pl.CurrentState 2;
                    }
                    
HarryPotter.Int(255);
                    
HarryPotter.Int(0);
                    
HarryPotter.Long(Pl.PlayerId);
                    
HarryPotter.Long(0xffffffff Pl.Bet);
                    
HarryPotter.Short(0xffff);
                   
HarryPotter.Short(0xffff);
                }
                catch
                {
                    
HarryPotter.Int(0);
                    
HarryPotter.Int(255);
                    
HarryPotter.Int(0);
                    
HarryPotter.Long(Pl.PlayerId);
                    
HarryPotter.Long(0xffffffff Pl.Bet);
                    
HarryPotter.Short(0xffff);
                    
HarryPotter.Short(0xffff);
                }
            }
            return 
HarryPotter.getFinal();
        }
        public static 
byte[] PokerLeaveTable(uint Id1)
        {
            
PacketBuilder HarryPotter = new PacketBuilder(209616);

            
HarryPotter.Long(1);//
            
HarryPotter.Long(0);
            
HarryPotter.Long(Id1);
            return 
HarryPotter.getFinal();
        }
        public static 
byte[] PokerTableState(PokerTable Tbyte CountDown)
        {
            
PacketBuilder HarryPotter = new PacketBuilder(209845 T.Players.Count 11);
            
uint Id1 0Id2 0Id3 0Id4 0Id5 0Id6 0byte Counter 0;
            foreach (
PokerPlayer Pl in T.Players.Values)
            {
                
Counter++;
                if (
Counter == 1Id1 Pl.PlayerId;
                else if (
Counter == 2Id2 Pl.PlayerId;
                else if (
Counter == 3Id3 Pl.PlayerId;
                else if (
Counter == 4Id4 Pl.PlayerId;
                else if (
Counter == 5Id5 Pl.PlayerId;
                else if (
Counter == 6Id6 Pl.PlayerId;
            }
            
HarryPotter.Short(0);
            
HarryPotter.Int(T.Players.Count);//Players Count
            
HarryPotter.Int(CountDown);//Time Count Down
            
HarryPotter.Int(0);
            
HarryPotter.Short(0);
            
HarryPotter.Long(0);
            
HarryPotter.Long(0);
            
HarryPotter.Long(Id1);
            
HarryPotter.Long(Id2);

            
HarryPotter.Long(Id3);
            
HarryPotter.Long(Id4);
            
HarryPotter.Long(Id5);
            
HarryPotter.Long(Id6);
            
HarryPotter.Short(0);
            foreach (
PokerPlayer Pl in T.Players.Values)
            {
                
HarryPotter.Int(2);
                
HarryPotter.Int(4);
                
HarryPotter.Int(13);
                
HarryPotter.Int(0);
                
HarryPotter.Int(4);
                
HarryPotter.Int(13);
                
HarryPotter.Int(0);

                
HarryPotter.Long(Pl.PlayerId);
            }
            return 
HarryPotter.getFinal();
        }
    }
    public class 
PokerTable
    
{
        public 
uint Pis 0;
        public 
uint Pis1 0;
        public 
uint Pis2 0;
        public 
uint Id 0;
        public 
byte Nomber 0;
        public 
uint Map 0;
        public 
ushort X 0;
        public 
ushort Y 0;
        public 
uint MinLimit 100000;
        public 
bool FreeBet true;
        public 
byte _State = (byte)PokerTableState.UnOpened;
        public 
byte StartSeat 0;
        public 
byte CurrentSeat 0;
        public 
uint _StartingPlayer 0;
        public 
byte RoundStage 0;
        public 
uint RoundMaxBet 0;
        public 
System.Timers.Timer RoundTimer = new System.Timers.Timer();
        public 
System.Timers.Timer MoveTimer = new System.Timers.Timer();
        public 
PokerTableState State
        
{
            
get
            
{
                return (
PokerTableState)_State;
            }
            
set
            
{
                
_State = (byte)value;
            }
        }
        public 
uint Pot 0;
        public 
byte BetType 1;//Silver=0 CPs=1;
        
public Dictionary<uintPokerPlayerPlayers = new Dictionary<uintPokerPlayer>(10);
        public 
Dictionary<bytePokerPlayerSeats
        
{
            
get
            
{
                
Dictionary<bytePokerPlayerSes = new Dictionary<bytePokerPlayer>(10);
                foreach (
PokerPlayer P in Players.Values)
                {
                    if (
P.CurrentState == 1Ses.Add(P.SeatP);
                }
                return 
Ses;
            }
        }
        public 
Dictionary<uintPokerPlayerWatchers = new Dictionary<uintPokerPlayer>(10);
        public 
Dictionary<bytePokerCardCards = new Dictionary<bytePokerCard>(52);
        public 
Dictionary<bytePokerCardTableCards = new Dictionary<bytePokerCard>(5);
        public 
uint PlayerBySeat(byte S)
        {
            
uint I 0;
            foreach (
PokerPlayer P in Players.Values)
                if (
P.Seat == SP.PlayerId;
            return 
I;
        }
        public 
uint GetStartingPlayer()
        {
            if (
Players.Count 2) return 0;
            
uint I 0;
            
StartSeat++;
            if (
StartSeat 9StartSeat 0;
            for (
byte x StartSeat10x++)
            {
                
PlayerBySeat(x);
                if (
0)
                {
                    
StartSeat x;
                    break;
                }
            }
            if (
== 0)
            {
                for (
byte x 0StartSeatx++)
                {
                    
PlayerBySeat(x);
                    if (
0)
                    {

                        
StartSeat x;
                        break;
                    }
                }
            }
            return 
I;
        }
        public 
PokerPlayer StartingPlayer
        
{
            
get
            
{
                if (
Players.ContainsKey(_StartingPlayer))
                    return 
Players[_StartingPlayer];
                else return 
null;
            }
        }
        public 
uint GetNextPlayer()
        {
            if (
Players.Count 2) return 0;
            
uint I 0byte StartSe StartSeat;
            if (
StartSe 9StartSe 0;
            for (
byte x StartSe10x++)
            {
                
PlayerBySeat(x);
                if (
0)
                {
                    if (
== GetLastPlayer()) continue;
                    break;
                }
            }
            if (
== 0)
            {
                for (
byte x 0StartSex++)
                {
                    
PlayerBySeat(x);
                    if (
0)
                    {
                        if (
== GetLastPlayer()) continue;
                        break;
                    }
                }
            }
            return 
I;
        }
        public 
uint GetLastPlayer()
        {
            if (
Players.Count 2) return 0;
            
uint I 0byte CurrentSeat StartSeat;
            if (
CurrentSeat 1CurrentSeat 9;
            for (
byte x CurrentSeat0x--)
            {
                
PlayerBySeat(x);
                if (
0)
                {
                    break;
                }
            }
            if (
== 0)
            {
                if (
PlayerBySeat(0) > 0) return PlayerBySeat(0);
                for (
byte x 9StartSeatx--)
                {
                    
PlayerBySeat(x);
                    if (
0)
                    {
                        break;
                    }
                }
            }
            return 
I;
        }
        public 
void SetNewRound(byte CountDown)
        {
            
Dictionary<uintPokerPlayerNotConnectedAnymore = new Dictionary<uintPokerPlayer>();
            foreach (
PokerPlayer P in Players.Values)
            {
                if (!
P.ConnectedNotConnectedAnymore.Add(P.PlayerIdP);
                else if (
P.CurrentState == 2)
                    if (!
Watchers.ContainsKey(P.PlayerId))
                        
Watchers.Add(P.PlayerIdP);
            }
            foreach (
PokerPlayer P in NotConnectedAnymore.Values)
                
RemovePlayer(P.PlayerId);
            foreach (
PokerPlayer P in Watchers.Values)
            {
                if (
P.CurrentState == 3)
                {
                    if (!
Players.ContainsKey(P.PlayerId))
                        
Players.Add(P.PlayerIdP);
                }
                else if (
P.CurrentState == 2)
                {
                    if (
Players.ContainsKey(P.PlayerId))
                        
Players.Remove(P.PlayerId);
                }
            }
            foreach (
PokerPlayer P in Players.Values)
            {
                if (
Watchers.ContainsKey(P.PlayerId))
                    
Watchers.Remove(P.PlayerId);
                
P.MyCards.Clear();
                
P.CurrentState 1;
                
P.RoundState 0;
                
P.HandVals "";
                
P.Bet MinLimit;
                if (
BetType == 0)
                {
                    if (
P.MyChar.Money >= MinLimit)
                        
P.MyChar.Money -= MinLimit;
                    else 
P.MyChar.Money 0;
                }
                else if (
BetType == 1)
                {
                    if (
P.MyChar.ConquerPoints >= MinLimit)
                        
P.MyChar.ConquerPoints -= MinLimit;
                    else 
P.MyChar.ConquerPoints 0;
                }
            }
            
Cards.Clear();
            
TableCards.Clear();
            
RoundStage 0;
            for (
byte Y 04Y++)
            {
                
PokerCardsType T PokerCardsType.Hearts;
                if (
== 1PokerCardsType.Spades;
                else if (
== 2PokerCardsType.Clubs;
                else if (
== 3PokerCardsType.Diamonds;
                for (
byte x 013x++)
                {
                    
PokerCard Pc = new PokerCard();
                    
Pc.Id = (byte)(+ (13 Y));
                    
Pc.Typ T;
                    
Pc.Val x;
                    
Cards.Add(Pc.IdPc);
                }
            }
            if (
RoundTimer != null && RoundTimer.Enabled)
            {
                
RoundTimer.Stop();
                
RoundTimer.Dispose();
                
RoundTimer null;
                
RoundTimer = new System.Timers.Timer();
            }
            else if (
RoundTimer == null)
            {
                
RoundTimer = new System.Timers.Timer();
            }
            
RoundTimer.Interval CountDown 1000;
            
RoundTimer.Elapsed += delegate
            
{
                if (
Players.Count && Pot 1)
                {
                    
DrawCards(1false);
                    
Pot MinLimit;
                    
RoundMaxBet MinLimit;
                    
_StartingPlayer GetStartingPlayer();
                    
SendToAll(PokerPackets.PokerCards1Card(this));
                    
DrawCards(1false);
                    foreach (
PokerPlayer Pl in Players.Values)
                    {
                        
Pl.Bet MinLimit;
                        
Pl.Send(PokerPackets.PokerCards2Cards(thisPl.MyCards));
                    }
                    
SendToAll(PokerPackets.PokerPlayerTurn(_StartingPlayerMinLimitMinLimit 23820));
                    
StartMoveTimer(30_StartingPlayer);
                    
RoundTimer.Stop();
                    
RoundTimer.Dispose();
                     
RoundTimer null;
                }
            };
            
RoundTimer.Start();
            
SendToAll(PokerPackets.PokerPlayerTurn(0000CountDown));
            
Data D = new Data(true);
            
D.ID 234;
            
D.UID Id;
            
D.dwParam = (uint)(MinLimit Players.Count);
            
SendToAll(D.ToArray());
        }
        public 
void StartMoveTimer(byte CountDownuint PlayerId)
        {
            if (
MoveTimer != null && MoveTimer.Enabled)
            {
                
MoveTimer.Stop();
                
MoveTimer.Dispose();
            }
            
MoveTimer = new System.Timers.Timer();
            
MoveTimer.Interval CountDown 1000;
            
MoveTimer.Elapsed += delegate
            
{
                
byte[] FoldMe = new byte[10];
                
FoldMe[6] = 4;
                
NewPlayerMove(FoldMePlayerId);
                
MoveTimer.Stop();
                
MoveTimer.Dispose();
            };
            
MoveTimer.Start();
        }
        public 
bool FreeSeat(byte Seat)
        {
            
bool Free true;
            foreach (
PokerPlayer P in Players.Values)
            {
                if (
P.Seat == SeatFree false;
            }
            foreach (
PokerPlayer P in Watchers.Values)
            {
                if (
P.CurrentState == 3)
                    if (
P.Seat == SeatFree false;
            }
            return 
Free;
        }
        public 
void AddNewPlayer(Entity Pbyte Seatbool Player)
        {
            
P.PokerTable this.Id;
            
PokerPlayer Pl = new PokerPlayer();
            
Pl.PlayerId P.UID;
            
Pl.TableId Id;
            
Pl.Seat Seat;
            if (
Player)
            {
                if (
Pot 0Pl.RoundState 4;
                if (!
Players.ContainsKey(Pl.PlayerId))
                    
Players.Add(Pl.PlayerIdPl);
                
ToLocal(PokerPackets.PokerTable(this));
            }
            else
            {
                if (!
Watchers.ContainsKey(Pl.PlayerId))
                    
Watchers.Add(Pl.PlayerIdPl);
            }
        }
        public 
void RemovePlayer(uint Id)
        {
            if (
Players.ContainsKey(Id))
            {
                try
                {
                    
lock (Players)
                    {
                        foreach (
PokerPlayer P in Players.Values)
                        {
                            
P.Send(PokerPackets.PokerLeaveTable(Id));
                        }
                    }
                    
lock (Watchers)
                    {
                        foreach (
PokerPlayer P in Watchers.Values)
                        {
                            
P.Send(PokerPackets.PokerLeaveTable(Id));
                        }
                    }
                    if (
Players[Id].MyChar != null)
                        
Players[Id].MyChar.PokerTable 0;
                    
Players.Remove(Id);
                }
                catch { }
            }
            else if (
Watchers.ContainsKey(Id))
            {
                
lock (Players)
                {
                    foreach (
PokerPlayer P in Players.Values)
                        
P.Send(PokerPackets.PokerLeaveTable(Id));
                }
                
lock (Watchers)
                {
                    foreach (
PokerPlayer P in Watchers.Values)
                        
P.Send(PokerPackets.PokerLeaveTable(Id));
                }
                if (
Watchers[Id].MyChar != null)
                    
Watchers[Id].MyChar.PokerTable 0;
                
Watchers.Remove(Id);
            }
            
ToLocal(PokerPackets.PokerLeaveTable(Id));
            
ToLocal(PokerPackets.PokerTable(this));
        }
        public 
void SendToAll(byte[] P)
        {
            foreach (
PokerPlayer Player in Players.Values)
                
Player.Send(P);
            foreach (
PokerPlayer Player in Watchers.Values)
                
Player.Send(P);
        }
        public 
PokerCard GetNewCard()
        {
            
Random Rand = new Random();
            
PokerCard PC = new PokerCard();
            
int Rnd Rand.Next(52);
            
PC.Id = (byte)Rnd;
            while (!
Cards.ContainsKey(PC.Id))
            {
                
PC.Id = (byte)Rand.Next(52);
            }
            
PC Cards[PC.Id];
            return 
PC;
        }
        public 
void DrawCards(byte Countbool Table)
        {
            try
            {
                if (!
Table)
                {
                    for (
byte x 0Countx++)
                    {
                        foreach (
PokerPlayer P in Players.Values)
                        {
                            if (!
P.Connected) continue;
                            if (
P.CurrentState 1) continue;
                            
PokerCard C GetNewCard();
                            
C.PlayerId P.PlayerId;
                            
P.MyCards.Add(C.IdC);
                            if (
Cards.ContainsKey(C.Id)) Cards.Remove(C.Id);
                        }
                    }
                    return;
                }
                
byte Co = (byte)TableCards.Count;
                for (
byte x Co< (byte)(Count Co); x++)
                {
                    
PokerCard C GetNewCard();
                    
C.PlayerId 0;
                    
TableCards.Add(xC);
                    if (
Cards.ContainsKey(C.Id)) Cards.Remove(C.Id);
                }
            }
            catch (
Exception xp) { Console.WriteLine(xp.ToString()); }
        }
        public static 
int Allin 0;
        
int HarryPotter 0;
        public 
void NewPlayerMove(byte[] Puint PlayerId)
        {
            if (
Pot == 0) return;
            try
            {
                if (
Players.ContainsKey(PlayerId))
                {
                    if (
MoveTimer != null && MoveTimer.Enabled)
                    {
                        
MoveTimer.Stop();
                        
MoveTimer.Dispose();
                    }
                    
PokerPlayer Pl Players[PlayerId];
                    
byte Move P[6]; byte CSeat Pl.Seat;
                    
Pl.RoundState Move;
                    
uint ReqPot Pot;
                    switch (
Move)
                    {
                        
#region Rise
                        
case 2://call
                            
{
                                
Pot += MinLimit;
                                
Pl.Bet += MinLimit;
                                if (
Pl.Bet RoundMaxBetRoundMaxBet Pl.Bet;
                                if (
BetType == 0)
                                    
Pl.MyChar.Money -= MinLimit;
                                else if (
BetType == 1)
                                {
                                    if (
Pl.MyChar.ConquerPoints >= MinLimit)
                                        
Pl.MyChar.ConquerPoints -= MinLimit;
                                    else 
Pl.MyChar.ConquerPoints 0;
                                }
                                
Data D = new Data(true);
                                
D.ID 234;
                                
D.UID Id;
                                
D.dwParam Pot;
                                
SendToAll(D.ToArray());
                                
SendToAll(PokerPackets.PokerPlayerMove(PlayerIdMovePl.BetPot));
                                break;
                            }
                        case 
8:
                            {

                                break;
                            }
                        case 
16://Rise
                            
{
                                
uint Botting MinLimit MinLimit;
                                
Pot += Botting;
                                
Pl.Bet += Botting;
                                if (
Pl.Bet RoundMaxBetRoundMaxBet Pl.Bet;
                                if (
BetType == 0)
                                    
Pl.MyChar.Money -= Botting;
                                else if (
BetType == 1)
                                {
                                    if (
Pl.MyChar.ConquerPoints >= Botting)
                                        
Pl.MyChar.ConquerPoints -= Botting;
                                    else 
Pl.MyChar.ConquerPoints 0;
                                }
                                
Data D = new Data(true);
                                
D.ID 234;
                                
D.UID Id;
                                
D.dwParam Pot;
                                
D.Data24_Uint RoundMaxBet;
                                
SendToAll(D.ToArray());
                                
SendToAll(PokerPackets.PokerPlayerMove(PlayerIdMovePl.BetPot));
                                break;
                            }
                        
#endregion
                        #region Fold
                        
case 4:
                            {
                                if (
P[9] == 200)
                                {
                                    
//RemoveThis = true;
                                    
RemovePlayer(PlayerId);
                                }
                                else if (
Players.ContainsKey(PlayerId))
                                {
                                    
SendToAll(PokerPackets.PokerPlayerMove(PlayerIdMoveMinLimitPot));
                                    
Players[PlayerId].MyCards.Clear();
                                    
Players[PlayerId].RoundState 4;
                                }
                                break;
                            }
                        default: 
SendToAll(P); break;
                        
#endregion
                        #region AllIn
                        
case 32:
                            {
                                
uint Betting 0;
                                if (
HarryPotter == 0)
                                    
Pis Pl.MyChar.Money;
                                if (
HarryPotter == 1)
                                    
Pis1 Pl.MyChar.Money;
                                if (
BetType == 0)
                                {
                                    
Betting = (uint)Pl.MyChar.Money;
                                    
Pl.MyChar.Money 0;
                                }
                                else if (
BetType == 1)
                                {
                                    
Betting = (uint)Pl.MyChar.ConquerPoints;
                                    
Pl.MyChar.ConquerPoints 0;
                                }
                                
Pot += Betting;
                                
Pl.Bet += Betting;
                                if (
Pl.Bet RoundMaxBetRoundMaxBet Pl.Bet;
                                
Allin++;
                                
Data D = new Data(true);
                                
D.ID 234;
                                
D.UID Id;
                                
D.dwParam Pot;
                                
D.Data24_Uint RoundMaxBet;
                                
SendToAll(D.ToArray());
                                
SendToAll(PokerPackets.PokerPlayerMove(PlayerIdMovePl.BetPot));
                                break;
                            }
                        
#endregion
                    
}
                    
uint NextPlayer GetNextSeat(CSeattrue);
                    if (
Allin >= 1)
                    {
                        
HarryPotter++;
                        if (
Players.Count == HarryPotter)
                        {
                            
#region Send First 3 table cards
                            
if (TableCards.Count 3)
                            {
                                
DrawCards(3true);
                                
Dictionary<bytePokerCardTC = new Dictionary<bytePokerCard>(3);
                                
TC.Add(0TableCards[0]);
                                
TC.Add(1TableCards[1]);
                                
TC.Add(2TableCards[2]);
                                
SendToAll(PokerPackets.PokerTableCards(TCthis1));
                            }
                            
#endregion
                            #region Send Forth table card
                            
if (TableCards.Count 4)
                            {
                                
DrawCards(1true);
                                
Dictionary<bytePokerCardTC = new Dictionary<bytePokerCard>(1);
                                if (
TableCards.ContainsKey(3))
                                    
TC.Add(3TableCards[3]);
                                
SendToAll(PokerPackets.PokerTableCards(TCthis2));
                            }
                            
#endregion
                            #region Send Fifth table cards
                            
if (TableCards.Count 5)
                            {
                                
DrawCards(1true);
                                
Dictionary<bytePokerCardTC = new Dictionary<bytePokerCard>(1);
                                if (
TableCards.ContainsKey(4))
                                    
TC.Add(4TableCards[4]);
                                
SendToAll(PokerPackets.PokerTableCards(TCthis3));
                            }
                            
#endregion
                            
EndRound(0u);
                            
HarryPotter 0;
                        }
                    }
                    else
                    {
                        if (
Players.Count HarryPotter)
                            
HarryPotter Players.Count;
                        else
                            
HarryPotter++;
                    }
                    
Console.WriteLine(HarryPotter);
                    
#region No More Players available
                    
if (NextPlayer == Pl.PlayerId)
                    {
                        
EndRound(NextPlayer);
                        return;
                    }
                    else if (
Players.ContainsKey(NextPlayer) &&  NextPlayer == GetNextSeat(Players[NextPlayer].Seatfalse))
                    {
                        
EndRound(NextPlayer);
                        return;
                    }
                    
#endregion
                    
switch (RoundStage)
                    {
                        
#region Send First 3 table cards
                        
case 1:
                            {
                                if (
TableCards.Count 3)
                                {
                                    
DrawCards(3true);
                                    
Dictionary<bytePokerCardTC = new Dictionary<bytePokerCard>(3);
                                    
TC.Add(0TableCards[0]);
                                    
TC.Add(1TableCards[1]);
                                    
TC.Add(2TableCards[2]);
                                    
SendToAll(PokerPackets.PokerTableCards(TCthis1));
                                }
                                break;
                            }
                        
#endregion
                        #region Send Forth table card
                        
case 2:
                            {
                                if (
TableCards.Count 4)
                                {
                                    
DrawCards(1true);
                                    
Dictionary<bytePokerCardTC = new Dictionary<bytePokerCard>(1);
                                    if (
TableCards.ContainsKey(3))
                                        
TC.Add(3TableCards[3]);
                                    
SendToAll(PokerPackets.PokerTableCards(TCthis2));
                                }
                                break;
                            }
                        
#endregion
                        #region Send Fifth table cards
                        
case 3:
                            {
                                if (
TableCards.Count 5)
                                {
                                    
DrawCards(1true);
                                    
Dictionary<bytePokerCardTC = new Dictionary<bytePokerCard>(1);
                                    if (
TableCards.ContainsKey(4))
                                        
TC.Add(4TableCards[4]);
                                    
SendToAll(PokerPackets.PokerTableCards(TCthis3));
                                }
                                break;
                            }
                        
#endregion
                        
case 4:
                            {
                                
EndRound(0);
                                return;
                            }
                    }
                    if (
this.RoundStage != 4)
                    {
                        
byte b3 36;
                        
bool flag false;
                        if (
this.Players.ContainsKey(NextPlayer))
                        {
                            
uint bet this.Players[NextPlayer].Bet;
                            
PokerPlayer pokerPlayer2 this.Players[NextPlayer];
                            if (
this.RoundMaxBet bet)
                            {
                                
b3 += 8;
                            }
                            else
                            {
                                
b3 += 2;
                            }
                            if (
this.BetType == 0)
                            {
                                if (
pokerPlayer2.MyChar.Money this.RoundMaxBet)
                                {
                                    
flag true;
                                }
                                else
                                {
                                    if (
pokerPlayer2.MyChar.Money this.MinLimit)
                                    {
                                        
flag true;
                                    }
                                }
                                if (
pokerPlayer2.MyChar.Money >= this.MinLimit 2u)
                                {
                                    
b3 += 16;
                                }
                            }
                            else
                            {
                                if (
this.BetType == 1)
                                {
                                    if (
pokerPlayer2.MyChar.ConquerPoints this.RoundMaxBet)
                                    {
                                        
flag true;
                                    }
                                    else
                                    {
                                        if (
pokerPlayer2.MyChar.ConquerPoints this.MinLimit)
                                        {
                                            
flag true;
                                        }
                                    }
                                    if (
pokerPlayer2.MyChar.ConquerPoints >= this.MinLimit 2u)
                                    {
                                        
b3 += 16;
                                    }
                                }
                            }
                        }
                        if (
flag)
                        {
                            
b3 32;
                        }
                        
SendToAll(PokerPackets.PokerPlayerTurn(NextPlayerMinLimitRoundMaxBetb330));
                        
StartMoveTimer(30NextPlayer);
                    }
                }
            }
            catch (
Exception xp) { Console.WriteLine(xp.ToString()); }
        }
        public 
void EndRound(uint WinnerId)
        {
            
SendToAll(PokerPackets.PokerPlayerTurn(000030));
            try
            {
                if (
MoveTimer != null || MoveTimer.Enabled)
                {
                    
MoveTimer.Stop();
                    
MoveTimer.Dispose();
                }
            }
            catch { }
            
uint num Pot - (Pot 10);
            
#region Check Winner
            
if (WinnerId == 0)
            {
                
ushort HighestPower 0;
                
ulong HighestHandPower 0;
                
SendToAll(PokerPackets.PokerShowAllCards(this));
                foreach (
PokerPlayer Pla in Players.Values)
                {
                    if (
Pla.RoundState == || !Pla.Connected) continue;
                    
ulong HP GetHandPower(Pla.MyCardsPla);
                    if (
HP HighestHandPower)
                    {
                        
HighestHandPower HP;
                        
WinnerId Pla.PlayerId;
                        
HighestPower Pla.GetFullPower(Pla.MyCards);
                    }
                    else if (
HP == HighestHandPower)
                    {
                        if (
Pla.GetFullPower(Pla.MyCards) > HighestPower)
                        {
                            
WinnerId Pla.PlayerId;
                            
HighestPower Pla.GetFullPower(Pla.MyCards);
                        }
                    }
                }
            }
            
#endregion
            
if (this.Players.ContainsKey(WinnerId))
            {
                if (
this.BetType == 0)
                {
                    
#region Drop Allin
                    
if (Pis Pis1 && Allin >= 2)
                    {
                        foreach (
PokerPlayer current in this.Players.Values)
                        {
                            if (
current.PlayerId != WinnerId// 1 - loss - low
                            
{
                                
this.Players[current.PlayerId].MyChar.Money += 0;
                            }
                            else if (
current.PlayerId == WinnerId)// 1 - win - great
                            
{
                                
this.Players[current.PlayerId].MyChar.Money += num;
                                
this.SendToAll(PokerPackets.PokerRoundResult(thisWinnerIdnum Pis));
                            }
                        }
                    }
                    else if (
Allin >= 2)
                    {
                        foreach (
PokerPlayer current in this.Players.Values)// 2 - win - low
                        
{
                            if (
current.PlayerId != WinnerId)// 2 - loss - great
                            
{
                                
this.Players[current.PlayerId].MyChar.Money Pis1 Pis;
                            }
                            else if (
current.PlayerId == WinnerId)// 2 - win - low
                            
{
                                
this.Players[current.PlayerId].MyChar.Money += Pis 2;
                                
this.SendToAll(PokerPackets.PokerRoundResult(thisWinnerIdPis));
                            }
                        }
                    }
                    else
                    {
                        
this.Players[WinnerId].MyChar.Money += num;
                        
this.SendToAll(PokerPackets.PokerRoundResult(thisWinnerIdnum));
                    }
                    
#endregion
                
}
                else
                {
                    if (
this.BetType == 1)
                    {
                        
this.Players[WinnerId].MyChar.ConquerPoints += num;
                    }
                }
            }
            
Pot 0;
            
#region Start new round
            
if (Players.Count 2) return;
            else
            {
                
Pot 0;
                
SetNewRound(15);

            }
            
#endregion
        
}
        public 
void ToLocal(byte[] P)
        {
            
Client.GameState[] Locals = new Client.GameState[Program.Values.Length];
            
Locals Kernel.GamePool.Values.ToArray();
            foreach (
Client.GameState client in Locals)
            {
                if (
client != null)
                {
                    if (
client.Map.ID == Map)
                    {
                        if (
Kernel.GetDistance(client.Entity.Xclient.Entity.YXY) > 25)
                        {
                            continue;
                        }
                        
client.Send(P);
                    }

                }
            }
        }
        public 
uint GetNextSeat(byte Seatbool Next)
        {
            try
            {
                
Dictionary<bytePokerPlayerSes Seats;
                
uint Id 0;
                
byte Se = (byte)(Seat 1);
                
bool Found false;
                while (!
Found)
                {
                    if (
Ses.ContainsKey(Se))
                    {
                        if (
Ses[Se].RoundState == || !Ses[Se].Connected) { }
                        else
                        {
                            
Found true;
                            break;
                        }
                    }
                    
Se++;
                    if (
Se 9Se 0;
                }
                
Id Ses[Se].PlayerId;
                if (
Id == _StartingPlayer && NextRoundStage++;
                return 
Id;
            }
            catch (
Exception xp) { Console.WriteLine(xp.ToString()); return 0; }
        }
        public 
ulong GetHandPower(Dictionary<bytePokerCardhandPokerPlayer Pl)
        {
            
ulong _hand 0;
            
ulong board 0;
            foreach (var 
item in hand.Values)
            {
                
_hand |= HoldemHand.Hand.CardMasksTable[item.Id];
            }
            foreach (var 
item in this.TableCards.Values)
            {
                
board |= HoldemHand.Hand.CardMasksTable[item.Id];
            }
            return 
HoldemHand.Hand.Evaluate((ulong)(board _hand));
        }
        public 
bool IsRoyal(string HandVals)
        {
            if (
HandVals.Contains("89ABC")) return true;
            else return 
false;
        }
        public 
bool IsStraight(string HandVals)
        {
            
bool Straight false;
            
string V HandVals;
            if (
V.Contains("01234") || V.Contains("12345") || V.Contains("23456")) Straight true;
            else if (
V.Contains("34567") || V.Contains("45678") || V.Contains("56789")) Straight true;
            else if (
V.Contains("6789A") || V.Contains("789AB") || V.Contains("89ABC")) Straight true;
            else if (
V.Contains("C0123")) Straight true;
            return 
Straight;
        }
        public 
bool IsFourOfAKind(string HandVals)
        {
            
bool Yes false;
            
string V HandVals;
            if (
V.Contains("0123") || V.Contains("1234") || V.Contains("2345")) Yes true;
            else if (
V.Contains("3456") || V.Contains("4567") || V.Contains("5678")) Yes true;
            else if (
V.Contains("6789") || V.Contains("789A") || V.Contains("89AB")) Yes true;
            else if (
V.Contains("9ABC") || V.Contains("C012")) Yes true;
            else if (
V.Contains("0000") || V.Contains("1111") || V.Contains("2222")) Yes true;
            else if (
V.Contains("3333") || V.Contains("4444") || V.Contains("5555")) Yes true;
            else if (
V.Contains("6666") || V.Contains("7777") || V.Contains("8888")) Yes true;
            else if (
V.Contains("9999") || V.Contains("AAAA") || V.Contains("BBBB")) Yes true;
            else if (
V.Contains("CCCC")) Yes true;
            return 
Yes;
        }
        public 
bool IsThreeOfAKind(PokerPlayer Pl)
        {
            
bool Yes false;
            
string V Pl.HandVals;
            if (
V.Contains("012") || V.Contains("123") || V.Contains("234")) Yes true;
            else if (
V.Contains("345") || V.Contains("456") || V.Contains("567")) Yes true;
            else if (
V.Contains("678") || V.Contains("789") || V.Contains("89A")) Yes true;
            else if (
V.Contains("9AB") || V.Contains("ABC") || V.Contains("C01")) Yes true;
            else if (
V.Contains("000") || V.Contains("111") || V.Contains("222")) Yes true;
            else if (
V.Contains("333") || V.Contains("444") || V.Contains("555")) Yes true;
            else if (
V.Contains("666") || V.Contains("777") || V.Contains("888")) Yes true;
            else if (
V.Contains("999") || V.Contains("AAA") || V.Contains("BBB")) Yes true;
            else if (
V.Contains("CCC")) Yes true;
            if (
V.Contains("CCC")) V.Replace("CCC""");
            else if (
V.Contains("BBB")) V.Replace("BBB""");
            else if (
V.Contains("AAA")) V.Replace("AAA""");
            else if (
V.Contains("999")) V.Replace("999""");
            else if (
V.Contains("888")) V.Replace("888""");
            else if (
V.Contains("777")) V.Replace("777""");
            else if (
V.Contains("666")) V.Replace("666""");
            else if (
V.Contains("555")) V.Replace("555""");
            else if (
V.Contains("444")) V.Replace("444""");
            else if (
V.Contains("333")) V.Replace("333""");
            else if (
V.Contains("222")) V.Replace("222""");
            else if (
V.Contains("111")) V.Replace("111""");
            else if (
V.Contains("000")) V.Replace("000""");
            else if (
V.Contains("ABC")) V.Replace("ABC""");
            else if (
V.Contains("C01")) V.Replace("C01""");
            else if (
V.Contains("9AB")) V.Replace("9AB""");
            else if (
V.Contains("89A")) V.Replace("89A""");
            else if (
V.Contains("789")) V.Replace("789""");
            else if (
V.Contains("678")) V.Replace("678""");
            else if (
V.Contains("567")) V.Replace("567""");
            else if (
V.Contains("456")) V.Replace("456""");
            else if (
V.Contains("345")) V.Replace("345""");
            else if (
V.Contains("234")) V.Replace("234""");
            else if (
V.Contains("123")) V.Replace("123""");
            else if (
V.Contains("012")) V.Replace("012""");
            
Pl.HandVals V;
            return 
Yes;
        }
        public 
bool IsPair(PokerPlayer Pl)
        {
            
bool Yes false;
            
string V Pl.HandVals;
            if (
V.Contains("01") || V.Contains("12") || V.Contains("23")) Yes true;
            else if (
V.Contains("34") || V.Contains("45") || V.Contains("56")) Yes true;
            else if (
V.Contains("67") || V.Contains("78") || V.Contains("89")) Yes true;
            else if (
V.Contains("9A") || V.Contains("AB") || V.Contains("BC")) Yes true;
            else if (
V.Contains("C0")) Yes true;
            else if (
V.Contains("00") || V.Contains("11") || V.Contains("22")) Yes true;
            else if (
V.Contains("33") || V.Contains("44") || V.Contains("55")) Yes true;
            else if (
V.Contains("66") || V.Contains("77") || V.Contains("88")) Yes true;
            else if (
V.Contains("99") || V.Contains("AA") || V.Contains("BB")) Yes true;
            else if (
V.Contains("CC")) Yes true;
            if (
V.Contains("CC")) V.Replace("CC""");
            else if (
V.Contains("BB")) V.Replace("BB""");
            else if (
V.Contains("AA")) V.Replace("AA""");
            else if (
V.Contains("99")) V.Replace("99""");
            else if (
V.Contains("88")) V.Replace("88""");
            else if (
V.Contains("77")) V.Replace("77""");
            else if (
V.Contains("66")) V.Replace("66""");
            else if (
V.Contains("55")) V.Replace("55""");
            else if (
V.Contains("44")) V.Replace("44""");
            else if (
V.Contains("33")) V.Replace("33""");
            else if (
V.Contains("22")) V.Replace("22""");
            else if (
V.Contains("11")) V.Replace("11""");
            else if (
V.Contains("00")) V.Replace("00""");
            else if (
V.Contains("BC")) V.Replace("BC""");
            else if (
V.Contains("AB")) V.Replace("AB""");
            else if (
V.Contains("C0")) V.Replace("C0""");
            else if (
V.Contains("9A")) V.Replace("9A""");
            else if (
V.Contains("89")) V.Replace("89""");
            else if (
V.Contains("78")) V.Replace("78""");
            else if (
V.Contains("67")) V.Replace("67""");
            else if (
V.Contains("56")) V.Replace("56""");
            else if (
V.Contains("45")) V.Replace("45""");
            else if (
V.Contains("34")) V.Replace("34""");
            else if (
V.Contains("23")) V.Replace("23""");
            else if (
V.Contains("12")) V.Replace("12""");
            else if (
V.Contains("01")) V.Replace("01""");
            
Pl.HandVals V;
            return 
Yes;
        }
    }
    public class 
PokerPlayer
    
{
        public 
uint TableId 0;
        public 
uint PlayerId 0;
        public 
bool Connected true;
        public 
byte CurrentState 1;
        public 
byte RoundState 0;
        public 
uint Bet 0;
        public 
byte Seat 0;
        public 
byte CardsPower 0;
        public 
string HandVals "";
        public 
System.Timers.Timer MoveTimer = new System.Timers.Timer();
        public 
ushort GetFullPower(Dictionary<bytePokerCardTCards)
        {
            
ushort P 0;
            foreach (
PokerCard C in MyCards.Values)
            {
                
+= (ushort)(C.Id);
            }
            return 
P;
        }
        public 
Dictionary<bytePokerCardMyCards = new Dictionary<bytePokerCard>(5);
        public 
Entity MyChar
        
{
            
get
            
{
                if (
Kernel.GamePool.ContainsKey(PlayerId))
                    return 
Kernel.GamePool[PlayerId].Entity;
                else { 
Connected false; return null; }
            }
            
set
            
{
                
PlayerId value.UID;
            }
        }
        public 
PokerTable MyTable
        
{
            
get
            
{
                if (
Kernel.PokerTables.ContainsKey(TableId)) return Kernel.PokerTables[TableId];
                else return 
null;
            }
            
set
            
{
                
TableId value.Id;
            }
        }
        public 
void Send(byte[] P)
        {
            if (!
Connected)
            {
                if (
Kernel.PokerTables.ContainsKey(TableId))
                {
                    if (
Kernel.PokerTables[TableId].Players.ContainsKey(PlayerId))
                        
Kernel.PokerTables[TableId].Players[PlayerId].RoundState 4;
                    return;
                }
            }
            if (
Kernel.GamePool.ContainsKey(PlayerId))
                
Kernel.GamePool[PlayerId].Send(P);
            else
            {
                
Connected false;
                if (
Kernel.PokerTables.ContainsKey(TableId))
                {
                    if (
Kernel.PokerTables[TableId].Players.ContainsKey(PlayerId))
                        
Kernel.PokerTables[TableId].Players[PlayerId].RoundState 4;
                }
            }
        }
    }
    public class 
PokerCard
    
{
        public 
byte Id 0;
        public 
uint PlayerId;
        public 
byte Val 0;
        public 
PokerCardsType Typ PokerCardsType.Clubs;

    }

    public 
enum PokerTableState byte
    
{
        
UnOpened 0,
        
Pocket 1,
        
Flop 2,
        
Turn 3,
        
River 4,
        
ShowDown 5
    
}
    public 
enum PokerJoinTableType byte
    
{
        
Join 0,
        
Leave 1,
        
Watching 2
    
}
    public 
enum PokerCardsType byte
    
{
        
Hearts 0,
        
Spades 1,
        
Clubs 2,
        
Diamonds 3
    
}
    public 
enum PokerCardsValue byte
    
{
        
Ace 1,
        
Two 2,
        
Three 3,
        
Four 4,
        
Five 5,
        
Six 6,
        
Seven 7,
        
Eight 8,
        
Nine 9,
        
Ten 10,
        
Jack 11,
        
Queen 12,
        
King 13,
    }
    public 
enum PokerHandPower byte
    
{
        
RoyalFlush 10,
        
StraightFlush 9,
        
FourofaKind 8,
        
FullHouse 7,
        
Flush 6,
        
Straight 5,
        
ThreeOfAKind 4,
        
TwoPairs 3,
        
Pair 2,
        
Nothing 1
    
}
    public 
enum PokerCallTypes byte
    
{
        
Bet 1,
        
Call 2,
        
Fold 4,
        
Check 8,
        
Rise 16,
        
AllIn 32,
        
CallFold 6,
        
CheckFold 12,
        
RiseCall 18,
        
RiseFold 20,
        
RiseCallFold 22,
        
RiseCheck 24,
        
AllInCall 34,
        
AllInFold 36,
        
AllInCallFold 38,
    }

    public class 
PacketBuilder
    
{
        protected 
byte[] _buffer = new byte[1024];
        protected 
int Position 0;
        protected 
int Len 0;
        protected 
byte[] TQ_SERVER Program.Encoding.GetBytes("TQServer");
        public 
int GetPos()
        {
            return 
Position;
        }
        public 
void SetPosition(int Pos)
        {
            
Position Pos;
        }
        public 
PacketBuilder(int Tint L)
        {
            
Len L;
            
Length(L);
            
Type(T);
        }
        public 
void Short(int value)
        {
            
_buffer[Position] = ((byte)(value 0xff));
            
Position++;
            
_buffer[Position] = ((byte)((value >> 8) & 0xff));
            
Position++;
        }
        public 
void Short(uint value)
        {
            
_buffer[Position] = ((byte)(value 0xff));
            
Position++;
            
_buffer[Position] = ((byte)((value >> 8) & 0xff));
            
Position++;
        }
        public 
void Length(int value)
        {
            
_buffer[Position] = ((byte)(value 0xff));
            
Position++;
            
_buffer[Position] = ((byte)((value >> 8) & 0xff));
            
Position++;
        }
        public 
void Type(int value)
        {
            
_buffer[Position] = ((byte)(value 0xff));
            
Position++;
            
_buffer[Position] = ((byte)((value >> 8) & 0xff));
            
Position++;
        }
        public 
void Long(int value)
        {
            
_buffer[Position] = ((byte)(value 0xff));
            
Position++;
            
_buffer[Position] = ((byte)(value >> 0xff));
            
Position++;
            
_buffer[Position] = (byte)(value >> 16 0xff);
            
Position++;
            
_buffer[Position] = ((byte)(value >> 24 0xff));
            
Position++;
        }
        public 
void Long(ulong value)
        {
            
_buffer[Position] = ((byte)((ulong)value 0xffL));
            
Position++;
            
_buffer[Position] = ((byte)(value >> 0xff));
            
Position++;
            
_buffer[Position] = (byte)(value >> 16 0xff);
            
Position++;
            
_buffer[Position] = ((byte)(value >> 24 0xff));
            
Position++;
        }
        public 
void ULong(ulong value)
        {
            
_buffer[Position] = (byte)(value);
            
Position++;
            
_buffer[Position] = (byte)(value >> 8);
            
Position++;
            
_buffer[Position] = (byte)(value >> 16);
            
Position++;
            
_buffer[Position] = (byte)(value >> 24);
            
Position++;
            
_buffer[Position] = (byte)(value >> 32);
            
Position++;
            
_buffer[Position] = (byte)(value >> 40);
            
Position++;
            
_buffer[Position] = (byte)(value >> 48);
            
Position++;
            
_buffer[Position] = (byte)(value >> 56);
            
Position++;
        }
        public 
void Int(int value)
        {
            
_buffer[Position] = (Convert.ToByte(value 0xff));
            
Position++;
        }
        public 
void Int(uint value)
        {
            
_buffer[Position] = (Convert.ToByte(value 0xff));
            
Position++;
        }
        public 
void Long(uint value)
        {
            
_buffer[Position] = ((byte)(value 0xff));
            
Position++;
            
_buffer[Position] = ((byte)(value >> 0xff));
            
Position++;
            
_buffer[Position] = (byte)(value >> 16 0xff);
            
Position++;
            
_buffer[Position] = ((byte)(value >> 24 0xff));
            
Position++;
        }
        public 
void Move(int value)
        {
            for (
int x 0valuex++)
            {
                
_buffer[Position] = 0;
                
Position++;
            }
        }
        public 
void Text(string value)
        {
            
byte[] nvalue Program.Encoding.GetBytes(value);
            Array.
Copy(nvalue0_bufferPositionnvalue.Length);
            
Position += nvalue.Length;
        }
        protected 
void Seal()
        {
            Array.
Copy(TQ_SERVER0_bufferPositionTQ_SERVER.Length);
            
Position += TQ_SERVER.Length 1;
            
byte[] = new byte[Position 1];
            Array.
Copy(_bufferxPosition 1);
            
_buffer = new byte[x.Length];
            Array.
Copy(x_bufferx.Length);
            
null;
        }
        public 
byte[] getFinal()
        {
            
Seal();
            return 
_buffer;
        }
        
internal void Fill(int End)
        {
            for (
int x PositionEndx++)
                
Int(0);
        }
        
internal void PrintThis()
        {
            
string Dat "";
            for (
int x 0Positionx++)
                
Dat += _buffer[x].ToString("X") + " ";
            
Console.WriteLine(Dat);
        }
        
#region Add from offset
        
public void Short(int valueint Offset)
        {
            
_buffer[Offset] = ((byte)(value 0xff));
            
_buffer[Offset 1] = ((byte)((value >> 8) & 0xff));
        }
        public 
void Short(uint valueint Offset)
        {
            
_buffer[Offset] = ((byte)(value 0xff));
            
Offset++;
            
_buffer[Offset] = ((byte)((value >> 8) & 0xff));
        }
        public 
void Length(int valueint Offset)
        {
            
_buffer[Offset] = ((byte)(value 0xff));
            
Offset++;
            
_buffer[Offset] = ((byte)((value >> 8) & 0xff));
        }
        public 
void Type(int valueint Offset)
        {
            
_buffer[Offset] = ((byte)(value 0xff));
            
Offset++;
            
_buffer[Offset] = ((byte)((value >> 8) & 0xff));
        }
        public 
void Long(int valueint Offset)
        {
            
_buffer[Offset] = ((byte)(value 0xff));
            
Offset++;
            
_buffer[Offset] = ((byte)(value >> 0xff));
            
Offset++;
            
_buffer[Offset] = (byte)(value >> 16 0xff);
            
Offset++;
            
_buffer[Offset] = ((byte)(value >> 24 0xff));
        }
        public 
void Long(ulong valueint Offset)
        {
            
_buffer[Offset] = ((byte)((ulong)value 0xffL));
            
Offset++;
            
_buffer[Offset] = ((byte)(value >> 0xff));
            
Offset++;
            
_buffer[Offset] = (byte)(value >> 16 0xff);
            
Offset++;
            
_buffer[Offset] = ((byte)(value >> 24 0xff));
        }
        public 
void ULong(ulong valueint Offset)
        {
            
_buffer[Offset] = (byte)(value);
            
Offset++;
            
_buffer[Offset] = (byte)(value >> 8);
            
Offset++;
            
_buffer[Offset] = (byte)(value >> 16);
            
Offset++;
            
_buffer[Offset] = (byte)(value >> 24);
            
Offset++;
            
_buffer[Offset] = (byte)(value >> 32);
            
Offset++;
            
_buffer[Offset] = (byte)(value >> 40);
            
Offset++;
            
_buffer[Offset] = (byte)(value >> 48);
            
Offset++;
            
_buffer[Offset] = (byte)(value >> 56);
        }
        public 
void Int(int valueint Offset)
        {
            
_buffer[Offset] = (Convert.ToByte(value 0xff));
            
Offset++;
        }
        public 
void Int(uint valueint Offset)
        {
            
_buffer[Offset] = (Convert.ToByte(value 0xff));
            
Offset++;
        }
        public 
void Long(uint valueint Offset)
        {
            
_buffer[Offset] = ((byte)(value 0xff));
            
Offset++;
            
_buffer[Offset] = ((byte)(value >> 0xff));
            
Offset++;
            
_buffer[Offset] = (byte)(value >> 16 0xff);
            
Offset++;
            
_buffer[Offset] = ((byte)(value >> 24 0xff));
            
Offset++;
        }
        
#endregion
    
}


واعمل كلاس جديد لو مش عندك في

كود:
Network/GamePackets 

بأسم

كود:
PacketID.cs 

حط فيه دلو ولو عندك بدلو


كود:
namespace HarryPotter.Network.GamePackets
{
    public 
unsafe class PacketID
    
{
        public const 
ushort
        VipStatus 
1129,
        
UserIPInfo 2078,
        
ServerInfo 2079,
        
SpawnEntity 10014,
        
Update 10017,
        
UpdateAura 2410,
        
CraftItem 1028,
        
AuctionAction 1320,
        
AuctionBrowse 1321,
        
AuctionQuery 1322,
        
FactionWar 1072,
        
EnemyLast 1041,
        
ReloadScreen 1037,
        
ConfirmMap 1044,
        
Gambleing 1113,
        
SkillSoul 1103,
        
JiangHu 2700,
        
JiangHuStatus 2701,
        
JiangHuStudy 2702,
        
JiangHuRanking 2703,
        
JiangHuSettings 2704,
        
ClanCityWar 1313,
        
ThrillingSpooks 2400,
        
AutoHunt 1070,
        
CurrentFlag 2430,
        
OneArmedBandit 1351,
        
AdvertiseCommend 2227,
        
AdvertiseRank 2226,
        
AdvertiseRecruit 2225,
        
EnitityCreate 1001,
        
Message 1004,
        
ItemUsage 1009,
        
String 1015,
        
KnownPersons 1019,
        
Attack 1022,
        
Team 1023,
        
Atributes 1024,
        
Socketing 1027,
        
WindowStats 1040,
        
LoginPacket 1052,
        
Trade 1056,
        
Lottery 1314,
        
FloorItem 1101,
        
Warehouses 1102,
        
GuildCommand 1107,
        
PokerPlayerInfo 2090,
        
PokerPlayerMove 2093,
        
PokerLeaveTable 2096,
        
PokerJoinTable 2171,
        
Enlight 1127,
        
QuizShow 2068,
        
ArsenalInscribedPage 2202,
        
ArsenalPackets 2203,
        
FastInscribeItem 2204,
        
Compose 2036,
        
OfflineTG 2044,
        
TradePartner 2046,
        
ItemLock 2048,
        
Broadcast 2050,
        
Nobility 2064,
        
RacePotion 2072,
        
MessageBoard 1111,
        
TopGuild 1058,
        
GuildDoantion 2101,
        
FairyFlower 2070,
        
SendFlower 1150,
        
FlowersPacket 1151,
        
VIPTeleport 1128,
        
MentorPrize 2067,
        
MentorApprentice 2065,
        
MentorInformation 2066,
        
MentorPremio 1036,
        
GuildMember 2102,
        
ArenaRank 2207,
        
ArenaRequest 2206,
        
ArenaDialog 2205,
        
ArenaShowWiners 2208,
        
ArenaStatistic 2209,
        
ArenaWatch 2211,
        
TeamArenaRank 2243,
        
TeamArenaRequest 2242,
        
TeamArenaDialog 2241,
        
TeamArenaShowWiners 2244,
        
TeamArenaStatistic 2245,
        
InTeamArena 2247,
        
ChampionArenaRank 2600,
        
ChampionArenaStats 2601,
        
ChampionArenaShowTop 2602,
        
ChampionArenaShowTop2 2603,
        
ChampionArenaHandle 2604,
        
ElitePkRank 2223,
        
ElitePKBrackets 2219,
        
ElitePKWager 1064,
        
ElitePKWagersList 1065,
        
ElitePKTitle 1130,
        
TeamPkBrackets 2232,
        
TeamPkTournament 2233,
        
TeamPkFighterStats 2240,
        
SkillTeamPkBrackets 2252,
        
SkillTeamPkTournament 2253,
        
SkillTeamPkFighterStats 2260,
        
CaptureTheFlag 2224,
        
ChiSystem 2533,
        
RetreatChi 2536,
        
GroundMovement 10005,
        
Reincarnation 1066,
        
PurifyItem 2076,
        
Clan 1312,
        
SubClass 2320,
        
ItemAdding 1038,
        
GeneralData 10010,
        
TimePacket 1033,
        
PkExplorer 2220,
        
SecondaryPassword 2261,
        
ChangeName 2080,
        
AutoInvite 1126,
        
MemoryAgate 2110,
        
Achievement 1136,
        
MailboxPage 1045,
        
MailboxCheck 1046,
        
MailboxIcon 1047,
        
MailboxMessage 1048,
        
QuestTrace 1134,
        
QuestData 1135,
        
CloneAttack 2812,
        
RewardEvent 1315,
        
RewardPoint 1316,
        
OflineEvent 1317,
        
NpcSpawn 2030,
        
NpcInit 2031,
        
NpcDialog 2032,
        
RouletteShareBetting 2810,
        
RoulettedAddNewPlayer 2809,
        
RouletteOpenGui 2808,
        
RouletteTable 2807,
        
RouletteInvite 2806,
        
RouletteSignUp 2805,
        
RouletteAction 2804,
        
RouletteScreen 2803,
        
RouletteRecord 2802,
        
RouletteNoWinner 2801,
        
RouletteCheck 2800,
        
CrossServer 1063,
        
CrossServerData 2900,
        
CrossServerName 2901,
        
CrossServerSend 2902,
        
CrossServerColor 2501,
        
GuildPrizeRank 2504,
        
CrossServerWar 2505,
        
CrossServerBase 2506,
        
CrossServerRank 2507,
        
LuckyWheel 2811,
        
LuckyWheelGift 2812,
        
Activeness 2820,
        
ActivenessGift 2822,
        
ActivenessPoint 2823,
        
WayofHeroes 2830,
        
WayofHeroesDone 2831,
        
WayofHeroesSend 2832,
        
InnerPowerStageInfo 2611,
        
InnerPowerGui 2612,
        
InnerPowerHandler 2610;
    }


بس كده ولو جالك اي ايرور في اي حته انا موجود

سلام عليكم

#Mr.DeMo


Full Poker All In - k.g hgf,;v ;hlg tn sdvtv; allin full poker