本文整理汇总了C#中ServerPackets类的典型用法代码示例。如果您正苦于以下问题:C# ServerPackets类的具体用法?C# ServerPackets怎么用?C# ServerPackets使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ServerPackets类属于命名空间,在下文中一共展示了ServerPackets类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:thedeaths,项目名称:mir2,代码行数:26,代码来源:ItemObject.cs
示例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;
}
开发者ID:xiaofengzhiyu,项目名称:CSharpMir,代码行数:34,代码来源:SpellObject.cs
示例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();
}
开发者ID:xiaofengzhiyu,项目名称:CSharpMir,代码行数:27,代码来源:NPCObject.cs
示例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;
}
开发者ID:Pete107,项目名称:Mir2,代码行数:9,代码来源:DecoObject.cs
示例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();
}
开发者ID:Pete107,项目名称:Mir2,代码行数:48,代码来源:UserObject.cs
示例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;
}
开发者ID:ufaith,项目名称:cmirosg,代码行数:16,代码来源:ItemObject.cs
示例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));
}
开发者ID:thedeaths,项目名称:official-mir2c-,代码行数:8,代码来源:SelectScene.cs
示例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();
}
开发者ID:thedeaths,项目名称:official-mir2c-,代码行数:14,代码来源:SelectScene.cs
示例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();
}
开发者ID:thedeaths,项目名称:official-mir2c-,代码行数:9,代码来源:SelectScene.cs
示例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();
}
开发者ID:nerestaren,项目名称:mir2,代码行数:18,代码来源:PlayerObject.cs
示例11: Update
public void Update(S.PlayerUpdate info)
{
Weapon = info.Weapon;
Armour = info.Armour;
Light = info.Light;
WingEffect = info.WingEffect;
SetLibraries();
SetEffects();
}
开发者ID:nerestaren,项目名称:mir2,代码行数:10,代码来源:PlayerObject.cs
示例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();
}
开发者ID:WillMcKill,项目名称:MirRage,代码行数:32,代码来源:PlayerObject.cs
示例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();
}
}
开发者ID:ElijahLOMCN,项目名称:mir2,代码行数:10,代码来源:GameScene.cs
示例14: ResizeInventory
private void ResizeInventory(S.ResizeInventory p)
{
Array.Resize(ref User.Inventory, p.Size);
InventoryDialog.RefreshInventory2();
}
开发者ID:ElijahLOMCN,项目名称:mir2,代码行数:5,代码来源:GameScene.cs
示例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;
}
}
开发者ID:ElijahLOMCN,项目名称:mir2,代码行数:17,代码来源:GameScene.cs
示例16: GameShopUpdate
private void GameShopUpdate(S.GameShopInfo p)
{
p.Item.Stock = p.StockLevel;
GameShopInfoList.Add(p.Item);
if (p.Item.Date > DateTime.Now.AddDays(-7)) GameShopDialog.New.Visible = true;
}
开发者ID:ElijahLOMCN,项目名称:mir2,代码行数:6,代码来源:GameScene.cs
示例17: GameShopStock
private void GameShopStock(S.GameShopStock p)
{
for (int i = 0; i < GameShopInfoList.Count; i++)
{
if (GameShopInfoList[i].GIndex == p.GIndex)
{
if (p.StockLevel == 0) GameShopInfoList.Remove(GameShopInfoList[i]);
else GameShopInfoList[i].Stock = p.StockLevel;
if (GameShopDialog.Visible) GameShopDialog.UpdateShop();
}
}
}
开发者ID:ElijahLOMCN,项目名称:mir2,代码行数:13,代码来源:GameScene.cs
示例18: NewIntelligentCreature
private void NewIntelligentCreature(S.NewIntelligentCreature p)//IntelligentCreature
{
User.IntelligentCreatures.Add(p.Creature);
MirInputBox inputBox = new MirInputBox("Please give your creature a name.");
inputBox.InputTextBox.Text = GameScene.User.IntelligentCreatures[User.IntelligentCreatures.Count-1].CustomName;
inputBox.OKButton.Click += (o1, e1) =>
{
if (IntelligentCreatureDialog.Visible) IntelligentCreatureDialog.Update();//refresh changes
GameScene.User.IntelligentCreatures[User.IntelligentCreatures.Count - 1].CustomName = inputBox.InputTextBox.Text;
Network.Enqueue(new C.UpdateIntelligentCreature { Creature = GameScene.User.IntelligentCreatures[User.IntelligentCreatures.Count - 1] });
inputBox.Dispose();
};
inputBox.Show();
}
开发者ID:ElijahLOMCN,项目名称:mir2,代码行数:15,代码来源:GameScene.cs
示例19: FishingUpdate
public void FishingUpdate(S.FishingUpdate p)
{
if (Fishing != p.Fishing)
{
MirDirection dir = Functions.DirectionFromPoint(CurrentLocation, p.FishingPoint);
if (p.Fishing)
{
QueuedAction action = new QueuedAction { Action = MirAction.FishingCast, Direction = dir, Location = CurrentLocation };
ActionFeed.Add(action);
}
else
{
QueuedAction action = new QueuedAction { Action = MirAction.FishingReel, Direction = dir, Location = CurrentLocation };
ActionFeed.Add(action);
if (p.FoundFish)
GameScene.Scene.ChatDialog.ReceiveChat("Found fish!!", ChatType.Hint);
}
Fishing = p.Fishing;
SetLibraries();
}
if (!HasFishingRod)
{
GameScene.Scene.FishingDialog.Hide();
}
FishingPoint = p.FishingPoint;
FoundFish = p.FoundFish;
}
开发者ID:nerestaren,项目名称:mir2,代码行数:32,代码来源:PlayerObject.cs
示例20: UpdateIntelligentCreatureList
private void UpdateIntelligentCreatureList(S.UpdateIntelligentCreatureList p)//IntelligentCreature
{
User.CreatureSummoned = p.CreatureSummoned;
User.SummonedCreatureType = p.SummonedCreatureType;
User.PearlCount = p.PearlCount;
if (p.CreatureList.Count != User.IntelligentCreatures.Count)
{
User.IntelligentCreatures.Clear();
for (int i = 0; i < p.CreatureList.Count; i++)
User.IntelligentCreatures.Add(p.CreatureList[i]);
for (int i = 0; i < IntelligentCreatureDialog.CreatureButtons.Length; i++)
IntelligentCreatureDialog.CreatureButtons[i].Clear();
IntelligentCreatureDialog.Hide();
}
else
{
for (int i = 0; i < p.CreatureList.Count; i++)
User.IntelligentCreatures[i] = p.CreatureList[i];
if (IntelligentCreatureDialog.Visible) IntelligentCreatureDialog.Update();
}
}
开发者ID:ElijahLOMCN,项目名称:mir2,代码行数:23,代码来源:GameScene.cs
注:本文中的ServerPackets类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论