MCP 2.1 #301

Parent #1Owner #29Flags readSource hellcore/hellcore.db

Aliases: MCP 2.1, mcp

16 verbs · 21 properties · 0 children

Verbs

VerbSpecFlagsDefinerLines
create_sessionthis none thisrxd#30110
destroy_sessionthis none thisrxd#30110
initialize_connectionthis none thisrxd#3015
finalize_connectionthis none thisrxd#3014
parse_versionthis none thisrxd#3015
compare_version_rangethis none thisrxd#30119
compare_versionthis none thisrxd#30119
unparse_versionthis none thisrxd#3012
session_forthis none thisrxd#3012
user_created user_connected user_reconnectedthis none thisrxd#30116
user_disconnected user_client_disconnectedthis none thisrxd#30113
do_out_of_band_commandthis none thisrxd#3016
package_name match_package packgesthis none thisrxd#3011
handles_package wait_for_packagethis none thisrxd#3014
nominate_for_corethis none thisrxd#3011
acceptablethis none thisrxd#3011

Properties

PropertyDefinerFlagsOwnerValue
parser#301rc#29#399258
session#301r#29#363103
version#301rc#29{2, 1}
package#301r#29#290887
negotiate#301r#29#451510
registry#301rc#29#454969
cord#301r#29#214869
man#301rc#29#455086
net#301rc#29#454039
status#301rc#29#18678
packages#301rc#29#549194
aliases#1rc#29{"MCP 2.1", "mcp"}
description#1rc#29<clear>
object_size#1r#29{7506, 1298434562}
hidden_verbs#1rc#29<clear>
phelp_msg#1rc#29<clear>
weight#1rc#29<clear>
owner_verbs#1rc#29<clear>
plural_name#1rc#29<clear>
client_image#1rc#29<clear>
listening#1rc#29<clear>

Ancestry

Ancestors (nearest first): #1 root

Children: none

Call graph

calls n301_0 #301:create_session n57_2 #57:_create n301_0->n57_2 n301_1 #301:destroy_session n45_5 #45:isa n301_1->n45_5 n57_1 #57:_recycle n301_1->n57_1 n301_2 #301:initialize_connection n301_2->n301_0 n301_3 #301:finalize_connection n301_3->n301_1 n301_5 #301:compare_version_range n301_4 #301:parse_version n301_5->n301_4 n301_6 #301:compare_version n301_5->n301_6 n301_9 #301:user_created n301_9->n301_2 n103_24 #103:report_error n301_9->n103_24 n301_10 #301:user_disconnected n301_10->n103_24 n301_13 #301:handles_package n301_8 #301:session_for n301_13->n301_8

Source

create_session

Spec this none thisFlags rxdOwner #29Definer #301

Referenced by

Source

1{connection} = args;
2if (caller != this)
3raise(E_PERM);
4elseif (typeof(session = $recycler:_create(this.session)) != OBJ)
5raise(session);
6endif
7session:moveto(this);
8session:set_connection(connection);
9session:initialize_connection();
10return session;

destroy_session

Spec this none thisFlags rxdOwner #29Definer #301

Referenced by

Source

1{session} = args;
2if (!(caller in {this, session}))
3raise(E_PERM);
4elseif (!$object_utils:isa(session, this.session))
5raise(E_INVARG);
6elseif (session == this.session)
7raise(E_INVARG);
8else
9$recycler:_recycle(session);
10endif

initialize_connection

Spec this none thisFlags rxdOwner #29Definer #301

Referenced by

Source

1{who} = args;
2if (caller != this)
3raise(E_PERM);
4endif
5return this:create_session(who);

finalize_connection

Spec this none thisFlags rxdOwner #29Definer #301

Referenced by

none

Source

1{con} = args;
2if (caller == con)
3this:destroy_session(con);
4endif

parse_version

Spec this none thisFlags rxdOwner #29Definer #301

Referenced by

