19
20:- module(mu, [srv_mu/0, run_mu/0]). 21
23
24:- if(\+ exists_source(library(poor_bugger))). 25:- prolog_load_context(file,File),
26 absolute_file_name('.',X,[relative_to(File),file_type(directory)]),
27 asserta(user:file_search_path(library,X)). 28:- endif. 29
30:- pack_install(dictoo). 31
32:- ensure_loaded('./marty_white/adv_telnet'). 33:- ensure_loaded('./marty_white/adv_main'). 36
38
39mu_port(2666).
40
41srv_mu(TwoSixSixSix) :-
42 atom_concat('mu_',TwoSixSixSix,Alias),
43 thread_property(_,alias(Alias)),!,
44 format('~NServer should be running on port ~w~n',[TwoSixSixSix]),
45 threads, !.
46
47srv_mu(TwoSixSixSix) :-
48 adv_server(TwoSixSixSix),
49 format('~NServer is starting on port ~w~n',[TwoSixSixSix]),
50 threads,
51 !.
52
53srv_mu:-
54 mu_port(TwoSixSixSix),
55 srv_mu(TwoSixSixSix),
56 run_mu.
57
58run_mu:-
59 setup_console,
60 must(adventure),!.
61
62
63usage_mu:- format('~N
64You may start the server with:
65
66 ?- srv_mu.
67
68',[]).
69
70
71
72
73:- initialization(srv_mu, main). 74
75:- initialization(usage_mu).