Ejemplo n.º 1
0
        public ReturnValue AddNpcDeath(NpcDeath npcDeath)
        {
            var returnValue = new ReturnValue();

            try
            {
                DapperDb dapperDb = DapperDb.Init(OpenConnection(), 3, false);

                var newId = dapperDb.NpcDeathTable.Insert(
                    new //NpcDeath()
                {
                    Name   = npcDeath.Name,
                    Deaths = npcDeath.Deaths
                });

                returnValue.Success = true;
                returnValue.Message = newId.ToString();
                return(returnValue);
            }
            catch (Exception ex)
            {
                returnValue.Message = ex.Message;
                return(returnValue);
            }
        }
Ejemplo n.º 2
0
        public void KillNpc(Player player, NpcInstance npc)
        {
            var session = sessions.Get(player);

            foreach (var connection in connectionProvider.GetConnectedActivePlayerConnections(session))
            {
                connection.Send(NpcDeath.Create(npc, player), SendOption.Reliable);
            }
        }
Ejemplo n.º 3
0
        public ReturnValue UpdateNpcDeath(NpcDeath npcDeath)
        {
            var returnValue = new ReturnValue();

            try
            {
                string timeElapsed;

                var result = Execute(e => e.Execute(MySQL.NpcDeath.UpdateItem,
                                                    new { @deaths = npcDeath.Deaths, @name = npcDeath.Name }), out timeElapsed);

                returnValue.Success = true;
                returnValue.Message = result.ToString();
                return(returnValue);
            }
            catch (Exception ex)
            {
                returnValue.Message = ex.Message;
                return(returnValue);
            }
        }