public void RPC_GetTeamPlayers(RPC.RPCForwardInfo fwd) { RPC.PackageWriter pkg = new RPC.PackageWriter(); H_RPCRoot.smInstance.HGet_ComServer(pkg).HGet_UserRoleManager(pkg).RPC_GetTeamPlayers(pkg, PlayerData.RoleDetail.RoleId); pkg.WaitDoCommand(IPlanesServer.Instance.ComConnect, RPC.CommandTargetType.DefaultType, null).OnFarCallFinished = delegate(RPC.PackageProxy _io, bool isTimeOut) { if (isTimeOut) { return; } RPC.PackageWriter retPkg = new RPC.PackageWriter(); retPkg.SetSinglePkg(); sbyte result = _io.ReadSByte(); retPkg.Write(result); if (result == (sbyte)CSCommon.eRet_Team.Succeed) { byte count = _io.ReadByte(); retPkg.Write(count); for (byte i = 0; i < count; i++) { RoleCom data = new RoleCom(); _io.Read(data); retPkg.Write(data); } } retPkg.DoReturnPlanes2Client(fwd); }; }
protected bool InitPlayerData(OffPlayerData pd, RoleCom rc) { mPlayerData = pd; mRoleData = rc; SkillMgr.InitBag(this, pd.skills); return(true); }
public void RPC_GetGuilds(RPC.RPCForwardInfo fwd) { RPC.PackageWriter pkg = new RPC.PackageWriter(); H_RPCRoot.smInstance.HGet_ComServer(pkg).HGet_UserRoleManager(pkg).RPC_GetGuilds(pkg, PlayerData.RoleDetail.RoleId); pkg.WaitDoCommand(IPlanesServer.Instance.ComConnect, RPC.CommandTargetType.DefaultType, null).OnFarCallFinished = delegate(RPC.PackageProxy _io, bool isTimeOut) { if (isTimeOut) { return; } RPC.PackageWriter retPkg = new RPC.PackageWriter(); retPkg.SetSinglePkg(); sbyte success; _io.Read(out success); retPkg.Write(success); if (success == (sbyte)CSCommon.eRet_GetGuilds.ReturnGuilds) { int guildcount = 0; _io.Read(out guildcount); retPkg.Write(guildcount); for (int i = 0; i < guildcount; i++) { CSCommon.Data.GuildCom guild = new CSCommon.Data.GuildCom(); _io.Read(guild); retPkg.Write(guild); } } else if (success == (sbyte)CSCommon.eRet_GetGuilds.ReturnGuildMembers) { CSCommon.Data.GuildCom ownguild = new CSCommon.Data.GuildCom(); _io.Read(ownguild); retPkg.Write(ownguild); int membercount = 0; _io.Read(out membercount); retPkg.Write(membercount); for (int j = 0; j < membercount; j++) { RoleCom roleData = new RoleCom(); _io.Read(roleData); retPkg.Write(roleData); } } retPkg.DoReturnPlanes2Client(fwd); }; }