⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 timers.h

📁 This programm is proxy server for ragnarok online game. Also it s can be use as bot. It control all
💻 H
字号:
#ifndef __TIMERS_H
#define __TIMERS_H

#pragma once

#pragma warning(disable:4786)  // anti-STL
#include <set>

#include "win_and_sock.h"
#include "data.h" // ParsePoint

// timer tags
enum {
    TTAG_ALL = 0,
    TTAG_WALK,
    TTAG_LOOT
};

// timer ids
enum {
    TID_NULL = 0,
    TID_WALK,
    TID_LOOT_HERE,
    TID_LOOT_ALL
};

typedef DWORD (*TimerFuncT)(ParsePoint * pp, DWORD timestamp);

class stl_class_timer
{
public:
    DWORD tick;
    TimerFuncT timer_func;
    DWORD tag;
    DWORD id;
    ParserFuncT timer_death;
    

	// constructor
	stl_class_timer(DWORD ttick=0, 
                    TimerFuncT tfunc=NULL, 
                    DWORD ttag=TTAG_ALL, DWORD tid=0,
                    ParserFuncT tdeath=NULL)
	{
		tick = ttick;
		timer_func = tfunc;
        tag = ttag;
        id = tid;
        timer_death = tdeath;
	}
};

bool operator<(stl_class_timer first, stl_class_timer second);

typedef std::set <stl_class_timer> TimersSetT;

//////////////////////

TimersSetT::iterator register_timer(DWORD tick, TimerFuncT parse_func, 
                                    DWORD tag, DWORD id,
                                    ParserFuncT tdeath=NULL
                                    );

int call_timers(ParsePoint * pp);

// DO NOT KILL timers in the `timer_func`!!! Do `return 0` instead.
void kill_timer(DWORD id);
void kill_all_timers(void);
void kill_timers_byTag(DWORD tag);

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -