public bool RemoteCall(string Method, byte[] Args) { UInt64 hash = FNV1a.Hash(Method); byte[] buf; int hedrlen; int argslen = Args == null ? 0 : Args.Length; buf = new byte[m_hedrsize + argslen]; hedrlen = NetStruct.PackFmtBuffer(buf, 0, "li", unchecked ((Int64)hash), argslen); if (hedrlen != m_hedrsize) { Console.WriteLine($"RemoteClient.RemoteCall() internal error"); return(false); } if (argslen > 0) { Array.Copy(Args, 0, buf, hedrlen, argslen); } m_calls.Add(buf); return(true); }
public RemoteMethod Find(string Str) { return(FindHash(FNV1a.Hash(Str))); }
public RemoteMethod(string Name, Func <RemoteClient, byte[], bool> Method) { m_name = Name; m_hash = FNV1a.Hash(Name); m_meth = Method; }