Exemplo n.º 1
0
 public PlayerData(int ownerObjectId, MapInfoPacket mapInfo)
 {
     OwnerObjectId = ownerObjectId;
     Name = "";
     MapName = mapInfo.Name;
     TeleportAllowed = mapInfo.AllowPlayerTeleport;
     MapWidth = mapInfo.Width;
     MapHeight = mapInfo.Height;
 }
Exemplo n.º 2
0
        private void OnMapInfoPacket(Client client, MapInfoPacket packet)
        {
            if (this.m_currentGameId != -5) return;

            packet.ClientXML = packet.ClientXML.Concat(new[]
                {
                    @"	<Objects>
            <Object type=""0x0504"" id=""Vault Chest"">
            <Class>Container</Class>
            <Container/>
            <CanPutNormalObjects/>
            <CanPutSoulboundObjects/>
            <ShowName/>
            <Texture><File>lofiObj2</File><Index>0x0e</Index></Texture>
            <SlotTypes>0, 0, 0, 0, 0, 0, 0, 0</SlotTypes>
            </Object>
            </Objects>"
                }).ToArray();
        }
Exemplo n.º 3
0
 private void OnMapInfo(Client client, MapInfoPacket packet)
 {
     client.State["MapInfo"] = packet;
 }
Exemplo n.º 4
0
 public void MapInfo(MapInfoPacket mapinfo)
 {
     TileTypes = new ushort[mapinfo.Width, mapinfo.Height];
 }
Exemplo n.º 5
0
 // TODO: Add more hooks
 private void HandlePacketInternal(Packet packet)
 {
     if (packet.Type == PacketType.CREATESUCCESS)
     {
         ObjectId = (packet as CreateSuccessPacket).ObjectId;
         PlayerData = new PlayerData(ObjectId);
         PlayerData.MapName = _mapInfo.Name;
         PlayerData.TeleportAllowed = _mapInfo.AllowPlayerTeleport;
         PlayerData.MapWidth = _mapInfo.Width;
         PlayerData.MapHeight = _mapInfo.Height;
     }
     else if (packet.Type == PacketType.MAPINFO)
     {
         _mapInfo = (MapInfoPacket)packet;
     }
     else if (packet.Type == PacketType.UPDATE)
     {
         PlayerData.Parse(packet as UpdatePacket);
     }
     else if (packet.Type == PacketType.NEWTICK)
     {
         PlayerData.Parse(packet as NewTickPacket);
     }
     else if (packet.Type == PacketType.PONG)
     {
         Time = (packet as PongPacket).Time;
     }
     else if (packet.Type == PacketType.MOVE)
     {
         Time = (packet as MovePacket).Time;
         PlayerData.Pos = (packet as MovePacket).NewPosition;
     }
     else if (packet.Type == PacketType.PLAYERSHOOT)
     {
         PlayerData.Pos = (packet as PlayerShootPacket).Position;
     }
 }