예제 #1
0
        public static void BuildWalls(MahjongGame game, NetState state, PacketReader pvSrc)
        {
            if (game == null || !game.Players.IsInGameDealer(state.Mobile))
                return;

            game.ResetWalls(state.Mobile);
        }
예제 #2
0
        public MahjongGeneralInfo( MahjongGame game )
            : base(0xDA)
        {
            EnsureCapacity( 13 );

            m_Stream.Write( (int) game.Serial );
            m_Stream.Write( (byte) 0 );
            m_Stream.Write( (byte) 0x5 );

            m_Stream.Write( (short) 0 );
            m_Stream.Write( (byte) 0 );

            m_Stream.Write( (byte) ( ( game.ShowScores ? 0x1 : 0x0 ) | ( game.SpectatorVision ? 0x2 : 0x0 ) ) );

            m_Stream.Write( (byte) game.Dices.First );
            m_Stream.Write( (byte) game.Dices.Second );

            m_Stream.Write( (byte) game.DealerIndicator.Wind );
            m_Stream.Write( (short) game.DealerIndicator.Position.Y );
            m_Stream.Write( (short) game.DealerIndicator.Position.X );
            m_Stream.Write( (byte) game.DealerIndicator.Direction );

            m_Stream.Write( (short) game.WallBreakIndicator.Position.Y );
            m_Stream.Write( (short) game.WallBreakIndicator.Position.X );
        }
예제 #3
0
		public MahjongDealerIndicator( MahjongGame game, Point2D position, MahjongPieceDirection direction, MahjongWind wind )
		{
			m_Game = game;
			m_Position = position;
			m_Direction = direction;
			m_Wind = wind;
		}
예제 #4
0
파일: Packets.cs 프로젝트: Godkong/RunUO
		public MahjongJoinGame( MahjongGame game ) : base( 0xDA )
		{
			EnsureCapacity( 9 );

			m_Stream.Write( (int) game.Serial );
			m_Stream.Write( (byte) 0 );
			m_Stream.Write( (byte) 0x19 );
		}
예제 #5
0
		public MahjongWallBreakIndicator( MahjongGame game, GenericReader reader )
		{
			m_Game = game;

			int version = reader.ReadInt();

			m_Position = reader.ReadPoint2D();
		}
예제 #6
0
        public static void ExitGame(MahjongGame game, NetState state, PacketReader pvSrc)
        {
            if (game == null)
                return;

            Mobile from = state.Mobile;

            game.Players.LeaveGame(from);
        }
예제 #7
0
        public static void AssignDealer(MahjongGame game, NetState state, PacketReader pvSrc)
        {
            if (game == null || !game.Players.IsInGameDealer(state.Mobile))
                return;

            int position = pvSrc.ReadByte();

            game.Players.AssignDealer(position);
        }
예제 #8
0
        public MahjongDices( MahjongGame game, GenericReader reader )
        {
            m_Game = game;

            /*int version = */reader.ReadInt();

            m_First = reader.ReadInt();
            m_Second = reader.ReadInt();
        }
예제 #9
0
        public MahjongDices(MahjongGame game, GenericReader reader)
        {
            this.m_Game = game;

            int version = reader.ReadInt();

            this.m_First = reader.ReadInt();
            this.m_Second = reader.ReadInt();
        }
예제 #10
0
        public static void GivePoints(MahjongGame game, NetState state, PacketReader pvSrc)
        {
            if (game == null || !game.Players.IsInGamePlayer(state.Mobile))
                return;

            int to = pvSrc.ReadByte();
            int amount = pvSrc.ReadInt32();

            game.Players.TransferScore(state.Mobile, to, amount);
        }
예제 #11
0
 public MahjongTile(MahjongGame game, int number, MahjongTileType value, Point2D position, int stackLevel, MahjongPieceDirection direction, bool flipped)
 {
     this.m_Game = game;
     this.m_Number = number;
     this.m_Value = value;
     this.m_Position = position;
     this.m_StackLevel = stackLevel;
     this.m_Direction = direction;
     this.m_Flipped = flipped;
 }
예제 #12
0
		public MahjongDealerIndicator( MahjongGame game, GenericReader reader )
		{
			m_Game = game;

			int version = reader.ReadInt();

			m_Position = reader.ReadPoint2D();
			m_Direction = (MahjongPieceDirection) reader.ReadInt();
			m_Wind = (MahjongWind) reader.ReadInt();
		}
