Fixing mamer

Discussion of chess software programming and technical issues.

Moderator: Ras

User avatar
Don
Posts: 5106
Joined: Tue Apr 29, 2008 4:27 pm

Re: Fixing mamer

Post by Don »

hgm wrote:But the system does not have automated account creation at all...

Accounts have to be created by hand, (at which time their ratings are automatically initialized), and only after that you can add the handle to the computer list (which does not touch ratings, as the command for that considers it just a list like any other list).
Is the system backed up by a sql database?
Capital punishment would be more effective as a preventive measure if it were administered prior to the crime.
User avatar
hgm
Posts: 28454
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Fixing mamer

Post by hgm »

Not that I know.
User avatar
Don
Posts: 5106
Joined: Tue Apr 29, 2008 4:27 pm

Re: Fixing mamer

Post by Don »

hgm wrote:Not that I know.
Somehow state has to be maintained by the server. If your server does not have mysql it is probably sqlite or something small - or else it's something like berkelyDB or some other database system or a "roll your own" flat file system customized for this.

Is the source code public? I would like to take a quick look.

Don
Capital punishment would be more effective as a preventive measure if it were administered prior to the crime.
User avatar
Raptor
Posts: 29
Joined: Mon Jan 28, 2013 10:18 am

Re: Fixing mamer

Post by Raptor »

Don wrote:Is the source code public? I would like to take a quick look.
Don
As HGM previously mentioned the whole ICS code is up at http://hgm.nubati.net/cgi-bin/gitweb.cg ... ;a=summary

Hope it helps :)
User avatar
hgm
Posts: 28454
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Fixing mamer

Post by hgm »

