示例#1
0
 public void WriteAddEntity( byte id, Player player, Position pos )
 {
     Write( OutputCodes.AddEntity );
     Write( id );
     Write( player.GetListName() );
     Write( (short)pos.x );
     Write( (short)pos.h );
     Write( (short)pos.y );
     Write( pos.r );
     Write( pos.l );
 }
示例#2
0
 public void WriteAddEntity( byte id, Player player, Position pos ) {
     if( player == null ) throw new ArgumentNullException( "player" );
     Write( OpCode.AddEntity );
     Write( id );
     Write( player.GetListName() );
     Write( pos.X );
     Write( pos.H );
     Write( pos.Y );
     Write( pos.R );
     Write( pos.L );
 }
示例#3
0
        internal static Packet MakeAddEntity(Player player, Position pos)
        {
            Packet packet = new Packet(74);

            packet.data[0] = (byte)OutputCodes.AddEntity;
            packet.data[1] = (byte)player.id;
            ASCIIEncoding.ASCII.GetBytes(player.GetListName().PadRight(64), 0, 64, packet.data, 2);
            ToNetOrder(pos.x, packet.data, 66);
            ToNetOrder(pos.h, packet.data, 68);
            ToNetOrder(pos.y, packet.data, 70);
            packet.data[72] = pos.r;
            packet.data[73] = pos.l;
            return(packet);
        }
示例#4
0
 public void WriteAddEntity(byte id, Player player, Position pos)
 {
     if (player == null)
     {
         throw new ArgumentNullException("player");
     }
     Write(OpCode.AddEntity);
     Write(id);
     Write(player.GetListName());
     Write(pos.X);
     Write(pos.H);
     Write(pos.Y);
     Write(pos.R);
     Write(pos.L);
 }
示例#5
0
 internal static Packet MakeAddEntity( Player player, Position pos ) {
     Packet packet = new Packet( 74 );
     packet.data[0] = (byte)OutputCodes.AddEntity;
     packet.data[1] = (byte)player.id;
     ASCIIEncoding.ASCII.GetBytes( player.GetListName().PadRight( 64 ), 0, 64, packet.data, 2 );
     ToNetOrder( pos.x, packet.data, 66 );
     ToNetOrder( pos.h, packet.data, 68 );
     ToNetOrder( pos.y, packet.data, 70 );
     packet.data[72] = pos.r;
     packet.data[73] = pos.l;
     return packet;
 }
示例#6
0
文件: Session.cs 项目: fragmer/fCraft
 void ReAddEntity( VisibleEntity entity, Player player, Position newPos ) {
     SendNow( PacketWriter.MakeRemoveEntity( entity.Id ) );
     SendNow( PacketWriter.MakeAddEntity( entity.Id, player.GetListName(), newPos ) );
     entity.LastKnownPosition = newPos;
 }
示例#7
0
文件: Session.cs 项目: fragmer/fCraft
 void AddEntity( Player player, Position newPos ) {
     var pos = new VisibleEntity( newPos, freePlayerIDs.Pop(), player.Info.Rank );
     entities.Add( player, pos );
     SendNow( PacketWriter.MakeAddEntity( pos.Id, player.GetListName(), newPos ) );
 }