Crossfire Client, Trunk
cfmaplog Namespace Reference

Functions

def check_completed ()
 
def client_send (text)
 
def console_send (text)
 
def debug_send (text)
 
def player_send (text)
 
def player_send_bare (text)
 

Variables

 buffer = buffer.rstrip(os.linesep)
 
 codefile = re.compile("[.][^.]+\Z").sub("", __file__)
 
 codepath = __file__
 
int completed = 0
 
string completed_date = ""
 
 cursor = dbConn.cursor()
 
string datafile = codefile + ".db"
 
 dbConn = sqlite3.connect(f"{datafile}")
 
bool debug = False
 
string helptext
 
string license
 
string map_data = '';
 
string map_date = '';
 
int map_id = 0;
 
int map_line = -1;
 
string map_made = '';
 
string map_name = '';
 
string map_path = '';
 
 maps = query[0]
 
 matches = regc_rqst_player_data.match(buffer)
 
int NDI_ALL = 0x200
 
int NDI_ALL_DMS = 0x400
 
int NDI_BLACK = 0
 
int NDI_BLUE = 5
 
int NDI_BROWN = 10
 
int NDI_COLOR_MASK = 0xff
 
int NDI_DK_ORANGE = 6
 
int NDI_GOLD = 11
 
int NDI_GREEN = 7
 
int NDI_GREY = 9
 
int NDI_LT_GREEN = 8
 
int NDI_MAX_COLOR = 12
 
int NDI_NAVY = 2
 
int NDI_ORANGE = 4
 
int NDI_RED = 3
 
int NDI_TAN = 12
 
int NDI_UNIQUE = 0x100
 
int NDI_WHITE = 1
 
int player_code = 0
 
int player_id = players
 
 player_nmbr = matches.group(1)
 
 player_seen = time.strftime("%Y/%m/%d %H:%M")
 
string player_title = ''
 
int players = 0
 
 query = cursor.fetchone()
 
int quiets = 0
 
 regc_rqst_player = re.compile(regx_rqst_player)
 
 regc_rqst_player_data = re.compile(regx_rqst_player_data)
 
 regc_rqst_player_id = re.compile(regx_rqst_player_id)
 
 regc_rqst_player_name = re.compile(regx_rqst_player_name)
 
 regc_rqst_player_strt = re.compile(regx_rqst_player_strt)
 
 regc_scripttell = re.compile('^scripttell\s+', 0)
 
 regc_wtch_draw = re.compile(regx_wtch_draw, 0)
 
 regc_wtch_draw_date = re.compile(regx_wtch_draw_date, 0)
 
 regc_wtch_draw_made = re.compile(regx_wtch_draw_made, 0)
 
 regc_wtch_draw_name = re.compile(regx_wtch_draw_name, 0)
 
 regc_wtch_draw_path = re.compile(regx_wtch_draw_path, 0)
 
 regc_wtch_draw_rnds = re.compile(regx_wtch_draw_rnds, 0)
 
 regc_wtch_draw_strt = re.compile(regx_wtch_draw_strt, 0)
 
 regc_wtch_draw_xsiz = re.compile(regx_wtch_draw_xsiz, 0)
 
string regx_rqst_player = "^request\splayer\s"
 
string regx_rqst_player_data = regx_rqst_player_id + regx_rqst_player_name
 
string regx_rqst_player_id = "(\d+)\s+"
 
string regx_rqst_player_name = "Player:\s+(\w+)\s+(.+)"
 
string regx_rqst_player_strt = regx_rqst_player + regx_rqst_player_id
 
string regx_wtch_draw = "^watch drawextinfo (\d+\s){3}"
 
string regx_wtch_draw_date = "Modified:\s+(.+)"
 
string regx_wtch_draw_made = "Created:\s+(.*)"
 
string regx_wtch_draw_name = regx_wtch_draw_strt + "[~/]"
 
string regx_wtch_draw_path = "^([^\(\)]+|\(null\)\s)\(([^\)]+)\)\s*(.*)"
 
string regx_wtch_draw_rnds = "random_seed\s\d+"
 
string regx_wtch_draw_strt = regx_wtch_draw + "([^\(]+|\(null\)\s*)\("
 
string regx_wtch_draw_xsiz = regx_wtch_draw + "xsize\s[-]?\d+"
 
int server_id = 0
 
int servers = 0
 
string sqlcmd
 
bool success = False
 
int v_head = 1
 
int v_tail = 0
 
 vcConn = sqlite3.connect(":memory:")
 
 vcursor = vcConn.cursor()
 
string visit_date = ''
 
int visit_total = 0
 
int visits = 0
 

Function Documentation

◆ check_completed()

def cfmaplog.check_completed ( )

