本文整理汇总了C#中YGOSharp.CoreMessage类的典型用法代码示例。如果您正苦于以下问题:C# CoreMessage类的具体用法?C# CoreMessage怎么用?C# CoreMessage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CoreMessage类属于YGOSharp命名空间,在下文中一共展示了CoreMessage类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnSelectChain
private int OnSelectChain(CoreMessage msg)
{
int player = msg.Reader.ReadByte();
int count = msg.Reader.ReadByte();
msg.Reader.ReadBytes(10 + count * 11);
if (count > 0)
{
Game.WaitForResponse(player);
SendToPlayer(msg, player);
return 1;
}
Game.SetResponse(-1);
return 0;
}
示例2: OnTagSwap
private void OnTagSwap(CoreMessage msg)
{
GameServerPacket packet = new GameServerPacket(GameMessage.TagSwap);
int player = msg.Reader.ReadByte();
packet.Write((byte)player);
packet.Write(msg.Reader.ReadBytes(2));
int count = msg.Reader.ReadByte();
packet.Write((byte)count);
packet.Write(msg.Reader.ReadBytes(4));
for (int i = 0; i < count; i++)
{
uint code = msg.Reader.ReadUInt32();
if ((code & 0x80000000) != 0)
packet.Write(code);
else
packet.Write(0);
}
SendToPlayer(msg, player);
Game.SendToAllBut(packet, player);
Game.RefreshExtra(player);
Game.RefreshMonsters(0, 0x81fff, false);
Game.RefreshMonsters(1, 0x81fff, false);
Game.RefreshSpells(0, 0x681fff, false);
Game.RefreshSpells(1, 0x681fff, false);
Game.RefreshHand(0, 0x181fff, false);
Game.RefreshHand(1, 0x181fff, false);
}
示例3: SendToAll
private void SendToAll(CoreMessage msg, int length)
{
if (length == 0)
{
Game.SendToAll(new GameServerPacket(msg.Message));
return;
}
msg.Reader.ReadBytes(length);
SendToAll(msg);
}
示例4: OnTossCoin
private void OnTossCoin(CoreMessage msg)
{
msg.Reader.ReadByte();
int count = msg.Reader.ReadByte();
msg.Reader.ReadBytes(count);
SendToAll(msg);
}
示例5: OnAnnounceNumber
private void OnAnnounceNumber(CoreMessage msg)
{
int player = msg.Reader.ReadByte();
int count = msg.Reader.ReadByte();
msg.Reader.ReadBytes(count * 4);
Game.WaitForResponse(player);
SendToPlayer(msg, player);
}
示例6: OnBecomeTarget
private void OnBecomeTarget(CoreMessage msg)
{
int count = msg.Reader.ReadByte();
msg.Reader.ReadBytes(count * 4);
SendToAll(msg);
}
示例7: OnLpUpdate
private void OnLpUpdate(CoreMessage msg)
{
int player = msg.Reader.ReadByte();
int value = msg.Reader.ReadInt32();
switch (msg.Message)
{
case GameMessage.LpUpdate:
Game.LifePoints[player] = value;
break;
case GameMessage.PayLpCost:
case GameMessage.Damage:
Game.LifePoints[player] -= value;
if (Game.LifePoints[player] < 0)
Game.LifePoints[player] = 0;
break;
case GameMessage.Recover:
Game.LifePoints[player] += value;
break;
}
SendToAll(msg);
}
示例8: OnShuffleHand
private void OnShuffleHand(CoreMessage msg)
{
GameServerPacket packet = new GameServerPacket(msg.Message);
int player = msg.Reader.ReadByte();
int count = msg.Reader.ReadByte();
packet.Write((byte)player);
packet.Write((byte)count);
msg.Reader.ReadBytes(count * 4);
for (int i = 0; i < count; i++)
packet.Write(0);
SendToPlayer(msg, player);
Game.SendToAllBut(packet, player);
Game.RefreshHand(player, 0x181fff, false);
}
示例9: OnSwapGraveDeck
private void OnSwapGraveDeck(CoreMessage msg)
{
int player = msg.Reader.ReadByte();
SendToAll(msg);
Game.RefreshGrave(player);
}
示例10: OnConfirmDecktop
private void OnConfirmDecktop(CoreMessage msg)
{
msg.Reader.ReadByte();
int count = msg.Reader.ReadByte();
msg.Reader.ReadBytes(count * 7);
SendToAll(msg);
}
示例11: OnConfirmCards
private void OnConfirmCards(CoreMessage msg)
{
int player = msg.Reader.ReadByte();
int count = msg.Reader.ReadByte();
msg.Reader.ReadBytes(count * 7);
byte[] buffer = msg.CreateBuffer();
GameServerPacket packet = new GameServerPacket(msg.Message);
packet.Write(buffer);
if ((CardLocation)buffer[7] == CardLocation.Hand)
Game.SendToAll(packet);
else
Game.CurPlayers[player].Send(packet);
}
示例12: OnSortCard
private void OnSortCard(CoreMessage msg)
{
int player = msg.Reader.ReadByte();
int count = msg.Reader.ReadByte();
msg.Reader.ReadBytes(count * 7);
Game.WaitForResponse(player);
SendToPlayer(msg, player);
}
示例13: OnSelectSum
private void OnSelectSum(CoreMessage msg)
{
msg.Reader.ReadByte();
int player = msg.Reader.ReadByte();
msg.Reader.ReadBytes(6);
int count = msg.Reader.ReadByte();
msg.Reader.ReadBytes(count * 11);
Game.WaitForResponse(player);
SendToPlayer(msg, player);
}
示例14: OnSelectPlace
private void OnSelectPlace(CoreMessage msg)
{
int player = msg.Reader.ReadByte();
msg.Reader.ReadBytes(5);
Game.WaitForResponse(player);
SendToPlayer(msg, player);
}
示例15: OnCardSelected
private void OnCardSelected(CoreMessage msg)
{
msg.Reader.ReadByte();
int count = msg.Reader.ReadByte();
msg.Reader.ReadBytes(count * 4);
}