Пример #1
0
 public Gamescreen(Game game, Sprite sprite, List <GameObject> gameObjects, NetworkAgent Agent)
     : base(game, sprite)
 {
     mAgent   = Agent;
     abilitys = new AbilityManager(game);
     LoadPick(gameObjects);
 }
Пример #2
0
 public override void SendState(NetworkAgent mAgent)
 {
     mAgent.WriteMessage(Playerindex);
     mAgent.WriteMessage(sprite.Position.X);
     mAgent.WriteMessage(sprite.Position.Y);
     mAgent.WriteMessage(sprite.Velocity.X);
     mAgent.WriteMessage(sprite.Velocity.Y);
 }
Пример #3
0
 public ConnectScreen(Sprite sprite, Game game, string ip)
     : base(game, sprite)
 {
     mIP     = ip;
     timeout = TimeManager.CurrentTime;
     mAgent  = new NetworkAgent(AgentRole.Client, "VikingArcade");
     mAgent.Connect(mIP);
     tries++;
     prompter             = FlatRedBall.Graphics.TextManager.AddText("Attempting to Connect, Attempt #" + tries + " of 4");
     prompter.Position.Y += 7;
     prompter.Position.X -= 5;
 }
Пример #4
0
 /// <summary>
 /// Inililizes the netcode
 /// </summary>
 /// <param name="gameObjects"></param>
 private void StartServerAndClient(List <GameObject> gameObjects)
 {
     if (GlobalData.GlobalData.GameData.TypeOfGame == GlobalData.GameData.GameType.Server)
     {
         mAgent = new NetworkAgent(AgentRole.Server, "VikingArcade");
         mAgent.forwardport();
     }
     else if (GlobalData.GlobalData.GameData.TypeOfGame == GlobalData.GameData.GameType.Client)
     {
         throw new Exception("Tried to creater server as client");
     }
 }
Пример #5
0
 public override void SendState(NetworkAgent mAgent)
 {
     //if (positionset) 
     {
         mAgent.WriteMessage((byte)GlobalData.MessageType.Spell);
         mAgent.WriteMessage((byte)selectedSpell);
         mAgent.WriteMessage(angle);
         mAgent.WriteMessage(sprite.Position.X);
         mAgent.WriteMessage(sprite.Position.Y);
         mAgent.WriteMessage((byte)playerID);
         
     }
 }
Пример #6
0
 public override void SendState(NetworkAgent mAgent)
 {
 }
Пример #7
0
 public override void SendState(NetworkAgent mAgent)
 {
     throw new NotImplementedException();
 }
Пример #8
0
 public abstract void SendState(NetworkAgent mAgent);