Ejemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        CreatePlayerUtil.RoleModels.Add(1, GameObject.Find("gs"));
        CreatePlayerUtil.RoleModels.Add(2, GameObject.Find("ms"));
        CreatePlayerUtil.RoleModels.Add(3, GameObject.Find("fs"));
        CreatePlayerUtil.RoleModels.Add(4, GameObject.Find("zs1"));
        CreatePlayerUtil.RoleModels.Add(5, GameObject.Find("zs2"));
        CreatePlayerUtil.RoleModels.Add(6, GameObject.Find("zs3"));

        IStreamObj obj = JLogicUserData.getLocalData().getData(JObjectType.sign_in_ret);

        if (null == obj)
        {
            return;
        }
        JObj_SignRet retObj = obj as JObj_SignRet;

        if (null == retObj)
        {
            return;
        }
        foreach (var role in retObj.RolesInfo)
        {
            initial(role);
        }
    }
Ejemplo n.º 2
0
        public void run(IDataSet dataSet)
        {
            IStreamObj obj = dataSet.getData(JObjectType.create_role_ret);

            if (null == obj || null == (obj as JCreateRoleRetObject))
            {
                JLog.Error("JProcesserCreateRoleRet : obj is empty!");
            }

            if ((obj as JCreateRoleRetObject).Result != JCreateRoleRetObject.CreateRoleResultType.successed)
            {
                JLog.Info("Received JCreateRoleRetObject create failed:!" + (obj as JCreateRoleRetObject).Result.GetDescription());
            }
            //todo:...remind to regist
            else if (null != createRole)
            {
                IStreamObj createRoleObjTemp = JLogicUserData.getLocalData().getData(JObjectType.create_role);
                if (null == createRoleObjTemp)
                {
                    return;
                }
                JCreateRoleReqObject createRoleObj = createRoleObjTemp as JCreateRoleReqObject;
                if (null == createRoleObj)
                {
                    return;
                }
                createRole(createRoleObj.RoleName, createRoleObj.RoleType);
            }
        }
Ejemplo n.º 3
0
            public static void ProcessLocalData(JPacketType data)
            {
                IProcessor processor = JLogicHelper.getProcessor(data);

                if (null == processor)
                {
                    return;
                }

                processor.run(JLogicUserData.getLocalData());
            }