本文整理汇总了C#中Mooege.Net.GS.GameClient类的典型用法代码示例。如果您正苦于以下问题:C# GameClient类的具体用法?C# GameClient怎么用?C# GameClient使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GameClient类属于Mooege.Net.GS命名空间,在下文中一共展示了GameClient类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: OnConnect
public void OnConnect(object sender, ConnectionEventArgs e)
{
Logger.Trace("Game-Client connected: {0}", e.Connection.ToString());
var gameClient = new GameClient(e.Connection);
e.Connection.Client = gameClient;
}
开发者ID:Jonsevc,项目名称:mooege,代码行数:7,代码来源:ClientManager.cs
示例2: SendMessage
public void SendMessage(GameClient client)
{
var list = GetMessageList();
foreach (var msg in list)
client.SendMessage(msg);
_changedAttributes.Clear();
}
开发者ID:kiwi0530,项目名称:mooege,代码行数:7,代码来源:GameAttributeMap.cs
示例3: Player
public Player(GameClient client, Universe universe, Toon bnetToon)
{
this.Client = client;
this.Universe = universe;
this.Hero = new Hero(client, universe, bnetToon);
}
开发者ID:BuloZB,项目名称:mooege,代码行数:7,代码来源:Player.cs
示例4: OnJoinGame
private void OnJoinGame(GameClient client, JoinBNetGameMessage message)
{
var game = GameManager.GetGameById(message.GameId);
lock (game)
{
var toon = ToonManager.GetToonByLowID((ulong) message.ToonEntityId.Low);
client.Game = game;
if (toon.Owner.LoggedInClient == null)
{
Logger.Warn("Client doesn't seem to be connected to moonet, dropping him..");
client.Connection.Disconnect();
return; // if moonet connection is lost, don't allow him to get in.
}
// Set references between MooNetClient and GameClient.
client.BnetClient = toon.Owner.LoggedInClient;
client.BnetClient.InGameClient = client;
client.Player = new Player(game.StartWorld, client, toon);
Logger.Info("Player {0}[PlayerIndex: {1}] connected.", client.Player.Properties.Name, client.Player.PlayerIndex);
client.SendMessage(new VersionsMessage(message.SNOPackHash));
client.SendMessage(new ConnectionEstablishedMessage
{
PlayerIndex = client.Player.PlayerIndex,
Field1 = 0x4BB91A16,
SNOPackHash = message.SNOPackHash,
});
client.SendMessage(new GameSetupMessage // should be the current tick for the game /raist.
{
Field0 = game.Tick,
});
client.SendMessage(new SavePointInfoMessage
{
snoLevelArea = -1,
});
client.SendMessage(new HearthPortalInfoMessage
{
snoLevelArea = -1,
Field1 = -1,
});
// transition player to act so client can load act related data? /raist
client.SendMessage(new ActTransitionMessage
{
Field0 = 0x00000000,
Field1 = true,
});
game.Enter(client.Player);
}
}
开发者ID:Jonsevc,项目名称:mooege,代码行数:58,代码来源:ClientManager.cs
示例5: Consume
public void Consume(GameClient client, GameMessage message)
{
if (message is AssignActiveSkillMessage) OnAssignActiveSkill(client, (AssignActiveSkillMessage)message);
else if (message is AssignPassiveSkillMessage) OnAssignPassiveSkill(client, (AssignPassiveSkillMessage)message);
else if (message is PlayerChangeHotbarButtonMessage) OnPlayerChangeHotbarButtonMessage(client, (PlayerChangeHotbarButtonMessage)message);
else return;
UpdateClient(client);
client.FlushOutgoingBuffer();
}
开发者ID:Tareg,项目名称:mooege,代码行数:10,代码来源:Skillset.cs
示例6: OnConnect
public static void OnConnect(object sender, ConnectionEventArgs e)
{
Logger.Trace("Game-Client connected: {0}", e.Connection.ToString());
// atm, just creating a universe - though clients should be able to join existing ones.
var universe = new Universe();
Universes.Add(universe);
var gameClient = new GameClient(e.Connection,universe);
e.Connection.Client = gameClient;
}
开发者ID:Rianon,项目名称:mooege,代码行数:11,代码来源:ClientManager.cs
示例7: Route
public void Route(GameClient client, GameMessage message)
{
switch (message.Consumer)
{
case Consumers.Game:
this.Consume(client, message);
break;
case Consumers.Inventory:
client.Player.Inventory.Consume(client, message);
break;
case Consumers.Player:
client.Player.Consume(client, message);
break;
}
}
开发者ID:ElCorpseMaker,项目名称:mooege,代码行数:15,代码来源:Game.cs
示例8: Route
public void Route(GameClient client, GameMessage message)
{
switch (message.Consumer)
{
case Consumers.Universe:
this.Consume(client, message);
break;
case Consumers.PlayerManager:
this.PlayerManager.Consume(client, message);
break;
case Consumers.Hero:
client.Player.Hero.Consume(client, message);
break;
}
}
开发者ID:Rianon,项目名称:mooege,代码行数:15,代码来源:Universe.cs
示例9: Hero
public Hero(GameClient client, Universe universe, Toon toon)
{
this.InGameClient = client;
this.Universe = universe;
this.Properties = toon;
this.CurrentWorldSNO = 0x115EE;
this.Inventory = new Inventory(this);
this.SkillSet = new Skills.SkillSet(this.Properties.Class);
RevealedWorlds = new List<World>();
RevealedScenes = new List<Scene>();
RevealedActors = new List<Actor>();
// actor values
this.DynamicId = universe.NextObjectId;
this.SnoId = this.ClassSNO;
this.Field2 = 0x00000009;
this.Field3 = 0x00000000;
this.Scale = ModelScale;
this.RotationAmount = 0.05940768f;
this.RotationAxis = new Vector3D(0f, 0f, 0.9982339f);
//initial world and position
this.WorldId = 0x772E0000;
this.Position.X = 3143.75f;
this.Position.Y = 2828.75f;
this.Position.Z = 59.075588f;
//den of evil: this.Position.X = 2526.250000f; this.Position.Y = 2098.750000f; this.Position.Z = -5.381495f;
//inn: this.Position.X = 2996.250000f; this.Position.Y = 2793.750000f; this.Position.Z = 24.045330f;
// adrias hut: this.Position.X = 1768.750000f; this.Position.Y = 2921.250000f; this.Position.Z = 20.333143f;
// cemetry of forsaken: this.Position.X = 2041.250000f; this.Position.Y = 1778.750000f; this.Position.Z = 0.426203f;
//defiled crypt level 2: this.WorldId = 2000289804; this.Position.X = 158.750000f; this.Position.Y = 76.250000f; this.Position.Z = 0.100000f;
this.GBHandle = new GBHandle()
{
Field0 = 0x00000007,
Field1 = this.Properties.ClassID,
};
this.Field7 = -1;
this.Field8 = -1;
this.Field9 = 0x00000000;
this.Field10 = 0x0;
}
开发者ID:TLZSMoky,项目名称:mooege,代码行数:47,代码来源:Hero.cs
示例10: OnNewPlayer
public void OnNewPlayer(GameClient client, JoinBNetGameMessage message)
{
client.BnetClient = GameManager.AvailableGames[(ulong)message.GameId].Clients.FirstOrDefault();
if (client.BnetClient == null)
{
Logger.Warn("Couldn't find bnet client for joined client/player!");
return;
}
client.BnetClient.InGameClient = client;
var player = new Player(client, this.Universe, client.BnetClient.CurrentToon);
client.Player = player;
this.Players.Add(player);
player.Greet(message);
}
开发者ID:Rianon,项目名称:mooege,代码行数:18,代码来源:PlayerManager.cs
示例11: OnNewPlayer
public void OnNewPlayer(GameClient client, JoinBNetGameMessage message)
{
client.BnetClient = GameManager.AvailableGames[(ulong)message.GameId].Clients.FirstOrDefault();
if (client.BnetClient == null)
{
Logger.Warn("Couldn't find bnet client for joined client/player!");
return;
}
client.BnetClient.InGameClient = client;
client.SendMessageNow(new VersionsMessage(message.SNOPackHash));
client.SendMessage(new ConnectionEstablishedMessage
{
Field0 = 0x00000000,
Field1 = 0x4BB91A16,
SNOPackHash = message.SNOPackHash,
});
client.SendMessage(new GameSetupMessage
{
Field0 = 0x00000077,
});
client.SendMessage(new SavePointInfoMessage
{
snoLevelArea = -1,
});
client.SendMessage(new HearthPortalInfoMessage
{
snoLevelArea = -1,
Field1 = -1,
});
// transition player to act so client can load act related data? /raist
client.SendMessage(new ActTransitionMessage
{
Field0 = 0x00000000,
Field1 = true,
});
var player = new Mooege.Core.GS.Player.Player(this.Game.StartWorld, client, client.BnetClient.CurrentToon);
client.Player = player;
}
开发者ID:SKiLLsSoLoN,项目名称:mooege,代码行数:41,代码来源:PlayerManager.cs
示例12: Consume
public void Consume(GameClient client, GameMessage message)
{
if (message is AssignActiveSkillMessage) OnAssignActiveSkill(client, (AssignActiveSkillMessage)message);
else if (message is AssignPassiveSkillMessage) OnAssignPassiveSkill(client, (AssignPassiveSkillMessage)message);
else if (message is PlayerChangeHotbarButtonMessage) OnPlayerChangeHotbarButtonMessage(client, (PlayerChangeHotbarButtonMessage)message);
else if (message is TargetMessage) OnObjectTargeted(client, (TargetMessage)message);
else if (message is PlayerMovementMessage) OnPlayerMovement(client, (PlayerMovementMessage)message);
else return;
UpdateState();
}
开发者ID:MacGiver,项目名称:mooege,代码行数:11,代码来源:Player.cs
示例13: OnPlayerMovement
private void OnPlayerMovement(GameClient client, PlayerMovementMessage message)
{
// here we should also be checking the position and see if it's valid. If not we should be resetting player to a good position with ACDWorldPositionMessage
// so we can have a basic precaution for hacks & exploits /raist.
if (message.Position != null)
this.Position = message.Position;
var msg = new NotifyActorMovementMessage
{
ActorId = message.ActorId,
Position = this.Position,
Angle = message.Angle,
Field3 = false,
Field4 = message.Field4,
Field5 = message.Field5,
Field6 = message.Field6
};
this.World.BroadcastExclusive(msg, this); // TODO: We should be instead notifying currentscene we're in. /raist.
this.CollectGold();
this.CollectHealthGlobe();
}
开发者ID:MacGiver,项目名称:mooege,代码行数:24,代码来源:Player.cs
示例14: Player
public Player(World world, GameClient client, Toon bnetToon)
: base(world, world.NewPlayerID)
{
this.InGameClient = client;
this.PlayerIndex = Interlocked.Increment(ref this.InGameClient.Game.PlayerIndexCounter); // make it atomic.
this.Properties = bnetToon;
this.Inventory = new Inventory(this);
this.SkillSet = new SkillSet(this.Properties.Class);
this.RevealedObjects = new Dictionary<uint, IRevealable>();
this.GroundItems = new Dictionary<uint, Item>();
// actor values
this.ActorSNO = this.ClassSNO;
this.Field2 = 0x00000009;
this.Field3 = 0x00000000;
this.Scale = ModelScale;
this.RotationAmount = 0.05940768f;
this.RotationAxis = new Vector3D(0f, 0f, 0.9982339f);
this.CollFlags = 0x00000000;
this.Position.X = 3143.75f;
this.Position.Y = 2828.75f;
this.Position.Z = 59.075588f;
// den of evil: this.Position.X = 2526.250000f; this.Position.Y = 2098.750000f; this.Position.Z = -5.381495f;
// inn: this.Position.X = 2996.250000f; this.Position.Y = 2793.750000f; this.Position.Z = 24.045330f;
// adrias hut: this.Position.X = 1768.750000f; this.Position.Y = 2921.250000f; this.Position.Z = 20.333143f;
// cemetery of the forsaken: this.Position.X = 2041.250000f; this.Position.Y = 1778.750000f; this.Position.Z = 0.426203f;
// defiled crypt level 2: this.WorldId = 2000289804; this.Position.X = 158.750000f; this.Position.Y = 76.250000f; this.Position.Z = 0.100000f;
this.GBHandle.Type = (int)GBHandleType.Player;
this.GBHandle.GBID = this.Properties.ClassID;
this.Field7 = -1;
this.Field8 = -1;
this.Field9 = 0x00000000;
this.Field10 = 0x0;
#region Attributes
this.Attributes[GameAttribute.SkillKit] = this.SkillKit;
this.Attributes[GameAttribute.Buff_Active, 0x33C40] = true;
this.Attributes[GameAttribute.Skill, 0x7545] = 1;
this.Attributes[GameAttribute.Skill_Total, 0x7545] = 1;
this.Attributes[GameAttribute.Resistance_Total, 0x226] = 0.5f;
this.Attributes[GameAttribute.Resistance, 0x226] = 0.5f;
this.Attributes[GameAttribute.Immobolize] = true;
this.Attributes[GameAttribute.Untargetable] = true;
this.Attributes[GameAttribute.Skill_Total, 0x76B7] = 1;
this.Attributes[GameAttribute.Skill, 0x76B7] = 1;
this.Attributes[GameAttribute.Skill, 0x6DF] = 1;
this.Attributes[GameAttribute.Buff_Active, 0xCE11] = true;
this.Attributes[GameAttribute.CantStartDisplayedPowers] = true;
this.Attributes[GameAttribute.Skill_Total, 0x216FA] = 1;
this.Attributes[GameAttribute.Skill, 0x176C4] = 1;
this.Attributes[GameAttribute.Skill, 0x216FA] = 1;
this.Attributes[GameAttribute.Skill_Total, 0x176C4] = 1;
this.Attributes[GameAttribute.Skill_Total, 0x6DF] = 1;
this.Attributes[GameAttribute.Resistance, 0xDE] = 0.5f;
this.Attributes[GameAttribute.Resistance_Total, 0xDE] = 0.5f;
this.Attributes[GameAttribute.Get_Hit_Recovery] = 6f;
this.Attributes[GameAttribute.Get_Hit_Recovery_Per_Level] = 1f;
this.Attributes[GameAttribute.Get_Hit_Recovery_Base] = 5f;
this.Attributes[GameAttribute.Skill, 0x7780] = 1;
this.Attributes[GameAttribute.Get_Hit_Max] = 60f;
this.Attributes[GameAttribute.Skill_Total, 0x7780] = 1;
this.Attributes[GameAttribute.Get_Hit_Max_Per_Level] = 10f;
this.Attributes[GameAttribute.Get_Hit_Max_Base] = 50f;
this.Attributes[GameAttribute.Resistance_Total, 0] = 3.051758E-05f; // im pretty sure key = 0 doesnt do anything since the lookup is (attributeId | (key << 12)), maybe this is some base resistance? /cm
this.Attributes[GameAttribute.Resistance_Total, 1] = 3.051758E-05f;
this.Attributes[GameAttribute.Resistance_Total, 2] = 3.051758E-05f;
this.Attributes[GameAttribute.Resistance_Total, 3] = 3.051758E-05f;
this.Attributes[GameAttribute.Resistance_Total, 4] = 3.051758E-05f;
this.Attributes[GameAttribute.Resistance_Total, 5] = 3.051758E-05f;
this.Attributes[GameAttribute.Resistance_Total, 6] = 3.051758E-05f;
this.Attributes[GameAttribute.Dodge_Rating_Total] = 3.051758E-05f;
this.Attributes[GameAttribute.IsTrialActor] = true;
this.Attributes[GameAttribute.Buff_Visual_Effect, 0xFFFFF] = true;
this.Attributes[GameAttribute.Crit_Percent_Cap] = 0x3F400000;
this.Attributes[GameAttribute.Resource_Cur, this.ResourceID] = 200f;
this.Attributes[GameAttribute.Resource_Max, this.ResourceID] = 200f;
this.Attributes[GameAttribute.Resource_Max_Total, this.ResourceID] = 200f;
this.Attributes[GameAttribute.Damage_Weapon_Min_Total_All] = 2f;
this.Attributes[GameAttribute.Damage_Weapon_Delta_Total_All] = 1f;
this.Attributes[GameAttribute.Resource_Regen_Total, this.ResourceID] = 3.051758E-05f;
this.Attributes[GameAttribute.Resource_Effective_Max, this.ResourceID] = 200f;
this.Attributes[GameAttribute.Damage_Min_Subtotal, 0xFFFFF] = 3.051758E-05f;
this.Attributes[GameAttribute.Damage_Min_Total, 0xFFFFF] = 3.051758E-05f;
this.Attributes[GameAttribute.Damage_Weapon_Min_Total_CurrentHand, 0xFFFFF] = 3.051758E-05f;
this.Attributes[GameAttribute.Attacks_Per_Second_Item_CurrentHand] = 1.199219f;
this.Attributes[GameAttribute.Attacks_Per_Second_Item_Total_MainHand] = 1.199219f;
this.Attributes[GameAttribute.Attacks_Per_Second_Total] = 1.199219f;
this.Attributes[GameAttribute.Attacks_Per_Second] = 1f;
this.Attributes[GameAttribute.Attacks_Per_Second_Item_MainHand] = 1.199219f;
this.Attributes[GameAttribute.Attacks_Per_Second_Item_Total] = 1.199219f;
this.Attributes[GameAttribute.Buff_Icon_End_Tick0, 0x00033C40] = 0x000003FB;
this.Attributes[GameAttribute.Attacks_Per_Second_Item_Subtotal] = 3.051758E-05f;
this.Attributes[GameAttribute.Attacks_Per_Second_Item] = 3.051758E-05f;
this.Attributes[GameAttribute.Buff_Icon_Start_Tick0, 0x00033C40] = 0x00000077;
//.........这里部分代码省略.........
开发者ID:ElCorpseMaker,项目名称:mooege,代码行数:101,代码来源:Player.cs
示例15: Consume
public void Consume(GameClient client, GameMessage message)
{
if (message is InventoryRequestMoveMessage) HandleInventoryRequestMoveMessage(message as InventoryRequestMoveMessage);
else if (message is InventorySplitStackMessage) OnInventorySplitStackMessage(message as InventorySplitStackMessage);
else if (message is InventoryStackTransferMessage) OnInventoryStackTransferMessage(message as InventoryStackTransferMessage);
else if (message is InventoryDropItemMessage) OnInventoryDropItemMessage(message as InventoryDropItemMessage);
else if (message is InventoryRequestUseMessage) OnInventoryRequestUseMessage(message as InventoryRequestUseMessage);
else return;
}
开发者ID:keltins,项目名称:mooege,代码行数:9,代码来源:Inventory.cs
示例16: ChangeToonWorld
public void ChangeToonWorld(GameClient client, int WorldID, Vector3D Pos)
{
Hero hero = client.Player.Hero;
World newworld = null;
//don't use getworld() here as that'd create a new empty world anyway
foreach (var x in _worlds)
if (x.WorldID == WorldID)
newworld = x;
World currentworld = null;
//don't use getworld() here as that'd create a new empty world anyway
foreach (var x in _worlds)
if (x.WorldID == hero.WorldId)
currentworld = x;
if (newworld == null || currentworld==null) return; //don't go to a world we don't have in the universe
currentworld.DestroyWorld(hero);
hero.WorldId = newworld.WorldID;
hero.CurrentWorldSNO = newworld.WorldSNO;
hero.Position.X = Pos.X;
hero.Position.Y = Pos.Y;
hero.Position.Z = Pos.Z;
newworld.Reveal(hero);
client.SendMessage(new ACDWorldPositionMessage
{
Id = 0x3f,
Field0 = 0x789E00E2,
Field1 = new WorldLocationMessageData
{
Field0 = 1.43f,
Field1 = new PRTransform
{
Field0 = new Quaternion
{
Amount = 0.05940768f,
Axis = new Vector3D
{
X = 0f,
Y = 0f,
Z = 0.9982339f,
}
},
ReferencePoint = hero.Position,
},
Field2 = newworld.WorldID,
}
});
client.FlushOutgoingBuffer();
client.SendMessage(new PlayerWarpedMessage()
{
Id = 0x0B1,
Field0 = 9,
Field1 = 0f,
});
client.PacketId += 40 * 2;
client.SendMessage(new DWordDataMessage()
{
Id = 0x89,
Field0 = client.PacketId,
});
client.FlushOutgoingBuffer();
}
开发者ID:Rianon,项目名称:mooege,代码行数:71,代码来源:Universe.cs
示例17: Consume
public void Consume(GameClient client, GameMessage message)
{
if (message is JoinBNetGameMessage) OnJoinGame(client, (JoinBNetGameMessage)message);
}
开发者ID:Jonsevc,项目名称:mooege,代码行数:4,代码来源:ClientManager.cs
示例18: Consume
public void Consume(GameClient client, GameMessage message)
{ } // for possile future messages consumed by game. /raist.
开发者ID:diablo1981,项目名称:mooege,代码行数:2,代码来源:Game.cs
示例19: SendAttributes
private void SendAttributes(List<NetAttributeKeyValue> netAttributesList, GameClient client)
{
// Attributes can't be send all together
// must be split up to part of max 15 attributes at once
List<NetAttributeKeyValue> tmpList = new List<NetAttributeKeyValue>(netAttributesList);
while (tmpList.Count > 0)
{
int selectCount = (tmpList.Count > 15) ? 15 : tmpList.Count;
client.SendMessage(new AttributesSetValuesMessage()
{
Id = 0x004D,
Field0 = ItemId,
atKeyVals = tmpList.GetRange(0, selectCount).ToArray(),
});
tmpList.RemoveRange(0, selectCount);
}
}
开发者ID:God601,项目名称:D3Mighty,代码行数:18,代码来源:Item.cs
示例20: OnToonTargetChange
private void OnToonTargetChange(GameClient client, TargetMessage message)
{
//Logger.Info("Player interaction with " + message.AsText());
Portal p=GetPortal(message.Field1);
if (p!=null)
{
//we have a transition between worlds here
ChangeToonWorld(client, p.TargetWorldID, p.TargetPos); //targetpos will always be valid as otherwise the portal wouldn't be targetable
return;
}
else if (client.ObjectIdsSpawned == null || !client.ObjectIdsSpawned.Contains(message.Field1)) return;
client.ObjectIdsSpawned.Remove(message.Field1);
var killAni = new int[]{
0x2cd7,
0x2cd4,
0x01b378,
0x2cdc,
0x02f2,
0x2ccf,
0x2cd0,
0x2cd1,
0x2cd2,
0x2cd3,
0x2cd5,
0x01b144,
0x2cd6,
0x2cd8,
0x2cda,
0x2cd9
};
client.SendMessage(new PlayEffectMessage()
{
Id = 0x7a,
Field0 = message.Field1,
Field1 = 0x0,
Field2 = 0x2,
});
client.SendMessage(new PlayEffectMessage()
{
Id = 0x7a,
Field0 = message.Field1,
Field1 = 0xc,
});
client.SendMessage(new PlayHitEffectMessage()
{
Id = 0x7b,
Field0 = message.Field1,
Field1 = 0x789E00E2,
Field2 = 0x2,
Field3 = false,
});
client.SendMessage(new FloatingNumberMessage()
{
Id = 0xd0,
Field0 = message.Field1,
Field1 = 9001.0f,
Field2 = 0,
});
client.SendMessage(new ANNDataMessage()
{
Id = 0x6d,
Field0 = message.Field1,
});
int ani = killAni[RandomHelper.Next(killAni.Length)];
//Logger.Info("Ani used: " + ani);
client.SendMessage(new PlayAnimationMessage()
{
Id = 0x6c,
Field0 = message.Field1,
Field1 = 0xb,
Field2 = 0,
tAnim = new PlayAnimationMessageSpec[1]
{
new PlayAnimationMessageSpec()
{
Field0 = 0x2,
Field1 = ani,
Field2 = 0x0,
Field3 = 1f
}
}
});
client.PacketId += 10 * 2;
client.SendMessage(new DWordDataMessage()
{
Id = 0x89,
Field0 = client.PacketId,
});
client.SendMessage(new ANNDataMessage()
//.........这里部分代码省略.........
开发者ID:Rianon,项目名称:mooege,代码行数:101,代码来源:Universe.cs
注:本文中的Mooege.Net.GS.GameClient类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论