本文整理匯總了C#中SharpTibiaProxy.Network.InMessage.ReadLocation方法的典型用法代碼示例。如果您正苦於以下問題:C# InMessage.ReadLocation方法的具體用法?C# InMessage.ReadLocation怎麽用?C# InMessage.ReadLocation使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類SharpTibiaProxy.Network.InMessage
的用法示例。
在下文中一共展示了InMessage.ReadLocation方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: ParseServerMapDescription
private void ParseServerMapDescription(InMessage message)
{
var location = message.ReadLocation();
client.PlayerLocation = location;
var tiles = new List<Tile>();
ParseServerMapDescription(message, tiles, location.X - 8, location.Y - 6, location.Z, 18, 14);
client.Map.OnMapUpdated(tiles);
}
示例2: ParseTibiaPacket
private void ParseTibiaPacket(InMessage message)
{
var cmd = message.ReadByte();
switch (cmd)
{
case 0x6C:
case 0x6D:
var location = message.ReadLocation();
var stack = message.ReadByte();
if (location.IsCreature && !client.BattleList.ContainsCreature(location.GetCretureId(stack)))
return;
break;
}
message.ReadPosition = 0;
client.ProtocolWorld.ParseServerMessage(message);
}
示例3: ParseServerDistanceShot
private void ParseServerDistanceShot(InMessage message)
{
Location fromLocation = message.ReadLocation();
Location toLocation = message.ReadLocation();
var effect = message.ReadByte();
}
示例4: ParseServerMagicEffect
private void ParseServerMagicEffect(InMessage message)
{
Location location = message.ReadLocation();
var effect = message.ReadByte();
}
示例5: ParseServerCreatureMove
private void ParseServerCreatureMove(InMessage message)
{
Location oldLocation = message.ReadLocation();
var oldStack = message.ReadByte();
Location newLocation = message.ReadLocation();
if (oldLocation.IsCreature)
{
var creatureId = oldLocation.GetCretureId(oldStack);
Creature creature = client.BattleList.GetCreature(creatureId);
if (creature == null)
throw new Exception("[ParseServerCreatureMove] Creature not found on battle list.");
var tile = client.Map.GetTile(newLocation);
if (tile == null)
throw new Exception("[ParseServerCreatureMove] New tile not found.");
tile.AddThing(creature);
client.Map.SetTile(tile);
}
else
{
Tile tile = client.Map.GetTile(oldLocation);
if (tile == null)
throw new Exception("[ParseServerCreatureMove] Old tile not found.");
Thing thing = tile.GetThing(oldStack);
Creature creature = thing as Creature;
if (creature == null)
return; //The client will send update tile.
tile.RemoveThing(oldStack);
client.Map.SetTile(tile);
tile = client.Map.GetTile(newLocation);
if (tile == null)
throw new Exception("[ParseServerCreatureMove] New tile not found.");
tile.AddThing(creature);
client.Map.SetTile(tile);
//update creature direction
if (oldLocation.X > newLocation.X)
{
creature.LookDirection = Direction.DIRECTION_WEST;
creature.TurnDirection = Direction.DIRECTION_WEST;
}
else if (oldLocation.X < newLocation.X)
{
creature.LookDirection = Direction.DIRECTION_EAST;
creature.TurnDirection = Direction.DIRECTION_EAST;
}
else if (oldLocation.Y > newLocation.Y)
{
creature.LookDirection = Direction.DIRECTION_NORTH;
creature.TurnDirection = Direction.DIRECTION_NORTH;
}
else if (oldLocation.Y < newLocation.Y)
{
creature.LookDirection = Direction.DIRECTION_SOUTH;
creature.TurnDirection = Direction.DIRECTION_SOUTH;
}
}
}
示例6: ParseServerCreatureSpeak
private void ParseServerCreatureSpeak(InMessage message)
{
var statementId = message.ReadUInt();
var name = message.ReadString();
var level = message.ReadUShort();
var type = (MessageClasses)message.ReadByte();
Location location = null;
switch (type)
{
case MessageClasses.SPEAK_SAY:
case MessageClasses.SPEAK_WHISPER:
case MessageClasses.SPEAK_YELL:
case MessageClasses.SPEAK_MONSTER_SAY:
case MessageClasses.SPEAK_MONSTER_YELL:
case MessageClasses.SPEAK_SPELL:
case MessageClasses.NPC_FROM:
location = message.ReadLocation();
break;
case MessageClasses.CHANNEL:
case MessageClasses.CHANNEL_HIGHLIGHT:
case MessageClasses.GAMEMASTER_CHANNEL:
var channelId = message.ReadUShort();
break;
default:
break;
}
var text = message.ReadString();
client.Chat.OnCreatureSpeak(statementId, name, level, type, location, text);
}
示例7: ParseServerAddMapMarker
private void ParseServerAddMapMarker(InMessage message)
{
Location location = message.ReadLocation();
var icon = message.ReadByte();
var desc = message.ReadString();
}
示例8: ParseServerAnimatedText
private void ParseServerAnimatedText(InMessage message)
{
Location location = message.ReadLocation();
var color = message.ReadByte();
var text = message.ReadString();
}
示例9: ParseServerUpdateTile
private void ParseServerUpdateTile(InMessage message)
{
Location location = message.ReadLocation();
var thingId = message.PeekUShort();
if (thingId == 0xFF01)
{
message.ReadUShort();
Tile tile = client.Map.GetTile(location);
if (tile == null)
throw new Exception("[ParseServerUpdateTile] Tile not found.");
tile.Clear();
}
else
{
ParseServerTileDescription(message, location);
message.ReadUShort();
}
}
示例10: ParseServerTileTransformThing
private void ParseServerTileTransformThing(InMessage message)
{
Location location = message.ReadLocation();
var stack = message.ReadByte();
var thing = GetThing(message);
if (!location.IsCreature)
{
//get tile
Tile tile = client.Map.GetTile(location);
if (tile == null)
throw new Exception("[ParseServerTileTransformThing] Tile not found.");
var oldThing = tile.GetThing(stack);
if (oldThing == null)
return; // the client will send update tile.
tile.ReplaceThing(stack, thing);
client.Map.SetTile(tile);
}
}
示例11: ParseServerTileRemoveThing
private void ParseServerTileRemoveThing(InMessage message)
{
Location location = message.ReadLocation();
var stack = message.ReadByte();
if (location.IsCreature) //TODO: Veirificar o porque disso.
return;
Tile tile = client.Map.GetTile(location);
if (tile == null)
throw new Exception("[ParseServerTileRemoveThing] Tile not found.");
var thing = tile.GetThing(stack);
if (thing == null) // The client will send update tile.
return;
tile.RemoveThing(stack);
}
示例12: ParseServerTileAddThing
private void ParseServerTileAddThing(InMessage message)
{
Location location = message.ReadLocation();
var stack = message.ReadByte();
Thing thing = GetThing(message);
Tile tile = client.Map.GetTile(location);
if (tile == null)
throw new Exception("[ParseServerTileAddThing] Tile not found.");
tile.AddThing(stack, thing);
client.Map.SetTile(tile);
}
示例13: ParseServerTextMessage
private void ParseServerTextMessage(InMessage message)
{
var mClass = (MessageClasses)message.ReadByte();
switch (mClass)
{
case MessageClasses.DAMAGE_DEALT:
case MessageClasses.DAMAGE_RECEIVED:
case MessageClasses.DAMAGE_OTHERS:
{
Location location = message.ReadLocation();
var detailsValue = message.ReadUInt();
var detailsColor = message.ReadByte();
var detailsSubValue = message.ReadUInt();
var deatilsSubColor = message.ReadByte();
break;
}
case MessageClasses.EXPERIENCE:
case MessageClasses.EXPERIENCE_OTHERS:
case MessageClasses.HEALED:
case MessageClasses.HEALED_OTHERS:
{
Location location = message.ReadLocation();
var detailsValue = message.ReadUInt();
var detailsColor = message.ReadByte();
break;
}
default:
break;
}
var text = message.ReadString();
}