コード例 #1
0
        public override void record_createRole(Variant data)
        {
            // "{\"roleId\":\"1\",\"roleName\":\"chasname\",\"roleLevel\":\"1\",\"roleGold\":\"300\",\"roleYb\":\"200\",
            // \"roleServerId\":\"1\",\"roleServerName\":\"servername\",\"rolevip\":\"1\",\"rolePartyName\":\"哈利噶多\",
            // \"rolePartyId\":\"123\",\"rolePower\":\"1234\",\"rolePartyRoleId\":\"1231\",\"rolePartyRoleName\":\"哈利波特\",
            // \"roleProfessionId\":\"12\",\"roleProfession\":\"无敌法师\",\"roleFriendlist\":\" \"}";

            Globle.YR_role_enter_time = Globle.getStrTimeNomal(NetClient.instance.CurServerTimeStamp);

            int    cid  = data["cid"];
            string name = data["name"];

            if (name.Length > 2)
            {
                name = name.Remove(name.Length - 2);
            }

            uint zhuan        = data["zhua"];
            uint lvl          = data["lvl"];
            int  professionId = data["carr"];

            Variant v = new Variant();

            v["roleId"]         = cid;
            v["roleName"]       = name;
            v["roleLevel"]      = getlv(zhuan, lvl);
            v["roleGold"]       = 0;
            v["roleYb"]         = 0;
            v["roleCreateTime"] = NetClient.instance.CurServerTimeStamp;
            //v["roleleveluptime"] = NetClient.instance.CurServerTimeStamp;
            v["roleServerId"]      = Globle.curServerD.sid;
            v["roleServerName"]    = Globle.curServerD.server_name;
            v["rolevip"]           = 0;
            v["rolePartyName"]     = "";
            v["rolePartyId"]       = "";
            v["rolePower"]         = 0;
            v["rolePartyRoleId"]   = "";
            v["rolePartyRoleName"] = "";
            v["roleProfessionId"]  = professionId;
            v["roleProfession"]    = "";
            v["roleFriendlist"]    = "";
            v["gpuid"]             = Globle.YR_srvlists__platuid;
            v["roleEnterTime"]     = Globle.YR_role_enter_time;
            string serverInfoJsonString = JsonManager.VariantToString(v);

            AnyPlotformSDK.Call_Cmd("createRole", "lanRole", serverInfoJsonString, false);

            debug.Log("[record]createRole:" + serverInfoJsonString);
        }
コード例 #2
0
        public override void record_login()
        {
            // "{\"roleId\":\"1\",\"roleName\":\"chasname\",\"roleLevel\":\"1\",\"roleGold\":\"300\",\"roleYb\":\"200\",
            // \"roleServerId\":\"1\",\"roleServerName\":\"servername\",\"rolevip\":\"1\",\"rolePartyName\":\"哈利噶多\",
            // \"rolePartyId\":\"123\",\"rolePower\":\"1234\",\"rolePartyRoleId\":\"1231\",\"rolePartyRoleName\":\"哈利波特\",
            //\"roleProfessionId\":\"12\",\"roleProfession\":\"无敌法师\",\"roleFriendlist\":\" \"}";

            Globle.YR_role_enter_time = Globle.getStrTimeNomal(NetClient.instance.CurServerTimeStamp);


            Variant v = new Variant();

            v["roleId"]         = PlayerModel.getInstance().cid;
            v["roleName"]       = PlayerModel.getInstance().name;
            v["roleLevel"]      = getlv(PlayerModel.getInstance().up_lvl, PlayerModel.getInstance().lvl);
            v["roleGold"]       = PlayerModel.getInstance().money;
            v["roleYb"]         = PlayerModel.getInstance().gold;
            v["roleCreateTime"] = PlayerModel.getInstance().crttm;
            //v["roleleveluptime"] = PlayerModel.getInstance().crttm;
            v["roleServerId"]      = Globle.curServerD.sid;
            v["roleServerName"]    = Globle.curServerD.server_name;
            v["rolevip"]           = PlayerModel.getInstance().vip;
            v["rolePartyName"]     = "";
            v["rolePartyId"]       = PlayerModel.getInstance().clanid;
            v["rolePower"]         = PlayerModel.getInstance().combpt;
            v["rolePartyRoleId"]   = "";
            v["rolePartyRoleName"] = "";
            v["roleProfessionId"]  = PlayerModel.getInstance().profession;
            v["roleProfession"]    = "";
            v["roleFriendlist"]    = "";
            v["gpuid"]             = Globle.YR_srvlists__platuid;
            v["roleEnterTime"]     = Globle.YR_role_enter_time;
            string serverInfoJsonString = JsonManager.VariantToString(v);

            AnyPlotformSDK.Call_Cmd("enterGame", "lanRole", serverInfoJsonString, false);

            debug.Log("[record]login:" + serverInfoJsonString);
        }