예제 #13
0
        public static void AssignDealer(MahjongGame game, NetState state, PacketReader pvSrc)
        {
            if (game == null || !game.Players.IsInGameDealer(state.Mobile))
            {
                return;
            }

            int position = pvSrc.ReadByte();

            game.Players.AssignDealer(position);
        }
예제 #14
0
        public static void ExitGame(MahjongGame game, NetState state, PacketReader pvSrc)
        {
            if (game == null)
            {
                return;
            }

            Mobile from = state.Mobile;

            game.Players.LeaveGame(from);
        }
예제 #15
0
        public MahjongDealerIndicator(MahjongGame game, GenericReader reader)
        {
            m_Game = game;

            /*int version = */
            reader.ReadInt();

            m_Position  = reader.ReadPoint2D();
            m_Direction = (MahjongPieceDirection)reader.ReadInt();
            m_Wind      = (MahjongWind)reader.ReadInt();
        }
예제 #16
0
        public static void GivePoints(MahjongGame game, NetState state, PacketReader pvSrc)
        {
            if (game == null || !game.Players.IsInGamePlayer(state.Mobile))
            {
                return;
            }

            int to     = pvSrc.ReadByte();
            int amount = pvSrc.ReadInt32();

            game.Players.TransferScore(state.Mobile, to, amount);
        }
예제 #17
0
        public static void MoveWallBreakIndicator(MahjongGame game, NetState state, PacketReader pvSrc)
        {
            if (game == null || !game.Players.IsInGameDealer(state.Mobile))
            {
                return;
            }

            int y = pvSrc.ReadInt16();
            int x = pvSrc.ReadInt16();

            game.WallBreakIndicator.Move(new Point2D(x, y));
        }
예제 #18
0
        public MahjongTile(MahjongGame game, GenericReader reader)
        {
            this.m_Game = game;

            int version = reader.ReadInt();

            this.m_Number = reader.ReadInt();
            this.m_Value = (MahjongTileType)reader.ReadInt();
            this.m_Position = reader.ReadPoint2D();
            this.m_StackLevel = reader.ReadInt();
            this.m_Direction = (MahjongPieceDirection)reader.ReadInt();
            this.m_Flipped = reader.ReadBool();
        }
예제 #19
0
        public MahjongTile(MahjongGame game, GenericReader reader)
        {
            m_Game = game;

            int version = reader.ReadInt();

            m_Number     = reader.ReadInt();
            m_Value      = (MahjongTileType)reader.ReadInt();
            m_Position   = reader.ReadPoint2D();
            m_StackLevel = reader.ReadInt();
            m_Direction  = (MahjongPieceDirection)reader.ReadInt();
            m_Flipped    = reader.ReadBool();
        }
예제 #20
0
        public static void ChangeOption(MahjongGame game, NetState state, PacketReader pvSrc)
        {
            if (game == null || !game.Players.IsInGameDealer(state.Mobile))
                return;

            pvSrc.ReadInt16();
            pvSrc.ReadByte();

            int options = pvSrc.ReadByte();

            game.ShowScores = (options & 0x1) != 0;
            game.SpectatorVision = (options & 0x2) != 0;
        }
예제 #21
0
        public MahjongPlayers(MahjongGame game, int maxPlayers, int baseScore)
        {
            m_Game = game;
            m_Spectators = new ArrayList();

            m_Players = new Mobile[maxPlayers];
            m_InGame = new bool[maxPlayers];
            m_PublicHand = new bool[maxPlayers];
            m_Scores = new int[maxPlayers];

            for (int i = 0; i < m_Scores.Length; i++)
                m_Scores[i] = baseScore;
        }
예제 #22
0
        public static void TogglePublicHand(MahjongGame game, NetState state, PacketReader pvSrc)
        {
            if (game == null || !game.Players.IsInGamePlayer(state.Mobile))
            {
                return;
            }

            pvSrc.ReadInt16();
            pvSrc.ReadByte();

            bool publicHand = pvSrc.ReadBoolean();

            game.Players.SetPublic(game.Players.GetPlayerIndex(state.Mobile), publicHand);
        }
예제 #23
0
        public MahjongPlayers(MahjongGame game, int maxPlayers, int baseScore)
        {
            m_Game       = game;
            m_Spectators = new ArrayList();

            m_Players    = new Mobile[maxPlayers];
            m_InGame     = new bool[maxPlayers];
            m_PublicHand = new bool[maxPlayers];
            m_Scores     = new int[maxPlayers];

            for (int i = 0; i < m_Scores.Length; i++)
            {
                m_Scores[i] = baseScore;
            }
        }
