本文整理汇总了C#中Sinan.FrontServer.UserNote类的典型用法代码示例。如果您正苦于以下问题:C# UserNote类的具体用法?C# UserNote怎么用?C# UserNote使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UserNote类属于Sinan.FrontServer命名空间,在下文中一共展示了UserNote类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CallEmail
public static void CallEmail(UserNote note)
{
//MailAddress address = new MailAddress("", string.Empty, Encoding.UTF8);
//MailMessage mail = new MailMessage();
//mail.Subject = "asdfasdf";
//mail.From = address;
//Dictionary<string, string> dic = new Dictionary<string, string>();
//foreach (string k in dic.Keys)
//{
// mail.To.Add(new MailAddress(k, dic[k]));
//}
//mail.CC.Add(new MailAddress("[email protected]", "尊敬的领导"));
//mail.Body = string.Empty;
//mail.BodyEncoding = Encoding.UTF8;
//mail.IsBodyHtml = true;
//mail.Priority = MailPriority.Normal;
//mail.DeliveryNotificationOptions = DeliveryNotificationOptions.OnSuccess;
//SmtpClient client = new SmtpClient();
//client.Host = "smtp.hotmail.com";
//client.Port = 25;
//client.UseDefaultCredentials = false;
//client.Credentials = new NetworkCredential("", string.Empty);
//client.Send(mail);
}
示例2: Execute
void Execute(UserNote note)
{
switch (note.Name)
{
case StarCommand.PlayerMeditation:
StarBusiness.PlayerMeditation(note);
break;
case StarCommand.StartStar:
StarBusiness.StartStar(note);
break;
case StarCommand.StartStarShared:
StarBusiness.StartStarShared(note);
break;
case StarCommand.InStarTroops:
StarBusiness.InStarTroops(note);
break;
case StarCommand.OutStarTroops:
StarBusiness.OutStarTroops(note);
break;
case StarCommand.GetStarTroops:
//StarBusiness.GetStarTroops(note);
break;
case StarCommand.IsStartTroops:
StarBusiness.IsStartTroops(note);
break;
case LoginCommand.PlayerLoginSuccess:
StarBusiness.OfflineTroops(note);
break;
}
}
示例3: GetMyRank
private void GetMyRank(UserNote note)
{
//int rank = TopAccess.Instance.GetMyRank(note.Player);
//note.Call(PaiHangCommand.GetMyRankR, rank);
for (int i = 0; i < PlayerDump.Lev0Players.Length; i++)
{
Player p = PlayerDump.Lev0Players[i];
if (p == null) break;
if (p.PID == note.PID)
{
string fid = note.Player.Family.Value.GetStringOrDefault("FamilyID");
if (!string.IsNullOrEmpty(fid))
{
p.Value["LevF"] = GetLevF(fid);//TopAccess.Instance.GetMyFamilyRank(note.Player);
}
note.Call(PaiHangCommand.GetMyRankR, p.Value);
return;
}
}
string fid2 = note.Player.Family.Value.GetStringOrDefault("FamilyID");
int familRank = GetLevF(fid2);// TopAccess.Instance.GetMyFamilyRank(note.Player);
if (familRank > 0)
{
Variant v = new Variant(1);
v["LevF"] = familRank;
note.Call(PaiHangCommand.GetMyRankR, v);
}
else
{
note.Call(PaiHangCommand.GetMyRankR, new object[] { null });
}
}
示例4: Task10004
/// <summary>
/// 判断是否存在要求回收的物品
/// </summary>
/// <param name="note"></param>
/// <param name="s"></param>
/// <returns>true表示发生变化</returns>
public static bool Task10004(UserNote note, Variant s)
{
if (s.GetIntOrDefault("Cur") == s.GetIntOrDefault("Total"))
return false;
if (!s.ContainsKey("GoodsID"))
return false;
if (s.GetIntOrDefault("Type") != 10004)
return false;
int m = GameConfigAccess.Instance.GetStactCount(s.GetStringOrDefault("GoodsID"));
if (m <= 0) return false;
PlayerEx burden = note.Player.B0;
IList c = burden.Value.GetValue<IList>("C");
int number = 0;
foreach (Variant d in c)
{
if (d.GetStringOrDefault("G") == s.GetStringOrDefault("GoodsID"))
{
number += d.GetIntOrDefault("A");
}
}
if (number >= s.GetIntOrDefault("Total"))
s["Cur"] = s.GetIntOrDefault("Total");
else
s["Cur"] = number;
return true;
}
示例5: ExecuteUserNote
protected override void ExecuteUserNote(UserNote note)
{
switch (note.Name)
{
//case ClientCommand.WalkTo:
// WalkTo(note);
// return;
//case LoginCommand.PlayerLogin:
// PlayerLogin(note);
// return;
case ClientCommand.IntoSceneSuccess:
IntoSceneSuccess(note);
return;
case ClientCommand.ExitScene:
ExitScene(note.Player);
return;
case ClientCommand.UserDisconnected:
Disconnected(note.Player);
return;
default:
return;
}
}
示例6: DelEnemy
/// <summary>
/// 删除仇人
/// </summary>
/// <param name="note"></param>
public static void DelEnemy(UserNote note)
{
string playerid = note.GetString(0);
PlayerEx Social = note.Player.Social;
IList Enemy = Social.Value.GetValue<IList>("Enemy");
if (Enemy != null)
{
Variant msg = null;
foreach (Variant d in Enemy)
{
if (d.GetStringOrDefault("PlayerID") == playerid)
{
msg = d;
break;
}
}
if (msg != null)
{
///移除成功
Enemy.Remove(msg);
Social.Save();
}
}
Variant v = new Variant();
v.Add("ID",playerid);
note.Call(SocialCommand.DelEnemyR, true, v);
}
示例7: Aura
/// <summary>
/// 合成光环
/// </summary>
/// <param name="note"></param>
private void Aura(UserNote note)
{
RobBusiness part = PartProxy.TryGetPart(Part.Rob) as RobBusiness;
if (part != null)
{
if (part.CombinAura(note))
{
//成功合成元素的玩家得奖励
Int32 exp = (int)(part.TotalExp / 100);
PlayerBusiness player = note.Player;
player.AddExperience(exp, FinanceType.Part);
player.AddPetExp(player.Pet, exp, true, (int)FinanceType.Part);
var team = player.Team;
if (team == null)
{
player.AddExperience(exp, FinanceType.Part);
player.AddPetExp(player.Pet, exp, true, (int)FinanceType.Part);
}
else
{
TeamAddExp(team, exp);
}
}
}
}
示例8: OutTeam
/// <summary>
/// 离开队伍
/// </summary>
/// <param name="note"></param>
/// <param name="team"></param>
private void OutTeam(UserNote note, PlayerTeam team)
{
PlayerBusiness player = note.Player;
if (team.RemoveMember(player))
{
var buffer = AmfCodec.Encode(TeamCommand.OutTeamR,
new object[] { true, team.TeamID, player.ID, player.Name, null });
if (player.SceneID == team.Captain.SceneID)
{
team.Captain.CallAll(buffer);
//通知其它场景上的用户
team.CallAway(buffer, team.Captain.SceneID);
}
else
{
player.Call(buffer);
//通知其它场景上的用户
team.CallAway(buffer, player.SceneID);
}
}
var t = player.TeamInstance;
if (t != null)
{
t.Exit(player, true);
}
}
示例9: PetExtend
/// <summary>
/// 宠物仓库扩展
/// </summary>
public void PetExtend(UserNote note)
{
PlayerEx b2 = note.Player.B2;
Variant v = b2.Value;
//允许最大值
int max = v.GetIntOrDefault("Max");
//当前值
int cur = v.GetIntOrDefault("Cur");
IList c = v.GetValue<IList>("C");
if (cur >= max)
{
note.Call(PetsCommand.PetExtendR, false, TipManager.GetMessage(PetsReturn.PetExtendMax));
return;
}
int n = 4;
int number = 0;//note.GetInt32(0);
string goodsid = "";
double lv = GameConfigAccess.Instance.FindExtend(ExtendType.B2, cur.ToString(),out number, out goodsid);
if (string.IsNullOrEmpty(goodsid) || number <= 0)
{
note.Call(PetsCommand.PetExtendR, false, TipManager.GetMessage(ExtendReturn.B22));
return;
}
if (note.Player.RemoveGoods(goodsid, number, GoodsSource.PetExtend))
{
note.Player.UpdateBurden();
if (NumberRandom.RandomHit(lv))
{
for (int i = cur; i < cur + n; i++)
{
Variant m = new Variant();
m.Add("P", i);
m.Add("E", "");
m.Add("G", "");//道具ID
m.Add("A", 0);
m.Add("S", 0);//排序
m.Add("H", 0);//0非绑定,1绑定是否绑定
m.Add("D", 0);//0不能堆叠,1可以
m.Add("T", null);//物品类型
c.Add(m);
}
v["Cur"] = cur + n;
b2.Save();
note.Call(PetsCommand.PetExtendR, true, (cur + n));
}
else
{
note.Call(PetsCommand.PetExtendR, false, TipManager.GetMessage(ExtendReturn.B23));
}
}
else
{
note.Call(PetsCommand.PetExtendR, false, TipManager.GetMessage(ExtendReturn.B22));
}
}
示例10: Execute
void Execute(UserNote note)
{
switch (note.Name)
{
case LoginCommand.PlayerLoginSuccess:
//case ActivityCommand.CheckActivity:
ActivityBusiness.Activity(note);
break;
case ClientCommand.UserDisconnected:
ActivityBusiness.UserDisconnected(note);
break;
case ActivityCommand.ActivitySign:
ActivityBusiness.Sign(note);
break;
case ActivityCommand.ActivityAward:
ActivityBusiness.ActivityAward(note);
break;
case ActivityCommand.LoginAward:
ActivityBusiness.LoginAward(note);
break;
case ActivityCommand.SignAward:
ActivityBusiness.SignAward(note);
break;
case ActivityCommand.VIPDayAward:
ActivityBusiness.VIPDayAward(note);
break;
case ActivityCommand.VipExchange:
ActivityBusiness.VipExchange(note);
break;
case ActivityCommand.OnlineAward:
ActivityBusiness.OnlineAward(note);
break;
}
}
示例11: SupplyLimit
/// <summary>
/// 道具使用限制
/// </summary>
/// <param name="note"></param>
/// <param name="gc"></param>
/// <returns></returns>
public static bool SupplyLimit(UserNote note, GameConfig gc)
{
Variant limit = gc.Value.GetVariantOrDefault("UserLimit");
if (limit == null) return true;
//补充类使用限制
return CheckLevel(note, limit);
}
示例12: Execute
void Execute(UserNote note)
{
//表示角色正在战斗中,客户端提交信息不进行处理
if (note.Player.AState == ActionState.Fight)
{
Variant msg = GoodsAccess.Instance.LiaoTianList(TipManager.GetMessage(DealReturn.SelfFighting));
note.Call(ClientCommand.SendMsgToAllPlayerR, string.Empty, msg);
return;
}
switch (note.Name)
{
case DealCommand.DealApply:
DealBusiness.DealApply(note);
break;
case DealCommand.DealApplyBack:
DealBusiness.DealApplyBack(note);
break;
case DealCommand.LockDeal:
DealBusiness.LockDeal(note);
break;
case DealCommand.EnterDeal:
DealBusiness.EnterDeal(note);
break;
case DealCommand.ExitDeal:
case ClientCommand.UserDisconnected:
DealBusiness.ExitDeal(note);
break;
}
}
示例13: Execute
void Execute(UserNote note)
{
//表示角色正在战斗中,客户端提交信息不进行处理
if (note.Player.AState == ActionState.Fight)
return;
switch (note.Name)
{
case EmailCommand.EmailList:
EmailBusiness.EmailList(note);
break;
case EmailCommand.SendEmail:
EmailBusiness.SendEmail(note);
break;
case EmailCommand.NewEmailTotal:
EmailBusiness.NewEmailTotal(note);
break;
case EmailCommand.UpdateEmail:
EmailBusiness.UpdateEmail(note);
break;
case EmailCommand.DelEmail:
EmailBusiness.DelEmail(note);
break;
case EmailCommand.ExtractGoods:
//EmailBusiness.ExtractGoods(note);
EmailBusiness.GetEmailGoods(note);
break;
case EmailCommand.ExitEmail:
EmailBusiness.ExitEmail(note);
break;
case PartCommand.RobFamilyAward:
EmailBusiness.RobFamilyAward(note);
break;
}
}
示例14: BossAward
/// <summary>
/// 领取奖励
/// </summary>
/// <param name="note"></param>
public static void BossAward(UserNote note)
{
string fid = note.Player.Family.Value.GetStringOrDefault("FamilyID");
if (string.IsNullOrEmpty(fid))
{
note.Call(FamilyCommand.BossAwardR, false, TipManager.GetMessage(FamilyReturn.NoAddFamily));
return;
}
string bid = note.GetString(0);
var p = GameConfigAccess.Instance.FindOneById(bid);
if (p == null)
{
return;
}
string gid = note.GetString(1); //FamilyBossAccess.Instance.ViewAward(fid + bid, note.Player.ID);
if (string.IsNullOrEmpty(gid))
{
return;
}
string[] tt = gid.Split('$');
int number = 1;
if (tt.Length != 2 || (!int.TryParse(tt[1], out number)))
{
number = 1;
}
string goodsid = tt[0];
//TODO:检查包袱
Dictionary<string, Variant> goods = new Dictionary<string, Variant>();
Variant tmp = new Variant();
tmp.Add("Number1", number);
goods.Add(goodsid, tmp);
if (BurdenManager.GetBurdenSpace(note.Player.B0.Value.GetValue<IList>("C")) == null)
{
note.Call(FamilyCommand.BossAwardR, false, TipManager.GetMessage(ActivityReturn.SignAward4));
return;
}
//if (BurdenManager.IsFullBurden(note.Player.B0, goods))
//{
// note.Call(FamilyCommand.BossAwardR, false, TipManager.GetMessage(ActivityReturn.SignAward4));
// return;
//}
if (FamilyBossAccess.Instance.GetAward(fid + bid, note.Player.ID, gid))
{
//发放物品
note.Player.AddGoods(goods, GoodsSource.FamilyBoss);
note.Call(FamilyCommand.BossAwardR, true, gid);
}
else
{
//已领取..
note.Call(FamilyCommand.BossAwardR, false, TipManager.GetMessage(FamilyReturn.CannotBossAward));
}
}
示例15: AddFriends
/// <summary>
/// 添加好友
/// </summary>
/// <param name="note"></param>
public static void AddFriends(UserNote note)
{
string name = note.GetString(0);
if (note.Player.Name == name)
{
return;
}
PlayerEx social = note.Player.Social;
if (social == null)
{
note.Call(SocialCommand.AddFriendsR, false, TipManager.GetMessage(SocialReturn.UserInfoError));
return;
}
PlayerBusiness player = PlayersProxy.FindPlayerByName(name);
if (player == null)
{
note.Call(SocialCommand.AddFriendsR, false, TipManager.GetMessage(SocialReturn.UserInfoError));
return;
}
if (social.Value != null)
{
if (SocialBusiness.IsLet(social, player.ID, new List<string> { "Friends" }))
{
note.Call(SocialCommand.AddFriendsR, false, TipManager.GetMessage(SocialReturn.Friends));
return;
}
if (SocialBusiness.IsLet(social, player.ID, new List<string> { "Enemy" }))
{
note.Call(SocialCommand.AddFriendsR, false, TipManager.GetMessage(SocialReturn.Master));
return;
}
}
Variant v = new Variant();
v.Add("PlayerID", player.ID);
v.Add("Created", DateTime.UtcNow);
IList list = social.Value.GetValue<IList>("Friends");
int num = 0;
if (list == null)
{
social.Value["Friends"] = new List<Variant>() { v };
num = 1;
}
else
{
list.Add(v);
num = list.Count;
}
social.Save();
note.Call(SocialCommand.AddFriendsR, true, new PlayerSimple(player, 3));
//添加好友
note.Player.FinishNote(FinishCommand.Friends, num);
}