Definition at line 157 of file cfmaplog.py.

References console_send(), debug_send(), and player_send().

+ Here is the call graph for this function:

◆ client_send()

def cfmaplog.client_send (   text)

Definition at line 47 of file cfmaplog.py.

Referenced by player_send(), and player_send_bare().

+ Here is the caller graph for this function:

◆ console_send()

def cfmaplog.console_send (   text)

Definition at line 55 of file cfmaplog.py.

Referenced by check_completed(), and debug_send().

+ Here is the caller graph for this function:

◆ debug_send()

def cfmaplog.debug_send (   text)

Definition at line 63 of file cfmaplog.py.

References console_send().

Referenced by check_completed(), player_send(), and player_send_bare().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ player_send()

def cfmaplog.player_send (   text)

Definition at line 141 of file cfmaplog.py.

References client_send(), and debug_send().

Referenced by check_completed().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ player_send_bare()

def cfmaplog.player_send_bare (   text)

Definition at line 149 of file cfmaplog.py.

References client_send(), and debug_send().

+ Here is the call graph for this function:

Variable Documentation

◆ buffer

◆ codefile

cfmaplog.codefile = re.compile("[.][^.]+\Z").sub("", __file__)

Definition at line 194 of file cfmaplog.py.

◆ codepath

cfmaplog.codepath = __file__

Definition at line 198 of file cfmaplog.py.

◆ completed

int cfmaplog.completed = 0

Definition at line 672 of file cfmaplog.py.

◆ completed_date

cfmaplog.completed_date = ""

Definition at line 673 of file cfmaplog.py.

◆ cursor

cfmaplog.cursor = dbConn.cursor()

Definition at line 209 of file cfmaplog.py.

◆ datafile

string cfmaplog.datafile = codefile + ".db"

Definition at line 195 of file cfmaplog.py.

◆ dbConn

cfmaplog.dbConn = sqlite3.connect(f"{datafile}")

Definition at line 201 of file cfmaplog.py.

◆ debug

bool cfmaplog.debug = False

Definition at line 39 of file cfmaplog.py.

◆ helptext

string cfmaplog.helptext

Definition at line 715 of file cfmaplog.py.

◆ license

string cfmaplog.license
Initial value:
1 = '''
2 cfmaplog.py - Crossfire GTK Client plug-in to track per-character map visits.
3 Copyright (C) 2025, "Kevin R. Bulgrien" <kbulgrien@att.net>
4 
5 This program is free software: you can redistribute it and/or modify it under
6 the terms of the GNU General Public License as published by the Free Software
7 Foundation, either version 3 of the License, or (at your option) any later
8 version.
9 
10 This program is distributed in the hope that it will be useful, but WITHOUT
11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
13 details.
14 
15 You should have received a copy of the GNU General Public License along with
16 this program. If not, see <https://www.gnu.org/licenses/>.
17 '''

Definition at line 3 of file cfmaplog.py.

◆ map_data

string cfmaplog.map_data = '';

Definition at line 461 of file cfmaplog.py.

◆ map_date

string cfmaplog.map_date = '';

Definition at line 465 of file cfmaplog.py.

◆ map_id

int cfmaplog.map_id = 0;

Definition at line 459 of file cfmaplog.py.

◆ map_line

int cfmaplog.map_line = -1;

Definition at line 460 of file cfmaplog.py.

◆ map_made

string cfmaplog.map_made = '';

Definition at line 464 of file cfmaplog.py.

◆ map_name

string cfmaplog.map_name = '';

Definition at line 462 of file cfmaplog.py.

◆ map_path

string cfmaplog.map_path = '';

Definition at line 463 of file cfmaplog.py.

◆ maps

int cfmaplog.maps = query[0]

Definition at line 457 of file cfmaplog.py.

◆ matches

cfmaplog.matches = regc_rqst_player_data.match(buffer)

Definition at line 354 of file cfmaplog.py.

Referenced by get_new_char_info().

◆ NDI_ALL

int cfmaplog.NDI_ALL = 0x200

Definition at line 98 of file cfmaplog.py.

◆ NDI_ALL_DMS

int cfmaplog.NDI_ALL_DMS = 0x400

Definition at line 99 of file cfmaplog.py.

◆ NDI_BLACK

int cfmaplog.NDI_BLACK = 0

Definition at line 77 of file cfmaplog.py.

◆ NDI_BLUE

int cfmaplog.NDI_BLUE = 5

Definition at line 82 of file cfmaplog.py.

◆ NDI_BROWN

int cfmaplog.NDI_BROWN = 10

Definition at line 88 of file cfmaplog.py.

◆ NDI_COLOR_MASK

int cfmaplog.NDI_COLOR_MASK = 0xff