예제 #24
0
        public static void ChangeOption(MahjongGame game, NetState state, PacketReader pvSrc)
        {
            if (game == null || !game.Players.IsInGameDealer(state.Mobile))
            {
                return;
            }

            pvSrc.ReadInt16();
            pvSrc.ReadByte();

            int options = pvSrc.ReadByte();

            game.ShowScores      = (options & 0x1) != 0;
            game.SpectatorVision = (options & 0x2) != 0;
        }
예제 #25
0
        public static void OpenSeat(MahjongGame game, NetState state, PacketReader pvSrc)
        {
            if (game == null || !game.Players.IsInGameDealer(state.Mobile))
            {
                return;
            }

            int position = pvSrc.ReadByte();

            if (game.Players.GetPlayer(position) == state.Mobile)
            {
                return;
            }

            game.Players.OpenSeat(position);
        }
예제 #26
0
        public static void MoveDealerIndicator(MahjongGame game, NetState state, PacketReader pvSrc)
        {
            if (game == null || !game.Players.IsInGameDealer(state.Mobile))
            {
                return;
            }

            MahjongPieceDirection direction = GetDirection(pvSrc.ReadByte());

            MahjongWind wind = GetWind(pvSrc.ReadByte());

            int y = pvSrc.ReadInt16();
            int x = pvSrc.ReadInt16();

            game.DealerIndicator.Move(new Point2D(x, y), direction, wind);
        }
예제 #27
0
        public MahjongTilesInfo(MahjongGame game, Mobile to)
            : base(0xDA)
        {
            MahjongTile[]  tiles   = game.Tiles;
            MahjongPlayers players = game.Players;

            EnsureCapacity(11 + 9 * tiles.Length);

            m_Stream.Write(game.Serial);
            m_Stream.Write((byte)0);
            m_Stream.Write((byte)0x4);

            m_Stream.Write((short)tiles.Length);

            foreach (MahjongTile tile in tiles)
            {
                m_Stream.Write((byte)tile.Number);

                if (tile.Flipped)
                {
                    int hand = tile.Dimensions.GetHandArea();

                    if (hand < 0 || players.IsPublic(hand) || players.GetPlayer(hand) == to || (game.SpectatorVision && players.IsSpectator(to)))
                    {
                        m_Stream.Write((byte)tile.Value);
                    }
                    else
                    {
                        m_Stream.Write((byte)0);
                    }
                }
                else
                {
                    m_Stream.Write((byte)0);
                }

                m_Stream.Write((short)tile.Position.Y);
                m_Stream.Write((short)tile.Position.X);
                m_Stream.Write((byte)tile.StackLevel);
                m_Stream.Write((byte)tile.Direction);

                m_Stream.Write(tile.Flipped ? (byte)0x10 : (byte)0x0);
            }
        }
예제 #28
0
        public static void OnPacket(NetState state, PacketReader pvSrc)
        {
            MahjongGame game = World.FindItem(pvSrc.ReadUInt32()) as MahjongGame;

            game?.Players.CheckPlayers();

            pvSrc.ReadByte();

            int cmd = pvSrc.ReadByte();

            OnMahjongPacketReceive onReceive = GetSubCommandDelegate(cmd);

            if (onReceive != null)
            {
                onReceive(game, state, pvSrc);
            }
            else
            {
                pvSrc.Trace(state);
            }
        }
예제 #29
0
        public MahjongPlayers(MahjongGame game, GenericReader reader)
        {
            this.m_Game = game;
            this.m_Spectators = new ArrayList();

            int version = reader.ReadInt();

            int seats = reader.ReadInt();
            this.m_Players = new Mobile[seats];
            this.m_InGame = new bool[seats];
            this.m_PublicHand = new bool[seats];
            this.m_Scores = new int[seats];

            for (int i = 0; i < seats; i++)
            {
                this.m_Players[i] = reader.ReadMobile();
                this.m_PublicHand[i] = reader.ReadBool();
                this.m_Scores[i] = reader.ReadInt();
            }

            this.m_DealerPosition = reader.ReadInt();
        }
