void OnReqPick(NetworkMessage msg) { Log.i("LanHost OnReqPick", Log.Tag.Net); MsgPick m = msg.ReadMessage <MsgPick> (); DropItems u = mUnitMgr.getUnit(m.dropGuid) as DropItems; u.decState(UnitState.Alive | UnitState.Exist); WindowMgr.SendWindowMessage("MainWindow", "ShowDrop", u.tid); }
void OnReqPick(NetworkMessage msg) { Log.i("LanHost OnReqPick", Log.Tag.Net); MsgPick m = msg.ReadMessage <MsgPick> (); DropItems u = mUnitMgr.getUnit(m.dropGuid) as DropItems; Client client = getClient(msg.conn); if (u != null) { if (!u.pick(client.playerGUID)) { return; } Bag.Item it = client.bag.addItem(u.tid, 1); MsgItem reply = new MsgItem(); reply.itemId = it.id; reply.count = it.count; sendTo(msg.conn.connectionId, (short)MyMsgId.ItemChange, reply); } }
public bool pick(uint pickerGUID) { if (!isState(UnitState.Alive)) { return(false); } if (isServer) { MsgPick msg = new MsgPick(); msg.dropGuid = guid; msg.pickerGuid = pickerGUID; sendMsg((short)MyMsgId.ReqPick, msg); dispear(); return(true); } else { MsgPick msg = new MsgPick(); msg.dropGuid = guid; sendMsg((short)MyMsgId.ReqPick, msg); return(true); } }