Definition at line 93 of file cfmaplog.py.

◆ NDI_DK_ORANGE

int cfmaplog.NDI_DK_ORANGE = 6

Definition at line 83 of file cfmaplog.py.

◆ NDI_GOLD

int cfmaplog.NDI_GOLD = 11

Definition at line 89 of file cfmaplog.py.

◆ NDI_GREEN

int cfmaplog.NDI_GREEN = 7

Definition at line 84 of file cfmaplog.py.

◆ NDI_GREY

int cfmaplog.NDI_GREY = 9

Definition at line 87 of file cfmaplog.py.

◆ NDI_LT_GREEN

int cfmaplog.NDI_LT_GREEN = 8

Definition at line 85 of file cfmaplog.py.

◆ NDI_MAX_COLOR

int cfmaplog.NDI_MAX_COLOR = 12

Definition at line 91 of file cfmaplog.py.

◆ NDI_NAVY

int cfmaplog.NDI_NAVY = 2

Definition at line 79 of file cfmaplog.py.

◆ NDI_ORANGE

int cfmaplog.NDI_ORANGE = 4

Definition at line 81 of file cfmaplog.py.

◆ NDI_RED

int cfmaplog.NDI_RED = 3

Definition at line 80 of file cfmaplog.py.

◆ NDI_TAN

int cfmaplog.NDI_TAN = 12

Definition at line 90 of file cfmaplog.py.

◆ NDI_UNIQUE

int cfmaplog.NDI_UNIQUE = 0x100

Definition at line 97 of file cfmaplog.py.

◆ NDI_WHITE

int cfmaplog.NDI_WHITE = 1

Definition at line 78 of file cfmaplog.py.

◆ player_code

int cfmaplog.player_code = 0

Definition at line 288 of file cfmaplog.py.

◆ player_id

cfmaplog.player_id = players

Definition at line 372 of file cfmaplog.py.

◆ player_nmbr

cfmaplog.player_nmbr = matches.group(1)

Definition at line 355 of file cfmaplog.py.

◆ player_seen

cfmaplog.player_seen = time.strftime("%Y/%m/%d %H:%M")

Definition at line 290 of file cfmaplog.py.

◆ player_title

cfmaplog.player_title = ''

Definition at line 289 of file cfmaplog.py.

◆ players

int cfmaplog.players = 0

Definition at line 287 of file cfmaplog.py.

Referenced by print_entry(), and server_add().

◆ query

cfmaplog.query = cursor.fetchone()

Definition at line 243 of file cfmaplog.py.

◆ quiets

int cfmaplog.quiets = 0

Definition at line 477 of file cfmaplog.py.

◆ regc_rqst_player

cfmaplog.regc_rqst_player = re.compile(regx_rqst_player)

Definition at line 295 of file cfmaplog.py.

◆ regc_rqst_player_data

cfmaplog.regc_rqst_player_data = re.compile(regx_rqst_player_data)

Definition at line 303 of file cfmaplog.py.

◆ regc_rqst_player_id

cfmaplog.regc_rqst_player_id = re.compile(regx_rqst_player_id)

Definition at line 297 of file cfmaplog.py.

◆ regc_rqst_player_name

cfmaplog.regc_rqst_player_name = re.compile(regx_rqst_player_name)

Definition at line 301 of file cfmaplog.py.

◆ regc_rqst_player_strt

cfmaplog.regc_rqst_player_strt = re.compile(regx_rqst_player_strt)

Definition at line 299 of file cfmaplog.py.

◆ regc_scripttell

cfmaplog.regc_scripttell = re.compile('^scripttell\s+', 0)

Definition at line 618 of file cfmaplog.py.

◆ regc_wtch_draw

cfmaplog.regc_wtch_draw = re.compile(regx_wtch_draw, 0)

Definition at line 427 of file cfmaplog.py.

◆ regc_wtch_draw_date

cfmaplog.regc_wtch_draw_date = re.compile(regx_wtch_draw_date, 0)

Definition at line 437 of file cfmaplog.py.

◆ regc_wtch_draw_made

cfmaplog.regc_wtch_draw_made = re.compile(regx_wtch_draw_made, 0)

Definition at line 435 of file cfmaplog.py.

◆ regc_wtch_draw_name

cfmaplog.regc_wtch_draw_name = re.compile(regx_wtch_draw_name, 0)

Definition at line 431 of file cfmaplog.py.

◆ regc_wtch_draw_path

cfmaplog.regc_wtch_draw_path = re.compile(regx_wtch_draw_path, 0)

Definition at line 433 of file cfmaplog.py.

◆ regc_wtch_draw_rnds

cfmaplog.regc_wtch_draw_rnds = re.compile(regx_wtch_draw_rnds, 0)

