private static void OnUserLoginEvent(UserLogin2Client e, object[] args)
    {
        activationCode = "";
        if (e.code == 0)
        {
            isLogin = true;
            GameDataMonitor.PushData("User", e.user, "玩家数据");

            SDKManager.UserID = e.user.userID;
        }

        if (OnUserLogin != null)
        {
            OnUserLogin(e);
        }
        if (e.reloginState)
        {
            return;
        }
        isClickLogin = false;
        if (e.code != 0)
        {
            Debug.LogError("Login error code:" + e.code);
            return;
        }
        ResendMessageManager.startResend = true;
        loginMsg.typeKey = e.user.typeKey;

        SDKManager.LogLogin(e.user.userID);
    }
    public static void CreateWorld <T>() where T : WorldBase, new()
    {
        T world = new T();

        world.Init(true);

        s_worldList.Add(world);

        GameDataMonitor.PushData("world", world);
    }
Exemple #3
0
    private static void OnUserLoginEvent(UserLogin2Client e, object[] args)
    {
        activationCode = "";
        if (e.code == 0)
        {
            isLogin = true;
            GameDataMonitor.PushData("User", e.user, "玩家数据");
            GameInfoCollecter.AddPlayerInfoValue("IsLogin", IsLogin);
            GameInfoCollecter.AddPlayerInfoValue("UserID", e.user.userID);
            GameInfoCollecter.AddPlayerInfoValue("LoginType", e.user.loginType);
            GameInfoCollecter.AddPlayerInfoValue("NickName", e.user.nickName);
            GameInfoCollecter.AddPlayerInfoValue("TypeKey", e.user.typeKey);
            GameInfoCollecter.AddPlayerInfoValue("PlayTime", e.user.playTime);
            GameInfoCollecter.AddPlayerInfoValue("TotalLoginDays", e.user.totalLoginDays);

            SDKManager.UserID = e.user.userID;
        }

        if (OnUserLogin != null)
        {
            OnUserLogin(e);
        }
        if (e.reloginState)
        {
            return;
        }
        isClickLogin = false;
        if (e.code != 0)
        {
            Debug.LogError("Login error code:" + e.code);
            return;
        }
        ResendMessageManager.startResend = true;
        loginMsg.typeKey = e.user.typeKey;

        SDKManager.LogLogin(e.user.userID);
    }
Exemple #4
0
    public override void OnEnterStatus()
    {
        base.OnEnterStatus();

        List <string> list = new List <string>();

        list.Add("lizhu");
        list.Add("tuying");
        list.Add("luorui");


        GameDataClass gameDataObj = new GameDataClass();

        gameDataObj.list = list;
        GameDataMonitor.PushData("GameDataClass", gameDataObj);

        NetworkManager.Init <ProtocolService>();
        NetworkManager.SetServer("127.0.0.1", 2012);
        NetworkManager.Connect();

        ProtocolAnalysisService.Init();

        GlobalEvent.AddTypeEvent <role_login_c>(Recevice);
    }