本文整理汇总了C#中ServerPackets类的典型用法代码示例。如果您正苦于以下问题:C# ServerPackets类的具体用法?C# ServerPackets怎么用?C# ServerPackets使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ServerPackets类属于命名空间,在下文中一共展示了ServerPackets类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Load
public void Load(S.ObjectGold info)
{
Name = string.Format("Gold ({0:###,###,###})", info.Gold);
BodyLibrary = Libraries.FloorItems;
CurrentLocation = info.Location;
MapLocation = info.Location;
GameScene.Scene.MapControl.AddObject(this);
if (info.Gold < 100)
DrawFrame = 112;
else if (info.Gold < 200)
DrawFrame = 113;
else if (info.Gold < 500)
DrawFrame = 114;
else if (info.Gold < 1000)
DrawFrame = 115;
else
DrawFrame = 116;
Size = BodyLibrary.GetTrueSize(DrawFrame);
DrawY = CurrentLocation.Y;
}
示例2: Load
public void Load(S.ObjectSpell info)
{
CurrentLocation = info.Location;
MapLocation = info.Location;
GameScene.Scene.MapControl.AddObject(this);
Spell = info.Spell;
switch (Spell)
{
case Spell.TrapHexagon:
BodyLibrary = Libraries.Magic;
DrawFrame = 1390;
FrameInterval = 100;
FrameCount = 10;
break;
case Spell.FireWall:
BodyLibrary = Libraries.Magic;
DrawFrame = 1630;
FrameInterval = 120;
FrameCount = 6;
Light = 3;
break;
case Spell.PoisonField:
BodyLibrary = Libraries.Magic2;
DrawFrame = 1650;
FrameInterval = 120;
FrameCount = 20;
Light = 3;
break;
}
NextMotion = CMain.Time + FrameInterval;
NextMotion -= NextMotion % 100;
}
示例3: Load
public void Load(S.ObjectNPC info)
{
Name = info.Name;
NameColour = info.NameColour;
CurrentLocation = info.Location;
Movement = info.Location;
MapLocation = info.Location;
GameScene.Scene.MapControl.AddObject(this);
Direction = info.Direction;
if (info.Image < Libraries.NPCs.Length)
BodyLibrary = Libraries.NPCs[info.Image];
switch (info.Image)
{
case 23:
Frames = FrameSet.NPCs[1];
break;
default:
Frames = FrameSet.NPCs[0];
break;
}
Light = 10;
SetAction();
}
示例4: Load
public void Load(S.ObjectDeco info)
{
CurrentLocation = info.Location;
MapLocation = info.Location;
GameScene.Scene.MapControl.AddObject(this);
Image = info.Image;
BodyLibrary = Libraries.Deco;
}
示例5: Load
public void Load(S.UserInformation info)
{
Id = info.RealId;
Name = info.Name;
Settings.LoadTrackedQuests(info.Name);
NameColour = info.NameColour;
GuildName = info.GuildName;
GuildRankName = info.GuildRank;
Class = info.Class;
Gender = info.Gender;
Level = info.Level;
CurrentLocation = info.Location;
MapLocation = info.Location;
GameScene.Scene.MapControl.AddObject(this);
Direction = info.Direction;
Hair = info.Hair;
HP = info.HP;
MP = info.MP;
Experience = info.Experience;
MaxExperience = info.MaxExperience;
LevelEffects = info.LevelEffects;
Inventory = info.Inventory;
Equipment = info.Equipment;
QuestInventory = info.QuestInventory;
Magics = info.Magics;
for (int i = 0; i < Magics.Count; i++ )
{
if (Magics[i].CastTime > 0)
Magics[i].CastTime = CMain.Time - Magics[i].CastTime;
}
IntelligentCreatures = info.IntelligentCreatures;//IntelligentCreature
SummonedCreatureType = info.SummonedCreatureType;//IntelligentCreature
CreatureSummoned = info.CreatureSummoned;//IntelligentCreature
BindAllItems();
RefreshStats();
SetAction();
}
示例6: Load
public void Load(S.ObjectItem info)
{
Name = info.Name;
NameColour = info.NameColour;
BodyLibrary = Libraries.FloorItems;
CurrentLocation = info.Location;
MapLocation = info.Location;
GameScene.Scene.MapControl.AddObject(this);
DrawFrame = info.Image;
Size = BodyLibrary.GetTrueSize(DrawFrame);
DrawY = CurrentLocation.Y;
}
示例7: StartGame
public void StartGame(S.StartGameBanned p)
{
StartGameButton.Enabled = true;
TimeSpan d = p.ExpiryDate - CMain.Now;
MirMessageBox.Show(string.Format("This account is banned.\n\nReason: {0}\nExpiryDate: {1}\nDuration: {2:#,##0} Hours, {3} Minutes, {4} Seconds", p.Reason,
p.ExpiryDate, Math.Floor(d.TotalHours), d.Minutes, d.Seconds));
}
示例8: DeleteCharacter
private void DeleteCharacter(S.DeleteCharacterSuccess p)
{
DeleteCharacterButton.Enabled = true;
MirMessageBox.Show("Your character was deleted successfully.");
for (int i = 0; i < Characters.Count; i++)
if (Characters[i].Index == p.CharacterIndex)
{
Characters.RemoveAt(i);
break;
}
UpdateInterface();
}
示例9: NewCharacter
private void NewCharacter(S.NewCharacterSuccess p)
{
_character.Dispose();
MirMessageBox.Show("Your character was created successfully.");
Characters.Insert(0, p.CharInfo);
_selected = 0;
UpdateInterface();
}
示例10: MountUpdate
public void MountUpdate(S.MountUpdate info)
{
MountType = info.MountType;
RidingMount = info.RidingMount;
QueuedAction action = new QueuedAction { Action = MirAction.Standing, Direction = Direction, Location = CurrentLocation };
ActionFeed.Insert(0, action);
MountTime = CMain.Time;
if (MountType < 0)
GameScene.Scene.MountDialog.Hide();
SetLibraries();
SetEffects();
PlayMountSound();
}
示例11: Update
public void Update(S.PlayerUpdate info)
{
Weapon = info.Weapon;
Armour = info.Armour;
Light = info.Light;
WingEffect = info.WingEffect;
SetLibraries();
SetEffects();
}
示例12: Load
public void Load(S.ObjectPlayer info)
{
Name = info.Name;
NameColour = info.NameColour;
Class = info.Class;
Gender = info.Gender;
CurrentLocation = info.Location;
MapLocation = info.Location;
GameScene.Scene.MapControl.AddObject(this);
Direction = info.Direction;
Hair = info.Hair;
Weapon = info.Weapon;
Armour = info.Armour;
Light = info.Light;
Poison = info.Poison;
Dead = info.Dead;
Hidden = info.Hidden;
WingEffect = info.WingEffect;
SetLibraries();
if (Dead) ActionFeed.Add(new QueuedAction { Action = MirAction.Dead, Direction = Direction, Location = CurrentLocation });
if (info.Extra) Effects.Add(new Effect(Libraries.Magic2, 670, 10, 800, this));
SetAction();
}
示例13: MailCost
private void MailCost(S.MailCost p)
{
if(GameScene.Scene.MailComposeParcelDialog.Visible)
{
if (p.Cost > 0)
SoundManager.PlaySound(SoundList.Gold);
GameScene.Scene.MailComposeParcelDialog.ParcelCostLabel.Text = p.Cost.ToString();
}
}
示例14: ResizeInventory
private void ResizeInventory(S.ResizeInventory p)
{
Array.Resize(ref User.Inventory, p.Size);
InventoryDialog.RefreshInventory2();
}
示例15: ParcelCollected
private void ParcelCollected(S.ParcelCollected p)
{
switch(p.Result)
{
case -1:
MirMessageBox messageBox = new MirMessageBox(string.Format("No parcels to collect."), MirMessageBoxButtons.OK);
messageBox.Show();
break;
case 0:
messageBox = new MirMessageBox(string.Format("All parcels have been collected."), MirMessageBoxButtons.OK);
messageBox.Show();
break;
case 1:
GameScene.Scene.MailReadParcelDialog.Hide();
break;
}
}