예제 #1
0
        private static void SetupUser1()
        {
            Client.Send(NFriendAddMessage.ById(NakamaManager.Instance.Session.Id), b => { }, ErrorHandler);

            var builder = new NGroupCreateMessage.Builder("Thanksgiving");

            builder.Description("Turkey eating at my house!");
            builder.Lang("en");
            Client.Send(builder.Build(), b => { }, ErrorHandler);
        }
예제 #2
0
        public void Sit()
        {
            State.IsSitted = !State.IsSitted;

            if (State.IsSitted)
            {
                State.SitStartTime = Environment.TickCount;

                NClient.Send("ILS1000");
            }
            else
            {
                int regenerated = (int)(Environment.TickCount - State.SitStartTime) / 1000;
                int missing     = Stats.GetStat(StatEnum.MaxLife).Total - Life;

                if (regenerated > missing)
                {
                    regenerated = missing;
                }

                NClient.Player.Life += regenerated;

                NClient.Send("ILF" + regenerated);
                NClient.Send("ILS360000");
            }
        }
예제 #3
0
        private void LevelUp()
        {
            if (this.Level == Entities.Requests.LevelsRequests.MaxLevel())
            {
                return;
            }

            if (Exp >= Entities.Requests.LevelsRequests.ReturnLevel(Level + 1).Character)
            {
                while (Exp >= Entities.Requests.LevelsRequests.ReturnLevel(Level + 1).Character)
                {
                    if (this.Level == Entities.Requests.LevelsRequests.MaxLevel())
                    {
                        break;
                    }

                    Level++;
                    SpellPoint++;
                    CharactPoint += 5;
                }

                if (IsConnected)
                {
                    NClient.Send(string.Concat("AN", Level));
                }

                SpellsInventary.LearnSpells();
                SendChararacterStats();
            }
        }
예제 #4
0
        private void btnSend_Click(object sender, EventArgs e)
        {
            string message = tbxText.Text;

            if (message != "")
            {
                Nclient.Send(message);
            }
            tbxText.Text = "";
        }
예제 #5
0
        public void TeleportNewMap(int _mapID, int _cell)
        {
            NClient.Send(string.Format("GA;2;{0};", ID));

            GetMap().DelPlayer(this);
            var map = Entities.Requests.MapsRequests.MapsList.First(x => x.Model.ID == _mapID);

            MapID   = map.Model.ID;
            MapCell = _cell;

            LoadMap();
        }
예제 #6
0
        public void LoadMap()
        {
            if (Entities.Requests.MapsRequests.MapsList.Any(x => x.Model.ID == this.MapID))
            {
                var map = Entities.Requests.MapsRequests.MapsList.First(x => x.Model.ID == this.MapID);

                NClient.Send(string.Format("GDM|{0}|{1}|{2}", map.Model.ID, map.Model.Date, map.Model.Key));

                if (this.State.IsFollow)
                {
                    foreach (var character in this.State.Followers)
                    {
                        character.NClient.Send(string.Format("IC{0}|{1}", GetMap().Model.PosX, GetMap().Model.PosY));
                    }
                }
            }
        }
예제 #7
0
 public void SendPods()
 {
     NClient.Send(string.Format("Ow{0}|{1}", Pods, Stats.GetStat(StatEnum.MaxPods).Total));
 }
예제 #8
0
 public void SendChararacterStats()
 {
     NClient.Send(string.Concat("As", this.ToString()));
 }