Beispiel #1
0
    void reqUnit(uint guid)
    {
        MsgReqUnit msg = new MsgReqUnit();

        msg.guid = guid;
        mConn.Send((short)MyMsgId.ReqUnit, msg);
    }
Beispiel #2
0
    void onReqUnit(NetworkMessage msg)
    {
        Log.i("LanHost onReqUnit", Log.Tag.Net);
        MsgReqUnit m = msg.ReadMessage <MsgReqUnit> ();
        Unit       u = mUnitMgr.getUnit(m.guid);

        MsgCreate reply = new MsgCreate();

        reply.unitType = u.type;
        reply.guid     = u.guid;
        reply.agentId  = mClients[msg.conn.connectionId].accoundId;
        reply.pos      = u.pos;
        reply.dir      = u.dir;
        reply.state    = u.state;
        reply.tid      = u.tid;
        sendTo(msg.conn.connectionId, (short)MyMsgId.Create, reply);
    }