As far as I know the ICS maintains its own databases, in sub-trees of its install directory ~/players/d/don, ~/games/adjourned/k/komodox-raptor, ~/games/history/64/76159164 etc. It has a 'marshaller' that automatically converts C data structures to ascii texts (which requires a pre-pass during compilation to detect all declared structs and arrays, and automatically generate C code for handling them, a process which I don't fathom at all).

For FairyMax the player file looks like this:

Code: Select all

v 100
observe_list = 0:0
Flags = 34275687
name = {FairyMax}
passwd = {$1$og$rpH5/UTyMCQK4lnxoSmDv.}
fullName = {Fairy-Max bot}
emailAddress = {h.g.muller@hccnet.nl}
prompt = {fics% }
last_tell = {limera}
last_channel = -1
last_opponent = {ffiillffww}
s_stats = {
	num = 9
	los = 9
	rating = 1293
	ltime = 1255626932
	sterr = 159.837
}
b_stats = {
	num = 43
	win = 9
	los = 32
	dra = 2
	rating = 1323
	ltime = 1255626453
	best = 1464
	whenbest = 1254324354
	sterr = 77.423
}
w_stats = {
	num = 6
	win = 5
	los = 1
	rating = 1980
	ltime = 1326233214
	sterr = 185.602
}
l_stats = {
	num = 57
	win = 5
	los = 52
	rating = 1318
	ltime = 1267260719
	best = 1414
	whenbest = 1254352368
	sterr = 79.7242
}
bug_stats = {
	sterr = 350
}
d_time = 2
d_inc = 12
d_height = 24
d_width = 80
style = 11
num_plan = 9
planLines = 0:{Fairy-Max is a program that plays Chess variants}, 1:{It is derived from the minimalist 100-line program micro-Max}, 2:{This bot is set to play the following variants:}, 3:{Gothic and Capablanca Chess, and its sub-variants}, 4:{Knightmate, which reverses moves of K and N}, 5:{Seirawan Chess (S-Chess), where you 'gate in' B+N and R+N compounds}, 6:{Superchess, with 4 fairy pieces randomly replacing normal ones}, 7:{Spartan Chess, where black has two kings and unorthodox pieces}, 8:{Hardware: an Asus Eee with 1.3 GHz Celeron M}
num_white = 383
num_black = 378
lastHost = 127.0.0.1
numAlias = 1
alias_list = 0:{
	comm_name = {$}
	alias = {@}
}
lists = {
	which = L_NOTIFY
	next = {
		which = L_CENSOR
		next = {
			which = L_CHANNEL
			numMembers = 1
			m_member = 0:{49}
			next = {
				which = L_FOLLOW
				next = {
					which = L_GNOTIFY
					next = {
						which = L_NOPLAY
					}
				}
			}
		}
	}
}
User avatar
Don
Posts: 5106
Joined: Tue Apr 29, 2008 4:27 pm

Re: Fixing mamer

Post by Don »

It appears to me that they just maintain state using their own system - files inside a data structure.

An actual sql database is far easier for sure, but very slow in comparison. A custom solution like they use is always faster and for a server they probably need all the speed they can get.

I'll bet you could edit the rating information with a text editor and it would work - assuming you do it off-line of course just in case.

Don

hgm wrote:As far as I know the ICS maintains its own databases, in sub-trees of its install directory ~/players/d/don, ~/games/adjourned/k/komodox-raptor, ~/games/history/64/76159164 etc. It has a 'marshaller' that automatically converts C data structures to ascii texts (which requires a pre-pass during compilation to detect all declared structs and arrays, and automatically generate C code for handling them, a process which I don't fathom at all).

For FairyMax the player file looks like this:

Code: Select all

 
observe_list = 0:0
Flags = 34275687
name = {FairyMax}
passwd = {$1$og$rpH5/UTyMCQK4lnxoSmDv.}
fullName = {Fairy-Max bot}
emailAddress = {h.g.muller@hccnet.nl}
prompt = {fics% }
last_tell = {limera}
last_channel = -1
last_opponent = {ffiillffww}
s_stats = {
	num = 9
	los = 9
	rating = 1293
	ltime = 1255626932
	sterr = 159.837
}
b_stats = {
	num = 43
	win = 9
	los = 32
	dra = 2
	rating = 1323
	ltime = 1255626453
	best = 1464
	whenbest = 1254324354
	sterr = 77.423
}
w_stats = {
	num = 6
	win = 5
	los = 1
	rating = 1980
	ltime = 1326233214
	sterr = 185.602
}
l_stats = {
	num = 57
	win = 5
	los = 52
	rating = 1318
	ltime = 1267260719
	best = 1414
	whenbest = 1254352368
	sterr = 79.7242
}
bug_stats = {
	sterr = 350
}
d_time = 2
d_inc = 12
d_height = 24
d_width = 80
style = 11
num_plan = 9
planLines = 0:{Fairy-Max is a program that plays Chess variants}, 1:{It is derived from the minimalist 100-line program micro-Max}, 2:{This bot is set to play the following variants:}, 3:{Gothic and Capablanca Chess, and its sub-variants}, 4:{Knightmate, which reverses moves of K and N}, 5:{Seirawan Chess (S-Chess), where you 'gate in' B+N and R+N compounds}, 6:{Superchess, with 4 fairy pieces randomly replacing normal ones}, 7:{Spartan Chess, where black has two kings and unorthodox pieces}, 8:{Hardware: an Asus Eee with 1.3 GHz Celeron M}
num_white = 383
num_black = 378
lastHost = 127.0.0.1
numAlias = 1
alias_list = 0:{
	comm_name = {$}
	alias = {@}
}
lists = {
	which = L_NOTIFY
	next = {
		which = L_CENSOR
		next = {
			which = L_CHANNEL
			numMembers = 1
			m_member = 0:{49}
			next = {
				which = L_FOLLOW
				next = {
					which = L_GNOTIFY
					next = {
						which = L_NOPLAY
					}
				}
			}
		}
	}
}
Capital punishment would be more effective as a preventive measure if it were administered prior to the crime.
User avatar
hgm
Posts: 28454
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Fixing mamer

Post by hgm »

Yes, editing would work. As admin you have also ICS commands to set peoples rating, though. (asetblitz, asetstd, asetbughouse etc.)
User avatar
jshriver
Posts: 1372
Joined: Wed Mar 08, 2006 9:41 pm
Location: Morgantown, WV, USA

Re: Fixing mamer

Post by jshriver »

An issue I and others have had (not sure if it's client/ics/mamer)

But sometimes you can get a ":mamer notes: You can not join. Tourney is not open" even it is.

I found doing a manual "set tourney off" sometimes remedied that. But not always.

Another work around, but doesn't always work, is for the admin to do a "mam att username #".

If I catch it in time, I can restart mamer, start the tourney and there isn't an issue.

No chaos points either for the user.

-Josh