Ejemplo n.º 1
0
 internal static bool GetClientServiceMethod(uint pServiceId, uint pMethodId, out ClientImportedServiceMethodAttribute pMethod)
 {
     pMethod = null;
     ClientImportedServiceAttribute service = null;
     if (!sClientServices.TryGetValue(pServiceId, out service)) return false;
     return service.TryGetMethod(pMethodId, out pMethod);
 }
Ejemplo n.º 2
0
        private void OnMessage(Header pHeader, MemoryStream pData)
        {
            Log(ELogLevel.Debug, "Received Message: {0}.{1} Token = {2}, {3} Bytes", pHeader.ServiceId, pHeader.MethodId, pHeader.Token, pHeader.Size);

            if (!mImportedServices.Contains(pHeader.ServiceId))
            {
                Log(ELogLevel.Warn, "Unavailable Service: {0}", pHeader.ServiceId);
                return;
            }
            ClientImportedServiceMethodAttribute clientServiceMethod = null;

            if (!Program.GetClientServiceMethod(pHeader.ServiceId, pHeader.MethodId, out clientServiceMethod))
            {
                Log(ELogLevel.Warn, "Unknown Service Method: {0}.{1}", pHeader.ServiceId, pHeader.MethodId);
                return;
            }
            if (clientServiceMethod.Dump)
            {
                Logger.Dump(pData.ToArray(), 0, (int)pData.Length);
            }
            clientServiceMethod.Method(this, pHeader, pData);
        }
 public bool TryGetMethod(uint pMethodId, out ClientImportedServiceMethodAttribute pMethod)
 {
     return(mMethods.TryGetValue(pMethodId, out pMethod));
 }
 public void AddMethod(uint pMethodId, ClientImportedServiceMethodAttribute pMethod)
 {
     mMethods[pMethodId] = pMethod;
 }
 public bool TryGetMethod(uint pMethodId, out ClientImportedServiceMethodAttribute pMethod)
 {
     return mMethods.TryGetValue(pMethodId, out pMethod);
 }
 public void AddMethod(uint pMethodId, ClientImportedServiceMethodAttribute pMethod)
 {
     mMethods[pMethodId] = pMethod;
 }