MCP 2.1 #301
Aliases: MCP 2.1, mcp
16 verbs · 21 properties · 0 children
Verbs
| Verb | Spec | Flags | Definer | Lines |
|---|---|---|---|---|
create_session | this none this | rxd | #301 | 10 |
destroy_session | this none this | rxd | #301 | 10 |
initialize_connection | this none this | rxd | #301 | 5 |
finalize_connection | this none this | rxd | #301 | 4 |
parse_version | this none this | rxd | #301 | 5 |
compare_version_range | this none this | rxd | #301 | 19 |
compare_version | this none this | rxd | #301 | 19 |
unparse_version | this none this | rxd | #301 | 2 |
session_for | this none this | rxd | #301 | 2 |
user_created user_connected user_reconnected | this none this | rxd | #301 | 16 |
user_disconnected user_client_disconnected | this none this | rxd | #301 | 13 |
do_out_of_band_command | this none this | rxd | #301 | 6 |
package_name match_package packges | this none this | rxd | #301 | 1 |
handles_package wait_for_package | this none this | rxd | #301 | 4 |
nominate_for_core | this none this | rxd | #301 | 1 |
acceptable | this none this | rxd | #301 | 1 |
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
parser | #301 | rc | #29 | #399258 |
session | #301 | r | #29 | #363103 |
version | #301 | rc | #29 | {2, 1} |
package | #301 | r | #29 | #290887 |
negotiate | #301 | r | #29 | #451510 |
registry | #301 | rc | #29 | #454969 |
cord | #301 | r | #29 | #214869 |
man | #301 | rc | #29 | #455086 |
net | #301 | rc | #29 | #454039 |
status | #301 | rc | #29 | #18678 |
packages | #301 | rc | #29 | #549194 |
aliases | #1 | rc | #29 | {"MCP 2.1", "mcp"} |
description | #1 | rc | #29 | <clear> |
object_size | #1 | r | #29 | {7506, 1298434562} |
hidden_verbs | #1 | rc | #29 | <clear> |
phelp_msg | #1 | rc | #29 | <clear> |
weight | #1 | rc | #29 | <clear> |
owner_verbs | #1 | rc | #29 | <clear> |
plural_name | #1 | rc | #29 | <clear> |
client_image | #1 | rc | #29 | <clear> |
listening | #1 | rc | #29 | <clear> |
Ancestry
Ancestors (nearest first): #1 root
Children: none
Call graph
Source
create_session
Referenced by
- #301:initialize_connection line 5:
this:create_session
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
Referenced by
- #301:finalize_connection line 3:
this:destroy_session
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
Referenced by
- #301:user_created line 12:
this:initialize_connection
Source
1{who} = args; 2if (caller != this) 3raise(E_PERM); 4endif 5return this:create_session(who);
finalize_connection
Referenced by
none
Source
1{con} = args; 2if (caller == con) 3this:destroy_session(con); 4endif
parse_version
Referenced by
- #301:compare_version_range line 4:
this:parse_version - #301:compare_version_range line 5:
this:parse_version - #301:compare_version_range line 6:
this:parse_version - #301:compare_version_range line 7:
this:parse_version
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
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
Referenced by
- #301:compare_version_range line 11:
this:compare_version - #301:compare_version_range line 11:
this:compare_version - #301:compare_version_range line 12:
this:compare_version
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
Referenced by
none
Source
1{major, minor} = args; 2return tostr(major, ".", minor);
session_for
Referenced by
- #6:@quit line 12:
$mcp:session_for - #50:@quit line 1:
$mcp:session_for - #301:handles_package line 2:
this:session_for
Source
1{who} = args; 2return `who.out_of_band_session ! E_PROPNF => $failed_match';
user_created user_connected user_reconnected
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
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
Referenced by
- #0:do_out_of_band_command line 2:
$mcp:do_out_of_band_command
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
Referenced by
- #302:type_name line 2:
$mcp:package_name
Source
1return this.registry:(verb)(@args);
handles_package wait_for_package
Referenced by
none
Source
1{who, @rest} = args; 2if (valid(session = this:session_for(who))) 3return session:(verb)(@rest); 4endif
nominate_for_core
Referenced by
none
Source
1return {@pass(@args), this.package, this.session, this.registry, this.parser, $cord};
acceptable
Referenced by
none
Source
1return is_a(args[1], this.session);