public Gamescreen(Game game, Sprite sprite, List <GameObject> gameObjects, NetworkAgent Agent) : base(game, sprite) { mAgent = Agent; abilitys = new AbilityManager(game); LoadPick(gameObjects); }
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); }
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; }
/// <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"); } }
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); } }
public override void SendState(NetworkAgent mAgent) { }
public override void SendState(NetworkAgent mAgent) { throw new NotImplementedException(); }
public abstract void SendState(NetworkAgent mAgent);