예제 #30
0
        public MahjongTileInfo(MahjongTile tile, Mobile to) : base(0xDA)
        {
            MahjongGame    game    = tile.Game;
            MahjongPlayers players = game.Players;

            EnsureCapacity(18);

            Stream.Write(tile.Game.Serial);
            Stream.Write((byte)0);
            Stream.Write((byte)0x3);

            Stream.Write((byte)tile.Number);

            if (tile.Flipped)
            {
                int hand = tile.Dimensions.GetHandArea();

                if (hand < 0 || players.IsPublic(hand) || players.GetPlayer(hand) == to ||
                    (game.SpectatorVision && players.IsSpectator(to)))
                {
                    Stream.Write((byte)tile.Value);
                }
                else
                {
                    Stream.Write((byte)0);
                }
            }
            else
            {
                Stream.Write((byte)0);
            }

            Stream.Write((short)tile.Position.Y);
            Stream.Write((short)tile.Position.X);
            Stream.Write((byte)tile.StackLevel);
            Stream.Write((byte)tile.Direction);

            Stream.Write(tile.Flipped ? (byte)0x10 : (byte)0x0);
        }
예제 #31
0
        public MahjongPlayers(MahjongGame game, IGenericReader reader)
        {
            Game         = game;
            m_Spectators = new List <Mobile>();

            var version = reader.ReadInt();

            var seats = reader.ReadInt();

            m_Players    = new Mobile[seats];
            m_InGame     = new bool[seats];
            m_PublicHand = new bool[seats];
            m_Scores     = new int[seats];

            for (var i = 0; i < seats; i++)
            {
                m_Players[i]    = reader.ReadMobile();
                m_PublicHand[i] = reader.ReadBool();
                m_Scores[i]     = reader.ReadInt();
            }

            DealerPosition = reader.ReadInt();
        }
예제 #32
0
        public MahjongPlayers(MahjongGame game, GenericReader reader)
        {
            m_Game       = game;
            m_Spectators = new ArrayList();

            int version = reader.ReadInt();

            int seats = reader.ReadInt();

            m_Players    = new Mobile[seats];
            m_InGame     = new bool[seats];
            m_PublicHand = new bool[seats];
            m_Scores     = new int[seats];

            for (int i = 0; i < seats; i++)
            {
                m_Players[i]    = reader.ReadMobile();
                m_PublicHand[i] = reader.ReadBool();
                m_Scores[i]     = reader.ReadInt();
            }

            m_DealerPosition = reader.ReadInt();
        }
예제 #33
0
        public MahjongGeneralInfo(MahjongGame game) : base(0xDA)
        {
            EnsureCapacity(13);

            m_Stream.Write((int)game.Serial);
            m_Stream.Write((byte)0);
            m_Stream.Write((byte)0x5);

            m_Stream.Write((short)0);
            m_Stream.Write((byte)0);

            m_Stream.Write((byte)((game.ShowScores ? 0x1 : 0x0) | (game.SpectatorVision ? 0x2 : 0x0)));

            m_Stream.Write((byte)game.Dices.First);
            m_Stream.Write((byte)game.Dices.Second);

            m_Stream.Write((byte)game.DealerIndicator.Wind);
            m_Stream.Write((short)game.DealerIndicator.Position.Y);
            m_Stream.Write((short)game.DealerIndicator.Position.X);
            m_Stream.Write((byte)game.DealerIndicator.Direction);

            m_Stream.Write((short)game.WallBreakIndicator.Position.Y);
            m_Stream.Write((short)game.WallBreakIndicator.Position.X);
        }
예제 #34
0
파일: Packets.cs 프로젝트: Godkong/RunUO
		public MahjongTilesInfo( MahjongGame game, Mobile to ) : base( 0xDA )
		{
			MahjongTile[] tiles = game.Tiles;
			MahjongPlayers players = game.Players;

			EnsureCapacity( 11 + 9 * tiles.Length );

			m_Stream.Write( (int) game.Serial );
			m_Stream.Write( (byte) 0 );
			m_Stream.Write( (byte) 0x4 );

			m_Stream.Write( (short) tiles.Length );

			foreach ( MahjongTile tile in tiles )
			{
				m_Stream.Write( (byte) tile.Number );

				if ( tile.Flipped )
				{
					int hand = tile.Dimensions.GetHandArea();

					if ( hand < 0 || players.IsPublic( hand ) || players.GetPlayer( hand ) == to || (game.SpectatorVision && players.IsSpectator( to )) )
						m_Stream.Write( (byte)tile.Value );
					else
						m_Stream.Write( (byte) 0 );
				}
				else
				{
					m_Stream.Write( (byte) 0 );
				}

				m_Stream.Write( (short) tile.Position.Y );
				m_Stream.Write( (short) tile.Position.X );
				m_Stream.Write( (byte) tile.StackLevel );
				m_Stream.Write( (byte) tile.Direction );

				m_Stream.Write( tile.Flipped ? (byte) 0x10 : (byte) 0x0 );
			}
		}
 public MahjongWallBreakIndicator(MahjongGame game, Point2D position)
 {
     m_Game     = game;
     m_Position = position;
 }
		public MahjongWallBreakIndicator( MahjongGame game, Point2D position )
		{
			m_Game = game;
			m_Position = position;
		}
