Esempio n. 1
0
        public void SetPlayerInfo(PlayerInfo info)
        {
            GameState.Instance.SetPlayerInfo(info);
            ClientHandler.Instance.SetHandler(new IngameMessageHandler());

            SRActionMessage msg = new SRActionMessage(ActionType.GetMapData, ServiceType.Map);
            msg.args[ArgumentName.PlayerId] = info.id;
            ClientHandler.Instance.SendMessage(msg);
        }
Esempio n. 2
0
        public void DoLogin(string username, string password, NetConnection conn)
        {
            //TODO: validate login
            Console.WriteLine("{0} - {1}", username, password);

            //TODO: get player information
            PlayerInfo info = new PlayerInfo();
            info.name = "Stryfe";
            info.x = 20;
            info.y = 15;
            info.id = debugId;

            debugId++;

            DataManager.Instance.UpdateConnection(info.id, conn);
            DataManager.Instance.UpdatePlayer(info.id, info);

            SROrderMessage msg = new SROrderMessage(OrderType.SetPlayerInfo, new Dictionary<ArgumentName, object>() { { ArgumentName.PlayerInfo, info } });
            ServerHandler.Instance.SendMessageToPlayer(msg, conn);
        }
Esempio n. 3
0
 void UpdateNPlayerInfo(PlayerInfo info)
 {
     MapManager.Instance.UpdatePlayer(info);
 }
Esempio n. 4
0
 public void UpdatePlayer(PlayerInfo info)
 {
     if (!visiblePlayers.ContainsKey(info.id))
         visiblePlayers[info.id] = new Player(Global.defaultObj, Global.defaultTileset); //TODO
     visiblePlayers[info.id].SetInfo(info);
 }
Esempio n. 5
0
 public void SetInfo(PlayerInfo info)
 {
     this.info = info;
     Global.Player.MapPosition = new Vector2(info.x, info.y);
     Global.Player.Name = info.name;
 }
Esempio n. 6
0
 public void SetPlayerInfo(PlayerInfo info)
 {
     playerInfo = info;
     if (Global.Player != null)
         Global.Player.SetInfo(info);
 }
Esempio n. 7
0
 public void UpdatePlayer(int id, PlayerInfo info)
 {
     Players[id] = info;
 }