コード例 #1
0
        public void MsgUpdateInfo(Player player, ProtocolBase protoBase)
        {
            Room room = player.tempData.room;

            if (room == null)
            {
                return;
            }
            int           start     = 0;
            ProtocolBytes protocol  = (ProtocolBytes)protoBase;
            string        protoName = protocol.GetString(start, ref start);
            float         x         = protocol.GetFloat(start, ref start);
            float         y         = protocol.GetFloat(start, ref start);

            //int score = protocol.GetInt(start, ref start);
            room.UpdateInfo(player.id, x, y);

            ProtocolBytes protocolRet = new ProtocolBytes();

            protocolRet.AddString("UpdateInfo");
            protocolRet.AddString(player.id);
            protocolRet.AddFloat(x);
            protocolRet.AddFloat(y);
            //protocolRet.AddInt(score);
            room.Broadcast(protocolRet);
        }