예제 #37
0
 public ResetGameEntry(MahjongGame game) : base(6162)
 {
     m_Game = game;
 }
예제 #38
0
파일: Packets.cs 프로젝트: Godkong/RunUO
		public MahjongPlayersInfo( MahjongGame game, Mobile to ) : base( 0xDA )
		{
			MahjongPlayers players = game.Players;

			EnsureCapacity( 11 + 45 * players.Seats );

			m_Stream.Write( (int) game.Serial );
			m_Stream.Write( (byte) 0 );
			m_Stream.Write( (byte) 0x2 );

			m_Stream.Write( (byte) 0 );
			m_Stream.Write( (byte) players.Seats );

			int n = 0;
			for ( int i = 0; i < players.Seats; i++ )
			{
				Mobile mobile = players.GetPlayer( i );

				if ( mobile != null )
				{
					m_Stream.Write( (int) mobile.Serial );
					m_Stream.Write( players.DealerPosition == i ? (byte) 0x1 : (byte) 0x2 );
					m_Stream.Write( (byte) i );

					if ( game.ShowScores || mobile == to )
						m_Stream.Write( (int) players.GetScore( i ) );
					else
						m_Stream.Write( (int) 0 );

					m_Stream.Write( (short) 0 );
					m_Stream.Write( (byte) 0 );

					m_Stream.Write( players.IsPublic( i ) );

					m_Stream.WriteAsciiFixed( mobile.Name, 30 );
					m_Stream.Write( !players.IsInGamePlayer( i ) );

					n++;
				}
				else if ( game.ShowScores )
				{
					m_Stream.Write( (int) 0 );
					m_Stream.Write( (byte) 0x2 );
					m_Stream.Write( (byte) i );

					m_Stream.Write( (int) players.GetScore( i ) );

					m_Stream.Write( (short) 0 );
					m_Stream.Write( (byte) 0 );

					m_Stream.Write( players.IsPublic( i ) );

					m_Stream.WriteAsciiFixed( "", 30 );
					m_Stream.Write( true );

					n++;
				}
			}

			if ( n != players.Seats )
			{
				m_Stream.Seek( 10, System.IO.SeekOrigin.Begin );
				m_Stream.Write( (byte) n );
			}
		}
		public static void MoveDealerIndicator( MahjongGame game, NetState state, PacketReader pvSrc )
		{
			if ( game == null || !game.Players.IsInGameDealer( state.Mobile ) )
				return;

			MahjongPieceDirection direction = GetDirection( pvSrc.ReadByte() );

			MahjongWind wind = GetWind( pvSrc.ReadByte() );

			int y = pvSrc.ReadInt16();
			int x = pvSrc.ReadInt16();

			game.DealerIndicator.Move( new Point2D( x, y ), direction, wind );
		}
		public static void MoveTile( MahjongGame game, NetState state, PacketReader pvSrc )
		{
			if ( game == null || !game.Players.IsInGamePlayer( state.Mobile ) )
				return;

			int number = pvSrc.ReadByte();

			if ( number < 0 || number >= game.Tiles.Length )
				return;

			pvSrc.ReadByte(); // Current direction

			MahjongPieceDirection direction = GetDirection( pvSrc.ReadByte() );

			pvSrc.ReadByte();

			bool flip = pvSrc.ReadBoolean();

			pvSrc.ReadInt16(); // Current Y
			pvSrc.ReadInt16(); // Current X

			pvSrc.ReadByte();

			int y = pvSrc.ReadInt16();
			int x = pvSrc.ReadInt16();

			pvSrc.ReadByte();

			game.Tiles[number].Move( new Point2D( x, y ), direction, flip, game.Players.GetPlayerIndex( state.Mobile ) );
		}
예제 #41
0
			public ResetGameEntry( MahjongGame game ) : base( 6162 )
			{
				m_Game = game;
			}