Source

1"string version number -> {major, minor}";
2{version} = args;
3if (m = match(version, "%([0-9]+%)%.%([0-9]+%)"))
4return {tonum(substitute("%1", m)), tonum(substitute("%2", m))};
5endif

compare_version_range

Spec this none thisFlags rxdOwner #29Definer #301

Referenced by

none

Source

1{client, server} = args;
2{min1, max1} = client;
3{min2, max2} = server;
4min1 = (typeof(min1) == STR) ? this:parse_version(min1) | min1;
5min2 = (typeof(min2) == STR) ? this:parse_version(min2) | min2;
6max1 = (typeof(max1) == STR) ? this:parse_version(max1) | max1;
7max2 = (typeof(max2) == STR) ? this:parse_version(max2) | max2;
8if (!(((min1 && min2) && max1) && max2))
9return;
10else
11if ((this:compare_version(max1, min2) <= 0) && (this:compare_version(max2, min1) <= 0))
12if (this:compare_version(max1, max2) < 0)
13return max2;
14else
15return max1;
16endif
17endif
18endif
19return 0;

compare_version

Spec this none thisFlags rxdOwner #29Definer #301

Referenced by

Source

1"-1 if v1 > v2, 0 if v1 = v2, 1 if v1 < v2";
2{v1, v2} = args;
3if (v1 == v2)
4return 0;
5else
6{major1, minor1} = v1;
7{major2, minor2} = v2;
8if (major1 == major2)
9if (minor1 > minor2)
10return -1;
11else
12return 1;
13endif
14elseif (major1 > major2)
15return -1;
16else
17return 1;
18endif
19endif

unparse_version

Spec this none thisFlags rxdOwner #29Definer #301

Referenced by

none

Source

1{major, minor} = args;
2return tostr(major, ".", minor);

session_for

Spec this none thisFlags rxdOwner #29Definer #301

Referenced by

Source

1{who} = args;
2return `who.out_of_band_session ! E_PROPNF => $failed_match';

user_created user_connected user_reconnected

Spec this none thisFlags rxdOwner #29Definer #301

Referenced by

none

Source

1return;
2{who} = args;
3if (caller == #0)
4try
5if (gamevalid(s = who.out_of_band_session))
6s:finish();
7endif
8except e (ANY)
9$rpg:report_error(e);
10endtry
11try
12who.out_of_band_session = this:initialize_connection(who);
13except e (ANY)
14$rpg:report_error(e);
15endtry
16endif

user_disconnected user_client_disconnected

Spec this none thisFlags rxdOwner #29Definer #301

Referenced by

none

Source

1{who} = args;
2if (caller == #0)
3try
4if (gamevalid(s = who.out_of_band_session))
5s:finish();
6endif
7except e (ANY)
8$rpg:report_error(e);
9endtry
10who.out_of_band_session = #-1;
11else
12raise(E_PERM);
13endif

do_out_of_band_command

Spec this none thisFlags rxdOwner #361Definer #301

Referenced by

Source

1if (caller == #0)
2if (valid(player) && gamevalid(s = player.out_of_band_session))
3set_task_perms(player);
4return s:do_out_of_band_command(@args);
5endif
6endif

package_name match_package packges

Spec this none thisFlags rxdOwner #29Definer #301

Referenced by

Source

1return this.registry:(verb)(@args);

handles_package wait_for_package

Spec this none thisFlags rxdOwner #29Definer #301

Referenced by

none

Source

1{who, @rest} = args;
2if (valid(session = this:session_for(who)))
3return session:(verb)(@rest);
4endif

nominate_for_core

Spec this none thisFlags rxdOwner #29Definer #301

Referenced by

none

Source

1return {@pass(@args), this.package, this.session, this.registry, this.parser, $cord};

acceptable

Spec this none thisFlags rxdOwner #361Definer #301

Referenced by

none

Source

1return is_a(args[1], this.session);