Definition at line 441 of file cfmaplog.py.

◆ regc_wtch_draw_strt

cfmaplog.regc_wtch_draw_strt = re.compile(regx_wtch_draw_strt, 0)

Definition at line 429 of file cfmaplog.py.

◆ regc_wtch_draw_xsiz

cfmaplog.regc_wtch_draw_xsiz = re.compile(regx_wtch_draw_xsiz, 0)

Definition at line 439 of file cfmaplog.py.

◆ regx_rqst_player

string cfmaplog.regx_rqst_player = "^request\splayer\s"

Definition at line 294 of file cfmaplog.py.

◆ regx_rqst_player_data

string cfmaplog.regx_rqst_player_data = regx_rqst_player_id + regx_rqst_player_name

Definition at line 302 of file cfmaplog.py.

◆ regx_rqst_player_id

string cfmaplog.regx_rqst_player_id = "(\d+)\s+"

Definition at line 296 of file cfmaplog.py.

◆ regx_rqst_player_name

string cfmaplog.regx_rqst_player_name = "Player:\s+(\w+)\s+(.+)"

Definition at line 300 of file cfmaplog.py.

◆ regx_rqst_player_strt

string cfmaplog.regx_rqst_player_strt = regx_rqst_player + regx_rqst_player_id

Definition at line 298 of file cfmaplog.py.

◆ regx_wtch_draw

string cfmaplog.regx_wtch_draw = "^watch drawextinfo (\d+\s){3}"

Definition at line 426 of file cfmaplog.py.

◆ regx_wtch_draw_date

string cfmaplog.regx_wtch_draw_date = "Modified:\s+(.+)"

Definition at line 436 of file cfmaplog.py.

◆ regx_wtch_draw_made

string cfmaplog.regx_wtch_draw_made = "Created:\s+(.*)"

Definition at line 434 of file cfmaplog.py.

◆ regx_wtch_draw_name

string cfmaplog.regx_wtch_draw_name = regx_wtch_draw_strt + "[~/]"

Definition at line 430 of file cfmaplog.py.

◆ regx_wtch_draw_path

string cfmaplog.regx_wtch_draw_path = "^([^\(\)]+|\(null\)\s)\(([^\)]+)\)\s*(.*)"

Definition at line 432 of file cfmaplog.py.

◆ regx_wtch_draw_rnds

string cfmaplog.regx_wtch_draw_rnds = "random_seed\s\d+"

Definition at line 440 of file cfmaplog.py.

◆ regx_wtch_draw_strt

string cfmaplog.regx_wtch_draw_strt = regx_wtch_draw + "([^\(]+|\(null\)\s*)\("

Definition at line 428 of file cfmaplog.py.

◆ regx_wtch_draw_xsiz

string cfmaplog.regx_wtch_draw_xsiz = regx_wtch_draw + "xsize\s[-]?\d+"

Definition at line 438 of file cfmaplog.py.

◆ server_id

int cfmaplog.server_id = 0

Definition at line 214 of file cfmaplog.py.

◆ servers

int cfmaplog.servers = 0

Definition at line 213 of file cfmaplog.py.

◆ sqlcmd

string cfmaplog.sqlcmd
Initial value:
1 = '''
2  SELECT v.VISIT_DATE, v.VISIT_TOTAL, m.MAP_NAME, m.MAP_PATH
3  FROM visit v
4  JOIN server s ON s.SERVER_ID = v.SERVER_ID
5  JOIN player p ON p.PLAYER_ID = v.PLAYER_ID
6  JOIN map m ON m.MAP_ID = v.MAP_ID
7  WHERE v.PLAYER_ID = ? AND
8  v.SERVER_ID = ? AND
9  v.VISIT_TOTAL >= 1'''

Definition at line 778 of file cfmaplog.py.

◆ success

bool cfmaplog.success = False

Definition at line 522 of file cfmaplog.py.

◆ v_head

int cfmaplog.v_head = 1

Definition at line 613 of file cfmaplog.py.

◆ v_tail

int cfmaplog.v_tail = 0

Definition at line 614 of file cfmaplog.py.

◆ vcConn

cfmaplog.vcConn = sqlite3.connect(":memory:")

Definition at line 603 of file cfmaplog.py.

◆ vcursor

cfmaplog.vcursor = vcConn.cursor()

Definition at line 604 of file cfmaplog.py.

◆ visit_date

cfmaplog.visit_date = ''

Definition at line 593 of file cfmaplog.py.

◆ visit_total

int cfmaplog.visit_total = 0

Definition at line 986 of file cfmaplog.py.

◆ visits

cfmaplog.visits = 0

Definition at line 592 of file cfmaplog.py.