예제 #42
0
파일: Packets.cs 프로젝트: Crome696/ServUO
        public MahjongRelieve(MahjongGame game)
            : base(0xDA)
        {
            this.EnsureCapacity(9);

            this.m_Stream.Write((int)game.Serial);
            this.m_Stream.Write((byte)0);
            this.m_Stream.Write((byte)0x1A);
        }
예제 #43
0
 public MahjongDices(MahjongGame game)
 {
     m_Game   = game;
     m_First  = Utility.Random(1, 6);
     m_Second = Utility.Random(1, 6);
 }
		public static void MoveWallBreakIndicator( MahjongGame game, NetState state, PacketReader pvSrc )
		{
			if ( game == null || !game.Players.IsInGameDealer( state.Mobile ) )
				return;

			int y = pvSrc.ReadInt16();
			int x = pvSrc.ReadInt16();

			game.WallBreakIndicator.Move( new Point2D( x, y ) );
		}
		public static void RollDice( MahjongGame game, NetState state, PacketReader pvSrc )
		{
			if ( game == null || !game.Players.IsInGamePlayer( state.Mobile ) )
				return;

			game.Dices.RollDices( state.Mobile );
		}
		public static void TogglePublicHand( MahjongGame game, NetState state, PacketReader pvSrc )
		{
			if ( game == null || !game.Players.IsInGamePlayer( state.Mobile ) )
				return;

			pvSrc.ReadInt16();
			pvSrc.ReadByte();

			bool publicHand = pvSrc.ReadBoolean();

			game.Players.SetPublic( game.Players.GetPlayerIndex( state.Mobile ), publicHand );
		}
예제 #47
0
        public MahjongPlayersInfo(MahjongGame game, Mobile to)
            : base(0xDA)
        {
            MahjongPlayers players = game.Players;

            EnsureCapacity(11 + 45 * players.Seats);

            m_Stream.Write(game.Serial);
            m_Stream.Write((byte)0);
            m_Stream.Write((byte)0x2);

            m_Stream.Write((byte)0);
            m_Stream.Write((byte)players.Seats);

            int n = 0;

            for (int i = 0; i < players.Seats; i++)
            {
                Mobile mobile = players.GetPlayer(i);

                if (mobile != null)
                {
                    m_Stream.Write(mobile.Serial);
                    m_Stream.Write(players.DealerPosition == i ? (byte)0x1 : (byte)0x2);
                    m_Stream.Write((byte)i);

                    if (game.ShowScores || mobile == to)
                    {
                        m_Stream.Write(players.GetScore(i));
                    }
                    else
                    {
                        m_Stream.Write(0);
                    }

                    m_Stream.Write((short)0);
                    m_Stream.Write((byte)0);

                    m_Stream.Write(players.IsPublic(i));

                    m_Stream.WriteAsciiFixed(mobile.Name, 30);
                    m_Stream.Write(!players.IsInGamePlayer(i));

                    n++;
                }
                else if (game.ShowScores)
                {
                    m_Stream.Write(0);
                    m_Stream.Write((byte)0x2);
                    m_Stream.Write((byte)i);

                    m_Stream.Write(players.GetScore(i));

                    m_Stream.Write((short)0);
                    m_Stream.Write((byte)0);

                    m_Stream.Write(players.IsPublic(i));

                    m_Stream.WriteAsciiFixed("", 30);
                    m_Stream.Write(true);

                    n++;
                }
            }

            if (n != players.Seats)
            {
                m_Stream.Seek(10, System.IO.SeekOrigin.Begin);
                m_Stream.Write((byte)n);
            }
        }
		public static void ResetScores( MahjongGame game, NetState state, PacketReader pvSrc )
		{
			if ( game == null || !game.Players.IsInGameDealer( state.Mobile ) )
				return;

			game.Players.ResetScores( MahjongGame.BaseScore );
		}
		public static void OpenSeat( MahjongGame game, NetState state, PacketReader pvSrc )
		{
			if ( game == null || !game.Players.IsInGameDealer( state.Mobile ) )
				return;

			int position = pvSrc.ReadByte();

			if ( game.Players.GetPlayer( position ) == state.Mobile )
				return;

			game.Players.OpenSeat( position );
		}
예제 #50
0
 public MahjongDices(MahjongGame game)
 {
     this.m_Game = game;
     this.m_First = Utility.Random(1, 6);
     this.m_Second = Utility.Random(1, 6);
 }