Exemple #1
0
 public void SetUserInfo(string strJson)
 {
     try
     {
         stopConnectAll = false;
         Debug.Log("Pandora SetPara");
         Dictionary <string, object> dictionary = Json.Deserialize(strJson) as Dictionary <string, object>;
         Dictionary <string, string> dicPara    = new Dictionary <string, string>();
         foreach (KeyValuePair <string, object> pair in dictionary)
         {
             dicPara.Add(pair.Key, pair.Value as string);
         }
         string str = string.Empty;
         if (dictionary.ContainsKey("sRoleId"))
         {
             str = dictionary["sRoleId"].ToString();
         }
         if (str.Equals(string.Empty))
         {
             com.tencent.pandora.Logger.d("role is empty");
         }
         CUserData.SetPara(dicPara);
         if (Configer.strCtrFlagTotalSwitch.Equals(string.Empty))
         {
             com.tencent.pandora.Logger.d("InitSocket");
             NetProxcy.GetInstance().InitSocket();
         }
     }
     catch (Exception exception)
     {
         com.tencent.pandora.Logger.LogNetError(Configer.iCodeCSException, exception.Message + exception.StackTrace);
     }
 }
Exemple #2
0
        public void SetUserInfo(Dictionary <string, string> dicPara)
        {
            stopConnectAll = false;
            FileUtils.InitPath();
            string str = string.Empty;

            if (dicPara.ContainsKey("sRoleId"))
            {
                str = dicPara["sRoleId"].ToString();
            }
            if (str.Equals(string.Empty))
            {
                com.tencent.pandora.Logger.d("role is empty");
            }
            CUserData.SetPara(dicPara);
            if (Configer.strCtrFlagTotalSwitch.Equals(string.Empty))
            {
                com.tencent.pandora.Logger.d("InitSocket");
                NetProxcy.GetInstance().InitSocket();
            }
            else
            {
                object[] args = new object[] { string.Empty };
                Util.CallMethod("commonlib", "ReSetUserInfo", args);
            }
        }