private void GotoHomeMessageImpl(NetIncomingMessage im, MessageBase msg) { var homeMsg = msg as GotoHomeMessage; var r = new GotoResultMessage() { GoToType = GotoResultMessage.ToHome, }; RemoveFarmObj(im.SenderConnection); r.UserData = homeMsg.UserData; var customer = AdventurePluginDB.Customer.GetPlayerCustomer(homeMsg.PlayerId); if (customer != null) { r.Exp = customer.Exp; r.Money = customer.Money; } SharedServer.SendMessage(r, im.SenderConnection); }
private void OnGotoResultMessage(GotoResultMessage msg) { if(msg.GoToType == GotoResultMessage.ToHome) { SyncPlayerInfo(null, null, msg.Exp, msg.Money); if (msg.UserData == "Leave") { MessageManager.SendMessage("Message.GotoHome.Leave"); } else if (msg.UserData == "Camp") { MessageManager.SendMessage("Message.GotoHome.Camp"); } } else if (msg.GoToType == GotoResultMessage.ToMap) { MessageManager.SendMessage("Message.GotoMap.Success", msg.Level); } }
private void GotoMapMessageImpl(NetIncomingMessage im, MessageBase msg) { var mapMsg = msg as GotoMapMessage; var r = new GotoResultMessage() { Level = mapMsg.Level, GoToType = GotoResultMessage.ToMap, }; if(mapMsg.Attact >= mapMsg.AttactNeed) { AddFarmObj(im.SenderConnection, mapMsg.PlayerId, mapMsg.Money, mapMsg.Exp); } SharedServer.SendMessage(r, im.SenderConnection); }