Example #1
0
        //Process Report Guild
        public static DBResult Exec_MSG_GuildZoneReport(DBController gs, pServer GameServer)
        {
            _MSG_GuildZoneReport sm     = W2Marshal.GetStructure <_MSG_GuildZoneReport>(GameServer.RecvPacket.RawBuffer);
            _MSG_GuildReport     packet = W2Marshal.CreatePacket <_MSG_GuildReport>(_MSG_GuildReport.PacketID);

            for (int i = 0; i < BaseDef.MAX_CHANNEL; i++)
            {
                for (int x = 0; x < BaseDef.MAX_GUILDZONE; x++)
                {
                    gs.ChargedGuildList[i, x] = sm.Guild[x];
                }
            }
            int Guilds = 0;

            for (int i = 0; i < BaseDef.MAX_GUILD; i++)
            {
                gs.g_pGuildInfo[i] = Functions.ReadGuildInfo(i);
                if (!String.IsNullOrEmpty(gs.g_pGuildInfo[i].GuildName))
                {
                    Guilds++;
                }
            }
            gs.Server.SendPacket(packet);
            for (int i = 0; i < BaseDef.MAX_GUILD; i++)
            {
                if (gs.g_pGuildInfo[i].GuildID == 0)
                {
                    continue;
                }
                gs.SendGuildInfo(i);
            }
            W2Log.SendUpdate();
            return(DBResult.NO_ERROR);
        }
Example #2
0
        //Process ItemLog (Log de itens, id e sua quantidade)
        public static DBResult Exec_MSG_DBItemDayLog(DBController gs, pServer GameServer)
        {
            _MSG_SIGNALPARM sm = W2Marshal.GetStructure <_MSG_SIGNALPARM>(GameServer.RecvPacket.RawBuffer);

            int item = sm.parm;

            if (item <= 0 || item >= BaseDef.MAX_ITEMLIST)
            {
                W2Log.Write($"err, itemid {item} invalid", ELogType.CRITICAL_ERROR);
                return(DBResult.NO_ERROR);
            }

            gs.ItemDayLog[item].Count++;
            gs.Config.ItemCount++;
            W2Log.SendUpdate();
            return(DBResult.NO_ERROR);
        }
Example #3
0
        public static void Start(DBController gs, pServer Server)
        {
            if (Sec % 15 == 0)//15 segundos
            {
                // ProcessImportItem.Start(gs);

                W2Log.SendUpdate();
            }
            if (Sec % 5 == 0)//5 segundos
            {
                ProcessImportItem.Start(gs);
            }


            if (Sec++ > 1000)
            {
                Sec = 0;
            }
        }