1 /* Written by Ketmar // Invisible Vector <ketmar@ketmar.no-ip.org>
2 * Understanding is not required. Only obedience.
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 // very simple serializer
18 module ncproto
is aliced
;
26 // ////////////////////////////////////////////////////////////////////////// //
33 void ncSendPingback() (UDSocket sk
, in auto ref InjCodeInfo nfo
) {
34 sk
.writeNum
!ubyte(0); // version
39 void ncReceivePingback (UDSocket sk
, ref InjCodeInfo nfo
) {
40 if (sk
.readNum
!ubyte != 0) throw new Exception("invalid protocol version");
45 // ////////////////////////////////////////////////////////////////////////// //
46 public struct AssemblyInfo
{
52 // ////////////////////////////////////////////////////////////////////////// //
53 public struct NCClassInfo
{
59 @NCIgnore string asmname
;
60 @NCIgnore string fullname
;
61 @NCIgnore string fullnamenoasm
;
63 bool isNameEqu (const(char)[] name
) const {
64 import std
.algorithm
: endsWith
;
65 if (!fullname
.endsWith(name
)) return false;
66 if (fullname
.length
== name
.length
) return true;
67 if (fullname
[$-name
.length
-1] != '.') return false;
73 // ////////////////////////////////////////////////////////////////////////// //
74 public struct FieldInfo
{
83 // ////////////////////////////////////////////////////////////////////////// //
84 __gshared string
delegate (uint asmid
) getAssemblyName
;
85 __gshared AssemblyInfo
[] delegate () enumAssemblies
;
86 __gshared NCClassInfo
[] delegate (uint asmid
=0) getClassList
;
87 __gshared FieldInfo
[] delegate (uint clsid
) getClassFields
;