本文整理匯總了C#中SharpTibiaProxy.Network.InMessage.ReadString方法的典型用法代碼示例。如果您正苦於以下問題:C# InMessage.ReadString方法的具體用法?C# InMessage.ReadString怎麽用?C# InMessage.ReadString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類SharpTibiaProxy.Network.InMessage
的用法示例。
在下文中一共展示了InMessage.ReadString方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: ParseClientSay
private void ParseClientSay(InMessage message)
{
string receiver = null;
ushort channelId = 0;
MessageClasses type = (MessageClasses)message.ReadByte();
switch (type)
{
case MessageClasses.PRIVATE_TO:
case MessageClasses.GAMEMASTER_PRIVATE_TO:
receiver = message.ReadString();
break;
case MessageClasses.CHANNEL:
case MessageClasses.CHANNEL_HIGHLIGHT:
case MessageClasses.GAMEMASTER_CHANNEL:
channelId = message.ReadUShort();
break;
default:
break;
}
string text = message.ReadString();
client.Chat.OnPlayerSpeak(receiver, channelId, type, text);
}
示例2: ReadMarketOffer
private void ReadMarketOffer(InMessage message, OfferKind offer, ushort request)
{
uint Timestamp = message.ReadUInt();
ushort Counter = message.ReadUShort();
ushort TypeId = 0;
switch (request)
{
case 65534:
case 65535:
TypeId = message.ReadUShort();
break;
default:
TypeId = request;
break;
}
ushort Amount = message.ReadUShort();
uint PiecePrice = message.ReadUInt();
string Character = "";
TerminationType TerminationType = Domain.TerminationType.Active;
switch (request)
{
case 65534:
break;
case 65535:
TerminationType = (TerminationType)message.ReadByte();
break;
default:
Character = message.ReadString();
break;
}
client.Market.Offers.Add(new Offer(new OfferId(Timestamp, Counter), offer, TypeId, Amount, PiecePrice, Character, TerminationType));
}
示例3: ParseInitialize
private void ParseInitialize(InMessage message)
{
if (minorVersion >= 10)
message.ReadByte(); //?
int count = message.ReadUShort();
for (int i = 0; i < count; i++)
{
var creature = new Creature(message.ReadUInt());
creature.Type = (CreatureType)message.ReadByte();
creature.Name = message.ReadString();
//Trace.WriteLine(String.Format("Creature[{0}]: {1}", i, creature.Name));
creature.Health = message.ReadByte();
var direction = (Direction)message.ReadByte();
creature.LookDirection = direction;
creature.TurnDirection = direction;
//Outfit
creature.Outfit = message.ReadOutfit();
creature.LightLevel = message.ReadByte();
creature.LightColor = message.ReadByte();
creature.Speed = message.ReadUShort();
creature.Skull = message.ReadByte();
creature.Shield = message.ReadByte();
creature.Emblem = message.ReadByte();
creature.IsImpassable = message.ReadByte() == 0x01;
//10.20+ includes an extra 4 bytes per creature
//These bytes could alter the read order, but since I don't know what they are for yet, I'll read them out of the way.
message.ReadUInt();
//speech category?
if (client.Version.Number >= ClientVersion.Version1036.Number)
message.ReadByte();
client.BattleList.AddCreature(creature);
}
ParseTibiaPackets(message);
}
示例4: ParseServerOpenChannel
private void ParseServerOpenChannel(InMessage message)
{
var channelId = message.ReadUShort();
var name = message.ReadString();
var num = message.ReadUShort();
for (int i = 0; i < num; i++)
message.ReadString();
num = message.ReadUShort();
for (int i = 0; i < num; i++)
message.ReadString();
}
示例5: ParseServerMarketBrowser
private void ParseServerMarketBrowser(InMessage message)
{
ushort num = message.ReadUShort();
if (num == 65535)
{
var count = message.ReadUInt();
for (int i = 0; i < count; i++)
{
message.ReadUInt();
message.ReadUShort();
message.ReadUShort();
message.ReadUShort();
message.ReadUInt();
message.ReadByte();
}
count = message.ReadUInt();
for (int j = 0; j <= count; j++)
{
message.ReadUInt();
message.ReadUShort();
message.ReadUShort();
message.ReadUShort();
message.ReadUInt();
message.ReadByte();
}
}
else if (num == 65534)
{
var count = message.ReadUInt();
for (int k = 0; k <= count; k++)
{
message.ReadUInt();
message.ReadUShort();
message.ReadUShort();
message.ReadUShort();
message.ReadUInt();
}
count = message.ReadUInt();
for (int l = 0; l <= count; l++)
{
message.ReadUInt();
message.ReadUShort();
message.ReadUShort();
message.ReadUShort();
message.ReadUInt();
}
}
else
{
var count = message.ReadUInt();
for (int m = 0; m < count; m++)
{
message.ReadUInt();
message.ReadUShort();
message.ReadUShort();
message.ReadUInt();
message.ReadString();
}
count = message.ReadUInt();
for (int n = 0; n < count; n++)
{
message.ReadUInt();
message.ReadUShort();
message.ReadUShort();
message.ReadUInt();
message.ReadString();
}
}
}
示例6: ParseServerHouseTextWindow
private void ParseServerHouseTextWindow(InMessage message)
{
var unk = message.ReadByte();
var windowId = message.ReadUInt();
var text = message.ReadString();
}
示例7: 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);
}
示例8: ParseServerChannelList
private void ParseServerChannelList(InMessage message)
{
var count = message.ReadByte();
for (uint i = 0; i < count; ++i)
{
var channelId = message.ReadUShort();
var name = message.ReadString();
}
}
示例9: ParseServerQuestList
private void ParseServerQuestList(InMessage message)
{
var nQuests = message.ReadUShort();
for (uint i = 0; i < nQuests; ++i)
{
var questsID = message.ReadUShort();
var questsName = message.ReadString();
var questsState = message.ReadByte();
}
}
示例10: ParseServerOutfitWindow
private void ParseServerOutfitWindow(InMessage message)
{
message.ReadOutfit();
var nOutfits = message.ReadByte();
for (uint i = 0; i < nOutfits; ++i)
{
var outfitID = message.ReadUShort();
var name = message.ReadString();
var addons = message.ReadByte();
}
int mountCount = message.ReadByte();
for (int i = 0; i < mountCount; ++i)
{
int mountId = message.ReadUShort(); // mount type
string mountName = message.ReadString(); // mount name
}
}
示例11: ParseServerOpenShopWindow
private void ParseServerOpenShopWindow(InMessage message)
{
var shop = new Shop(message.ReadString());
var size = message.ReadUShort();
for (uint i = 0; i < size; ++i)
{
var shopItem = new ShopItem();
shopItem.Id = message.ReadUShort();
shopItem.SubType = message.ReadByte();
shopItem.Name = message.ReadString();
shopItem.Weight = message.ReadUInt();
shopItem.BuyPrice = message.ReadUInt();
shopItem.SellPrice = message.ReadUInt();
shop.Items.Add(shopItem);
}
client.OnOpenShopWindow(shop);
}
示例12: ParseServerOpenPrivatePlayerChat
private void ParseServerOpenPrivatePlayerChat(InMessage message)
{
var name = message.ReadString();
}
示例13: ParseServerOpenContainer
private void ParseServerOpenContainer(InMessage message)
{
var containerId = message.ReadByte();
var containerItem = GetItem(message, ushort.MaxValue);
var name = message.ReadString();
var capacity = message.ReadByte();
var hasParent = message.ReadByte();
var itemCount = message.ReadByte();
for (uint i = 0; i < itemCount; ++i)
{
Item item = GetItem(message, ushort.MaxValue);
if (item == null)
throw new Exception("Container Open - !item");
}
}
示例14: ParseServerVipState
private void ParseServerVipState(InMessage message)
{
var creatureID = message.ReadUInt();
var name = message.ReadString();
if (client.Version.Number > ClientVersion.Version961.Number)
{
var description = message.ReadString();
var icon = message.ReadUInt();
var notifyAtLogin = message.ReadByte().Equals(0x1);
}
var connectionStatus = message.ReadByte();
}
示例15: ParseServerAnimatedText
private void ParseServerAnimatedText(InMessage message)
{
Location location = message.ReadLocation();
var color = message.ReadByte();
var text = message.ReadString();
}