本文整理汇总了C#中Packet.GetBreakString方法的典型用法代码示例。如果您正苦于以下问题:C# Packet.GetBreakString方法的具体用法?C# Packet.GetBreakString怎么用?C# Packet.GetBreakString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Packet
的用法示例。
在下文中一共展示了Packet.GetBreakString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SkillmasterData
internal SkillmasterData(Packet pkt)
{
m_id = pkt.GetShort();
m_title = pkt.GetBreakString();
m_skills = new List<Skill>();
while(pkt.ReadPos < pkt.Length)
m_skills.Add(new Skill(pkt));
}
示例2: PartyMember
internal PartyMember(Packet pkt, bool isFullData)
{
m_isFullData = isFullData;
m_id = pkt.GetShort();
if (!m_isFullData)
{
//if it isn't full data, only the id and health are being provide as part of an AGREE packet
m_pctHealth = pkt.GetChar();
m_isLeader = false;
m_level = 0;
m_name = "";
return;
}
m_isLeader = pkt.GetChar() != 0;
m_level = pkt.GetChar();
m_pctHealth = pkt.GetChar();
m_name = pkt.GetBreakString();
m_name = char.ToUpper(m_name[0]) + m_name.Substring(1);
}
示例3: CharacterData
internal CharacterData(Packet pkt)
{
m_name = pkt.GetBreakString();
if (m_name.Length > 1)
m_name = char.ToUpper(m_name[0]) + m_name.Substring(1);
m_id = pkt.GetShort();
m_map = pkt.GetShort();
m_x = pkt.GetShort();
m_y = pkt.GetShort();
m_facing = (EODirection)pkt.GetChar();
pkt.GetChar(); //value is always 6? unknown
m_guildTag = pkt.GetFixedString(3);
m_level = pkt.GetChar();
m_gender = pkt.GetChar();
m_hairstyle = pkt.GetChar();
m_haircolor = pkt.GetChar();
m_race = pkt.GetChar();
m_maxhp = pkt.GetShort();
m_hp = pkt.GetShort();
m_maxtp = pkt.GetShort();
m_tp = pkt.GetShort();
m_boots = pkt.GetShort();
pkt.Skip(3 * sizeof(short)); //other paperdoll data is 0'd out
m_armor = pkt.GetShort();
pkt.Skip(sizeof(short));
m_hat = pkt.GetShort();
m_shield = pkt.GetShort();
m_weapon = pkt.GetShort();
m_sit = (SitState)pkt.GetChar();
m_hidden = pkt.GetChar() != 0;
}
示例4: PaperdollDisplayData
internal PaperdollDisplayData(Packet pkt)
{
//need to be applied to the character that is passed to the dialog
name = pkt.GetBreakString();
home = pkt.GetBreakString();
partner = pkt.GetBreakString();
title = pkt.GetBreakString();
guild = pkt.GetBreakString();
rank = pkt.GetBreakString();
playerID = pkt.GetShort();
clas = pkt.GetChar();
gender = pkt.GetChar();
if (pkt.GetChar() != 0)
throw new ArgumentException("Invalid/malformed packet", "pkt");
paperdoll = new short[(int)EquipLocation.PAPERDOLL_MAX];
for (int i = 0; i < (int)EquipLocation.PAPERDOLL_MAX; ++i)
paperdoll[i] = pkt.GetShort();
iconType = (PaperdollIconType)pkt.GetChar();
}
示例5: CharacterRenderData
internal CharacterRenderData(Packet pkt)
{
name = pkt.GetBreakString();
id = pkt.GetInt();
level = pkt.GetChar();
gender = pkt.GetChar();
hairstyle = pkt.GetChar();
haircolor = pkt.GetChar();
race = pkt.GetChar();
admin = (AdminLevel)pkt.GetChar();
boots = pkt.GetShort();
armor = pkt.GetShort();
hat = pkt.GetShort();
shield = pkt.GetShort();
weapon = pkt.GetShort();
}
示例6: _handleTalkAnnounce
private void _handleTalkAnnounce(Packet pkt)
{
if (OnPlayerChatByName == null) return;
string name = pkt.GetBreakString();
name = char.ToUpper(name[0]) + name.Substring(1);
string msg = pkt.GetBreakString();
OnPlayerChatByName(TalkType.Announce, name, msg);
}
示例7: _handleTalkOpen
/// <summary>
/// Handler for the TALK_OPEN packet (sent in response to party messages)
/// </summary>
private void _handleTalkOpen(Packet pkt)
{
if (OnPlayerChatByName == null) return;
short from = pkt.GetShort();
string message = pkt.GetBreakString();
OnPlayerChatByID(TalkType.Party, from, message);
}
示例8: _handleTalkRequest
/// <summary>
/// Handler for the TALK_REQUEST packet (sent in response to guild messages)
/// </summary>
private void _handleTalkRequest(Packet pkt)
{
if (OnPlayerChatByName == null) return;
string from = pkt.GetBreakString();
from = char.ToUpper(from[0]) + from.Substring(1).ToLower();
string message = pkt.GetBreakString();
OnPlayerChatByName(TalkType.Guild, from, message);
}
示例9: InProgressQuestData
internal InProgressQuestData(Packet pkt)
{
_name = pkt.GetBreakString();
_description = pkt.GetBreakString();
_icon = (BookIcon) pkt.GetShort();
_progress = pkt.GetShort();
_target = pkt.GetShort();
if (pkt.GetByte() != 255)
throw new ArgumentException("Malformed quest packet", "pkt");
}
示例10: _handleTradeOpen
private void _handleTradeOpen(Packet pkt)
{
if (OnTradeOpen == null) return;
short player1ID = pkt.GetShort();
string player1Name = pkt.GetBreakString();
short player2ID = pkt.GetShort();
string player2Name = pkt.GetBreakString();
OnTradeOpen(player1ID, player1Name, player2ID, player2Name);
}
示例11: _handlePlayerList
private void _handlePlayerList(Packet pkt, bool isFriendList)
{
short numTotal = pkt.GetShort();
if (pkt.GetByte() != 255)
return;
m_init_onlinePlayerList = new List<OnlineEntry>();
for (int i = 0; i < numTotal; ++i)
{
string name = pkt.GetBreakString();
if (!isFriendList)
{
string title = pkt.GetBreakString();
if (string.IsNullOrWhiteSpace(title))
title = "-";
if (pkt.GetChar() != 0)
return;
PaperdollIconType iconType = (PaperdollIconType)pkt.GetChar();
int clsId = pkt.GetChar();
string guild = pkt.GetBreakString();
if (string.IsNullOrWhiteSpace(guild))
guild = "-";
name = char.ToUpper(name[0]) + name.Substring(1);
title = char.ToUpper(title[0]) + title.Substring(1);
m_init_onlinePlayerList.Add(new OnlineEntry(name, title, guild, clsId, iconType));
}
else
{
m_init_onlinePlayerList.Add(new OnlineEntry(name, "", "", 0, PaperdollIconType.Normal));
}
}
}
示例12: WelcomeRequestData
internal WelcomeRequestData(Packet pkt)
{
PlayerID = pkt.GetShort();
ActiveCharacterID = pkt.GetInt();
MapID = pkt.GetShort();
MapRID = pkt.GetBytes(4);
MapLen = pkt.GetThree();
MapIsPK = MapRID[0] == 0xFF && MapRID[1] == 0x01;
EifRid = Packet.DecodeNumber(pkt.GetBytes(4));
EifLen = (short)Packet.DecodeNumber(pkt.GetBytes(2));
EnfRid = Packet.DecodeNumber(pkt.GetBytes(4));
EnfLen = (short)Packet.DecodeNumber(pkt.GetBytes(2));
EsfRid = Packet.DecodeNumber(pkt.GetBytes(4));
EsfLen = (short)Packet.DecodeNumber(pkt.GetBytes(2));
EcfRid = Packet.DecodeNumber(pkt.GetBytes(4));
EcfLen = (short)Packet.DecodeNumber(pkt.GetBytes(2));
Name = pkt.GetBreakString();
Title = pkt.GetBreakString();
GuildName = pkt.GetBreakString();
GuildRankStr = pkt.GetBreakString();
ClassID = pkt.GetChar();
PaddedGuildTag = pkt.GetFixedString(3); //padded guild tag is 3 characters
AdminLevel = (AdminLevel)pkt.GetChar();
Level = pkt.GetChar();
Exp = pkt.GetInt();
Usage = pkt.GetInt();
HP = pkt.GetShort();
MaxHP = pkt.GetShort();
TP = pkt.GetShort();
MaxTP = pkt.GetShort();
MaxSP = pkt.GetShort();
StatPoints = pkt.GetShort();
SkillPoints = pkt.GetShort();
Karma = pkt.GetShort();
MinDam = pkt.GetShort();
MaxDam = pkt.GetShort();
Accuracy = pkt.GetShort();
Evade = pkt.GetShort();
Armor = pkt.GetShort();
DispStr = pkt.GetShort();
DispInt = pkt.GetShort();
DispWis = pkt.GetShort();
DispAgi = pkt.GetShort();
DispCon = pkt.GetShort();
DispCha = pkt.GetShort();
PaperDoll = new short[(int)EquipLocation.PAPERDOLL_MAX];
for (int i = 0; i < (int)EquipLocation.PAPERDOLL_MAX; ++i)
{
PaperDoll[i] = pkt.GetShort();
}
GuildRankNum = pkt.GetChar();
JailMap = pkt.GetShort();
pkt.Skip(12); //i think these can safely be skipped for the moment
FirstTimePlayer = pkt.GetChar() == 2; //signal that the player should see the "first timer" message
}
示例13: WelcomeMessageData
internal WelcomeMessageData(Packet pkt)
{
m_news = new List<string>();
for (int i = 0; i < 9; ++i)
{
m_news.Add(pkt.GetBreakString());
}
Weight = pkt.GetChar();
MaxWeight = pkt.GetChar();
m_inventory = new List<InventoryItem>();
while (pkt.PeekByte() != 255)
m_inventory.Add(new InventoryItem { id = pkt.GetShort(), amount = pkt.GetInt() });
pkt.GetByte();
m_spells = new List<CharacterSpell>();
while (pkt.PeekByte() != 255)
m_spells.Add(new CharacterSpell { id = pkt.GetShort(), level = pkt.GetShort() });
pkt.GetByte();
//Get data for other characters
int numOtherCharacters = pkt.GetChar();
m_characters = new List<CharacterData>(numOtherCharacters);
if (pkt.GetByte() != 255) throw new Exception();
for (int i = 0; i < numOtherCharacters; ++i)
{
CharacterData newGuy = new CharacterData(pkt);
if (pkt.GetByte() != 255)
throw new Exception();
m_characters.Add(newGuy);
}
//get data for any npcs
m_npcs = new List<NPCData>();
while (pkt.PeekByte() != 255)
{
NPCData newGuy = new NPCData(pkt);
m_npcs.Add(newGuy);
}
pkt.GetByte();
//get data for items on map
m_items = new List<MapItem>();
while (pkt.ReadPos < pkt.Length)
{
m_items.Add(new MapItem
{
uid = pkt.GetShort(),
id = pkt.GetShort(),
x = pkt.GetChar(),
y = pkt.GetChar(),
amount = pkt.GetThree(),
//turn off drop protection for items coming into view - server will validate
time = DateTime.Now.AddSeconds(-5),
npcDrop = false,
playerID = -1
});
}
}
示例14: _handleQuestList
private void _handleQuestList(Packet pkt)
{
QuestPage page = (QuestPage) pkt.GetChar();
short numQuests = pkt.GetShort();
switch (page)
{
case QuestPage.Progress:
var dataCollection = new List<InProgressQuestData>(numQuests);
while (pkt.ReadPos != pkt.Length)
dataCollection.Add(new InProgressQuestData(pkt));
if (OnViewQuestProgress != null)
OnViewQuestProgress(numQuests, dataCollection);
break;
case QuestPage.History:
var completedNames = new List<string>(numQuests);
while (pkt.ReadPos != pkt.Length)
completedNames.Add(pkt.GetBreakString());
if (OnViewQuestHistory != null)
OnViewQuestHistory(numQuests, completedNames);
break;
default:
throw new ArgumentOutOfRangeException();
}
}
示例15: _handleQuestDialog
private void _handleQuestDialog(Packet pkt)
{
if (OnQuestDialog == null) return;
int numDialogs = pkt.GetChar();
short vendorID = pkt.GetShort();
short questID = pkt.GetShort();
short sessionID = pkt.GetShort(); //not used by eoserv
short dialogID = pkt.GetShort(); //not used by eoserv
if (pkt.GetByte() != 255) return;
QuestState stateInfo = new QuestState(sessionID, dialogID, questID, vendorID);
var dialogNames = new Dictionary<short, string>(numDialogs);
for (int i = 0; i < numDialogs; ++i)
{
dialogNames.Add(pkt.GetShort(), pkt.GetBreakString());
}
var pages = new List<string>();
var links = new Dictionary<short, string>();
while (pkt.ReadPos != pkt.Length)
{
var entry = (DialogEntry) pkt.GetShort();
switch (entry)
{
case DialogEntry.DialogText:
pages.Add(pkt.GetBreakString());
break;
case DialogEntry.DialogLink:
links.Add(pkt.GetShort(), pkt.GetBreakString());
break;
}
}
OnQuestDialog(stateInfo, dialogNames, pages, links);
}